From 811a031c36f82adfeb6c3f1b8d0d41298fd4d941 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 10 Nov 2019 11:14:58 +0000 Subject: [PATCH] CodeGenRegBank - make functions const to fix cppcheck warnings. --- llvm/utils/TableGen/CodeGenRegisters.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/utils/TableGen/CodeGenRegisters.h b/llvm/utils/TableGen/CodeGenRegisters.h index 6d933baec2ae..a8e9e0fbccbe 100644 --- a/llvm/utils/TableGen/CodeGenRegisters.h +++ b/llvm/utils/TableGen/CodeGenRegisters.h @@ -635,9 +635,11 @@ namespace llvm { CodeGenSubRegIndex * getConcatSubRegIndex(const SmallVector&); - const std::deque &getRegisters() { return Registers; } + const std::deque &getRegisters() const { + return Registers; + } - const StringMap &getRegistersByName() { + const StringMap &getRegistersByName() const { return RegistersByName; } @@ -686,7 +688,7 @@ namespace llvm { // Native units are the singular unit of a leaf register. Register aliasing // is completely characterized by native units. Adopted units exist to give // register additional weight but don't affect aliasing. - bool isNativeUnit(unsigned RUID) { + bool isNativeUnit(unsigned RUID) const { return RUID < NumNativeRegUnits; }