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
This commit is contained in:
Joerg Sonnenberger 2014-08-26 18:39:50 +00:00
parent de2d08ea17
commit a5718c69b4
4 changed files with 9 additions and 9 deletions

View File

@ -114,6 +114,8 @@ public:
bool isParsingInlineAsm () { return ParsingInlineAsm; } bool isParsingInlineAsm () { return ParsingInlineAsm; }
void setParsingInlineAsm (bool Value) { ParsingInlineAsm = Value; } void setParsingInlineAsm (bool Value) { ParsingInlineAsm = Value; }
MCTargetOptions getTargetOptions() const { return MCOptions; }
void setSemaCallback(MCAsmParserSemaCallback *Callback) { void setSemaCallback(MCAsmParserSemaCallback *Callback) {
SemaCallback = Callback; SemaCallback = Callback;
} }

View File

@ -24,6 +24,7 @@ public:
bool MCRelaxAll : 1; bool MCRelaxAll : 1;
bool MCNoExecStack : 1; bool MCNoExecStack : 1;
bool MCFatalWarnings : 1;
bool MCSaveTempLabels : 1; bool MCSaveTempLabels : 1;
bool MCUseDwarfDirectory : 1; bool MCUseDwarfDirectory : 1;
bool ShowMCEncoding : 1; bool ShowMCEncoding : 1;
@ -38,12 +39,13 @@ inline bool operator==(const MCTargetOptions &LHS, const MCTargetOptions &RHS) {
return (ARE_EQUAL(SanitizeAddress) && return (ARE_EQUAL(SanitizeAddress) &&
ARE_EQUAL(MCRelaxAll) && ARE_EQUAL(MCRelaxAll) &&
ARE_EQUAL(MCNoExecStack) && ARE_EQUAL(MCNoExecStack) &&
ARE_EQUAL(MCFatalWarnings) &&
ARE_EQUAL(MCSaveTempLabels) && ARE_EQUAL(MCSaveTempLabels) &&
ARE_EQUAL(MCUseDwarfDirectory) && ARE_EQUAL(MCUseDwarfDirectory) &&
ARE_EQUAL(ShowMCEncoding) && ARE_EQUAL(ShowMCEncoding) &&
ARE_EQUAL(ShowMCInst) && ARE_EQUAL(ShowMCInst) &&
ARE_EQUAL(AsmVerbose) && ARE_EQUAL(AsmVerbose) &&
ARE_EQUAL(DwarfVersion)); ARE_EQUAL(DwarfVersion));
#undef ARE_EQUAL #undef ARE_EQUAL
} }

View File

@ -45,10 +45,6 @@
#include <vector> #include <vector>
using namespace llvm; using namespace llvm;
static cl::opt<bool>
FatalAssemblerWarnings("fatal-assembler-warnings",
cl::desc("Consider warnings as error"));
MCAsmParserSemaCallback::~MCAsmParserSemaCallback() {} MCAsmParserSemaCallback::~MCAsmParserSemaCallback() {}
namespace { namespace {
@ -552,7 +548,7 @@ void AsmParser::Note(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges) {
} }
bool AsmParser::Warning(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges) { bool AsmParser::Warning(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges) {
if (FatalAssemblerWarnings) if (getTargetParser().getTargetOptions().MCFatalWarnings)
return Error(L, Msg, Ranges); return Error(L, Msg, Ranges);
printMessage(L, SourceMgr::DK_Warning, Msg, Ranges); printMessage(L, SourceMgr::DK_Warning, Msg, Ranges);
printMacroInstantiations(); printMacroInstantiations();

View File

@ -13,8 +13,8 @@ namespace llvm {
MCTargetOptions::MCTargetOptions() MCTargetOptions::MCTargetOptions()
: SanitizeAddress(false), MCRelaxAll(false), MCNoExecStack(false), : SanitizeAddress(false), MCRelaxAll(false), MCNoExecStack(false),
MCSaveTempLabels(false), MCUseDwarfDirectory(false), MCFatalWarnings(false), MCSaveTempLabels(false),
ShowMCEncoding(false), ShowMCInst(false), AsmVerbose(false), MCUseDwarfDirectory(false), ShowMCEncoding(false), ShowMCInst(false),
DwarfVersion(0) {} AsmVerbose(false), DwarfVersion(0) {}
} // end namespace llvm } // end namespace llvm