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

2007-05-05 Thread Chris Lattner
On May 5, 2007, at 11:48 PM, Duncan Sands wrote: > Hi Chris, > >> + (CE->getOpcode() == Instruction::BitCast || >> + CE->getOpcode() == Instruction::GetElementPtr)) >> +return dyn_cast(CE->getOperand(0)); > > isn't this only correct if all the GEP indices are zero? > By t

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

2007-05-05 Thread Duncan Sands
Hi Chris, > + (CE->getOpcode() == Instruction::BitCast || > + CE->getOpcode() == Instruction::GetElementPtr)) > +return dyn_cast(CE->getOperand(0)); isn't this only correct if all the GEP indices are zero? By the way, ExtractGlobalVariable in SelectionDAGISel does the