Index: src/IceConverter.cpp |
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp |
index 5316db6a07935fd89372dcc2112172ed0576a8db..ea352dde11a2ed27d7f59e770f573909995119b7 100644 |
--- a/src/IceConverter.cpp |
+++ b/src/IceConverter.cpp |
@@ -84,7 +84,9 @@ public: |
: LLVM2ICEConverter(Converter), Func(nullptr) {} |
void convertFunction(const Function *F) { |
- Func = Ice::Cfg::create(Ctx); |
+ if (Ctx->isIRGenerationDisabled()) |
+ return; |
+ Func = Ice::Cfg::create(Ctx, Converter.getNextSequenceNumber()); |
Ice::Cfg::setCurrentCfg(Func.get()); |
VarMap.clear(); |
@@ -801,7 +803,7 @@ void LLVM2ICEGlobalsConverter::addGlobalInitializer( |
namespace Ice { |
void Converter::nameUnnamedGlobalVariables(Module *Mod) { |
- const IceString &GlobalPrefix = Flags.DefaultGlobalPrefix; |
+ const IceString &GlobalPrefix = Ctx->getFlags().DefaultGlobalPrefix; |
if (GlobalPrefix.empty()) |
return; |
uint32_t NameIndex = 0; |
@@ -816,7 +818,7 @@ void Converter::nameUnnamedGlobalVariables(Module *Mod) { |
} |
void Converter::nameUnnamedFunctions(Module *Mod) { |
- const IceString &FunctionPrefix = Flags.DefaultFunctionPrefix; |
+ const IceString &FunctionPrefix = Ctx->getFlags().DefaultFunctionPrefix; |
if (FunctionPrefix.empty()) |
return; |
uint32_t NameIndex = 0; |
@@ -883,8 +885,8 @@ void Converter::installGlobalDeclarations(Module *Mod) { |
void Converter::convertGlobals(Module *Mod) { |
LLVM2ICEGlobalsConverter GlobalsConverter(*this); |
- VariableDeclarationList VariableDeclarations; |
- GlobalsConverter.convertGlobalsToIce(Mod, VariableDeclarations); |
+ VariableDeclarationList *VariableDeclarations = new VariableDeclarationList; |
+ GlobalsConverter.convertGlobalsToIce(Mod, *VariableDeclarations); |
lowerGlobals(VariableDeclarations); |
} |