<div dir="ltr">This introduced a crash that I just fixed in r234141. Maybe auto shouldn't be used for ErrorOr, to make it more difficult to make this type of mistake?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 16, 2015 at 1:29 PM, Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: bogner<br>
Date: Mon Feb 16 15:29:05 2015<br>
New Revision: 229434<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=229434&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=229434&view=rev</a><br>
Log:<br>
InstrProf: Update for LLVM API change<br>
<br>
Update for the API change in r229433<br>
<br>
Modified:<br>
cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=229434&r1=229433&r2=229434&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=229434&r1=229433&r2=229434&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Mon Feb 16 15:29:05 2015<br>
@@ -140,12 +140,14 @@ CodeGenModule::CodeGenModule(ASTContext<br>
RRData = new RREntrypoints();<br>
<br>
if (!CodeGenOpts.InstrProfileInput.empty()) {<br>
- if (std::error_code EC = llvm::IndexedInstrProfReader::create(<br>
- CodeGenOpts.InstrProfileInput, PGOReader)) {<br>
+ auto ReaderOrErr =<br>
+ llvm::IndexedInstrProfReader::create(CodeGenOpts.InstrProfileInput);<br>
+ if (std::error_code EC = ReaderOrErr.getError()) {<br>
unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,<br>
"Could not read profile: %0");<br>
getDiags().Report(DiagID) << EC.message();<br>
}<br>
+ PGOReader = std::move(ReaderOrErr.get());<br>
}<br>
<br>
// If coverage mapping generation is enabled, create the<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>