[TableGen] Use range-based for loops. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236089 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2015-04-29 07:13:14 +00:00
parent ac9abe5e99
commit 40048e70d7

View File

@ -443,11 +443,8 @@ static void
ProfileBitsInit(FoldingSetNodeID &ID, ArrayRef<Init *> Range) { ProfileBitsInit(FoldingSetNodeID &ID, ArrayRef<Init *> Range) {
ID.AddInteger(Range.size()); ID.AddInteger(Range.size());
for (ArrayRef<Init *>::iterator i = Range.begin(), for (Init *I : Range)
iend = Range.end(); ID.AddPointer(I);
i != iend;
++i)
ID.AddPointer(*i);
} }
BitsInit *BitsInit::get(ArrayRef<Init *> Range) { BitsInit *BitsInit::get(ArrayRef<Init *> Range) {
@ -593,11 +590,8 @@ static void ProfileListInit(FoldingSetNodeID &ID,
ID.AddInteger(Range.size()); ID.AddInteger(Range.size());
ID.AddPointer(EltTy); ID.AddPointer(EltTy);
for (ArrayRef<Init *>::iterator i = Range.begin(), for (Init *I : Range)
iend = Range.end(); ID.AddPointer(I);
i != iend;
++i)
ID.AddPointer(*i);
} }
ListInit *ListInit::get(ArrayRef<Init *> Range, RecTy *EltTy) { ListInit *ListInit::get(ArrayRef<Init *> Range, RecTy *EltTy) {
@ -1540,17 +1534,12 @@ DagInit::get(Init *V, const std::string &VN,
DagInit * DagInit *
DagInit::get(Init *V, const std::string &VN, DagInit::get(Init *V, const std::string &VN,
const std::vector<std::pair<Init*, std::string> > &args) { const std::vector<std::pair<Init*, std::string> > &args) {
typedef std::pair<Init*, std::string> PairType;
std::vector<Init *> Args; std::vector<Init *> Args;
std::vector<std::string> Names; std::vector<std::string> Names;
for (std::vector<PairType>::const_iterator i = args.begin(), for (const auto &Arg : args) {
iend = args.end(); Args.push_back(Arg.first);
i != iend; Names.push_back(Arg.second);
++i) {
Args.push_back(i->first);
Names.push_back(i->second);
} }
return DagInit::get(V, VN, Args, Names); return DagInit::get(V, VN, Args, Names);
@ -1942,11 +1931,8 @@ void MultiClass::dump() const {
Rec.dump(); Rec.dump();
errs() << "Defs:\n"; errs() << "Defs:\n";
for (RecordVector::const_iterator r = DefPrototypes.begin(), for (const auto &Proto : DefPrototypes) {
rend = DefPrototypes.end(); Proto->dump();
r != rend;
++r) {
(*r)->dump();
} }
} }