[llvm-commits] [poolalloc] r124407 - /poolalloc/trunk/lib/DSA/Basic.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Thu Jan 27 11:51:45 PST 2011


Author: aggarwa4
Date: Thu Jan 27 13:51:45 2011
New Revision: 124407

URL: http://llvm.org/viewvc/llvm-project?rev=124407&view=rev
Log:
Globals that do not have internal linkage must
be marked external.
Also, mark external flag on the node for 
external globals.

Modified:
    poolalloc/trunk/lib/DSA/Basic.cpp

Modified: poolalloc/trunk/lib/DSA/Basic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Basic.cpp?rev=124407&r1=124406&r2=124407&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Basic.cpp (original)
+++ poolalloc/trunk/lib/DSA/Basic.cpp Thu Jan 27 13:51:45 2011
@@ -43,7 +43,7 @@
   DSNode * GVNodeExternal = new DSNode(GlobalsGraph);
   for (Module::global_iterator I = M.global_begin(), E = M.global_end();
        I != E; ++I) {
-    if (I->isDeclaration()) {
+    if (I->isDeclaration() || (!(I->hasInternalLinkage()))) {
       GlobalsGraph->getNodeForValue(&*I).mergeWith(GVNodeExternal);
     } else {
       GlobalsGraph->getNodeForValue(&*I).mergeWith(GVNodeInternal);
@@ -54,6 +54,7 @@
   GVNodeInternal->maskNodeTypes(DSNode::IncompleteNode);
 
   GVNodeExternal->foldNodeCompletely();
+  GVNodeExternal->setExternalMarker();
 
   // Next step, iterate through the nodes in the globals graph, unioning
   // together the globals into equivalence classes.





More information about the llvm-commits mailing list