Marcelo Sousa
2012-Jun-23 22:00 UTC
[LLVMdev] getting identifier for alloca instruction and basic blocks
Hello, How can I retrieve the identifier in a alloca instruction? In the AllocaInst class there is no method to get this info so I assumed that the actual value name for the instruction is the identifier but when I have something like: %1 = alloca %"mystruct", align 8 When calling the function Value::getName() I get the empty string. What should I do to retrieve the "%1"? Also, in the basic blocks how can I retrieve the label identifier? Thanks, Marcelo
Duncan Sands
2012-Jun-24 08:36 UTC
[LLVMdev] getting identifier for alloca instruction and basic blocks
Hi Marcelo,> How can I retrieve the identifier in a alloca instruction?except for globals, identifier names in LLVM IR are only there to make the IR easier to read: they are optional and can't be relied upon to exist, or to mean anything or be "correct" if they exist. Use debug info to map things back to variable names in the original code. Ciao, Duncan.> > In the AllocaInst class there is no method to get this info so I > assumed that the actual value name for the instruction is the > identifier but when I have something like: > > %1 = alloca %"mystruct", align 8 > > When calling the function Value::getName() I get the empty string. > What should I do to retrieve the "%1"? > > Also, in the basic blocks how can I retrieve the label identifier? > > > Thanks, > Marcelo > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >