Pointer ownership semantics, Attaching debug info and "unsigned" usage in LLVM -
i've started using llvm ir generation apis project. documentation , llc tool pretty helpful, haven't been able find answer following -
question-1 - pointer ownership semantics
all code creates llvm ir instructions using apis seems "new" instructions instead of creating them stack variables.
auto x = new alloca(...) vs. alloca(...) x;
i wondering ownership semantics pointers created? have call delete on these instruction objects. code i've seen calls "delete engine;".
i guessing memory owned module object , when module destroyed, memory occupied these instructions destroyed. looking @ of code, seems these instruction objects created using "placement new" ... understanding correct?
question-2 - why doe llvm ir apis take "unsigned" data-type args. (e.g. unsigned addresspace 1 common argument. why not sized type uint32_t ?)
question-3 - how attach debug information ir instruction? pointers llvm apis attach debug info useful.
it's best split 3 questions, answer 3rd question did talk @ year's llvm developer conference on this:
http://llvm.org/devmtg/2014-10/#tutorial3
and can use documentation wrote after guideline:
Comments
Post a Comment