[llvm-commits] llvm-c ignores module Triple arch. patch

David Blaikie dblaikie at gmail.com
Tue Oct 2 19:36:40 PDT 2012


Could you provide a test case as well? & usually patches are sent as
attachments, rather than inline (to avoid any possible issues with
mail clients line wrapping content, etc)

On Mon, Sep 24, 2012 at 1:36 AM, Weiss, Eran <Eran.Weiss at emc.com> wrote:
> Hi,
>
> I've fixed a bug in llvm-c api - LLVMCreateJITCompilerForModule
> specifically. It ignored the triple from the module, which caused the JIT to
> always use the default triple. That crashed when running on x86_64 in x86
> mode.
> For more details: http://llvm.org/bugs/show_bug.cgi?id=13833.
> svn diff follows.
>
> Eran.
>
> Index: lib/ExecutionEngine/ExecutionEngineBindings.cpp
> ===================================================================
> --- lib/ExecutionEngine/ExecutionEngineBindings.cpp (revision 164482)
> +++ lib/ExecutionEngine/ExecutionEngineBindings.cpp (working copy)
> @@ -13,6 +13,7 @@
>
>  #define DEBUG_TYPE "jit"
>  #include "llvm-c/ExecutionEngine.h"
> +#include "llvm/ADT/Triple.h"
>  #include "llvm/ExecutionEngine/GenericValue.h"
>  #include "llvm/ExecutionEngine/ExecutionEngine.h"
>  #include "llvm/Support/ErrorHandling.h"
> @@ -123,7 +124,8 @@
>    EngineBuilder builder(unwrap(M));
>    builder.setEngineKind(EngineKind::JIT)
>           .setErrorStr(&Error)
> -         .setOptLevel((CodeGenOpt::Level)OptLevel);
> +         .setOptLevel((CodeGenOpt::Level)OptLevel)
> +         .setMArch(Triple(unwrap(M)->getTargetTriple()).getArchName());
>    if (ExecutionEngine *JIT = builder.create()) {
>      *OutJIT = wrap(JIT);
>      return 0;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list