summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-25 23:36:08 +0000
committerChris Lattner <sabre@nondot.org>2004-02-25 23:36:08 +0000
commit71626b8f3696f3e760a13d808583a49a8810fa83 (patch)
tree6381b7248089d71ceddeb1f65a87b6d11c43c9a6 /llvm/lib/Analysis/DataStructure
parentfc0912d02a5ebed2de664b67c08cc638b49a216b (diff)
downloadbcm5719-llvm-71626b8f3696f3e760a13d808583a49a8810fa83.tar.gz
bcm5719-llvm-71626b8f3696f3e760a13d808583a49a8810fa83.zip
Two changes:
1. Functions do not make things incomplete, only variables 2. Constant global variables no longer need to be marked incomplete, because we are guaranteed that the initializer for the global will be in the graph we are hacking on now. This makes resolution of indirect calls happen a lot more in the bu pass, supports things like vtables and the C counterparts (giant constant arrays of function pointers), etc... Testcase here: test/Regression/Analysis/DSGraph/constant_globals.ll llvm-svn: 11852
Diffstat (limited to 'llvm/lib/Analysis/DataStructure')
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index 3339d6152f0..686655637be 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
@@ -13,6 +13,7 @@
#include "llvm/Analysis/DSGraph.h"
#include "llvm/Function.h"
+#include "llvm/GlobalVariable.h"
#include "llvm/iOther.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Target/TargetData.h"
@@ -1353,7 +1354,9 @@ void DSGraph::markIncompleteNodes(unsigned Flags) {
if ((Flags & DSGraph::IgnoreGlobals) == 0)
for (DSScalarMap::global_iterator I = ScalarMap.global_begin(),
E = ScalarMap.global_end(); I != E; ++I)
- markIncompleteNode(ScalarMap[*I].getNode());
+ if (GlobalVariable *GV = dyn_cast<GlobalVariable>(*I))
+ if (!GV->isConstant())
+ markIncompleteNode(ScalarMap[GV].getNode());
}
static inline void killIfUselessEdge(DSNodeHandle &Edge) {
OpenPOWER on IntegriCloud