[llvm-commits] CVS: llvm/lib/VMCore/Globals.cpp

Chris Lattner clattner at apple.com
Sat May 5 23:49:29 PDT 2007


On May 5, 2007, at 11:48 PM, Duncan Sands wrote:
> Hi Chris,
>
>> +          (CE->getOpcode() == Instruction::BitCast ||
>> +           CE->getOpcode() == Instruction::GetElementPtr))
>> +        return dyn_cast<GlobalValue>(CE->getOperand(0));
>
> isn't this only correct if all the GEP indices are zero?
> By the way, ExtractGlobalVariable in SelectionDAGISel does
> the same thing as this function, maybe they should be combined?

The verifier should reject any GEPs that don't have all zero indices.

-Chris



More information about the llvm-commits mailing list