mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
Support resolving function arguments/return values to pointers that index
into other objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2094 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
85e1e9c22f
commit
a13d6ceed7
@ -18,11 +18,21 @@
|
|||||||
// Make all of the pointers that point to Val also point to N.
|
// Make all of the pointers that point to Val also point to N.
|
||||||
//
|
//
|
||||||
static void copyEdgesFromTo(PointerVal Val, DSNode *N) {
|
static void copyEdgesFromTo(PointerVal Val, DSNode *N) {
|
||||||
assert(Val.Index == 0 && "copyEdgesFromTo:index != 0 TODO");
|
unsigned ValIdx = Val.Index;
|
||||||
|
unsigned NLinks = N->getNumLinks();
|
||||||
|
|
||||||
const vector<PointerValSet*> &PVSToUpdate(Val.Node->getReferrers());
|
const vector<PointerValSet*> &PVSsToUpdate(Val.Node->getReferrers());
|
||||||
for (unsigned i = 0, e = PVSToUpdate.size(); i != e; ++i)
|
for (unsigned i = 0, e = PVSsToUpdate.size(); i != e; ++i) {
|
||||||
PVSToUpdate[i]->add(N); // TODO: support index
|
// Loop over all of the pointers pointing to Val...
|
||||||
|
PointerValSet &PVS = *PVSsToUpdate[i];
|
||||||
|
for (unsigned j = 0, je = PVS.size(); j != je; ++j) {
|
||||||
|
if (PVS[j].Node == Val.Node && PVS[j].Index >= ValIdx &&
|
||||||
|
PVS[j].Index < ValIdx+NLinks)
|
||||||
|
PVS.add(PointerVal(N, PVS[j].Index-ValIdx));
|
||||||
|
|
||||||
|
//PVS.add(PointerVal(N, Val.Index)); // TODO: support index
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ResolveNodesTo(const PointerVal &FromPtr,
|
static void ResolveNodesTo(const PointerVal &FromPtr,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user