<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<div style="color: rgb(33, 33, 33);">
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
-void warning(const Twine &Msg) { llvm::errs() << Msg << "\n"; }<br>
+void warning(const Twine &Msg) {<br>
+ if (Config->FatalWarnings)<br>
+ error(Msg);<br>
+ else<br>
+ llvm::errs() << Msg << "\n";<br>
<br>
</blockquote>
<div>> You don't need `llvm::`.</div>
<div> <br>
</div>
<div>I need. Also it is consistent with other code in error.cpp<br>
</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
+}<br>
<br>
void error(const Twine &Msg) {<br>
*ErrorOS << Msg << "\n";<br>
Index: ELF/Driver.cpp<br>
===================================================================<br>
--- ELF/Driver.cpp<br>
+++ ELF/Driver.cpp<br>
@@ -344,6 +344,7 @@<br>
Config->EhFrameHdr = Args.hasArg(OPT_eh_frame_hdr);<br>
Config->EnableNewDtags = !Args.hasArg(OPT_disable_new_dtags);<br>
Config->ExportDynamic = Args.hasArg(OPT_export_dynamic);<br>
+ Config->FatalWarnings = Args.hasArg(OPT_fatal_warnings);<br>
</blockquote>
<div><br>
</div>
<div>> This needs to be done earlier, probably at beginning of LinkerDriver::main. Otherwise, warnings before this line are not going to be handled as fatal errors.<br>
</div>
<div><br>
</div>
<div>Initially I placed it here for consistency. <span style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">And I doubt we will need to use warnings untill this option be
processed.</span><br>
</div>
<div>Looks the only place of using warning() was the one you removed in r<span style="font-size: 12pt;">274723 ("Do not call warning() from ELFOptTable::parse()."), that what I workarounded in r274507 as well.</span></div>
<div><span style="font-size: 12pt;">So I guess nothing should be changed here anymore after <span style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">r</span><span style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);">274723 </span>?</span></div>
<div><span style="font-size: 12pt;"><br>
</span></div>
<div><span style="font-size: 12pt;">George.</span></div>
<div><span style="font-size: 12pt;"></span>
<div><br>
</div>
<br>
</div>
<div><br>
</div>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>