| Index: src/IceConverter.cpp
|
| diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
|
| index d389a0215da943a2b25de754897ab3dbad0de658..d8c85fa6ee813e7c1e9105b6bdf53575cfd94ba3 100644
|
| --- a/src/IceConverter.cpp
|
| +++ b/src/IceConverter.cpp
|
| @@ -27,6 +27,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"
|
| @@ -60,9 +61,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; }
|
|
|
| @@ -128,8 +129,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
|
| @@ -733,10 +734,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);
|
| }
|
| }
|
| @@ -806,12 +807,12 @@ void LLVM2ICEGlobalsConverter::addGlobalInitializer(
|
|
|
| namespace Ice {
|
|
|
| -void Converter::nameUnnamedGlobalVariables(Module *Mod) {
|
| +void Converter::nameUnnamedGlobalVariables(Module *MyMod) {
|
| 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;
|
| @@ -821,12 +822,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;
|
| @@ -856,10 +857,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(
|
| @@ -874,8 +875,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);
|
| @@ -887,8 +888,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() {
|
|
|