[LLVMdev] The best way to cope with AllocationInst type in old code?

Nick Lewycky nicholas at mxc.ca
Wed Dec 15 00:37:02 PST 2010


Hamid 2C wrote:
> Hi all,
>
> I am working on some old code which was compiled against llvm-2.5.
> Anyway, in some places I, AllocationInst is used (e.g. to ensure the
> instruction's type). Even in your current documentation
> (http://llvm.org/docs/ProgrammersManual.html), I found an example that
> uses this instruction.
> If I got it correctly, this istruction (AllocationInst) has been
> removed from llvm instruction set. How can I recode the behavior one
> can expect from the AllocationInst? Should I check for call
> instructions to malloc?

AllocationInst was a superclass of the AllocaInst and MallocInst, the 
latter of which was deleted so AllocationInst was removed.

In LLVM, a lot of code was updated to use the isMalloc() out of 
include/llvm/Analysis/MemoryBuiltins.h, but "isa<AllocaInst>(...) || 
isMalloc(...)" would be closest to "isa<AllocationInst>(...)".

Nick

> I'm new to llvm and I would really appreciate any comment or suggestion.
>
> Thanks,
> Hamid
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list