Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: src/IceTranslator.cpp

Issue 619893002: Subzero: Auto-awesome iterators. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Use AsmCodeByte instead of uint8_t Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTimerTree.cpp ('k') | src/IceTypeConverter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTranslator.cpp
diff --git a/src/IceTranslator.cpp b/src/IceTranslator.cpp
index 9cc97a0d3051f637b45ce50af3d9e3b820f9d67c..d11e76d2582b37ef04d9d3e752c5d725e2b084b2 100644
--- a/src/IceTranslator.cpp
+++ b/src/IceTranslator.cpp
@@ -58,19 +58,15 @@ void Translator::nameUnnamedGlobalAddresses(llvm::Module *Mod) {
Ostream &errs = Ctx->getStrDump();
if (!GlobalPrefix.empty()) {
uint32_t NameIndex = 0;
- for (llvm::Module::global_iterator I = Mod->global_begin(),
- E = Mod->global_end();
- I != E; ++I) {
+ for (auto I = Mod->global_begin(), E = Mod->global_end(); I != E; ++I)
setValueName(I, "global", GlobalPrefix, NameIndex, errs);
- }
}
const IceString &FunctionPrefix = Flags.DefaultFunctionPrefix;
if (FunctionPrefix.empty())
return;
uint32_t NameIndex = 0;
- for (llvm::Module::iterator I = Mod->begin(), E = Mod->end(); I != E; ++I) {
- setValueName(I, "function", FunctionPrefix, NameIndex, errs);
- }
+ for (llvm::Function &I : *Mod)
+ setValueName(&I, "function", FunctionPrefix, NameIndex, errs);
}
void Translator::translateFcn(Cfg *Fcn) {
@@ -100,9 +96,7 @@ void Translator::emitConstants() {
void Translator::convertGlobals(llvm::Module *Mod) {
std::unique_ptr<TargetGlobalInitLowering> GlobalLowering(
TargetGlobalInitLowering::createLowering(Ctx->getTargetArch(), Ctx));
- for (llvm::Module::const_global_iterator I = Mod->global_begin(),
- E = Mod->global_end();
- I != E; ++I) {
+ for (auto I = Mod->global_begin(), E = Mod->global_end(); I != E; ++I) {
if (!I->hasInitializer())
continue;
const llvm::Constant *Initializer = I->getInitializer();
« no previous file with comments | « src/IceTimerTree.cpp ('k') | src/IceTypeConverter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698