[LLVMdev] Proposed modification of AsmPrinter::EmitConstantValueOnly()

Richard Pennington rich at pennware.com
Thu Aug 14 05:11:18 PDT 2008


I have a problem (bug 2672) in which I have a static initializer that 
contains a GEP. The GEP itself has arguments that do casts and another GEP.

This fails in EmitConstantValueOnly() because the GEP arguments are not 
recognized as constant (link time) expressions.

It looks to me that a proper solution could be to make 
EmitConstantValueOnly() return its constant value and call it for each 
argument of the GEP which will then be passed to getIndexedOffset().

Does this sound like a reasonable solution?

-Rich



More information about the llvm-dev mailing list