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

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 5 08:37:17 PDT 2016


On 5 June 2016 at 08:22, edA-qa mort-ora-y via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> `CreateStructGEP` requires a type parameter now. I'm not sure what type it's expecting, so I converted `CreateStructGEP( valuePtr, index )` to `CreateStructGEP( valuePtr->getType(), valuePtr, index )`... would that be correct?

This is part of an in-progress move to untyped pointers. if you're
executing a gep on "type*", the type that'll be needed is "type".
Which is probably "valuePtr->getType()->getElementType()" in your
case.

> `arg_iterator` no longer converst to Value*, I have a lot of this now:
>     &*(args++)
> This seems like I'm doing something wrong. Is there a more correct way to convert to the `Value*`?

This looks right. Duncan removed the implicit conversions as part of a refactor.

> `PassManager` is now a tample type with `IRUnitT`. What is the `IRUnitT` type? Or rather, how should I be creating the `PassManager`?

The pass manager you're used to has been renamed "LegacyPassManager"
as we're working on a new implementation (templated, as you see). For
the initial migration it's best to just use LegacyPassManager.

> Why does `EngineBuilder` require a `unique_ptr` for the `Module` now? After I create the builder I still need to reference the module, in particular to run the pass manager and look up functions to run. Same for `linker::linkInModule`.

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

> `createBasicAliasAnalyisPass` is gone. What is the replacement, or do I not need it anymore (I believe it was required to be run for other passes).
>
> `linkInModule` used to provide an error message output. Is there a way to get the error now that it is gone?

I'm afraid I'm not familiar with these.

Cheers.

Tim.


More information about the llvm-dev mailing list