[LLVMdev] LLVM use chains
Rafael EspĂndola
rafael.espindola at gmail.com
Thu Oct 24 07:43:01 PDT 2013
>> 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?
Cheers,
Rafael
More information about the llvm-dev
mailing list