[lld] r232448 - Make it compile with MSVC 2013.
Rui Ueyama
ruiu at google.com
Mon Mar 16 18:10:13 PDT 2015
Author: ruiu
Date: Mon Mar 16 20:10:12 2015
New Revision: 232448
URL: http://llvm.org/viewvc/llvm-project?rev=232448&view=rev
Log:
Make it compile with MSVC 2013.
MSVC 2013 cannot compile this code because of C1001 "internal error".
Stop using initializer list without type name.
Modified:
lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
Modified: lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h?rev=232448&r1=232447&r2=232448&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DefaultLayout.h Mon Mar 16 20:10:12 2015
@@ -435,11 +435,12 @@ DefaultLayout<ELFT>::getOutputSectionNam
StringRef memberPath,
StringRef inputSectionName) const {
StringRef outputSectionName;
- if (_linkerScriptSema.hasLayoutCommands() &&
- !(outputSectionName = _linkerScriptSema.getOutputSection(
- {archivePath, memberPath, inputSectionName})).empty())
- return outputSectionName;
-
+ if (_linkerScriptSema.hasLayoutCommands()) {
+ script::Sema::SectionKey key = {archivePath, memberPath, inputSectionName};
+ outputSectionName = _linkerScriptSema.getOutputSection(key);
+ if (!outputSectionName.empty())
+ return outputSectionName;
+ }
return llvm::StringSwitch<StringRef>(inputSectionName)
.StartsWith(".text", ".text")
.StartsWith(".ctors", ".ctors")
More information about the llvm-commits
mailing list