aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-01 19:02:54 +0000
committerChris Lattner <sabre@nondot.org>2004-03-01 19:02:54 +0000
commit82e9d7224e537cdc984f23fe4c6ffe5161b5d756 (patch)
treeaa74607c52218b8749e86df8d3f29a1582b8f12b /lib/Analysis/DataStructure/Local.cpp
parent58ae9c7290ff7a639a55784f2362f1e52626c2ee (diff)
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
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--lib/Analysis/DataStructure/Local.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index 471eeb9561..dea8e9f360 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -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();
}