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
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index 471eeb9..dea8e9f 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -383,6 +383,10 @@
     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();
     }