about getName in llvm


I’m new to llvm and I’m looking at some pass code. I have a question:

what does the Value::getName() exactly return ? I’m looking at some global varibles, why it prints out something like a type: llvm.gdb.derivedtype6, .str… instead of the name of the variables that I declared ? I compiled the code with -g

besides, I’ve read through your programming guidance, but still not quite sure about the difference and relationship between the derived type and composite type, can you explain that to me with a simple example ?

thanks !

Hi Hui,

  1. Although LLVM IR transformations try to preserve variable names in the source code, these names may be changed (usually suffixed) during transformation.

  2. I don’t think DerivedType is used any more. It used to be a superclass of CompositeType, FunctionType, etc.