mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 00:36:36 +00:00
Correctly add an array marker on a node when appropriate!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12055 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
58ae9c7290
commit
82e9d7224e
@ -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
Block a user