From fade2f72b82cce82dec0ea3b2ac8972586122632 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 6 Jul 2015 06:23:01 +0000 Subject: [PATCH] [TableGen] Change a couple methods to return an ArrayRef instead of a const std::vector reference. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241430 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/TableGen/Record.h | 6 +++--- lib/TableGen/Record.cpp | 2 +- lib/TableGen/SetTheory.cpp | 2 +- lib/TableGen/TGParser.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h index 717a2a4ba62..b4642c99119 100644 --- a/include/llvm/TableGen/Record.h +++ b/include/llvm/TableGen/Record.h @@ -1222,11 +1222,11 @@ public: /// get the corresponding DefInit. DefInit *getDefInit(); - const std::vector &getTemplateArgs() const { + ArrayRef getTemplateArgs() const { return TemplateArgs; } - const std::vector &getValues() const { return Values; } - const std::vector &getSuperClasses() const { return SuperClasses; } + ArrayRef getValues() const { return Values; } + ArrayRef getSuperClasses() const { return SuperClasses; } ArrayRef getSuperClassRanges() const { return SuperClassRanges; } bool isTemplateArg(Init *Name) const { diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 6e982bf1da1..c9a31b64cfd 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -1648,7 +1648,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const Record &R) { } OS << " {"; - const std::vector &SC = R.getSuperClasses(); + ArrayRef SC = R.getSuperClasses(); if (!SC.empty()) { OS << "\t//"; for (const Record *Super : SC) diff --git a/lib/TableGen/SetTheory.cpp b/lib/TableGen/SetTheory.cpp index 92f5b2dd717..07c538159dc 100644 --- a/lib/TableGen/SetTheory.cpp +++ b/lib/TableGen/SetTheory.cpp @@ -302,7 +302,7 @@ const RecVec *SetTheory::expand(Record *Set) { return &I->second; // This is the first time we see Set. Find a suitable expander. - const std::vector &SC = Set->getSuperClasses(); + ArrayRef SC = Set->getSuperClasses(); for (unsigned i = 0, e = SC.size(); i != e; ++i) { // Skip unnamed superclasses. if (!dyn_cast(SC[i]->getNameInit())) diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index 15df25aea50..5c36fda2e1c 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -184,7 +184,7 @@ bool TGParser::AddSubClass(Record *CurRec, SubClassReference &SubClass) { // Since everything went well, we can now set the "superclass" list for the // current record. - const std::vector &SCs = SC->getSuperClasses(); + ArrayRef SCs = SC->getSuperClasses(); ArrayRef SCRanges = SC->getSuperClassRanges(); for (unsigned i = 0, e = SCs.size(); i != e; ++i) { if (CurRec->isSubClassOf(SCs[i])) -- 2.34.1