Trying to get the Pure compiler to work with LLVM 3.1, I've run into a
problem. The release notes say: "Target specific options have been moved
from global variables to members on the new TargetOptions class, which
is local to each TargetMachine." Unfortunately, they don't say anything
about how to fix existing source to work around this.
In my application I create a JIT using ExecutionEngine::create() after
initializing the native target using InitializeNativeTarget(). I also
need to set the GuaranteedTailCallOpt flag beforehand.
However, with LLVM 3.1 the global GuaranteedTailCallOpt flag is gone and
neither ExecutionEngine::create() nor InitializeNativeTarget() accept a
TargetOptions argument. Nor could I find a way to retrieve and change
the target options later.
Is that an oversight, or is there some easy way to set the native target
options somewhere that I missed?
> Any help is much appreciated.
I believe examples/ExceptionDemo contains sample code which sets
In particular, llvm::EngineBuilder class has setTargetOptions() method
which does all necessary magic here.
On 05/08/2012 05:05 PM, Anton Korobeynikov wrote:
> I believe examples/ExceptionDemo contains sample code which sets
> TargetOptions flags.
> In particular, llvm::EngineBuilder class has setTargetOptions() method
> which does all necessary magic here.
On Tue, May 8, 2012 at 7:16 PM, Albert Graef <[hidden email]> wrote:
> Now I've run into another issue: The ConstantArray::get() method for
> constructing a string constant from a char* seems to be gone. Is there
> a replacement for that somewhere?
ConstantDataArray::getString. IRBuilder::CreateGlobalString might also
be useful in some cases.
> BTW, this isn't mentioned in the release notes yet.