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(); |