<div dir="ltr"><div>I'm using this version of MSVC.</div><div><br></div><div>  Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64<br></div><div><br></div><div>And the error I got is below.</div><div><br></div><div><div>c:\cygwin\home\ruiu\llvm\tools\lld\lib\readerwriter\elf\DefaultLayout.h(440) : fatal error C1001: An internal error has occurred in the compiler.</div><div>(compiler file 'msc1.cpp', line 1325)</div><div> To work around this problem, try simplifying or changing the program near the locations listed above.</div><div>Please choose the Technical Support command on the Visual C++</div><div> Help menu, or open the Technical Support help file for more information</div><div>        c:\cygwin\home\ruiu\llvm\tools\lld\lib\readerwriter\elf\DefaultLayout.h(436) : while compiling class template member function 'llvm::StringRef lld::elf::DefaultLayout<ELFT>::getOutputSectionName(llvm::StringRef,llvm::StringRef,llvm::StringRef) const'</div><div>        with</div><div>        [</div><div>            ELFT=lld::elf::X86ELFType</div><div>        ]</div><div>        c:\cygwin\home\ruiu\llvm\tools\lld\lib\readerwriter\elf\TargetLayout.h(21) : see reference to class template instantiation 'lld::elf::DefaultLayout<ELFT>' being compiled</div><div>        with</div><div>        [</div><div>            ELFT=lld::elf::X86ELFType</div><div>        ]</div><div>        c:\cygwin\home\ruiu\llvm\tools\lld\lib\readerwriter\elf\x86\X86TargetHandler.h(59) : see reference to class template instantiation 'lld::elf::TargetLayout<ELFT>' being compiled</div><div>        with</div><div>        [</div><div>            ELFT=lld::elf::X86ELFType</div><div>        ]</div><div>Internal Compiler Error in C:\PROGRA~2\MICROS~2.0\VC\bin\amd64\cl.exe.  You will be prompted to send an error report to Microsoft later.</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 17, 2015 at 5:38 AM, Rafael Auler <span dir="ltr"><<a href="mailto:rafaelauler@gmail.com" target="_blank">rafaelauler@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for fixing this, Rui. I find it odd because I test my patches in a MSVC 2013 box and I didn't get an error and I didn't receive any complaints from buildbots.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 16, 2015 at 10:10 PM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ruiu<br>
Date: Mon Mar 16 20:10:12 2015<br>
New Revision: 232448<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232448&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=232448&view=rev</a><br>
Log:<br>
Make it compile with MSVC 2013.<br>
<br>
MSVC 2013 cannot compile this code because of C1001 "internal error".<br>
Stop using initializer list without type name.<br>
<br>
Modified:<br>
    lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h?rev=232448&r1=232447&r2=232448&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h?rev=232448&r1=232447&r2=232448&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h Mon Mar 16 20:10:12 2015<br>
@@ -435,11 +435,12 @@ DefaultLayout<ELFT>::getOutputSectionNam<br>
                                           StringRef memberPath,<br>
                                           StringRef inputSectionName) const {<br>
   StringRef outputSectionName;<br>
-  if (_linkerScriptSema.hasLayoutCommands() &&<br>
-      !(outputSectionName = _linkerScriptSema.getOutputSection(<br>
-           {archivePath, memberPath, inputSectionName})).empty())<br>
-    return outputSectionName;<br>
-<br>
+  if (_linkerScriptSema.hasLayoutCommands()) {<br>
+    script::Sema::SectionKey key = {archivePath, memberPath, inputSectionName};<br>
+    outputSectionName = _linkerScriptSema.getOutputSection(key);<br>
+    if (!outputSectionName.empty())<br>
+      return outputSectionName;<br>
+  }<br>
   return llvm::StringSwitch<StringRef>(inputSectionName)<br>
       .StartsWith(".text", ".text")<br>
       .StartsWith(".ctors", ".ctors")<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>