diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-12-09 08:05:51 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-12-09 08:05:51 +0000 |
commit | 8a417c1fabc72c685621bff3ce8d2621e9324de5 (patch) | |
tree | 1f8919d532150e53d806dba3a295be87f4610c2b /llvm/utils/TableGen/CodeGenTarget.cpp | |
parent | fa4a6c18f71d6faf72e437e21cd9bad5b4bec290 (diff) | |
download | llvm-8a417c1fabc72c685621bff3ce8d2621e9324de5.zip llvm-8a417c1fabc72c685621bff3ce8d2621e9324de5.tar.gz llvm-8a417c1fabc72c685621bff3ce8d2621e9324de5.tar.bz2 |
Use range-based for loops. NFC.
llvm-svn: 223762
Diffstat (limited to 'llvm/utils/TableGen/CodeGenTarget.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenTarget.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp index 49e1316..1cb66a8 100644 --- a/llvm/utils/TableGen/CodeGenTarget.cpp +++ b/llvm/utils/TableGen/CodeGenTarget.cpp @@ -151,11 +151,11 @@ const std::string &CodeGenTarget::getName() const { } std::string CodeGenTarget::getInstNamespace() const { - for (inst_iterator i = inst_begin(), e = inst_end(); i != e; ++i) { + for (const CodeGenInstruction *Inst : instructions()) { // Make sure not to pick up "TargetOpcode" by accidentally getting // the namespace off the PHI instruction or something. - if ((*i)->Namespace != "TargetOpcode") - return (*i)->Namespace; + if (Inst->Namespace != "TargetOpcode") + return Inst->Namespace; } return ""; @@ -307,9 +307,8 @@ void CodeGenTarget::ComputeInstrsByEnum() const { } unsigned EndOfPredefines = InstrsByEnum.size(); - for (DenseMap<const Record*, CodeGenInstruction*>::const_iterator - I = Insts.begin(), E = Insts.end(); I != E; ++I) { - const CodeGenInstruction *CGI = I->second; + for (const auto &I : Insts) { + const CodeGenInstruction *CGI = I.second; if (CGI->Namespace != "TargetOpcode") InstrsByEnum.push_back(CGI); } @@ -339,9 +338,7 @@ void CodeGenTarget::reverseBitsForLittleEndianEncoding() { return; std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction"); - for (std::vector<Record*>::iterator I = Insts.begin(), E = Insts.end(); - I != E; ++I) { - Record *R = *I; + for (Record *R : Insts) { if (R->getValueAsString("Namespace") == "TargetOpcode" || R->getValueAsBit("isPseudo")) continue; |