[LLVMdev] LLVM use chains

Vassil Vassilev vvasilev at cern.ch
Thu Oct 24 07:57:26 PDT 2013


On 10/24/13 9:43 AM, Rafael EspĂ­ndola wrote:
>>> You probably want replaceAllUsesWith.
>> I am sorry I don't understand. Are you suggesting calling replaceAllUses of
>> the .str1? What I really want to do is to 'erase' the function. By erasing
>> I'd expect the uses of .str1 to 0 (because in the example I have it is used
>> only by f()) and I see they are not.
> To remove something, the normal idiom is
>
> Foo->replaceAllUsesWith(UndefValue::get(FooTy));
> Foo->eraseFromParent();
>
> Is that what you are trying to do?
I want llvm to 'forget' already compiled and run function. Both from the 
ExecutionEngine/JIT and the llvm::Module. The problem using 
replaceAllUsesWith is that the JIT inserts a invisible use so that it 
can prevent from out-of-sync situations. I already tried using 
ExecutionContext::updateGlobalMapping and it doesn't help.
Vassil
>
> Cheers,
> Rafael




More information about the llvm-dev mailing list