[llvm] r216471 - Convert MC command line option for fatal assembler warnings into a
Joerg Sonnenberger
joerg at bec.de
Tue Aug 26 11:39:51 PDT 2014
Author: joerg
Date: Tue Aug 26 13:39:50 2014
New Revision: 216471
URL: http://llvm.org/viewvc/llvm-project?rev=216471&view=rev
Log:
Convert MC command line option for fatal assembler warnings into a
proper flag.
Modified:
llvm/trunk/include/llvm/MC/MCTargetAsmParser.h
llvm/trunk/include/llvm/MC/MCTargetOptions.h
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/lib/MC/MCTargetOptions.cpp
Modified: llvm/trunk/include/llvm/MC/MCTargetAsmParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCTargetAsmParser.h?rev=216471&r1=216470&r2=216471&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCTargetAsmParser.h (original)
+++ llvm/trunk/include/llvm/MC/MCTargetAsmParser.h Tue Aug 26 13:39:50 2014
@@ -114,6 +114,8 @@ public:
bool isParsingInlineAsm () { return ParsingInlineAsm; }
void setParsingInlineAsm (bool Value) { ParsingInlineAsm = Value; }
+ MCTargetOptions getTargetOptions() const { return MCOptions; }
+
void setSemaCallback(MCAsmParserSemaCallback *Callback) {
SemaCallback = Callback;
}
Modified: llvm/trunk/include/llvm/MC/MCTargetOptions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCTargetOptions.h?rev=216471&r1=216470&r2=216471&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCTargetOptions.h (original)
+++ llvm/trunk/include/llvm/MC/MCTargetOptions.h Tue Aug 26 13:39:50 2014
@@ -24,6 +24,7 @@ public:
bool MCRelaxAll : 1;
bool MCNoExecStack : 1;
+ bool MCFatalWarnings : 1;
bool MCSaveTempLabels : 1;
bool MCUseDwarfDirectory : 1;
bool ShowMCEncoding : 1;
@@ -38,12 +39,13 @@ inline bool operator==(const MCTargetOpt
return (ARE_EQUAL(SanitizeAddress) &&
ARE_EQUAL(MCRelaxAll) &&
ARE_EQUAL(MCNoExecStack) &&
+ ARE_EQUAL(MCFatalWarnings) &&
ARE_EQUAL(MCSaveTempLabels) &&
ARE_EQUAL(MCUseDwarfDirectory) &&
ARE_EQUAL(ShowMCEncoding) &&
ARE_EQUAL(ShowMCInst) &&
ARE_EQUAL(AsmVerbose) &&
- ARE_EQUAL(DwarfVersion));
+ ARE_EQUAL(DwarfVersion));
#undef ARE_EQUAL
}
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=216471&r1=216470&r2=216471&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Tue Aug 26 13:39:50 2014
@@ -45,10 +45,6 @@
#include <vector>
using namespace llvm;
-static cl::opt<bool>
-FatalAssemblerWarnings("fatal-assembler-warnings",
- cl::desc("Consider warnings as error"));
-
MCAsmParserSemaCallback::~MCAsmParserSemaCallback() {}
namespace {
@@ -552,7 +548,7 @@ void AsmParser::Note(SMLoc L, const Twin
}
bool AsmParser::Warning(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges) {
- if (FatalAssemblerWarnings)
+ if (getTargetParser().getTargetOptions().MCFatalWarnings)
return Error(L, Msg, Ranges);
printMessage(L, SourceMgr::DK_Warning, Msg, Ranges);
printMacroInstantiations();
Modified: llvm/trunk/lib/MC/MCTargetOptions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCTargetOptions.cpp?rev=216471&r1=216470&r2=216471&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCTargetOptions.cpp (original)
+++ llvm/trunk/lib/MC/MCTargetOptions.cpp Tue Aug 26 13:39:50 2014
@@ -13,8 +13,8 @@ namespace llvm {
MCTargetOptions::MCTargetOptions()
: SanitizeAddress(false), MCRelaxAll(false), MCNoExecStack(false),
- MCSaveTempLabels(false), MCUseDwarfDirectory(false),
- ShowMCEncoding(false), ShowMCInst(false), AsmVerbose(false),
- DwarfVersion(0) {}
+ MCFatalWarnings(false), MCSaveTempLabels(false),
+ MCUseDwarfDirectory(false), ShowMCEncoding(false), ShowMCInst(false),
+ AsmVerbose(false), DwarfVersion(0) {}
} // end namespace llvm
More information about the llvm-commits
mailing list