<div dir="ltr">Is it possible to add some test?<div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 23, 2016 at 9:53 AM, Mehdi Amini via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mehdi_amini<br>
Date: Tue Aug 23 11:53:34 2016<br>
New Revision: 279532<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=279532&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=279532&view=rev</a><br>
Log:<br>
[ThinLTO] Make sure the Context used for the ThinLTO backend has all the appropriate options<br>
<br>
An important performance setting on the LLVMContext for LTO is<br>
enableDebugTypeODRUniquing(), this adds an automatic merging of<br>
debug information in the context based on type ids.<br>
<br>
Also, the lto::Config includes a diagnostic handler that needs to<br>
be set on the Context, as well as the setDiscardValueNames() setting.<br>
<br>
Modified:<br>
    llvm/trunk/lib/LTO/LTO.cpp<br>
    llvm/trunk/lib/LTO/LTOBackend.<wbr>cpp<br>
<br>
Modified: llvm/trunk/lib/LTO/LTO.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTO.cpp?rev=279532&r1=279531&r2=279532&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/LTO/<wbr>LTO.cpp?rev=279532&r1=279531&<wbr>r2=279532&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/LTO/LTO.cpp (original)<br>
+++ llvm/trunk/lib/LTO/LTO.cpp Tue Aug 23 11:53:34 2016<br>
@@ -468,7 +468,7 @@ public:<br>
                           const FunctionImporter::ImportMapTy &ImportList,<br>
                           const GVSummaryMapTy &DefinedGlobals,<br>
                           MapVector<StringRef, MemoryBufferRef> &ModuleMap) {<br>
-    LLVMContext BackendContext;<br>
+    LTOLLVMContext BackendContext(Conf);<br>
<br>
     ErrorOr<std::unique_ptr<<wbr>Module>> MOrErr =<br>
         parseBitcodeFile(MBRef, BackendContext);<br>
<br>
Modified: llvm/trunk/lib/LTO/LTOBackend.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOBackend.cpp?rev=279532&r1=279531&r2=279532&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/LTO/<wbr>LTOBackend.cpp?rev=279532&r1=<wbr>279531&r2=279532&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/LTO/LTOBackend.<wbr>cpp (original)<br>
+++ llvm/trunk/lib/LTO/LTOBackend.<wbr>cpp Tue Aug 23 11:53:34 2016<br>
@@ -271,6 +271,8 @@ Error lto::thinBackend(Config &Conf, uns<br>
     return Error();<br>
<br>
   auto ModuleLoader = [&](StringRef Identifier) {<br>
+    assert(Mod.getContext().<wbr>isODRUniquingDebugTypes() &&<br>
+           "ODR Type uniquing shoudl be enabled on the context");<br>
     return std::move(<wbr>getLazyBitcodeModule(<wbr>MemoryBuffer::getMemBuffer(<br>
                                               ModuleMap[Identifier], false),<br>
                                           Mod.getContext(),<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>