summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/utils/TableGen/CodeGenRegisters.h2
-rw-r--r--llvm/utils/TableGen/DAGISelMatcherGen.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/CodeGenRegisters.h b/llvm/utils/TableGen/CodeGenRegisters.h
index 32aa33c80b3..0f7a025ded1 100644
--- a/llvm/utils/TableGen/CodeGenRegisters.h
+++ b/llvm/utils/TableGen/CodeGenRegisters.h
@@ -348,7 +348,7 @@ namespace llvm {
ArrayRef<ValueTypeByHwMode> getValueTypes() const { return VTs; }
unsigned getNumValueTypes() const { return VTs.size(); }
- ValueTypeByHwMode getValueTypeNum(unsigned VTNum) const {
+ const ValueTypeByHwMode &getValueTypeNum(unsigned VTNum) const {
if (VTNum < VTs.size())
return VTs[VTNum];
llvm_unreachable("VTNum greater than number of ValueTypes in RegClass!");
diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
index ce23651b968..f8c8a16efcd 100644
--- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
@@ -33,15 +33,15 @@ static MVT::SimpleValueType getRegisterValueType(Record *R,
if (!FoundRC) {
FoundRC = true;
- ValueTypeByHwMode VVT = RC.getValueTypeNum(0);
+ const ValueTypeByHwMode &VVT = RC.getValueTypeNum(0);
if (VVT.isSimple())
VT = VVT.getSimple().SimpleTy;
continue;
}
- // If this occurs in multiple register classes, they all have to agree.
#ifndef NDEBUG
- ValueTypeByHwMode T = RC.getValueTypeNum(0);
+ // If this occurs in multiple register classes, they all have to agree.
+ const ValueTypeByHwMode &T = RC.getValueTypeNum(0);
assert((!T.isSimple() || T.getSimple().SimpleTy == VT) &&
"ValueType mismatch between register classes for this register");
#endif
OpenPOWER on IntegriCloud