[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol

Vladimir Prus ghost at cs.msu.su
Thu Jun 17 08:12:02 PDT 2004


Hi,
here I am again with "why is this so" kind of a question. Among different 
types of MachineOperand there are MO_ExternalSymbol and MO_GlobalAddress.

For MO_GlobalAddress, we can get usefull information from the getGlobal() 
method, which returns GlobalValue*. Wouldn'it it be better is 
MO_GlobalAddress be called MO_GlobalValue, for consistency?

Second, MO_ExternalSymbol is used for storing name of external 
variable/function, right? Why it's not possible to use MO_GlobalAddress, 
where returned GlobalValue* has isExternal set to true? The 
GlobalValue::getName would return the name of the symbol.

- Volodya




More information about the llvm-dev mailing list