Correctly add an array marker on a node when appropriate!
llvm-svn: 12055
This commit is contained in:
parent
88cc178e3b
commit
c8d23b19fb
|
@ -383,6 +383,10 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) {
|
|||
if (const StructType *STy = dyn_cast<StructType>(*I)) {
|
||||
unsigned FieldNo = cast<ConstantUInt>(I.getOperand())->getValue();
|
||||
Offset += TD.getStructLayout(STy)->MemberOffsets[FieldNo];
|
||||
} else if (const PointerType *PTy = dyn_cast<PointerType>(*I)) {
|
||||
if (!isa<Constant>(I.getOperand()) ||
|
||||
!cast<Constant>(I.getOperand())->isNullValue())
|
||||
Value.getNode()->setArrayMarker();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue