[LLVMdev] Patch to compile LLVM with MSVC 2010

David Blaikie dblaikie at gmail.com
Wed Apr 17 21:56:43 PDT 2013


On Wed, Apr 17, 2013 at 11:36 AM, Sergiy Migdalskiy
<migdalskiy at hotmail.com> wrote:
> In order to get llvm to compile on Windows with MSVC 10, I have to disable
> inline on utostr to avoid internal compiler failure, and disable _xgetbv
> call in OsSupportsAVX because it's only defined in MSVC 2012 compiler. The
> first patch (noinline) is known for many months now. I'm a casual llvm user,
> and don't know the proper channels to go through to submit a patch. Could
> someone tell me, where do I submit patches like this one below?

http://llvm.org/docs/DeveloperPolicy.html

> Or maybe why
> I shouldn't try to do it.

We're generally happy to apply patches to ensure LLVM compiles on
relevant compilers. For ICEs it might help to know what the precise
problem is & to have a bug filed on the compiler.

>
> Sincerely,
> Sergiy
>
> Index: include/llvm/ADT/StringExtras.h
> ===================================================================
> --- include/llvm/ADT/StringExtras.h (revision 179701)
> +++ include/llvm/ADT/StringExtras.h (working copy)
> @@ -84,7 +84,7 @@
>    return std::string(BufPtr, Buffer+11);
>  }
>
> -static inline std::string utostr(uint64_t X, bool isNeg = false) {
> +static __declspec(noinline) inline std::string utostr(uint64_t X, bool
> isNeg = false) {
>    char Buffer[21];
>    char *BufPtr = Buffer+21;
>
> Index: lib/Support/Host.cpp
> ===================================================================
> --- lib/Support/Host.cpp (revision 179701)
> +++ lib/Support/Host.cpp (working copy)
> @@ -119,7 +119,7 @@
>    // there is no easy way to conditionally compile based on the assembler
> used.
>    int rEAX, rEDX;
>    __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (rEAX), "=d" (rEDX) : "c" (0));
> -#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 160040219
> +#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER > 160040219
>    unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
>  #else
>    int rEAX = 0; // Ensures we return false
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



More information about the llvm-dev mailing list