bool MCRelaxAll : 1;
bool MCNoExecStack : 1;
bool MCFatalWarnings : 1;
+ bool MCNoWarn : 1;
bool MCSaveTempLabels : 1;
bool MCUseDwarfDirectory : 1;
bool ShowMCEncoding : 1;
ARE_EQUAL(MCRelaxAll) &&
ARE_EQUAL(MCNoExecStack) &&
ARE_EQUAL(MCFatalWarnings) &&
+ ARE_EQUAL(MCNoWarn) &&
ARE_EQUAL(MCSaveTempLabels) &&
ARE_EQUAL(MCUseDwarfDirectory) &&
ARE_EQUAL(ShowMCEncoding) &&
cl::opt<bool> FatalWarnings("fatal-warnings",
cl::desc("Treat warnings as errors"));
+cl::opt<bool> NoWarn("no-warn", cl::desc("Suppress all warnings"));
+cl::alias NoWarnW("W", cl::desc("Alias for --no-warn"), cl::aliasopt(NoWarn));
+
cl::opt<std::string>
ABIName("target-abi", cl::Hidden,
cl::desc("The name of the ABI to be targeted from the backend."),
Options.ShowMCInst = ShowMCInst;
Options.ABIName = ABIName;
Options.MCFatalWarnings = FatalWarnings;
+ Options.MCNoWarn = NoWarn;
return Options;
}
}
bool AsmParser::Warning(SMLoc L, const Twine &Msg, ArrayRef<SMRange> Ranges) {
+ if(getTargetParser().getTargetOptions().MCNoWarn)
+ return false;
if (getTargetParser().getTargetOptions().MCFatalWarnings)
return Error(L, Msg, Ranges);
printMessage(L, SourceMgr::DK_Warning, Msg, Ranges);
MCTargetOptions::MCTargetOptions()
: SanitizeAddress(false), MCRelaxAll(false), MCNoExecStack(false),
- MCFatalWarnings(false), MCSaveTempLabels(false),
+ MCFatalWarnings(false), MCNoWarn(false), MCSaveTempLabels(false),
MCUseDwarfDirectory(false), ShowMCEncoding(false), ShowMCInst(false),
AsmVerbose(false), DwarfVersion(0), ABIName() {}
--- /dev/null
+# RUN: llvm-mc --no-warn %s 2>&1 | FileCheck %s
+# XFAIL: hexagon
+
+# CHECK-NOT: warning:
+.warning