Commit df80eb86 by Karl Schimpf

Adds accessor methods to class ClFlags.

Allows one to define explicit overrides in get accessors, based on compilation features. To show usage, modified SubConstantCalls to never be enabled if building a minimal llvm2ice. BUG=None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/905463003
parent c9ec5793
...@@ -54,10 +54,12 @@ ifdef MINIMAL ...@@ -54,10 +54,12 @@ ifdef MINIMAL
NOASSERT = 1 NOASSERT = 1
OBJDIR := $(OBJDIR)+Min OBJDIR := $(OBJDIR)+Min
CXX_DEFINES += -DALLOW_DUMP=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 \ CXX_DEFINES += -DALLOW_DUMP=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 \
-DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_DISABLE_IR_GEN=0 -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_DISABLE_IR_GEN=0 \
-DALLOW_MINIMAL_BUILD=1
else else
CXX_DEFINES += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \ CXX_DEFINES += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \
-DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_DISABLE_IR_GEN=1 -DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_DISABLE_IR_GEN=1 \
-DALLOW_MINIMAL_BUILD=0
endif endif
ifdef NOASSERT ifdef NOASSERT
......
...@@ -81,14 +81,15 @@ void Cfg::translate() { ...@@ -81,14 +81,15 @@ void Cfg::translate() {
// TimeEachFunction is enabled. // TimeEachFunction is enabled.
std::unique_ptr<TimerMarker> FunctionTimer; std::unique_ptr<TimerMarker> FunctionTimer;
if (ALLOW_DUMP) { if (ALLOW_DUMP) {
const IceString &TimingFocusOn = getContext()->getFlags().TimingFocusOn; const IceString &TimingFocusOn =
getContext()->getFlags().getTimingFocusOn();
const IceString &Name = getFunctionName(); const IceString &Name = getFunctionName();
if (TimingFocusOn == "*" || TimingFocusOn == Name) { if (TimingFocusOn == "*" || TimingFocusOn == Name) {
setFocusedTiming(); setFocusedTiming();
getContext()->resetTimer(GlobalContext::TSK_Default); getContext()->resetTimer(GlobalContext::TSK_Default);
getContext()->setTimerName(GlobalContext::TSK_Default, Name); getContext()->setTimerName(GlobalContext::TSK_Default, Name);
} }
if (getContext()->getFlags().TimeEachFunction) if (getContext()->getFlags().getTimeEachFunction())
FunctionTimer.reset(new TimerMarker( FunctionTimer.reset(new TimerMarker(
getContext()->getTimerID(GlobalContext::TSK_Funcs, Name), getContext()->getTimerID(GlobalContext::TSK_Funcs, Name),
getContext(), GlobalContext::TSK_Funcs)); getContext(), GlobalContext::TSK_Funcs));
...@@ -399,7 +400,7 @@ void Cfg::contractEmptyNodes() { ...@@ -399,7 +400,7 @@ void Cfg::contractEmptyNodes() {
// such, we disable this pass when DecorateAsm is specified. This // such, we disable this pass when DecorateAsm is specified. This
// may make the resulting code look more branchy, but it should have // may make the resulting code look more branchy, but it should have
// no effect on the register assignments. // no effect on the register assignments.
if (Ctx->getFlags().DecorateAsm) if (Ctx->getFlags().getDecorateAsm())
return; return;
for (CfgNode *Node : Nodes) { for (CfgNode *Node : Nodes) {
Node->contractIfEmpty(); Node->contractIfEmpty();
...@@ -421,9 +422,9 @@ void Cfg::emitTextHeader(const IceString &MangledName) { ...@@ -421,9 +422,9 @@ void Cfg::emitTextHeader(const IceString &MangledName) {
// Note: Still used by emit IAS. // Note: Still used by emit IAS.
Ostream &Str = Ctx->getStrEmit(); Ostream &Str = Ctx->getStrEmit();
Str << "\t.text\n"; Str << "\t.text\n";
if (Ctx->getFlags().FunctionSections) if (Ctx->getFlags().getFunctionSections())
Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n"; Str << "\t.section\t.text." << MangledName << ",\"ax\",@progbits\n";
if (!getInternal() || Ctx->getFlags().DisableInternal) { if (!getInternal() || Ctx->getFlags().getDisableInternal()) {
Str << "\t.globl\t" << MangledName << "\n"; Str << "\t.globl\t" << MangledName << "\n";
Str << "\t.type\t" << MangledName << ",@function\n"; Str << "\t.type\t" << MangledName << ",@function\n";
} }
...@@ -439,7 +440,7 @@ void Cfg::emit() { ...@@ -439,7 +440,7 @@ void Cfg::emit() {
if (!ALLOW_DUMP) if (!ALLOW_DUMP)
return; return;
TimerMarker T(TimerStack::TT_emit, this); TimerMarker T(TimerStack::TT_emit, this);
if (Ctx->getFlags().DecorateAsm) { if (Ctx->getFlags().getDecorateAsm()) {
renumberInstructions(); renumberInstructions();
getVMetadata()->init(VMK_Uses); getVMetadata()->init(VMK_Uses);
liveness(Liveness_Basic); liveness(Liveness_Basic);
...@@ -456,7 +457,7 @@ void Cfg::emit() { ...@@ -456,7 +457,7 @@ void Cfg::emit() {
void Cfg::emitIAS() { void Cfg::emitIAS() {
TimerMarker T(TimerStack::TT_emit, this); TimerMarker T(TimerStack::TT_emit, this);
assert(!Ctx->getFlags().DecorateAsm); assert(!Ctx->getFlags().getDecorateAsm());
IceString MangledName = getContext()->mangleName(getFunctionName()); IceString MangledName = getContext()->mangleName(getFunctionName());
// The emitIAS() routines emit into the internal assembler buffer, // The emitIAS() routines emit into the internal assembler buffer,
// so there's no need to lock the streams until we're ready to call // so there's no need to lock the streams until we're ready to call
...@@ -464,7 +465,7 @@ void Cfg::emitIAS() { ...@@ -464,7 +465,7 @@ void Cfg::emitIAS() {
for (CfgNode *Node : Nodes) for (CfgNode *Node : Nodes)
Node->emitIAS(this); Node->emitIAS(this);
// Now write the function to the file and track. // Now write the function to the file and track.
if (Ctx->getFlags().UseELFWriter) { if (Ctx->getFlags().getUseELFWriter()) {
getAssembler<Assembler>()->alignFunction(); getAssembler<Assembler>()->alignFunction();
Ctx->getObjectWriter()->writeFunctionCode(MangledName, getInternal(), Ctx->getObjectWriter()->writeFunctionCode(MangledName, getInternal(),
getAssembler<Assembler>()); getAssembler<Assembler>());
...@@ -489,7 +490,7 @@ void Cfg::dump(const IceString &Message) { ...@@ -489,7 +490,7 @@ void Cfg::dump(const IceString &Message) {
// Print function name+args // Print function name+args
if (isVerbose(IceV_Instructions)) { if (isVerbose(IceV_Instructions)) {
Str << "define "; Str << "define ";
if (getInternal() && !Ctx->getFlags().DisableInternal) if (getInternal() && !Ctx->getFlags().getDisableInternal())
Str << "internal "; Str << "internal ";
Str << ReturnType << " @" << Ctx->mangleName(getFunctionName()) << "("; Str << ReturnType << " @" << Ctx->mangleName(getFunctionName()) << "(";
for (SizeT i = 0; i < Args.size(); ++i) { for (SizeT i = 0; i < Args.size(); ++i) {
......
...@@ -859,7 +859,8 @@ void CfgNode::emit(Cfg *Func) const { ...@@ -859,7 +859,8 @@ void CfgNode::emit(Cfg *Func) const {
Func->setCurrentNode(this); Func->setCurrentNode(this);
Ostream &Str = Func->getContext()->getStrEmit(); Ostream &Str = Func->getContext()->getStrEmit();
Liveness *Liveness = Func->getLiveness(); Liveness *Liveness = Func->getLiveness();
bool DecorateAsm = Liveness && Func->getContext()->getFlags().DecorateAsm; bool DecorateAsm =
Liveness && Func->getContext()->getFlags().getDecorateAsm();
Str << getAsmName() << ":\n"; Str << getAsmName() << ":\n";
std::vector<SizeT> LiveRegCount(Func->getTarget()->getNumRegisters()); std::vector<SizeT> LiveRegCount(Func->getTarget()->getNumRegisters());
if (DecorateAsm) if (DecorateAsm)
......
...@@ -19,41 +19,157 @@ ...@@ -19,41 +19,157 @@
namespace Ice { namespace Ice {
class ClFlags { class ClFlags {
ClFlags(const ClFlags &) = delete;
ClFlags &operator=(const ClFlags &) = delete;
public: public:
ClFlags() ClFlags()
: DisableInternal(false), SubzeroTimingEnabled(false), : // bool fields.
DisableTranslation(false), FunctionSections(false), DataSections(false), AllowErrorRecovery(false),
UseELFWriter(false), UseIntegratedAssembler(false), AllowUninitializedGlobals(false), DataSections(false),
UseSandboxing(false), PhiEdgeSplit(false), DecorateAsm(false), DecorateAsm(false), DisableInternal(false), DisableIRGeneration(false),
DumpStats(false), AllowUninitializedGlobals(false), DisableTranslation(false), DumpStats(false), FunctionSections(false),
TimeEachFunction(false), DisableIRGeneration(false), GenerateUnitTestMessages(false), PhiEdgeSplit(false),
AllowErrorRecovery(false), StubConstantCalls(false), StubConstantCalls(false), SubzeroTimingEnabled(false),
GenerateUnitTestMessages(false), NumTranslationThreads(0), TimeEachFunction(false), UseELFWriter(false),
DefaultGlobalPrefix(""), DefaultFunctionPrefix(""), TimingFocusOn(""), UseIntegratedAssembler(false), UseSandboxing(false),
VerboseFocusOn(""), TranslateOnly("") {} // IceString fields.
DefaultFunctionPrefix(""), DefaultGlobalPrefix(""), TimingFocusOn(""),
TranslateOnly(""), VerboseFocusOn(""),
// size_t fields.
NumTranslationThreads(0) {}
// bool accessors.
bool getAllowErrorRecovery() const { return AllowErrorRecovery; }
void setAllowErrorRecovery(bool NewValue) { AllowErrorRecovery = NewValue; }
bool getAllowUninitializedGlobals() const {
return AllowUninitializedGlobals;
}
void setAllowUninitializedGlobals(bool NewValue) {
AllowUninitializedGlobals = NewValue;
}
bool getDataSections() const { return DataSections; }
void setDataSections(bool NewValue) { DataSections = NewValue; }
bool getDecorateAsm() const { return DecorateAsm; }
void setDecorateAsm(bool NewValue) { DecorateAsm = NewValue; }
bool getDisableInternal() const { return DisableInternal; }
void setDisableInternal(bool NewValue) { DisableInternal = NewValue; }
bool getDisableIRGeneration() const {
return ALLOW_DISABLE_IR_GEN && DisableIRGeneration;
}
void setDisableIRGeneration(bool NewValue) { DisableIRGeneration = NewValue; }
bool getDisableTranslation() const { return DisableTranslation; }
void setDisableTranslation(bool NewValue) { DisableTranslation = NewValue; }
bool getDumpStats() const { return ALLOW_DUMP && DumpStats; }
void setDumpStats(bool NewValue) { DumpStats = NewValue; }
bool getFunctionSections() const { return FunctionSections; }
void setFunctionSections(bool NewValue) { FunctionSections = NewValue; }
bool getGenerateUnitTestMessages() const {
// Note: If dump routines have been turned off, the error messages
// will not be readable. Hence, turn off.
return !ALLOW_DUMP || GenerateUnitTestMessages;
}
void setGenerateUnitTestMessages(bool NewValue) {
GenerateUnitTestMessages = NewValue;
}
bool getPhiEdgeSplit() const { return PhiEdgeSplit; }
void setPhiEdgeSplit(bool NewValue) { PhiEdgeSplit = NewValue; }
bool getStubConstantCalls() const {
return !ALLOW_MINIMAL_BUILD && StubConstantCalls;
}
void setStubConstantCalls(bool NewValue) { StubConstantCalls = NewValue; }
bool getSubzeroTimingEnabled() const { return SubzeroTimingEnabled; }
void setSubzeroTimingEnabled(bool NewValue) {
SubzeroTimingEnabled = NewValue;
}
bool getTimeEachFunction() const { return ALLOW_DUMP && TimeEachFunction; }
void setTimeEachFunction(bool NewValue) { TimeEachFunction = NewValue; }
bool getUseELFWriter() const { return UseELFWriter; }
void setUseELFWriter(bool NewValue) { UseELFWriter = NewValue; }
bool getUseIntegratedAssembler() const { return UseIntegratedAssembler; }
void setUseIntegratedAssembler(bool NewValue) {
UseIntegratedAssembler = NewValue;
}
bool getUseSandboxing() const { return UseSandboxing; }
void setUseSandboxing(bool NewValue) { UseSandboxing = NewValue; }
// IceString accessors.
const IceString &getDefaultFunctionPrefix() const {
return DefaultFunctionPrefix;
}
void setDefaultFunctionPrefix(const IceString &NewValue) {
DefaultFunctionPrefix = NewValue;
}
const IceString &getDefaultGlobalPrefix() const {
return DefaultGlobalPrefix;
}
void setDefaultGlobalPrefix(const IceString &NewValue) {
DefaultGlobalPrefix = NewValue;
}
const IceString &getTimingFocusOn() const { return TimingFocusOn; }
void setTimingFocusOn(const IceString &NewValue) { TimingFocusOn = NewValue; }
const IceString &getTranslateOnly() const { return TranslateOnly; }
void setTranslateOnly(const IceString &NewValue) { TranslateOnly = NewValue; }
const IceString &getVerboseFocusOn() const { return VerboseFocusOn; }
void setVerboseFocusOn(const IceString &NewValue) {
VerboseFocusOn = NewValue;
}
// size_t accessors.
size_t getNumTranslationThreads() const { return NumTranslationThreads; }
void setNumTranslationThreads(size_t NewValue) {
NumTranslationThreads = NewValue;
}
private:
bool AllowErrorRecovery;
bool AllowUninitializedGlobals;
bool DataSections;
bool DecorateAsm;
bool DisableInternal; bool DisableInternal;
bool SubzeroTimingEnabled; bool DisableIRGeneration;
bool DisableTranslation; bool DisableTranslation;
bool DumpStats;
bool FunctionSections; bool FunctionSections;
bool DataSections; bool GenerateUnitTestMessages;
bool PhiEdgeSplit;
bool StubConstantCalls;
bool SubzeroTimingEnabled;
bool TimeEachFunction;
bool UseELFWriter; bool UseELFWriter;
bool UseIntegratedAssembler; bool UseIntegratedAssembler;
bool UseSandboxing; bool UseSandboxing;
bool PhiEdgeSplit;
bool DecorateAsm;
bool DumpStats;
bool AllowUninitializedGlobals;
bool TimeEachFunction;
bool DisableIRGeneration;
bool AllowErrorRecovery;
bool StubConstantCalls;
bool GenerateUnitTestMessages;
size_t NumTranslationThreads; // 0 means completely sequential
IceString DefaultGlobalPrefix;
IceString DefaultFunctionPrefix; IceString DefaultFunctionPrefix;
IceString DefaultGlobalPrefix;
IceString TimingFocusOn; IceString TimingFocusOn;
IceString VerboseFocusOn;
IceString TranslateOnly; IceString TranslateOnly;
IceString VerboseFocusOn;
size_t NumTranslationThreads; // 0 means completely sequential
}; };
} // end of namespace Ice } // end of namespace Ice
......
...@@ -716,7 +716,7 @@ void LLVM2ICEGlobalsConverter::convertGlobalsToIce( ...@@ -716,7 +716,7 @@ void LLVM2ICEGlobalsConverter::convertGlobalsToIce(
} }
if (!GV->hasInitializer()) { if (!GV->hasInitializer()) {
if (Ctx->getFlags().AllowUninitializedGlobals) if (Ctx->getFlags().getAllowUninitializedGlobals())
continue; continue;
else { else {
std::string Buffer; std::string Buffer;
...@@ -801,7 +801,7 @@ void LLVM2ICEGlobalsConverter::addGlobalInitializer( ...@@ -801,7 +801,7 @@ void LLVM2ICEGlobalsConverter::addGlobalInitializer(
namespace Ice { namespace Ice {
void Converter::nameUnnamedGlobalVariables(Module *Mod) { void Converter::nameUnnamedGlobalVariables(Module *Mod) {
const IceString &GlobalPrefix = Flags.DefaultGlobalPrefix; const IceString &GlobalPrefix = Flags.getDefaultGlobalPrefix();
if (GlobalPrefix.empty()) if (GlobalPrefix.empty())
return; return;
uint32_t NameIndex = 0; uint32_t NameIndex = 0;
...@@ -816,7 +816,7 @@ void Converter::nameUnnamedGlobalVariables(Module *Mod) { ...@@ -816,7 +816,7 @@ void Converter::nameUnnamedGlobalVariables(Module *Mod) {
} }
void Converter::nameUnnamedFunctions(Module *Mod) { void Converter::nameUnnamedFunctions(Module *Mod) {
const IceString &FunctionPrefix = Flags.DefaultFunctionPrefix; const IceString &FunctionPrefix = Flags.getDefaultFunctionPrefix();
if (FunctionPrefix.empty()) if (FunctionPrefix.empty())
return; return;
uint32_t NameIndex = 0; uint32_t NameIndex = 0;
...@@ -895,8 +895,7 @@ void Converter::convertFunctions() { ...@@ -895,8 +895,7 @@ void Converter::convertFunctions() {
continue; continue;
TimerIdT TimerID = 0; TimerIdT TimerID = 0;
const bool TimeThisFunction = const bool TimeThisFunction = Ctx->getFlags().getTimeEachFunction();
ALLOW_DUMP && Ctx->getFlags().TimeEachFunction;
if (TimeThisFunction) { if (TimeThisFunction) {
TimerID = Ctx->getTimerID(StackID, I.getName()); TimerID = Ctx->getTimerID(StackID, I.getName());
Ctx->pushTimer(TimerID, StackID); Ctx->pushTimer(TimerID, StackID);
......
...@@ -296,7 +296,8 @@ void ELFObjectWriter::writeDataSection(const VariableDeclarationList &Vars, ...@@ -296,7 +296,8 @@ void ELFObjectWriter::writeDataSection(const VariableDeclarationList &Vars,
VariableDeclarationList VarsBySection[ELFObjectWriter::NumSectionTypes]; VariableDeclarationList VarsBySection[ELFObjectWriter::NumSectionTypes];
for (auto &SectionList : VarsBySection) for (auto &SectionList : VarsBySection)
SectionList.reserve(Vars.size()); SectionList.reserve(Vars.size());
partitionGlobalsBySection(Vars, VarsBySection, Ctx.getFlags().TranslateOnly); partitionGlobalsBySection(Vars, VarsBySection,
Ctx.getFlags().getTranslateOnly());
bool IsELF64 = isELF64(Ctx.getTargetArch()); bool IsELF64 = isELF64(Ctx.getTargetArch());
size_t I = 0; size_t I = 0;
for (auto &SectionList : VarsBySection) { for (auto &SectionList : VarsBySection) {
...@@ -371,7 +372,7 @@ void ELFObjectWriter::writeDataOfType(SectionType ST, ...@@ -371,7 +372,7 @@ void ELFObjectWriter::writeDataOfType(SectionType ST,
Elf64_Xword Align = Var->getAlignment(); Elf64_Xword Align = Var->getAlignment();
Section->padToAlignment(Str, Align); Section->padToAlignment(Str, Align);
SizeT SymbolSize = Var->getNumBytes(); SizeT SymbolSize = Var->getNumBytes();
bool IsExternal = Var->isExternal() || Ctx.getFlags().DisableInternal; bool IsExternal = Var->isExternal() || Ctx.getFlags().getDisableInternal();
const uint8_t SymbolBinding = IsExternal ? STB_GLOBAL : STB_LOCAL; const uint8_t SymbolBinding = IsExternal ? STB_GLOBAL : STB_LOCAL;
IceString MangledName = Var->mangleName(&Ctx); IceString MangledName = Var->mangleName(&Ctx);
SymTab->createDefinedSym(MangledName, SymbolType, SymbolBinding, Section, SymTab->createDefinedSym(MangledName, SymbolType, SymbolBinding, Section,
......
...@@ -134,8 +134,8 @@ GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, ...@@ -134,8 +134,8 @@ GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit,
: ConstPool(new ConstantPool()), ErrorStatus(), StrDump(OsDump), : ConstPool(new ConstantPool()), ErrorStatus(), StrDump(OsDump),
StrEmit(OsEmit), VMask(Mask), Arch(Arch), Opt(Opt), StrEmit(OsEmit), VMask(Mask), Arch(Arch), Opt(Opt),
TestPrefix(TestPrefix), Flags(Flags), RNG(""), ObjectWriter(), TestPrefix(TestPrefix), Flags(Flags), RNG(""), ObjectWriter(),
CfgQ(/*MaxSize=*/Flags.NumTranslationThreads, CfgQ(/*MaxSize=*/Flags.getNumTranslationThreads(),
/*Sequential=*/(Flags.NumTranslationThreads == 0)) { /*Sequential=*/(Flags.getNumTranslationThreads() == 0)) {
// Make sure thread_local fields are properly initialized before any // Make sure thread_local fields are properly initialized before any
// accesses are made. Do this here instead of at the start of // accesses are made. Do this here instead of at the start of
// main() so that all clients (e.g. unit tests) can benefit for // main() so that all clients (e.g. unit tests) can benefit for
...@@ -156,7 +156,7 @@ GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, ...@@ -156,7 +156,7 @@ GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit,
newTimerStackID("Per-function summary"); newTimerStackID("Per-function summary");
} }
Timers.initInto(MyTLS->Timers); Timers.initInto(MyTLS->Timers);
if (Flags.UseELFWriter) { if (Flags.getUseELFWriter()) {
ObjectWriter.reset(new ELFObjectWriter(*this, *ELFStr)); ObjectWriter.reset(new ELFObjectWriter(*this, *ELFStr));
} }
} }
...@@ -169,14 +169,16 @@ void GlobalContext::translateFunctions() { ...@@ -169,14 +169,16 @@ void GlobalContext::translateFunctions() {
resetStats(); resetStats();
// Set verbose level to none if the current function does NOT // Set verbose level to none if the current function does NOT
// match the -verbose-focus command-line option. // match the -verbose-focus command-line option.
if (!matchSymbolName(Func->getFunctionName(), getFlags().VerboseFocusOn)) if (!matchSymbolName(Func->getFunctionName(),
getFlags().getVerboseFocusOn()))
Func->setVerbose(IceV_None); Func->setVerbose(IceV_None);
// Disable translation if -notranslate is specified, or if the // Disable translation if -notranslate is specified, or if the
// current function matches the -translate-only option. If // current function matches the -translate-only option. If
// translation is disabled, just dump the high-level IR and // translation is disabled, just dump the high-level IR and
// continue. // continue.
if (getFlags().DisableTranslation || if (getFlags().getDisableTranslation() ||
!matchSymbolName(Func->getFunctionName(), getFlags().TranslateOnly)) { !matchSymbolName(Func->getFunctionName(),
getFlags().getTranslateOnly())) {
Func->dump(); Func->dump();
} else { } else {
Func->translate(); Func->translate();
...@@ -185,7 +187,7 @@ void GlobalContext::translateFunctions() { ...@@ -185,7 +187,7 @@ void GlobalContext::translateFunctions() {
OstreamLocker L(this); OstreamLocker L(this);
getStrDump() << "ICE translation error: " << Func->getError() << "\n"; getStrDump() << "ICE translation error: " << Func->getError() << "\n";
} else { } else {
if (getFlags().UseIntegratedAssembler) if (getFlags().getUseIntegratedAssembler())
Func->emitIAS(); Func->emitIAS();
else else
Func->emit(); Func->emit();
...@@ -562,7 +564,7 @@ std::unique_ptr<Cfg> GlobalContext::cfgQueueBlockingPop() { ...@@ -562,7 +564,7 @@ std::unique_ptr<Cfg> GlobalContext::cfgQueueBlockingPop() {
} }
void GlobalContext::dumpStats(const IceString &Name, bool Final) { void GlobalContext::dumpStats(const IceString &Name, bool Final) {
if (!ALLOW_DUMP || !getFlags().DumpStats) if (!getFlags().getDumpStats())
return; return;
OstreamLocker OL(this); OstreamLocker OL(this);
if (Final) { if (Final) {
...@@ -584,10 +586,10 @@ void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) { ...@@ -584,10 +586,10 @@ void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) {
void TimerMarker::push() { void TimerMarker::push() {
switch (StackID) { switch (StackID) {
case GlobalContext::TSK_Default: case GlobalContext::TSK_Default:
Active = Ctx->getFlags().SubzeroTimingEnabled; Active = Ctx->getFlags().getSubzeroTimingEnabled();
break; break;
case GlobalContext::TSK_Funcs: case GlobalContext::TSK_Funcs:
Active = Ctx->getFlags().TimeEachFunction; Active = Ctx->getFlags().getTimeEachFunction();
break; break;
default: default:
break; break;
...@@ -598,7 +600,8 @@ void TimerMarker::push() { ...@@ -598,7 +600,8 @@ void TimerMarker::push() {
void TimerMarker::pushCfg(const Cfg *Func) { void TimerMarker::pushCfg(const Cfg *Func) {
Ctx = Func->getContext(); Ctx = Func->getContext();
Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled; Active =
Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled();
if (Active) if (Active)
Ctx->pushTimer(ID, StackID); Ctx->pushTimer(ID, StackID);
} }
......
...@@ -202,7 +202,7 @@ public: ...@@ -202,7 +202,7 @@ public:
const ClFlags &getFlags() const { return Flags; } const ClFlags &getFlags() const { return Flags; }
bool isIRGenerationDisabled() const { bool isIRGenerationDisabled() const {
return ALLOW_DISABLE_IR_GEN ? getFlags().DisableIRGeneration : false; return getFlags().getDisableIRGeneration();
} }
// Allocate data of type T using the global allocator. // Allocate data of type T using the global allocator.
...@@ -223,35 +223,35 @@ public: ...@@ -223,35 +223,35 @@ public:
} }
void dumpStats(const IceString &Name, bool Final = false); void dumpStats(const IceString &Name, bool Final = false);
void statsUpdateEmitted(uint32_t InstCount) { void statsUpdateEmitted(uint32_t InstCount) {
if (!ALLOW_DUMP || !getFlags().DumpStats) if (!getFlags().getDumpStats())
return; return;
ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS);
TLS->StatsFunction.update(CodeStats::CS_InstCount, InstCount); TLS->StatsFunction.update(CodeStats::CS_InstCount, InstCount);
TLS->StatsCumulative.update(CodeStats::CS_InstCount, InstCount); TLS->StatsCumulative.update(CodeStats::CS_InstCount, InstCount);
} }
void statsUpdateRegistersSaved(uint32_t Num) { void statsUpdateRegistersSaved(uint32_t Num) {
if (!ALLOW_DUMP || !getFlags().DumpStats) if (!getFlags().getDumpStats())
return; return;
ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS);
TLS->StatsFunction.update(CodeStats::CS_RegsSaved, Num); TLS->StatsFunction.update(CodeStats::CS_RegsSaved, Num);
TLS->StatsCumulative.update(CodeStats::CS_RegsSaved, Num); TLS->StatsCumulative.update(CodeStats::CS_RegsSaved, Num);
} }
void statsUpdateFrameBytes(uint32_t Bytes) { void statsUpdateFrameBytes(uint32_t Bytes) {
if (!ALLOW_DUMP || !getFlags().DumpStats) if (!getFlags().getDumpStats())
return; return;
ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS);
TLS->StatsFunction.update(CodeStats::CS_FrameByte, Bytes); TLS->StatsFunction.update(CodeStats::CS_FrameByte, Bytes);
TLS->StatsCumulative.update(CodeStats::CS_FrameByte, Bytes); TLS->StatsCumulative.update(CodeStats::CS_FrameByte, Bytes);
} }
void statsUpdateSpills() { void statsUpdateSpills() {
if (!ALLOW_DUMP || !getFlags().DumpStats) if (!getFlags().getDumpStats())
return; return;
ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS);
TLS->StatsFunction.update(CodeStats::CS_NumSpills); TLS->StatsFunction.update(CodeStats::CS_NumSpills);
TLS->StatsCumulative.update(CodeStats::CS_NumSpills); TLS->StatsCumulative.update(CodeStats::CS_NumSpills);
} }
void statsUpdateFills() { void statsUpdateFills() {
if (!ALLOW_DUMP || !getFlags().DumpStats) if (!getFlags().getDumpStats())
return; return;
ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS); ThreadContext *TLS = ICE_TLS_GET_FIELD(TLS);
TLS->StatsFunction.update(CodeStats::CS_NumFills); TLS->StatsFunction.update(CodeStats::CS_NumFills);
...@@ -290,7 +290,7 @@ public: ...@@ -290,7 +290,7 @@ public:
void cfgQueueNotifyEnd() { CfgQ.notifyEnd(); } void cfgQueueNotifyEnd() { CfgQ.notifyEnd(); }
void startWorkerThreads() { void startWorkerThreads() {
size_t NumWorkers = getFlags().NumTranslationThreads; size_t NumWorkers = getFlags().getNumTranslationThreads();
auto Timers = getTimers(); auto Timers = getTimers();
for (size_t i = 0; i < NumWorkers; ++i) { for (size_t i = 0; i < NumWorkers; ++i) {
ThreadContext *WorkerTLS = new ThreadContext(); ThreadContext *WorkerTLS = new ThreadContext();
......
...@@ -313,7 +313,7 @@ TargetX8632::TargetX8632(Cfg *Func) ...@@ -313,7 +313,7 @@ TargetX8632::TargetX8632(Cfg *Func)
void TargetX8632::translateO2() { void TargetX8632::translateO2() {
TimerMarker T(TimerStack::TT_O2, Func); TimerMarker T(TimerStack::TT_O2, Func);
if (!Ctx->getFlags().PhiEdgeSplit) { if (!Ctx->getFlags().getPhiEdgeSplit()) {
// Lower Phi instructions. // Lower Phi instructions.
Func->placePhiLoads(); Func->placePhiLoads();
if (Func->hasError()) if (Func->hasError())
...@@ -377,7 +377,7 @@ void TargetX8632::translateO2() { ...@@ -377,7 +377,7 @@ void TargetX8632::translateO2() {
return; return;
Func->dump("After linear scan regalloc"); Func->dump("After linear scan regalloc");
if (Ctx->getFlags().PhiEdgeSplit) { if (Ctx->getFlags().getPhiEdgeSplit()) {
Func->advancedPhiLowering(); Func->advancedPhiLowering();
Func->dump("After advanced Phi lowering"); Func->dump("After advanced Phi lowering");
} }
...@@ -3067,7 +3067,7 @@ void TargetX8632::lowerIntrinsicCall(const InstIntrinsicCall *Instr) { ...@@ -3067,7 +3067,7 @@ void TargetX8632::lowerIntrinsicCall(const InstIntrinsicCall *Instr) {
return; return;
} }
case Intrinsics::NaClReadTP: { case Intrinsics::NaClReadTP: {
if (Ctx->getFlags().UseSandboxing) { if (Ctx->getFlags().getUseSandboxing()) {
Constant *Zero = Ctx->getConstantZero(IceType_i32); Constant *Zero = Ctx->getConstantZero(IceType_i32);
Operand *Src = Operand *Src =
OperandX8632Mem::create(Func, IceType_i32, nullptr, Zero, nullptr, 0, OperandX8632Mem::create(Func, IceType_i32, nullptr, Zero, nullptr, 0,
...@@ -4566,7 +4566,7 @@ TargetDataX8632::TargetDataX8632(GlobalContext *Ctx) ...@@ -4566,7 +4566,7 @@ TargetDataX8632::TargetDataX8632(GlobalContext *Ctx)
void TargetDataX8632::lowerGlobal(const VariableDeclaration &Var) const { void TargetDataX8632::lowerGlobal(const VariableDeclaration &Var) const {
// If external and not initialized, this must be a cross test. // If external and not initialized, this must be a cross test.
// Don't generate a declaration for such cases. // Don't generate a declaration for such cases.
bool IsExternal = Var.isExternal() || Ctx->getFlags().DisableInternal; bool IsExternal = Var.isExternal() || Ctx->getFlags().getDisableInternal();
if (IsExternal && !Var.hasInitializer()) if (IsExternal && !Var.hasInitializer())
return; return;
...@@ -4579,7 +4579,7 @@ void TargetDataX8632::lowerGlobal(const VariableDeclaration &Var) const { ...@@ -4579,7 +4579,7 @@ void TargetDataX8632::lowerGlobal(const VariableDeclaration &Var) const {
SizeT Size = Var.getNumBytes(); SizeT Size = Var.getNumBytes();
IceString MangledName = Var.mangleName(Ctx); IceString MangledName = Var.mangleName(Ctx);
IceString SectionSuffix = ""; IceString SectionSuffix = "";
if (Ctx->getFlags().DataSections) if (Ctx->getFlags().getDataSections())
SectionSuffix = "." + MangledName; SectionSuffix = "." + MangledName;
Str << "\t.type\t" << MangledName << ",@object\n"; Str << "\t.type\t" << MangledName << ",@object\n";
...@@ -4702,11 +4702,11 @@ void TargetDataX8632::emitConstantPool(GlobalContext *Ctx) { ...@@ -4702,11 +4702,11 @@ void TargetDataX8632::emitConstantPool(GlobalContext *Ctx) {
} }
void TargetDataX8632::lowerConstants(GlobalContext *Ctx) const { void TargetDataX8632::lowerConstants(GlobalContext *Ctx) const {
if (Ctx->getFlags().DisableTranslation) if (Ctx->getFlags().getDisableTranslation())
return; return;
// No need to emit constants from the int pool since (for x86) they // No need to emit constants from the int pool since (for x86) they
// are embedded as immediates in the instructions, just emit float/double. // are embedded as immediates in the instructions, just emit float/double.
if (Ctx->getFlags().UseELFWriter) { if (Ctx->getFlags().getUseELFWriter()) {
ELFObjectWriter *Writer = Ctx->getObjectWriter(); ELFObjectWriter *Writer = Ctx->getObjectWriter();
Writer->writeConstantPool<ConstantFloat>(IceType_f32); Writer->writeConstantPool<ConstantFloat>(IceType_f32);
Writer->writeConstantPool<ConstantDouble>(IceType_f64); Writer->writeConstantPool<ConstantDouble>(IceType_f64);
......
...@@ -55,7 +55,7 @@ bool Translator::checkIfUnnamedNameSafe(const IceString &Name, const char *Kind, ...@@ -55,7 +55,7 @@ bool Translator::checkIfUnnamedNameSafe(const IceString &Name, const char *Kind,
void Translator::translateFcn(std::unique_ptr<Cfg> Func) { void Translator::translateFcn(std::unique_ptr<Cfg> Func) {
Ctx->cfgQueueBlockingPush(std::move(Func)); Ctx->cfgQueueBlockingPush(std::move(Func));
if (Ctx->getFlags().NumTranslationThreads == 0) { if (Ctx->getFlags().getNumTranslationThreads() == 0) {
Ctx->translateFunctions(); Ctx->translateFunctions();
} }
} }
...@@ -73,10 +73,10 @@ void Translator::transferErrorCode() const { ...@@ -73,10 +73,10 @@ void Translator::transferErrorCode() const {
void void
Translator::lowerGlobals(const VariableDeclarationList &VariableDeclarations) { Translator::lowerGlobals(const VariableDeclarationList &VariableDeclarations) {
TimerMarker T(TimerStack::TT_emitGlobalInitializers, Ctx); TimerMarker T(TimerStack::TT_emitGlobalInitializers, Ctx);
bool DisableTranslation = Ctx->getFlags().DisableTranslation; bool DisableTranslation = Ctx->getFlags().getDisableTranslation();
const bool DumpGlobalVariables = const bool DumpGlobalVariables = ALLOW_DUMP && Ctx->getVerbose() &&
ALLOW_DUMP && Ctx->getVerbose() && Ctx->getFlags().VerboseFocusOn.empty(); Ctx->getFlags().getVerboseFocusOn().empty();
if (Ctx->getFlags().UseELFWriter) { if (Ctx->getFlags().getUseELFWriter()) {
// Dump all globals if requested, but don't interleave w/ emission. // Dump all globals if requested, but don't interleave w/ emission.
if (DumpGlobalVariables) { if (DumpGlobalVariables) {
OstreamLocker L(Ctx); OstreamLocker L(Ctx);
...@@ -87,7 +87,7 @@ Translator::lowerGlobals(const VariableDeclarationList &VariableDeclarations) { ...@@ -87,7 +87,7 @@ Translator::lowerGlobals(const VariableDeclarationList &VariableDeclarations) {
} }
DataLowering->lowerGlobalsELF(VariableDeclarations); DataLowering->lowerGlobalsELF(VariableDeclarations);
} else { } else {
const IceString &TranslateOnly = Ctx->getFlags().TranslateOnly; const IceString &TranslateOnly = Ctx->getFlags().getTranslateOnly();
OstreamLocker L(Ctx); OstreamLocker L(Ctx);
Ostream &Stream = Ctx->getStrDump(); Ostream &Stream = Ctx->getStrDump();
for (const Ice::VariableDeclaration *Global : VariableDeclarations) { for (const Ice::VariableDeclaration *Global : VariableDeclarations) {
......
...@@ -191,8 +191,7 @@ public: ...@@ -191,8 +191,7 @@ public:
/// Returns true if generation of Subzero IR is disabled. /// Returns true if generation of Subzero IR is disabled.
bool isIRGenerationDisabled() const { bool isIRGenerationDisabled() const {
return ALLOW_DISABLE_IR_GEN ? Translator.getFlags().DisableIRGeneration return Translator.getFlags().getDisableIRGeneration();
: false;
} }
/// Returns the undefined type associated with type ID. /// Returns the undefined type associated with type ID.
...@@ -458,7 +457,7 @@ bool TopLevelParser::Error(const std::string &Message) { ...@@ -458,7 +457,7 @@ bool TopLevelParser::Error(const std::string &Message) {
raw_ostream &OldErrStream = setErrStream(Context->getStrDump()); raw_ostream &OldErrStream = setErrStream(Context->getStrDump());
NaClBitcodeParser::Error(Message); NaClBitcodeParser::Error(Message);
setErrStream(OldErrStream); setErrStream(OldErrStream);
if (!Translator.getFlags().AllowErrorRecovery) if (!Translator.getFlags().getAllowErrorRecovery())
report_fatal_error("Unable to continue"); report_fatal_error("Unable to continue");
return true; return true;
} }
...@@ -552,8 +551,7 @@ protected: ...@@ -552,8 +551,7 @@ protected:
const Ice::ClFlags &getFlags() const { return getTranslator().getFlags(); } const Ice::ClFlags &getFlags() const { return getTranslator().getFlags(); }
bool isIRGenerationDisabled() const { bool isIRGenerationDisabled() const {
return ALLOW_DISABLE_IR_GEN ? getTranslator().getFlags().DisableIRGeneration return getTranslator().getFlags().getDisableIRGeneration();
: false;
} }
// Default implementation. Reports that block is unknown and skips // Default implementation. Reports that block is unknown and skips
...@@ -632,14 +630,14 @@ bool BlockParserBaseClass::Error(const std::string &Message) { ...@@ -632,14 +630,14 @@ bool BlockParserBaseClass::Error(const std::string &Message) {
// Note: If dump routines have been turned off, the error messages // Note: If dump routines have been turned off, the error messages
// will not be readable. Hence, replace with simple error. We also // will not be readable. Hence, replace with simple error. We also
// use the simple form for unit tests. // use the simple form for unit tests.
if (ALLOW_DUMP && !getFlags().GenerateUnitTestMessages) { if (getFlags().getGenerateUnitTestMessages()) {
StrBuf << Message;
} else {
StrBuf << "Invalid " << getBlockName() << " record: <" << Record.GetCode(); StrBuf << "Invalid " << getBlockName() << " record: <" << Record.GetCode();
for (const uint64_t Val : Record.GetValues()) { for (const uint64_t Val : Record.GetValues()) {
StrBuf << " " << Val; StrBuf << " " << Val;
} }
StrBuf << ">"; StrBuf << ">";
} else {
StrBuf << Message;
} }
return Context->Error(StrBuf.str()); return Context->Error(StrBuf.str());
} }
...@@ -1091,7 +1089,7 @@ public: ...@@ -1091,7 +1089,7 @@ public:
bool convertFunction() { bool convertFunction() {
const Ice::TimerStackIdT StackID = Ice::GlobalContext::TSK_Funcs; const Ice::TimerStackIdT StackID = Ice::GlobalContext::TSK_Funcs;
Ice::TimerIdT TimerID = 0; Ice::TimerIdT TimerID = 0;
const bool TimeThisFunction = ALLOW_DUMP && getFlags().TimeEachFunction; const bool TimeThisFunction = getFlags().getTimeEachFunction();
if (TimeThisFunction) { if (TimeThisFunction) {
TimerID = getTranslator().getContext()->getTimerID(StackID, TimerID = getTranslator().getContext()->getTimerID(StackID,
FuncDecl->getName()); FuncDecl->getName());
...@@ -2461,7 +2459,7 @@ void FunctionParser::ProcessRecord() { ...@@ -2461,7 +2459,7 @@ void FunctionParser::ProcessRecord() {
} }
} }
} else { } else {
if (getFlags().StubConstantCalls && if (getFlags().getStubConstantCalls() &&
llvm::isa<Ice::ConstantInteger32>(Callee)) { llvm::isa<Ice::ConstantInteger32>(Callee)) {
Callee = Context->getStubbedConstCallValue(Callee); Callee = Context->getStubbedConstCallValue(Callee);
} }
...@@ -2811,14 +2809,15 @@ private: ...@@ -2811,14 +2809,15 @@ private:
void InstallGlobalNamesAndGlobalVarInitializers() { void InstallGlobalNamesAndGlobalVarInitializers() {
if (!GlobalDeclarationNamesAndInitializersInstalled) { if (!GlobalDeclarationNamesAndInitializersInstalled) {
Ice::Translator &Trans = getTranslator(); Ice::Translator &Trans = getTranslator();
const Ice::IceString &GlobalPrefix = getFlags().DefaultGlobalPrefix; const Ice::IceString &GlobalPrefix = getFlags().getDefaultGlobalPrefix();
if (!GlobalPrefix.empty()) { if (!GlobalPrefix.empty()) {
uint32_t NameIndex = 0; uint32_t NameIndex = 0;
for (Ice::VariableDeclaration *Var : Context->getGlobalVariables()) { for (Ice::VariableDeclaration *Var : Context->getGlobalVariables()) {
installDeclarationName(Trans, Var, GlobalPrefix, "global", NameIndex); installDeclarationName(Trans, Var, GlobalPrefix, "global", NameIndex);
} }
} }
const Ice::IceString &FunctionPrefix = getFlags().DefaultFunctionPrefix; const Ice::IceString &FunctionPrefix =
getFlags().getDefaultFunctionPrefix();
if (!FunctionPrefix.empty()) { if (!FunctionPrefix.empty()) {
uint32_t NameIndex = 0; uint32_t NameIndex = 0;
for (Ice::FunctionDeclaration *Func : for (Ice::FunctionDeclaration *Func :
......
...@@ -228,10 +228,11 @@ static struct { ...@@ -228,10 +228,11 @@ static struct {
const char *FlagName; const char *FlagName;
int FlagValue; int FlagValue;
} ConditionalBuildAttributes[] = {{"dump", ALLOW_DUMP}, } ConditionalBuildAttributes[] = {{"dump", ALLOW_DUMP},
{"disable_ir_gen", ALLOW_DISABLE_IR_GEN},
{"llvm_cl", ALLOW_LLVM_CL}, {"llvm_cl", ALLOW_LLVM_CL},
{"llvm_ir", ALLOW_LLVM_IR}, {"llvm_ir", ALLOW_LLVM_IR},
{"llvm_ir_as_input", ALLOW_LLVM_IR_AS_INPUT}, {"llvm_ir_as_input", ALLOW_LLVM_IR_AS_INPUT},
{"disable_ir_gen", ALLOW_DISABLE_IR_GEN}}; {"minimal_build", ALLOW_MINIMAL_BUILD}};
// Validates values of build attributes. Prints them to Stream if // Validates values of build attributes. Prints them to Stream if
// Stream is non-null. // Stream is non-null.
...@@ -298,28 +299,28 @@ int main(int argc, char **argv) { ...@@ -298,28 +299,28 @@ int main(int argc, char **argv) {
} }
Ice::ClFlags Flags; Ice::ClFlags Flags;
Flags.DisableInternal = DisableInternal; Flags.setAllowErrorRecovery(AllowErrorRecovery);
Flags.SubzeroTimingEnabled = SubzeroTimingEnabled; Flags.setAllowUninitializedGlobals(AllowUninitializedGlobals);
Flags.DisableTranslation = DisableTranslation; Flags.setDataSections(DataSections);
Flags.FunctionSections = FunctionSections; Flags.setDecorateAsm(DecorateAsm);
Flags.DataSections = DataSections; Flags.setDefaultFunctionPrefix(DefaultFunctionPrefix);
Flags.UseELFWriter = UseELFWriter; Flags.setDefaultGlobalPrefix(DefaultGlobalPrefix);
Flags.UseIntegratedAssembler = UseIntegratedAssembler; Flags.setDisableInternal(DisableInternal);
Flags.UseSandboxing = UseSandboxing; Flags.setDisableIRGeneration(DisableIRGeneration);
Flags.PhiEdgeSplit = EnablePhiEdgeSplit; Flags.setDisableTranslation(DisableTranslation);
Flags.DecorateAsm = DecorateAsm; Flags.setDumpStats(DumpStats);
Flags.DumpStats = DumpStats; Flags.setFunctionSections(FunctionSections);
Flags.AllowUninitializedGlobals = AllowUninitializedGlobals; Flags.setNumTranslationThreads(NumThreads);
Flags.TimeEachFunction = TimeEachFunction; Flags.setPhiEdgeSplit(EnablePhiEdgeSplit);
Flags.NumTranslationThreads = NumThreads; Flags.setStubConstantCalls(StubConstantCalls);
Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; Flags.setSubzeroTimingEnabled(SubzeroTimingEnabled);
Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; Flags.setTimeEachFunction(TimeEachFunction);
Flags.TimingFocusOn = TimingFocusOn; Flags.setTimingFocusOn(TimingFocusOn);
Flags.VerboseFocusOn = VerboseFocusOn; Flags.setTranslateOnly(TranslateOnly);
Flags.TranslateOnly = TranslateOnly; Flags.setUseELFWriter(UseELFWriter);
Flags.DisableIRGeneration = DisableIRGeneration; Flags.setUseIntegratedAssembler(UseIntegratedAssembler);
Flags.AllowErrorRecovery = AllowErrorRecovery; Flags.setUseSandboxing(UseSandboxing);
Flags.StubConstantCalls = StubConstantCalls; Flags.setVerboseFocusOn(VerboseFocusOn);
// Force -build-on-read=0 for .ll files. // Force -build-on-read=0 for .ll files.
const std::string LLSuffix = ".ll"; const std::string LLSuffix = ".ll";
......
...@@ -26,8 +26,8 @@ bool IceTest::SubzeroBitcodeMunger::runTest(const char *TestName, ...@@ -26,8 +26,8 @@ bool IceTest::SubzeroBitcodeMunger::runTest(const char *TestName,
setupTest(TestName, Munges, MungeSize, AddHeader); setupTest(TestName, Munges, MungeSize, AddHeader);
Ice::ClFlags Flags; Ice::ClFlags Flags;
Flags.AllowErrorRecovery = true; Flags.setAllowErrorRecovery(true);
Flags.GenerateUnitTestMessages = true; Flags.setGenerateUnitTestMessages(true);
Ice::GlobalContext Ctx(DumpStream, DumpStream, nullptr, Ice::GlobalContext Ctx(DumpStream, DumpStream, nullptr,
Ice::IceV_Instructions, Ice::Target_X8632, Ice::Opt_m1, Ice::IceV_Instructions, Ice::Target_X8632, Ice::Opt_m1,
"", Flags); "", Flags);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment