[lld] r232448 - Make it compile with MSVC 2013.

Rafael Auler rafaelauler at gmail.com
Tue Mar 17 05:38:39 PDT 2015


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.

On Mon, Mar 16, 2015 at 10:10 PM, Rui Ueyama <ruiu at google.com> wrote:

> 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")
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150317/519ae3c2/attachment.html>


More information about the llvm-commits mailing list