[llvm] r241430 - [TableGen] Change a couple methods to return an ArrayRef instead of a const std::vector reference. NFC
Craig Topper
craig.topper at gmail.com
Sun Jul 5 23:23:01 PDT 2015
Author: ctopper
Date: Mon Jul 6 01:23:01 2015
New Revision: 241430
URL: http://llvm.org/viewvc/llvm-project?rev=241430&view=rev
Log:
[TableGen] Change a couple methods to return an ArrayRef instead of a const std::vector reference. NFC
Modified:
llvm/trunk/include/llvm/TableGen/Record.h
llvm/trunk/lib/TableGen/Record.cpp
llvm/trunk/lib/TableGen/SetTheory.cpp
llvm/trunk/lib/TableGen/TGParser.cpp
Modified: llvm/trunk/include/llvm/TableGen/Record.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=241430&r1=241429&r2=241430&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h (original)
+++ llvm/trunk/include/llvm/TableGen/Record.h Mon Jul 6 01:23:01 2015
@@ -1222,11 +1222,11 @@ public:
/// get the corresponding DefInit.
DefInit *getDefInit();
- const std::vector<Init *> &getTemplateArgs() const {
+ ArrayRef<Init *> getTemplateArgs() const {
return TemplateArgs;
}
- const std::vector<RecordVal> &getValues() const { return Values; }
- const std::vector<Record*> &getSuperClasses() const { return SuperClasses; }
+ ArrayRef<RecordVal> getValues() const { return Values; }
+ ArrayRef<Record *> getSuperClasses() const { return SuperClasses; }
ArrayRef<SMRange> getSuperClassRanges() const { return SuperClassRanges; }
bool isTemplateArg(Init *Name) const {
Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=241430&r1=241429&r2=241430&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Mon Jul 6 01:23:01 2015
@@ -1648,7 +1648,7 @@ raw_ostream &llvm::operator<<(raw_ostrea
}
OS << " {";
- const std::vector<Record*> &SC = R.getSuperClasses();
+ ArrayRef<Record *> SC = R.getSuperClasses();
if (!SC.empty()) {
OS << "\t//";
for (const Record *Super : SC)
Modified: llvm/trunk/lib/TableGen/SetTheory.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/SetTheory.cpp?rev=241430&r1=241429&r2=241430&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/SetTheory.cpp (original)
+++ llvm/trunk/lib/TableGen/SetTheory.cpp Mon Jul 6 01:23:01 2015
@@ -302,7 +302,7 @@ const RecVec *SetTheory::expand(Record *
return &I->second;
// This is the first time we see Set. Find a suitable expander.
- const std::vector<Record*> &SC = Set->getSuperClasses();
+ ArrayRef<Record *> SC = Set->getSuperClasses();
for (unsigned i = 0, e = SC.size(); i != e; ++i) {
// Skip unnamed superclasses.
if (!dyn_cast<StringInit>(SC[i]->getNameInit()))
Modified: llvm/trunk/lib/TableGen/TGParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/TGParser.cpp?rev=241430&r1=241429&r2=241430&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/TGParser.cpp (original)
+++ llvm/trunk/lib/TableGen/TGParser.cpp Mon Jul 6 01:23:01 2015
@@ -184,7 +184,7 @@ bool TGParser::AddSubClass(Record *CurRe
// Since everything went well, we can now set the "superclass" list for the
// current record.
- const std::vector<Record*> &SCs = SC->getSuperClasses();
+ ArrayRef<Record *> SCs = SC->getSuperClasses();
ArrayRef<SMRange> SCRanges = SC->getSuperClassRanges();
for (unsigned i = 0, e = SCs.size(); i != e; ++i) {
if (CurRec->isSubClassOf(SCs[i]))
More information about the llvm-commits
mailing list