[llvm] 811a031 - CodeGenRegBank - make functions const to fix cppcheck warnings.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 10 03:20:40 PST 2019
Author: Simon Pilgrim
Date: 2019-11-10T11:14:58Z
New Revision: 811a031c36f82adfeb6c3f1b8d0d41298fd4d941
URL: https://github.com/llvm/llvm-project/commit/811a031c36f82adfeb6c3f1b8d0d41298fd4d941
DIFF: https://github.com/llvm/llvm-project/commit/811a031c36f82adfeb6c3f1b8d0d41298fd4d941.diff
LOG: CodeGenRegBank - make functions const to fix cppcheck warnings.
Added:
Modified:
llvm/utils/TableGen/CodeGenRegisters.h
Removed:
################################################################################
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<CodeGenSubRegIndex *, 8>&);
- const std::deque<CodeGenRegister> &getRegisters() { return Registers; }
+ const std::deque<CodeGenRegister> &getRegisters() const {
+ return Registers;
+ }
- const StringMap<CodeGenRegister*> &getRegistersByName() {
+ const StringMap<CodeGenRegister *> &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;
}
More information about the llvm-commits
mailing list