mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
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
This commit is contained in:
parent
5f39fa8149
commit
9fd0c48f80
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user