[llvm-dev] Migration help required for 3.3 to 3.8

Caldarale, Charles R via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 5 10:04:53 PDT 2016


> From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of edA-qa mort-ora-y via llvm-dev
> Subject: Re: [llvm-dev] Migration help required for 3.3 to 3.8

> To confirm, the type parameter for CreateStructGEP is the resulting
> type, not the source structure type?

No, it's the type of the source structure - the type that used to be inherent in the ptr argument.

> One related issue, I used to add the DataLayout to the pass manager like
> this:
>     fpm.add( new llvm::DataLayout( ee->getDataLayout() ) );

The DataLayout is now set in the Module; we use something like this:
    pMod->setDataLayout(target_machine->createDataLayout());

Not sure what happens if you don't make the call; I would not let it just default.

> > Because EngineBuilder takes ownership of the module and deletes it
> > afterwards. It's still fine to keep your own pointer to the Module. 

> Should there not be a `getModule` function on the EngineBuilder (and
> Linker) in this case? 

There can be more than one Module in play.

> To me passing a `unique_ptr` kind of implies I've given up all control 
> of my original pointer.

Not all control, just ownership.

 - Chuck



More information about the llvm-dev mailing list