edA-qa mort-ora-y via llvm-dev
2016-Jun-05 15:22 UTC
[llvm-dev] Migration help required for 3.3 to 3.8
I'm migrating from 3.3 to 3.8 and am having a few problems. `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? `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*`? `PassManager` is now a tample type with `IRUnitT`. What is the `IRUnitT` type? Or rather, how should I be creating the `PassManager`? 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`. `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? -- edA-qa mort-ora-y http://mortoray.com/ Leaf - the language we always wanted http://leaflang.org/
Tim Northover via llvm-dev
2016-Jun-05 15:37 UTC
[llvm-dev] Migration help required for 3.3 to 3.8
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.
edA-qa mort-ora-y via llvm-dev
2016-Jun-05 16:40 UTC
[llvm-dev] Migration help required for 3.3 to 3.8
On 05/06/16 17:37, Tim Northover wrote:> 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.To confirm, the type parameter for CreateStructGEP is the resulting type, not the source structure type?> 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.One related issue, I used to add the DataLayout to the pass manager like this: fpm.add( new llvm::DataLayout( ee->getDataLayout() ) ); Where `ee` is the ExecutionEngine. Is there a replacement to setting the DataLayout -- note I'm just using defaults for all data layouts now, so I don't need to set this if it's implied now.> 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? To me passing a `unique_ptr` kind of implies I've given up all control of my original pointer. Using my own copy past that point feels like an error. Thanks for the answers. -- edA-qa mort-ora-y http://mortoray.com/ Leaf - the language we always wanted http://leaflang.org/