diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-03-17 17:26:09 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2013-03-17 17:26:09 +0000 |
commit | 13d4a07fa9895fbc989206f2dfd06a75423fd855 (patch) | |
tree | b065cf70fddc720049a1de0a110d245e9e7f0859 /llvm/utils/TableGen/CodeGenTarget.h | |
parent | 37ef20d3075e8e15a23483e6d0307786de710bf3 (diff) | |
download | llvm-13d4a07fa9895fbc989206f2dfd06a75423fd855.zip llvm-13d4a07fa9895fbc989206f2dfd06a75423fd855.tar.gz llvm-13d4a07fa9895fbc989206f2dfd06a75423fd855.tar.bz2 |
Use ArrayRef<MVT::SimpleValueType> when possible.
Not passing vector references around makes it possible to use
SmallVector in most places.
llvm-svn: 177235
Diffstat (limited to 'llvm/utils/TableGen/CodeGenTarget.h')
-rw-r--r-- | llvm/utils/TableGen/CodeGenTarget.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/CodeGenTarget.h b/llvm/utils/TableGen/CodeGenTarget.h index 4a1c6d8..6271443 100644 --- a/llvm/utils/TableGen/CodeGenTarget.h +++ b/llvm/utils/TableGen/CodeGenTarget.h @@ -68,7 +68,7 @@ class CodeGenTarget { mutable DenseMap<const Record*, CodeGenInstruction*> Instructions; mutable CodeGenRegBank *RegBank; mutable std::vector<Record*> RegAltNameIndices; - mutable std::vector<MVT::SimpleValueType> LegalValueTypes; + mutable SmallVector<MVT::SimpleValueType, 8> LegalValueTypes; void ReadRegAltNameIndices() const; void ReadInstructions() const; void ReadLegalValueTypes() const; @@ -129,7 +129,7 @@ public: /// specified physical register. std::vector<MVT::SimpleValueType> getRegisterVTs(Record *R) const; - const std::vector<MVT::SimpleValueType> &getLegalValueTypes() const { + ArrayRef<MVT::SimpleValueType> getLegalValueTypes() const { if (LegalValueTypes.empty()) ReadLegalValueTypes(); return LegalValueTypes; } @@ -137,7 +137,7 @@ public: /// isLegalValueType - Return true if the specified value type is natively /// supported by the target (i.e. there are registers that directly hold it). bool isLegalValueType(MVT::SimpleValueType VT) const { - const std::vector<MVT::SimpleValueType> &LegalVTs = getLegalValueTypes(); + ArrayRef<MVT::SimpleValueType> LegalVTs = getLegalValueTypes(); for (unsigned i = 0, e = LegalVTs.size(); i != e; ++i) if (LegalVTs[i] == VT) return true; return false; |