[LLVMdev] MachineOperand type

Chris Lattner clattner at apple.com
Wed Mar 2 22:21:56 PST 2011


On Mar 2, 2011, at 8:34 PM, Bin Zeng wrote:

> Hi all,
> 
> I have a question about the types of MachineOperand. There are 12 
> different types of MachineOperand such as MO_Register, MO_Immediate and 
> so on. Some of the names are self-explanatory such as MO_Register and 
> MO_Immediate. Some of them are a little confusing such as MO_FrameIndex, 
> MO_ConstantPoolIndex and so on. For example, what is the different 
> between MO_ExternalSymbol and MO_GlobalAddress? Are these two types 
> orthogonal? I found that memset and memcpy are MO_ExternalSymbol and 
> printf and fprintf and so on are MO_GlobalAddress.
> 
> Thanks a lot in advance. Any advice will be greatly appreciated.

GlobalAddress is used to refer to something that exists in IR, such as a global variable.  ExternalSymbol is used to refer to something that isn't in the IR because it was synthesized by codegen, such as __addsi3.

-Chris



More information about the llvm-dev mailing list