aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-11-07 20:36:02 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-11-07 20:36:02 +0000
commitdf983de743fa94b7d8f90f20238e7503960726fd (patch)
tree6e191e084c89820de5f034dd8982ecac71e2b21a /lib/Analysis/DataStructure
parenteb01e395e7d52218da11fddef4c9419ed04ca40c (diff)
Allow loop detection during debug in forwarding nodes, and revert auxcall patch as it make 176.gcc untenable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index 169cd659e5..15c6c75dc6 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -62,7 +62,17 @@ bool DSNodeHandle::isForwarding() const {
DSNode *DSNodeHandle::HandleForwarding() const {
assert(N->isForwarding() && "Can only be invoked if forwarding!");
-
+ DEBUG(
+ { //assert not looping
+ DSNode* NH = N;
+ std::set<DSNode*> seen;
+ while(NH && NH->isForwarding()) {
+ assert(seen.find(NH) == seen.end() && "Loop detected");
+ seen.insert(NH);
+ NH = NH->ForwardNH.N;
+ }
+ }
+ );
// Handle node forwarding here!
DSNode *Next = N->ForwardNH.getNode(); // Cause recursive shrinkage
Offset += N->ForwardNH.getOffset();
@@ -421,6 +431,8 @@ static bool ElementTypesAreCompatible(const Type *T1, const Type *T2,
///
bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
bool FoldIfIncompatible) {
+ DEBUG(std::cerr << "merging " << *NewTy << " at " << Offset
+ << " with " << *Ty << "\n");
const TargetData &TD = getTargetData();
// Check to make sure the Size member is up-to-date. Size can be one of the
// following:
@@ -1595,13 +1607,13 @@ void DSGraph::mergeInGraph(const DSCallSite &CS,
for (afc_iterator I = Graph.afc_begin(), E = Graph.afc_end(); I!=E; ++I)
if (SCCFinder.PathExistsToClonedNode(*I))
AuxCallToCopy.push_back(&*I);
- else if (I->isIndirectCall()){
- //If the call node doesn't have any callees, clone it
- std::vector< Function *> List;
- I->getCalleeNode()->addFullFunctionList(List);
- if (!List.size())
- AuxCallToCopy.push_back(&*I);
- }
+// else if (I->isIndirectCall()){
+// //If the call node doesn't have any callees, clone it
+// std::vector< Function *> List;
+// I->getCalleeNode()->addFullFunctionList(List);
+// if (!List.size())
+// AuxCallToCopy.push_back(&*I);
+// }
const DSScalarMap &GSM = Graph.getScalarMap();
for (DSScalarMap::global_iterator GI = GSM.global_begin(),