llvm.org GIT mirror llvm / a5718c6
Convert MC command line option for fatal assembler warnings into a proper flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216471 91177308-0d34-0410-b5e6-96231b3b80d8 Joerg Sonnenberger 6 years ago
4 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
112112
113113 bool isParsingInlineAsm () { return ParsingInlineAsm; }
114114 void setParsingInlineAsm (bool Value) { ParsingInlineAsm = Value; }
115
116 MCTargetOptions getTargetOptions() const { return MCOptions; }
115117
116118 void setSemaCallback(MCAsmParserSemaCallback *Callback) {
117119 SemaCallback = Callback;
2323
2424 bool MCRelaxAll : 1;
2525 bool MCNoExecStack : 1;
26 bool MCFatalWarnings : 1;
2627 bool MCSaveTempLabels : 1;
2728 bool MCUseDwarfDirectory : 1;
2829 bool ShowMCEncoding : 1;
3738 return (ARE_EQUAL(SanitizeAddress) &&
3839 ARE_EQUAL(MCRelaxAll) &&
3940 ARE_EQUAL(MCNoExecStack) &&
41 ARE_EQUAL(MCFatalWarnings) &&
4042 ARE_EQUAL(MCSaveTempLabels) &&
4143 ARE_EQUAL(MCUseDwarfDirectory) &&
4244 ARE_EQUAL(ShowMCEncoding) &&
4345 ARE_EQUAL(ShowMCInst) &&
4446 ARE_EQUAL(AsmVerbose) &&
45 ARE_EQUAL(DwarfVersion));
47 ARE_EQUAL(DwarfVersion));
4648 #undef ARE_EQUAL
4749 }
4850
4444 #include
4545 using namespace llvm;
4646
47 static cl::opt
48 FatalAssemblerWarnings("fatal-assembler-warnings",
49 cl::desc("Consider warnings as error"));
50
5147 MCAsmParserSemaCallback::~MCAsmParserSemaCallback() {}
5248
5349 namespace {
551547 }
552548
553549 bool AsmParser::Warning(SMLoc L, const Twine &Msg, ArrayRef Ranges) {
554 if (FatalAssemblerWarnings)
550 if (getTargetParser().getTargetOptions().MCFatalWarnings)
555551 return Error(L, Msg, Ranges);
556552 printMessage(L, SourceMgr::DK_Warning, Msg, Ranges);
557553 printMacroInstantiations();
1212
1313 MCTargetOptions::MCTargetOptions()
1414 : SanitizeAddress(false), MCRelaxAll(false), MCNoExecStack(false),
15 MCSaveTempLabels(false), MCUseDwarfDirectory(false),
16 ShowMCEncoding(false), ShowMCInst(false), AsmVerbose(false),
17 DwarfVersion(0) {}
15 MCFatalWarnings(false), MCSaveTempLabels(false),
16 MCUseDwarfDirectory(false), ShowMCEncoding(false), ShowMCInst(false),
17 AsmVerbose(false), DwarfVersion(0) {}
1818
1919 } // end namespace llvm