3.1 API Breakage

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

3.1 API Breakage

Albert Graef
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.

TIA,
Albert

--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email:  [hidden email], [hidden email]
WWW:    http://www.musikinformatik.uni-mainz.de/ag
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: 3.1 API Breakage

Anton Korobeynikov-2
Hello Albert,

> Any help is much appreciated.
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.

--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: 3.1 API Breakage

Albert Graef
Hi Anton,

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.

Cool, that's certainly easy enough. :)

Thanks,
Albert

--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email:  [hidden email], [hidden email]
WWW:    http://www.musikinformatik.uni-mainz.de/ag
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: 3.1 API Breakage

Albert Graef
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?

BTW, this isn't mentioned in the release notes yet.

--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email:  [hidden email], [hidden email]
WWW:    http://www.musikinformatik.uni-mainz.de/ag
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: 3.1 API Breakage

Eli Friedman-2
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.

Hmm... might be worth a mention.

-Eli

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: 3.1 API Breakage

Albert Graef
On 05/09/2012 04:41 AM, Eli Friedman wrote:
> ConstantDataArray::getString. IRBuilder::CreateGlobalString might also
> be useful in some cases.

ConstantDataArray::getString was just what I needed. Thanks! Still some
more testing to do, but it seems that I have Pure up and running on LLVM
3.1 now.

--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email:  [hidden email], [hidden email]
WWW:    http://www.musikinformatik.uni-mainz.de/ag
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev