Chromium Code Reviews| Index: src/IceConverter.cpp |
| diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp |
| index 0fe6f10ac0eec25d1974cd7d806309bf345ed64f..461cf9d3a0b97fc34f37ec2618484204a3c679db 100644 |
| --- a/src/IceConverter.cpp |
| +++ b/src/IceConverter.cpp |
| @@ -28,6 +28,7 @@ |
| #pragma clang diagnostic push |
| #pragma clang diagnostic ignored "-Wunused-parameter" |
| +#pragma clang diagnostic ignored "-Wshadow" |
| #include "llvm/IR/Constant.h" |
| #include "llvm/IR/Constants.h" |
| #include "llvm/IR/DataLayout.h" |
| @@ -61,9 +62,9 @@ class LLVM2ICEConverter { |
| LLVM2ICEConverter &operator=(const LLVM2ICEConverter &) = delete; |
| public: |
| - explicit LLVM2ICEConverter(Ice::Converter &Converter) |
| - : Converter(Converter), Ctx(Converter.getContext()), |
| - TypeConverter(Converter.getModule()->getContext()) {} |
| + explicit LLVM2ICEConverter(Ice::Converter &MyConverter) |
| + : Converter(MyConverter), Ctx(MyConverter.getContext()), |
| + TypeConverter(MyConverter.getModule()->getContext()) {} |
| Ice::Converter &getConverter() const { return Converter; } |
| @@ -129,8 +130,8 @@ public: |
| if (const auto GV = dyn_cast<GlobalValue>(Const)) { |
| Ice::GlobalDeclaration *Decl = getConverter().getGlobalDeclaration(GV); |
| bool IsUndefined = false; |
| - if (const auto *Func = llvm::dyn_cast<Ice::FunctionDeclaration>(Decl)) |
| - IsUndefined = Func->isProto(); |
| + if (const auto *MyFunc = llvm::dyn_cast<Ice::FunctionDeclaration>(Decl)) |
| + IsUndefined = MyFunc->isProto(); |
| else if (const auto *Var = llvm::dyn_cast<Ice::VariableDeclaration>(Decl)) |
| IsUndefined = !Var->hasInitializer(); |
| else |
| @@ -734,10 +735,10 @@ LLVM2ICEGlobalsConverter::convertGlobalsToIce(Module *Mod) { |
| const Constant *Initializer = GV->getInitializer(); |
| if (const auto CompoundInit = dyn_cast<ConstantStruct>(Initializer)) { |
| - for (ConstantStruct::const_op_iterator I = CompoundInit->op_begin(), |
| - E = CompoundInit->op_end(); |
| - I != E; ++I) { |
| - if (const auto Init = dyn_cast<Constant>(I)) { |
| + for (ConstantStruct::const_op_iterator CII = CompoundInit->op_begin(), |
| + CIE = CompoundInit->op_end(); |
| + CII != CIE; ++CII) { |
| + if (const auto Init = dyn_cast<Constant>(CII)) { |
| addGlobalInitializer(*VarDecl, Init); |
| } |
| } |
| @@ -807,12 +808,12 @@ void LLVM2ICEGlobalsConverter::addGlobalInitializer( |
| namespace Ice { |
| -void Converter::nameUnnamedGlobalVariables(Module *Mod) { |
| +void Converter::nameUnnamedGlobalVariables(Module *MyMod) { |
|
jvoung (off chromium)
2015/07/14 01:25:19
This could probably just use Mod instead of taking
|
| const IceString &GlobalPrefix = Ctx->getFlags().getDefaultGlobalPrefix(); |
| if (GlobalPrefix.empty()) |
| return; |
| uint32_t NameIndex = 0; |
| - for (auto V = Mod->global_begin(), E = Mod->global_end(); V != E; ++V) { |
| + for (auto V = MyMod->global_begin(), E = MyMod->global_end(); V != E; ++V) { |
| if (!V->hasName()) { |
| V->setName(createUnnamedName(GlobalPrefix, NameIndex)); |
| ++NameIndex; |
| @@ -822,12 +823,12 @@ void Converter::nameUnnamedGlobalVariables(Module *Mod) { |
| } |
| } |
| -void Converter::nameUnnamedFunctions(Module *Mod) { |
| +void Converter::nameUnnamedFunctions(Module *MyMod) { |
| const IceString &FunctionPrefix = Ctx->getFlags().getDefaultFunctionPrefix(); |
| if (FunctionPrefix.empty()) |
| return; |
| uint32_t NameIndex = 0; |
| - for (Function &F : *Mod) { |
| + for (Function &F : *MyMod) { |
| if (!F.hasName()) { |
| F.setName(createUnnamedName(FunctionPrefix, NameIndex)); |
| ++NameIndex; |
| @@ -857,10 +858,10 @@ GlobalDeclaration *Converter::getGlobalDeclaration(const GlobalValue *V) { |
| return Pos->second; |
| } |
| -void Converter::installGlobalDeclarations(Module *Mod) { |
| - const TypeConverter Converter(Mod->getContext()); |
| +void Converter::installGlobalDeclarations(Module *MyMod) { |
| + const TypeConverter Converter(MyMod->getContext()); |
| // Install function declarations. |
| - for (const Function &Func : *Mod) { |
| + for (const Function &Func : *MyMod) { |
| FuncSigType Signature; |
| FunctionType *FuncType = Func.getFunctionType(); |
| Signature.setReturnType( |
| @@ -875,8 +876,8 @@ void Converter::installGlobalDeclarations(Module *Mod) { |
| GlobalDeclarationMap[&Func] = IceFunc; |
| } |
| // Install global variable declarations. |
| - for (Module::const_global_iterator I = Mod->global_begin(), |
| - E = Mod->global_end(); |
| + for (Module::const_global_iterator I = MyMod->global_begin(), |
| + E = MyMod->global_end(); |
| I != E; ++I) { |
| const GlobalVariable *GV = I; |
| VariableDeclaration *Var = VariableDeclaration::create(Ctx); |
| @@ -888,8 +889,8 @@ void Converter::installGlobalDeclarations(Module *Mod) { |
| } |
| } |
| -void Converter::convertGlobals(Module *Mod) { |
| - lowerGlobals(LLVM2ICEGlobalsConverter(*this).convertGlobalsToIce(Mod)); |
| +void Converter::convertGlobals(Module *MyMod) { |
| + lowerGlobals(LLVM2ICEGlobalsConverter(*this).convertGlobalsToIce(MyMod)); |
| } |
| void Converter::convertFunctions() { |