[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp CompleteBottomUp.cpp DataStructure.cpp DataStructureAA.cpp DataStructureOpt.cpp DataStructureStats.cpp EquivClassGraphs.cpp GraphChecker.cpp Local.cpp Printer.cpp Steensgaard.cpp TopDownClosure.cpp
Misha Brukman
brukman at cs.uiuc.edu
Thu Apr 21 14:07:39 PDT 2005
Changes in directory llvm/lib/Analysis/DataStructure:
BottomUpClosure.cpp updated: 1.113 -> 1.114
CompleteBottomUp.cpp updated: 1.31 -> 1.32
DataStructure.cpp updated: 1.238 -> 1.239
DataStructureAA.cpp updated: 1.37 -> 1.38
DataStructureOpt.cpp updated: 1.11 -> 1.12
DataStructureStats.cpp updated: 1.17 -> 1.18
EquivClassGraphs.cpp updated: 1.43 -> 1.44
GraphChecker.cpp updated: 1.17 -> 1.18
Local.cpp updated: 1.132 -> 1.133
Printer.cpp updated: 1.82 -> 1.83
Steensgaard.cpp updated: 1.60 -> 1.61
TopDownClosure.cpp updated: 1.88 -> 1.89
---
Log message:
Remove trailing whitespace
---
Diffs of the changes: (+183 -183)
BottomUpClosure.cpp | 36 +++++++--------
CompleteBottomUp.cpp | 22 ++++-----
DataStructure.cpp | 116 ++++++++++++++++++++++++-------------------------
DataStructureAA.cpp | 18 +++----
DataStructureOpt.cpp | 6 +-
DataStructureStats.cpp | 10 ++--
EquivClassGraphs.cpp | 52 ++++++++++-----------
GraphChecker.cpp | 14 ++---
Local.cpp | 44 +++++++++---------
Printer.cpp | 16 +++---
Steensgaard.cpp | 16 +++---
TopDownClosure.cpp | 16 +++---
12 files changed, 183 insertions(+), 183 deletions(-)
Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.113 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.114
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.113 Thu Apr 21 11:09:43 2005
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- BottomUpClosure.cpp - Compute bottom-up interprocedural closure ----===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the BUDataStructures class, which represents the
@@ -26,7 +26,7 @@
Statistic<> MaxSCC("budatastructure", "Maximum SCC Size in Call Graph");
Statistic<> NumBUInlines("budatastructures", "Number of graphs inlined");
Statistic<> NumCallEdges("budatastructures", "Number of 'actual' call edges");
-
+
RegisterAnalysis<BUDataStructures>
X("budatastructure", "Bottom-up Data Structure Analysis");
}
@@ -48,23 +48,23 @@
GlobalValue *First = GVs[0];
for (unsigned i = 1, e = GVs.size(); i != e; ++i)
GlobalECs.unionSets(First, GVs[i]);
-
+
// Next, get the leader element.
assert(First == GlobalECs.getLeaderValue(First) &&
"First did not end up being the leader?");
-
+
// Next, remove all globals from the scalar map that are not the leader.
assert(GVs[0] == First && "First had to be at the front!");
for (unsigned i = 1, e = GVs.size(); i != e; ++i) {
ECGlobals.insert(GVs[i]);
SM.erase(SM.find(GVs[i]));
}
-
+
// Finally, change the global node to only contain the leader.
I->clearGlobals();
I->addGlobal(First);
}
-
+
DEBUG(GG.AssertGraphOK());
}
@@ -161,7 +161,7 @@
// nothing! In particular, externally visible globals and unresolvable call
// nodes at the end of the BU phase should make things that they point to
// incomplete in the globals graph.
- //
+ //
GlobalsGraph->removeTriviallyDeadNodes();
GlobalsGraph->maskIncompleteMarkers();
@@ -186,7 +186,7 @@
if (MainFunc && !MainFunc->isExternal()) {
DSGraph &MainGraph = getOrCreateGraph(MainFunc);
const DSGraph &GG = *MainGraph.getGlobalsGraph();
- ReachabilityCloner RC(MainGraph, GG,
+ ReachabilityCloner RC(MainGraph, GG,
DSGraph::DontCloneCallNodes |
DSGraph::DontCloneAuxCallNodes);
@@ -197,7 +197,7 @@
RC.getClonedNH(GG.getNodeForValue(*I));
MainGraph.maskIncompleteMarkers();
- MainGraph.markIncompleteNodes(DSGraph::MarkFormalArgs |
+ MainGraph.markIncompleteNodes(DSGraph::MarkFormalArgs |
DSGraph::IgnoreGlobals);
}
@@ -210,7 +210,7 @@
if (Graph) return *Graph;
DSGraph &LocGraph = getAnalysis<LocalDataStructures>().getDSGraph(*F);
-
+
// Steal the local graph.
Graph = new DSGraph(GlobalECs, LocGraph.getTargetData());
Graph->spliceFrom(LocGraph);
@@ -235,7 +235,7 @@
return !callee->isExternal() || isVAHackFn(callee);
}
-static void GetAllCallees(const DSCallSite &CS,
+static void GetAllCallees(const DSCallSite &CS,
std::vector<Function*> &Callees) {
if (CS.isDirectCall()) {
if (isResolvableFunc(CS.getCalleeFunc()))
@@ -244,7 +244,7 @@
// Get all callees.
unsigned OldSize = Callees.size();
CS.getCalleeNode()->addFullFunctionList(Callees);
-
+
// If any of the callees are unresolvable, remove the whole batch!
for (unsigned i = OldSize, e = Callees.size(); i != e; ++i)
if (!isResolvableFunc(Callees[i])) {
@@ -265,7 +265,7 @@
unsigned BUDataStructures::calculateGraphs(Function *F,
std::vector<Function*> &Stack,
- unsigned &NextID,
+ unsigned &NextID,
hash_map<Function*, unsigned> &ValMap) {
assert(!ValMap.count(F) && "Shouldn't revisit functions!");
unsigned Min = NextID++, MyID = Min;
@@ -488,7 +488,7 @@
if (!Printed)
std::cerr << "In Fns: " << Graph.getFunctionNames() << "\n";
std::cerr << " calls " << CalledFuncs.size()
- << " fns from site: " << CS.getCallSite().getInstruction()
+ << " fns from site: " << CS.getCallSite().getInstruction()
<< " " << *CS.getCallSite().getInstruction();
std::cerr << " Fns =";
unsigned NumPrinted = 0;
@@ -510,7 +510,7 @@
if (IndCallGraph.first == 0) {
std::vector<Function*>::iterator I = CalledFuncs.begin(),
E = CalledFuncs.end();
-
+
// Start with a copy of the first graph.
GI = IndCallGraph.first = new DSGraph(getDSGraph(**I), GlobalECs);
GI->setGlobalsGraph(Graph.getGlobalsGraph());
@@ -539,7 +539,7 @@
for (e = NextArgs.size(); i != e; ++i)
Args.push_back(NextArgs[i]);
}
-
+
// Clean up the final graph!
GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
} else {
@@ -580,7 +580,7 @@
// Clone everything reachable from globals in the function graph into the
// globals graph.
for (DSScalarMap::global_iterator I = MainSM.global_begin(),
- E = MainSM.global_end(); I != E; ++I)
+ E = MainSM.global_end(); I != E; ++I)
RC.getClonedNH(MainSM[*I]);
//Graph.writeGraphToFile(std::cerr, "bu_" + F.getName());
Index: llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp
diff -u llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.31 llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.32
--- llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.31 Sat Apr 2 14:02:41 2005
+++ llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- CompleteBottomUp.cpp - Complete Bottom-Up Data Structure Graphs ----===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This is the exact same as the bottom-up graphs, but we use take a completed
@@ -52,7 +52,7 @@
} else {
std::cerr << "CBU-DSA: No 'main' function found!\n";
}
-
+
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal() && !DSInfo.count(I))
calculateSCCGraphs(getOrCreateGraph(*I), Stack, NextID, ValMap);
@@ -66,7 +66,7 @@
if (MainFunc && !MainFunc->isExternal()) {
DSGraph &MainGraph = getOrCreateGraph(*MainFunc);
const DSGraph &GG = *MainGraph.getGlobalsGraph();
- ReachabilityCloner RC(MainGraph, GG,
+ ReachabilityCloner RC(MainGraph, GG,
DSGraph::DontCloneCallNodes |
DSGraph::DontCloneAuxCallNodes);
@@ -77,7 +77,7 @@
RC.getClonedNH(GG.getNodeForValue(*I));
MainGraph.maskIncompleteMarkers();
- MainGraph.markIncompleteNodes(DSGraph::MarkFormalArgs |
+ MainGraph.markIncompleteNodes(DSGraph::MarkFormalArgs |
DSGraph::IgnoreGlobals);
}
@@ -107,7 +107,7 @@
unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG,
std::vector<DSGraph*> &Stack,
- unsigned &NextID,
+ unsigned &NextID,
hash_map<DSGraph*, unsigned> &ValMap) {
assert(!ValMap.count(&FG) && "Shouldn't revisit functions!");
unsigned Min = NextID++, MyID = Min;
@@ -157,7 +157,7 @@
// Remove NG from the ValMap since the pointer may get recycled.
ValMap.erase(NG);
delete NG;
-
+
Stack.pop_back();
IsMultiNodeSCC = true;
}
@@ -165,7 +165,7 @@
// Clean up the graph before we start inlining a bunch again...
if (IsMultiNodeSCC)
FG.removeTriviallyDeadNodes();
-
+
Stack.pop_back();
processGraph(FG);
ValMap[&FG] = ~0U;
@@ -187,7 +187,7 @@
assert(calls.insert(TheCall).second &&
"Call instruction occurs multiple times in graph??");
-
+
// Fast path for noop calls. Note that we don't care about merging globals
// in the callee with nodes in the caller here.
if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0)
@@ -196,7 +196,7 @@
// Loop over all of the potentially called functions...
// Inline direct calls as well as indirect calls because the direct
// callee may have indirect callees and so may have changed.
- //
+ //
callee_iterator I = callee_begin(TheCall),E = callee_end(TheCall);
unsigned TNum = 0, Num = 0;
DEBUG(Num = std::distance(I, E));
@@ -208,7 +208,7 @@
// calls or for self recursion within an SCC.
DSGraph &GI = getOrCreateGraph(*CalleeFunc);
++NumCBUInlines;
- G.mergeInGraph(CS, *CalleeFunc, GI,
+ G.mergeInGraph(CS, *CalleeFunc, GI,
DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes |
DSGraph::DontCloneAuxCallNodes);
DEBUG(std::cerr << " Inlining graph [" << i << "/"
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.238 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.239
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.238 Mon Apr 11 22:59:27 2005
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- DataStructure.cpp - Implement the core data structure analysis -----===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the core data structure functionality.
@@ -95,7 +95,7 @@
return I->second;
}
}
-
+
// Okay, this is either not an equivalenced global or it is the leader, it
// will be inserted into the scalar map now.
GlobalSet.insert(GV);
@@ -163,7 +163,7 @@
Ty = Type::VoidTy;
// Remove this node from the parent graph's Nodes list.
- ParentGraph->unlinkNode(this);
+ ParentGraph->unlinkNode(this);
ParentGraph = 0;
}
@@ -221,16 +221,16 @@
DestNode->Ty = Type::VoidTy;
DestNode->Size = 1;
DestNode->Globals.swap(Globals);
-
+
// Start forwarding to the destination node...
forwardNode(DestNode, 0);
-
+
if (!Links.empty()) {
DestNode->Links.reserve(1);
-
+
DSNodeHandle NH(DestNode);
DestNode->Links.push_back(Links[0]);
-
+
// If we have links, merge all of our outgoing links together...
for (unsigned i = Links.size()-1; i != 0; --i)
NH.getNode()->Links[0].mergeWith(Links[i]);
@@ -328,7 +328,7 @@
++SS.Idx;
if (SS.Idx != ST->getNumElements()) {
const StructLayout *SL = TD.getStructLayout(ST);
- SS.Offset +=
+ SS.Offset +=
unsigned(SL->MemberOffsets[SS.Idx]-SL->MemberOffsets[SS.Idx-1]);
return;
}
@@ -388,7 +388,7 @@
static bool ElementTypesAreCompatible(const Type *T1, const Type *T2,
bool AllowLargerT1, const TargetData &TD){
TypeElementWalker T1W(T1, TD), T2W(T2, TD);
-
+
while (!T1W.isDone() && !T2W.isDone()) {
if (T1W.getCurrentOffset() != T2W.getCurrentOffset())
return false;
@@ -397,11 +397,11 @@
const Type *T2 = T2W.getCurrentType();
if (T1 != T2 && !T1->isLosslesslyConvertibleTo(T2))
return false;
-
+
T1W.StepToNextType();
T2W.StepToNextType();
}
-
+
return AllowLargerT1 || T1W.isDone();
}
@@ -573,13 +573,13 @@
if (isa<FunctionType>(SubType) &&
isa<FunctionType>(NewTy)) return false;
- unsigned SubTypeSize = SubType->isSized() ?
+ unsigned SubTypeSize = SubType->isSized() ?
(unsigned)TD.getTypeSize(SubType) : 0;
// Ok, we are getting desperate now. Check for physical subtyping, where we
// just require each element in the node to be compatible.
if (NewTySize <= SubTypeSize && NewTySize && NewTySize < 256 &&
- SubTypeSize && SubTypeSize < 256 &&
+ SubTypeSize && SubTypeSize < 256 &&
ElementTypesAreCompatible(NewTy, SubType, !isArray(), TD))
return false;
@@ -611,7 +611,7 @@
NextPadSize = NextSubTypeSize;
break;
default: ;
- // fall out
+ // fall out
}
if (NextSubType == 0)
@@ -707,14 +707,14 @@
} else {
// Make a copy to the side of Dest...
std::vector<GlobalValue*> Old(Dest);
-
+
// Make space for all of the type entries now...
Dest.resize(Dest.size()+Src.size());
-
+
// Merge the two sorted ranges together... into Dest.
std::merge(Old.begin(), Old.end(), Src.begin(), Src.end(), Dest.begin());
-
- // Now erase any duplicate entries that may have accumulated into the
+
+ // Now erase any duplicate entries that may have accumulated into the
// vectors (because they were in both of the input sets)
Dest.erase(std::unique(Dest.begin(), Dest.end()), Dest.end());
}
@@ -728,7 +728,7 @@
// This function does the hard work of merging two nodes, CurNodeH
// and NH after filtering out trivial cases and making sure that
// CurNodeH.offset >= NH.offset.
-//
+//
// ***WARNING***
// Since merging may cause either node to go away, we must always
// use the node-handles to refer to the nodes. These node handles are
@@ -761,7 +761,7 @@
#endif
}
- // Merge the type entries of the two nodes together...
+ // Merge the type entries of the two nodes together...
if (NH.getNode()->Ty != Type::VoidTy)
CurNodeH.getNode()->mergeTypeInfo(NH.getNode()->Ty, NOffset);
assert(!CurNodeH.getNode()->isDeadNode());
@@ -916,7 +916,7 @@
DSNode *DN = new DSNode(*SN, &Dest, true /* Null out all links */);
DN->maskNodeTypes(BitsToKeep);
NH = DN;
-
+
// Next, recursively clone all outgoing links as necessary. Note that
// adding these links can cause the node to collapse itself at any time, and
// the current node may be merged with arbitrary other nodes. For this
@@ -939,7 +939,7 @@
CN->addEdgeTo(MergeOffset, DestEdge);
}
}
-
+
// If this node contains any globals, make sure they end up in the scalar
// map with the correct offset.
for (DSNode::globals_iterator I = SN->globals_begin(), E = SN->globals_end();
@@ -977,7 +977,7 @@
SCNH.getOffset()+SrcNH.getOffset()));
return; // Nothing to do!
}
-
+
// Okay, so the source node has not already been cloned. Instead of creating
// a new DSNode, only to merge it into the one we already have, try to perform
// the merge in-place. The only case we cannot handle here is when the offset
@@ -1006,8 +1006,8 @@
}
#endif
}
-
- // Merge the type entries of the two nodes together...
+
+ // Merge the type entries of the two nodes together...
if (SN->getType() != Type::VoidTy && !DN->isNodeCompletelyFolded()) {
DN->mergeTypeInfo(SN->getType(), NH.getOffset()-SrcNH.getOffset());
DN = NH.getNode();
@@ -1015,7 +1015,7 @@
}
assert(!DN->isDeadNode());
-
+
// Merge the NodeType information.
DN->mergeNodeFlags(SN->getNodeFlags() & BitsToKeep);
@@ -1060,7 +1060,7 @@
// sure it is known that this is the representative node for the src node.
SCNH = DSNodeHandle(NH.getNode(), NH.getOffset()-SrcNH.getOffset());
- // If the source node contained any globals, make sure to create entries
+ // If the source node contained any globals, make sure to create entries
// in the scalar map for them!
for (DSNode::globals_iterator I = SN->globals_begin(),
E = SN->globals_end(); I != E; ++I) {
@@ -1092,7 +1092,7 @@
DSNode *CN = SCNH.getNode();
unsigned MergeOffset =
((i << DS::PointerShift)+SCNH.getOffset()) % CN->getSize();
-
+
DSNodeHandle Tmp = CN->getLink(MergeOffset);
if (!Tmp.isNull()) {
// Perform the recursive merging. Make sure to create a temporary NH,
@@ -1120,7 +1120,7 @@
merge(DestCS.getRetVal(), SrcCS.getRetVal());
unsigned MinArgs = DestCS.getNumPtrArgs();
if (SrcCS.getNumPtrArgs() < MinArgs) MinArgs = SrcCS.getNumPtrArgs();
-
+
for (unsigned a = 0; a != MinArgs; ++a)
merge(DestCS.getPtrArg(a), SrcCS.getPtrArg(a));
@@ -1253,11 +1253,11 @@
New->maskNodeTypes(~BitsToClear);
OldNodeMap[I] = New;
}
-
+
#ifndef NDEBUG
Timer::addPeakMemoryMeasurement();
#endif
-
+
// Rewrite the links in the new nodes to point into the current graph now.
// Note that we don't loop over the node's list to do this. The problem is
// that remaping links can cause recursive merging to happen, which means
@@ -1314,7 +1314,7 @@
I->setParentGraph(this);
// Take all of the nodes.
Nodes.splice(Nodes.end(), RHS.Nodes);
-
+
// Take all of the calls.
FunctionCalls.splice(FunctionCalls.end(), RHS.FunctionCalls);
AuxFunctionCalls.splice(AuxFunctionCalls.end(), RHS.AuxFunctionCalls);
@@ -1376,7 +1376,7 @@
unsigned CurNodeId;
std::vector<const DSNode*> SCCStack;
std::map<const DSNode*, std::pair<unsigned, bool> > NodeInfo;
-
+
HackedGraphSCCFinder(ReachabilityCloner &rc) : RC(rc), CurNodeId(1) {
// Remove null pointer as a special case.
NodeInfo[0] = std::make_pair(0, false);
@@ -1473,7 +1473,7 @@
/// call site (in this graph) with the bindings specified by the vector in G2.
/// The two DSGraphs must be different.
///
-void DSGraph::mergeInGraph(const DSCallSite &CS,
+void DSGraph::mergeInGraph(const DSCallSite &CS,
std::vector<DSNodeHandle> &Args,
const DSGraph &Graph, unsigned CloneFlags) {
TIME_REGION(X, "mergeInGraph");
@@ -1485,12 +1485,12 @@
if (&Graph == this) {
// Merge the return value with the return value of the context.
Args[0].mergeWith(CS.getRetVal());
-
+
// Resolve all of the function arguments.
for (unsigned i = 0, e = CS.getNumPtrArgs(); i != e; ++i) {
if (i == Args.size()-1)
break;
-
+
// Add the link from the argument scalar to the provided value.
Args[i+1].mergeWith(CS.getPtrArg(i));
}
@@ -1501,7 +1501,7 @@
// scalars in the old graph _used_ to point, and of the new nodes matching
// nodes of the old graph.
ReachabilityCloner RC(*this, Graph, CloneFlags);
-
+
// Map the return node pointer over.
if (!CS.getRetVal().isNull())
RC.merge(CS.getRetVal(), Args[0]);
@@ -1510,11 +1510,11 @@
for (unsigned i = 0, e = CS.getNumPtrArgs(); i != e; ++i) {
if (i == Args.size()-1)
break;
-
+
// Add the link from the argument scalar to the provided value.
RC.merge(CS.getPtrArg(i), Args[i+1]);
}
-
+
// We generally don't want to copy global nodes or aux calls from the callee
// graph to the caller graph. However, we have to copy them if there is a
// path from the node to a node we have already copied which does not go
@@ -1548,7 +1548,7 @@
// Copy aux calls that are needed.
for (unsigned i = 0, e = AuxCallToCopy.size(); i != e; ++i)
AuxFunctionCalls.push_back(DSCallSite(*AuxCallToCopy[i], RC));
-
+
// Copy globals that are needed.
for (unsigned i = 0, e = GlobalsToCopy.size(); i != e; ++i)
RC.getClonedNH(Graph.getNodeForValue(GlobalsToCopy[i]));
@@ -1759,7 +1759,7 @@
killIfUselessEdge(CS.getRetVal());
for (unsigned a = 0, e = CS.getNumPtrArgs(); a != e; ++a)
killIfUselessEdge(CS.getPtrArg(a));
-
+
#if 0
// If this call site calls the same function as the last call site, and if
// the function pointer contains an external function, this node will
@@ -1776,7 +1776,7 @@
else
LastCalleeContainsExternalFunction = LastCalleeFunc->isExternal();
}
-
+
// It is not clear why, but enabling this code makes DSA really
// sensitive to node forwarding. Basically, with this enabled, DSA
// performs different number of inlinings based on which nodes are
@@ -1791,11 +1791,11 @@
NumDuplicateCalls > 20
#endif
) {
-
+
std::list<DSCallSite>::iterator PrevIt = OldIt;
--PrevIt;
PrevIt->mergeWith(CS);
-
+
// No need to keep this call anymore.
Calls.erase(OldIt);
++NumDeleted;
@@ -1957,7 +1957,7 @@
void DSCallSite::markReachableNodes(hash_set<const DSNode*> &Nodes) const {
getRetVal().getNode()->markReachableNodes(Nodes);
if (isIndirectCall()) getCalleeNode()->markReachableNodes(Nodes);
-
+
for (unsigned i = 0, e = getNumPtrArgs(); i != e; ++i)
getPtrArg(i).getNode()->markReachableNodes(Nodes);
}
@@ -2055,7 +2055,7 @@
// Make sure that all globals are cloned over as roots.
if (!(Flags & DSGraph::RemoveUnreachableGlobals) && GlobalsGraph) {
- DSGraph::ScalarMapTy::iterator SMI =
+ DSGraph::ScalarMapTy::iterator SMI =
GlobalsGraph->getScalarMap().find(I->first);
if (SMI != GlobalsGraph->getScalarMap().end())
GGCloner.merge(SMI->second, I->second);
@@ -2079,7 +2079,7 @@
// Now find globals and aux call nodes that are already live or reach a live
// value (which makes them live in turn), and continue till no more are found.
- //
+ //
bool Iterate;
hash_set<const DSNode*> Visited;
hash_set<const DSCallSite*> AuxFCallsAlive;
@@ -2092,7 +2092,7 @@
Iterate = false;
if (!(Flags & DSGraph::RemoveUnreachableGlobals))
for (unsigned i = 0; i != GlobalNodes.size(); ++i)
- if (CanReachAliveNodes(GlobalNodes[i].second, Alive, Visited,
+ if (CanReachAliveNodes(GlobalNodes[i].second, Alive, Visited,
Flags & DSGraph::RemoveUnreachableGlobals)) {
std::swap(GlobalNodes[i--], GlobalNodes.back()); // Move to end to...
GlobalNodes.pop_back(); // erase efficiently
@@ -2124,7 +2124,7 @@
// Copy and merge global nodes and dead aux call nodes into the
// GlobalsGraph, and all nodes reachable from those nodes. Update their
// target pointers using the GGCloner.
- //
+ //
if (!(Flags & DSGraph::RemoveUnreachableGlobals))
GlobalsGraph->AuxFunctionCalls.push_back(DSCallSite(*CI, GGCloner));
@@ -2180,7 +2180,7 @@
#if 0
if (CS.getNumPtrArgs() && CS.getCalleeNode() == CS.getPtrArg(0).getNode() &&
CS.getCalleeNode() && CS.getCalleeNode()->getGlobals().empty())
- std::cerr << "WARNING: WEIRD CALL SITE FOUND!\n";
+ std::cerr << "WARNING: WEIRD CALL SITE FOUND!\n";
#endif
}
AssertNodeInGraph(CS.getRetVal().getNode());
@@ -2250,7 +2250,7 @@
}
return;
}
-
+
Entry.setTo(N2, NH2.getOffset()-NH1.getOffset());
// Loop over all of the fields that N1 and N2 have in common, recursively
@@ -2284,7 +2284,7 @@
E = SM.global_end(); I != E; ++I)
DSGraph::computeNodeMapping(SM[*I], GG.getNodeForValue(*I), NodeMap);
}
-
+
/// computeGGToGMapping - Compute the mapping of nodes in the global graph to
/// nodes in this graph. Note that any uses of this method are probably bugs,
/// unless it is known that the globals graph has been merged into this graph!
@@ -2298,7 +2298,7 @@
NodeMap.erase(NodeMap.begin());
}
}
-
+
/// computeCalleeCallerMapping - Given a call from a function in the current
/// graph to the 'Callee' function (which lives in 'CalleeGraph'), compute the
@@ -2309,7 +2309,7 @@
DSCallSite CalleeArgs =
CalleeGraph.getCallSiteForArguments(const_cast<Function&>(Callee));
-
+
computeNodeMapping(CalleeArgs.getRetVal(), CS.getRetVal(), NodeMap);
unsigned NumArgs = CS.getNumPtrArgs();
@@ -2318,18 +2318,18 @@
for (unsigned i = 0; i != NumArgs; ++i)
computeNodeMapping(CalleeArgs.getPtrArg(i), CS.getPtrArg(i), NodeMap);
-
+
// Map the nodes that are pointed to by globals.
DSScalarMap &CalleeSM = CalleeGraph.getScalarMap();
DSScalarMap &CallerSM = getScalarMap();
if (CalleeSM.global_size() >= CallerSM.global_size()) {
- for (DSScalarMap::global_iterator GI = CallerSM.global_begin(),
+ for (DSScalarMap::global_iterator GI = CallerSM.global_begin(),
E = CallerSM.global_end(); GI != E; ++GI)
if (CalleeSM.global_count(*GI))
computeNodeMapping(CalleeSM[*GI], CallerSM[*GI], NodeMap);
} else {
- for (DSScalarMap::global_iterator GI = CalleeSM.global_begin(),
+ for (DSScalarMap::global_iterator GI = CalleeSM.global_begin(),
E = CalleeSM.global_end(); GI != E; ++GI)
if (CallerSM.global_count(*GI))
computeNodeMapping(CalleeSM[*GI], CallerSM[*GI], NodeMap);
Index: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.37 llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.38
--- llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.37 Sun Mar 27 15:57:09 2005
+++ llvm/lib/Analysis/DataStructure/DataStructureAA.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- DataStructureAA.cpp - Data Structure Based Alias Analysis ----------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This pass uses the top-down data structure graphs to implement a simple
@@ -68,7 +68,7 @@
//------------------------------------------------
// Implement the AliasAnalysis API
- //
+ //
AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);
@@ -124,14 +124,14 @@
DSGraph *G1 = getGraphForValue(V1);
DSGraph *G2 = getGraphForValue(V2);
assert((!G1 || !G2 || G1 == G2) && "Alias query for 2 different functions?");
-
+
// Get the graph to use...
DSGraph &G = *(G1 ? G1 : (G2 ? G2 : &TD->getGlobalsGraph()));
const DSGraph::ScalarMapTy &GSM = G.getScalarMap();
DSGraph::ScalarMapTy::const_iterator I = GSM.find((Value*)V1);
if (I == GSM.end()) return NoAlias;
-
+
DSGraph::ScalarMapTy::const_iterator J = GSM.find((Value*)V2);
if (J == GSM.end()) return NoAlias;
@@ -188,10 +188,10 @@
HaveMappingInfo:
assert(N && "Null pointer in scalar map??");
-
+
typedef std::multimap<DSNode*, const DSNode*>::iterator NodeMapIt;
std::pair<NodeMapIt, NodeMapIt> Range = CallerCalleeMap.equal_range(N);
-
+
// Loop over all of the nodes in the callee that correspond to "N", keeping
// track of aggregate mod/ref info.
bool NeverReads = true, NeverWrites = true;
@@ -203,13 +203,13 @@
if (NeverReads == false && NeverWrites == false)
return AliasAnalysis::getModRefInfo(CS, P, Size);
}
-
+
ModRefResult Result = ModRef;
if (NeverWrites) // We proved it was not modified.
Result = ModRefResult(Result & ~Mod);
if (NeverReads) // We proved it was not read.
Result = ModRefResult(Result & ~Ref);
-
+
return ModRefResult(Result & AliasAnalysis::getModRefInfo(CS, P, Size));
}
Index: llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp:1.11 llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp:1.12
--- llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp:1.11 Thu Mar 17 09:36:21 2005
+++ llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- DataStructureOpt.cpp - Data Structure Analysis Based Optimizations -===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This pass uses DSA to a series of simple optimizations, like marking
@@ -66,7 +66,7 @@
DSNode *GNode = 0;
DSGraph::ScalarMapTy::const_iterator SMI = SM.find(I);
if (SMI != SM.end()) GNode = SMI->second.getNode();
-
+
if (GNode == 0 && I->hasInternalLinkage()) {
// If there is no entry in the scalar map for this global, it was never
// referenced in the program. If it has internal linkage, that means we
Index: llvm/lib/Analysis/DataStructure/DataStructureStats.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.17 llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.18
--- llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.17 Sat Mar 19 20:40:27 2005
+++ llvm/lib/Analysis/DataStructure/DataStructureStats.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- DataStructureStats.cpp - Various statistics for DS Graphs ----------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file defines a little pass that prints out statistics for DS Graphs.
@@ -76,7 +76,7 @@
unsigned numIndirectCalls = 0, totalNumCallees = 0;
for (DSGraph::fc_iterator I = TDGraph->fc_begin(), E = TDGraph->fc_end();
- I != E; ++I)
+ I != E; ++I)
if (isIndirectCallee(I->getCallSite().getCalledValue())) {
// This is an indirect function call
std::vector<Function*> Callees;
@@ -90,10 +90,10 @@
<< "' at call: \n"
<< *I->getCallSite().getInstruction();
}
-
+
TotalNumCallees += totalNumCallees;
NumIndirectCalls += numIndirectCalls;
-
+
if (numIndirectCalls)
std::cout << " In function " << F.getName() << ": "
<< (totalNumCallees / (double) numIndirectCalls)
Index: llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
diff -u llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.43 llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.44
--- llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.43 Sat Apr 2 14:08:17 2005
+++ llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- EquivClassGraphs.cpp - Merge equiv-class graphs & inline bottom-up -===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This pass is the same as the complete bottom-up graphs, but
@@ -50,12 +50,12 @@
DSGraph::NodeMapTy GlobalsGraphNodeMapping;
G.computeGToGGMapping(GlobalsGraphNodeMapping);
- }
+ }
}
#endif
// getSomeCalleeForCallSite - Return any one callee function at a call site.
-//
+//
Function *EquivClassGraphs::getSomeCalleeForCallSite(const CallSite &CS) const{
Function *thisFunc = CS.getCaller();
assert(thisFunc && "getSomeCalleeForCallSite(): Not a valid call site?");
@@ -94,7 +94,7 @@
} else {
std::cerr << "Fold Graphs: No 'main' function found!\n";
}
-
+
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal())
processSCC(getOrCreateGraph(*I), Stack, NextID, ValMap);
@@ -110,7 +110,7 @@
if (MainFunc && !MainFunc->isExternal()) {
DSGraph &MainGraph = getOrCreateGraph(*MainFunc);
const DSGraph &GG = *MainGraph.getGlobalsGraph();
- ReachabilityCloner RC(MainGraph, GG,
+ ReachabilityCloner RC(MainGraph, GG,
DSGraph::DontCloneCallNodes |
DSGraph::DontCloneAuxCallNodes);
@@ -121,7 +121,7 @@
RC.getClonedNH(GG.getNodeForValue(*I));
MainGraph.maskIncompleteMarkers();
- MainGraph.markIncompleteNodes(DSGraph::MarkFormalArgs |
+ MainGraph.markIncompleteNodes(DSGraph::MarkFormalArgs |
DSGraph::IgnoreGlobals);
}
@@ -158,7 +158,7 @@
//
void EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
const ActualCalleesTy& AC = CBU->getActualCallees();
-
+
// Loop over all of the indirect calls in the program. If a call site can
// call multiple different functions, we need to unify all of the callees into
// the same equivalence class.
@@ -204,7 +204,7 @@
// equivalence class. More precisely, if F is in the class, and G(F) is
// its graph, then we include all other functions that are also in G(F).
// Currently, that is just the functions in the same call-graph-SCC as F.
- //
+ //
DSGraph& funcDSGraph = CBU->getDSGraph(*I->second);
for (DSGraph::retnodes_iterator RI = funcDSGraph.retnodes_begin(),
RE = funcDSGraph.retnodes_end(); RI != RE; ++RI)
@@ -242,24 +242,24 @@
DSGraph &MergedG = getOrCreateGraph(*LF);
// Record the argument nodes for use in merging later below.
- std::vector<DSNodeHandle> ArgNodes;
+ std::vector<DSNodeHandle> ArgNodes;
for (Function::arg_iterator AI = LF->arg_begin(), E = LF->arg_end();
AI != E; ++AI)
if (DS::isPointerType(AI->getType()))
ArgNodes.push_back(MergedG.getNodeForValue(AI));
-
+
// Merge in the graphs of all other functions in this equiv. class. Note
// that two or more functions may have the same graph, and it only needs
// to be merged in once.
std::set<DSGraph*> GraphsMerged;
GraphsMerged.insert(&CBU->getDSGraph(*LF));
-
+
for (++SI; SI != FuncECs.member_end(); ++SI) {
Function *F = *SI;
DSGraph *&FG = DSInfo[F];
-
- DSGraph &CBUGraph = CBU->getDSGraph(*F);
+
+ DSGraph &CBUGraph = CBU->getDSGraph(*F);
if (GraphsMerged.insert(&CBUGraph).second) {
// Record the "folded" graph for the function.
for (DSGraph::retnodes_iterator I = CBUGraph.retnodes_begin(),
@@ -267,14 +267,14 @@
assert(DSInfo[I->first] == 0 && "Graph already exists for Fn!");
DSInfo[I->first] = &MergedG;
}
-
+
// Clone this member of the equivalence class into MergedG.
MergedG.cloneInto(CBUGraph);
}
-
+
// Merge the return nodes of all functions together.
MergedG.getReturnNodes()[LF].mergeWith(MergedG.getReturnNodes()[F]);
-
+
// Merge the function arguments with all argument nodes found so far.
// If there are extra function args, add them to the vector of argNodes
Function::arg_iterator AI2 = F->arg_begin(), AI2end = F->arg_end();
@@ -282,7 +282,7 @@
arg != numArgs && AI2 != AI2end; ++AI2, ++arg)
if (DS::isPointerType(AI2->getType()))
ArgNodes[arg].mergeWith(MergedG.getNodeForValue(AI2));
-
+
for ( ; AI2 != AI2end; ++AI2)
if (DS::isPointerType(AI2->getType()))
ArgNodes.push_back(MergedG.getNodeForValue(AI2));
@@ -319,7 +319,7 @@
unsigned EquivClassGraphs::
-processSCC(DSGraph &FG, std::vector<DSGraph*> &Stack, unsigned &NextID,
+processSCC(DSGraph &FG, std::vector<DSGraph*> &Stack, unsigned &NextID,
std::map<DSGraph*, unsigned> &ValMap) {
std::map<DSGraph*, unsigned>::iterator It = ValMap.lower_bound(&FG);
if (It != ValMap.end() && It->first == &FG)
@@ -366,7 +366,7 @@
for (DSGraph::retnodes_iterator I = NG->retnodes_begin();
I != NG->retnodes_end(); ++I)
DSInfo[I->first] = &FG;
-
+
// Remove NG from the ValMap since the pointer may get recycled.
ValMap.erase(NG);
delete NG;
@@ -404,14 +404,14 @@
assert(calls.insert(TheCall).second &&
"Call instruction occurs multiple times in graph??");
-
+
if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0)
continue;
// Inline the common callee graph into the current graph, if the callee
// graph has not changed. Note that all callees should have the same
// graph so we only need to do this once.
- //
+ //
DSGraph* CalleeGraph = NULL;
callee_iterator I = callee_begin(TheCall), E = callee_end(TheCall);
unsigned TNum, Num;
@@ -424,12 +424,12 @@
// Now check if the graph has changed and if so, clone and inline it.
if (I != E) {
Function *CalleeFunc = I->second;
-
+
// Merge the callee's graph into this graph, if not already the same.
// Callees in the same equivalence class (which subsumes those
// in the same SCCs) have the same graph. Note that all recursion
// including self-recursion have been folded in the equiv classes.
- //
+ //
CalleeGraph = &getOrCreateGraph(*CalleeFunc);
if (CalleeGraph != &G) {
++NumFoldGraphInlines;
@@ -463,7 +463,7 @@
// Recompute the Incomplete markers.
G.maskIncompleteMarkers();
G.markIncompleteNodes(DSGraph::MarkFormalArgs);
-
+
// Delete dead nodes. Treat globals that are unreachable but that can
// reach live nodes as live.
G.removeDeadNodes(DSGraph::KeepUnreachableGlobals);
@@ -476,7 +476,7 @@
// globals graph.
DSScalarMap &MainSM = G.getScalarMap();
for (DSScalarMap::global_iterator I = MainSM.global_begin(),
- E = MainSM.global_end(); I != E; ++I)
+ E = MainSM.global_end(); I != E; ++I)
RC.getClonedNH(MainSM[*I]);
DEBUG(std::cerr << " -- DONE ProcessGraph for function "
Index: llvm/lib/Analysis/DataStructure/GraphChecker.cpp
diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.17 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.18
--- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.17 Wed Mar 16 16:42:19 2005
+++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- GraphChecker.cpp - Assert that various graph properties hold -------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This pass is used to test DSA with regression tests. It can be used to check
@@ -39,7 +39,7 @@
cl::desc("Specify which DSA pass the -datastructure-gc pass should use"),
cl::values(clEnumVal(local, "Local pass"),
clEnumVal(bu, "Bottom-up pass"),
- clEnumVal(td, "Top-down pass"),
+ clEnumVal(td, "Top-down pass"),
clEnumValEnd), cl::init(local));
cl::opt<bool>
@@ -133,7 +133,7 @@
std::set<std::string> AbortIfMergedS(AbortIfMerged.begin(),
AbortIfMerged.end());
std::map<std::string, unsigned> CheckFlagsM;
-
+
for (cl::list<std::string>::iterator I = CheckFlags.begin(),
E = CheckFlags.end(); I != E; ++I) {
std::string::size_type ColonPos = I->rfind(':');
@@ -158,18 +158,18 @@
}
CheckFlagsM[std::string(I->begin(), I->begin()+ColonPos)] = Flags;
}
-
+
// Now we loop over all of the scalars, checking to see if any are collapsed
// that are not supposed to be, or if any are merged together.
const DSGraph::ScalarMapTy &SM = G.getScalarMap();
std::map<DSNode*, std::string> AbortIfMergedNodes;
-
+
for (DSGraph::ScalarMapTy::const_iterator I = SM.begin(), E = SM.end();
I != E; ++I)
if (I->first->hasName() && I->second.getNode()) {
const std::string &Name = I->first->getName();
DSNode *N = I->second.getNode();
-
+
// Verify it is not collapsed if it is not supposed to be...
if (N->isNodeCompletelyFolded() && AbortIfCollapsedS.count(Name)) {
std::cerr << "Node for value '%" << Name << "' is collapsed: ";
Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.132 llvm/lib/Analysis/DataStructure/Local.cpp:1.133
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.132 Mon Mar 21 20:45:13 2005
+++ llvm/lib/Analysis/DataStructure/Local.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- Local.cpp - Compute a local data structure graph for a function ----===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// Compute the local version of the data structure graph for a function. The
@@ -76,7 +76,7 @@
std::list<DSCallSite> *FunctionCalls;
public:
- GraphBuilder(Function &f, DSGraph &g, DSNodeHandle &retNode,
+ GraphBuilder(Function &f, DSGraph &g, DSNodeHandle &retNode,
std::list<DSCallSite> &fc)
: G(g), RetNode(&retNode), ScalarMap(G.getScalarMap()),
FunctionCalls(&fc) {
@@ -148,7 +148,7 @@
///
void setDestTo(Value &V, const DSNodeHandle &NH);
- /// getValueDest - Return the DSNode that the actual value points to.
+ /// getValueDest - Return the DSNode that the actual value points to.
///
DSNodeHandle getValueDest(Value &V);
@@ -182,7 +182,7 @@
// initializers into the local graph from the globals graph.
if (ScalarMap.global_begin() != ScalarMap.global_end()) {
ReachabilityCloner RC(*this, *GG, 0);
-
+
for (DSScalarMap::global_iterator I = ScalarMap.global_begin();
I != ScalarMap.global_end(); ++I)
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(*I))
@@ -313,7 +313,7 @@
void GraphBuilder::visitSelectInst(SelectInst &SI) {
if (!isPointerType(SI.getType())) return; // Only pointer Selects
-
+
DSNodeHandle &Dest = ScalarMap[&SI];
Dest.mergeWith(getValueDest(*SI.getOperand(1)));
Dest.mergeWith(getValueDest(*SI.getOperand(2)));
@@ -573,7 +573,7 @@
AI != E; ++AI) {
if (isPointerType((*AI)->getType()))
if (DSNode *N = getValueDest(**AI).getNode())
- N->setReadMarker();
+ N->setReadMarker();
}
return;
} else if (F->getName() == "read" || F->getName() == "pipe" ||
@@ -583,7 +583,7 @@
AI != E; ++AI) {
if (isPointerType((*AI)->getType()))
if (DSNode *N = getValueDest(**AI).getNode())
- N->setModifiedMarker();
+ N->setModifiedMarker();
}
return;
} else if (F->getName() == "stat" || F->getName() == "fstat" ||
@@ -630,7 +630,7 @@
if (isPointerType((*AI)->getType()))
if (DSNode *N = getValueDest(**AI).getNode())
N->setReadMarker();
-
+
// fopen allocates in an unknown way and writes to the file
// descriptor. Also, merge the allocated type into the node.
DSNodeHandle Result = getValueDest(*CS.getInstruction());
@@ -661,7 +661,7 @@
N->mergeTypeInfo(PTy->getElementType(), H.getOffset());
}
return;
- } else if (CS.arg_end()-CS.arg_begin() == 1 &&
+ } else if (CS.arg_end()-CS.arg_begin() == 1 &&
(F->getName() == "fflush" || F->getName() == "feof" ||
F->getName() == "fileno" || F->getName() == "clearerr" ||
F->getName() == "rewind" || F->getName() == "ftell" ||
@@ -672,13 +672,13 @@
DSNodeHandle H = getValueDest(**CS.arg_begin());
if (DSNode *N = H.getNode()) {
N->setReadMarker()->setModifiedMarker();
-
+
const Type *ArgTy = F->getFunctionType()->getParamType(0);
if (const PointerType *PTy = dyn_cast<PointerType>(ArgTy))
N->mergeTypeInfo(PTy->getElementType(), H.getOffset());
}
return;
- } else if (CS.arg_end()-CS.arg_begin() == 4 &&
+ } else if (CS.arg_end()-CS.arg_begin() == 4 &&
(F->getName() == "fwrite" || F->getName() == "fread")) {
// fread writes the first operand, fwrite reads it. They both
// read/write the FILE descriptor, and merges the FILE type.
@@ -739,7 +739,7 @@
AI != E; ++AI)
if (isPointerType((*AI)->getType()))
if (DSNode *N = getValueDest(**AI).getNode())
- N->setReadMarker();
+ N->setReadMarker();
return;
} else if (F->getName() == "fseek" || F->getName() == "fgetpos" ||
F->getName() == "fsetpos") {
@@ -789,7 +789,7 @@
// printf reads all pointer arguments.
if (isPointerType((*AI)->getType()))
if (DSNode *N = getValueDest(**AI).getNode())
- N->setReadMarker();
+ N->setReadMarker();
}
return;
} else if (F->getName() == "vprintf" || F->getName() == "vfprintf" ||
@@ -825,7 +825,7 @@
N->setReadMarker();
++AI;
}
-
+
// Read the valist, and the pointed-to objects.
if (AI != E && isPointerType((*AI)->getType())) {
const DSNodeHandle &VAList = getValueDest(**AI);
@@ -869,7 +869,7 @@
// scanf writes all pointer arguments.
if (isPointerType((*AI)->getType()))
if (DSNode *N = getValueDest(**AI).getNode())
- N->setModifiedMarker();
+ N->setModifiedMarker();
}
return;
} else if (F->getName() == "strtok") {
@@ -905,7 +905,7 @@
if (isPointerType((*AI)->getType()))
if (DSNode *N = getValueDest(**AI).getNode())
N->setReadMarker();
-
+
if (DSNode *N = H.getNode())
N->setReadMarker();
return;
@@ -1079,23 +1079,23 @@
GlobalValue *First = GVs[0];
for (unsigned i = 1, e = GVs.size(); i != e; ++i)
GlobalECs.unionSets(First, GVs[i]);
-
+
// Next, get the leader element.
assert(First == GlobalECs.getLeaderValue(First) &&
"First did not end up being the leader?");
-
+
// Next, remove all globals from the scalar map that are not the leader.
assert(GVs[0] == First && "First had to be at the front!");
for (unsigned i = 1, e = GVs.size(); i != e; ++i) {
ECGlobals.insert(GVs[i]);
SM.erase(SM.find(GVs[i]));
}
-
+
// Finally, change the global node to only contain the leader.
I->clearGlobals();
I->addGlobal(First);
}
-
+
DEBUG(GG.AssertGraphOK());
}
@@ -1151,7 +1151,7 @@
GlobalsGraph = new DSGraph(GlobalECs, TD);
{
GraphBuilder GGB(*GlobalsGraph);
-
+
// Add initializers for all of the globals to the globals graph.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I)
Index: llvm/lib/Analysis/DataStructure/Printer.cpp
diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.82 llvm/lib/Analysis/DataStructure/Printer.cpp:1.83
--- llvm/lib/Analysis/DataStructure/Printer.cpp:1.82 Sat Apr 2 14:08:17 2005
+++ llvm/lib/Analysis/DataStructure/Printer.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- Printer.cpp - Code for printing data structure graphs nicely -------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the 'dot' graph printer.
@@ -76,7 +76,7 @@
EquivalenceClasses<GlobalValue*> *GlobalECs = 0;
if (G) GlobalECs = &G->getGlobalECs();
-
+
for (unsigned i = 0, e = N->getGlobalsList().size(); i != e; ++i) {
WriteAsOperand(OS, N->getGlobalsList()[i], false, true, M);
@@ -85,7 +85,7 @@
EquivalenceClasses<GlobalValue*>::iterator I =
GlobalECs->findValue(N->getGlobalsList()[i]);
if (I != GlobalECs->end()) {
- unsigned NumMembers =
+ unsigned NumMembers =
std::distance(GlobalECs->member_begin(I), GlobalECs->member_end());
if (NumMembers != 1) OS << " + " << (NumMembers-1) << " EC";
}
@@ -132,7 +132,7 @@
return R;
}
-
+
/// addCustomGraphFeatures - Use this graph writing hook to emit call nodes
/// and the return node.
///
@@ -156,7 +156,7 @@
std::stringstream OS;
WriteAsOperand(OS, I->first, false, true, CurMod);
GW.emitSimpleNode(I->first, "", OS.str());
-
+
// Add edge from return node to real destination
DSNode *DestNode = I->second.getNode();
int EdgeDest = I->second.getOffset() >> DS::PointerShift;
@@ -241,7 +241,7 @@
std::string Filename = GraphName + ".dot";
O << "Writing '" << Filename << "'...";
std::ofstream F(Filename.c_str());
-
+
if (F.good()) {
print(F);
unsigned NumCalls = shouldPrintAuxCalls() ?
@@ -329,7 +329,7 @@
<< GG.getGraphSize() << "+" << GG.getFunctionCalls().size() << "]\n";
}
- O << "\nGraphs contain [" << TotalNumNodes << "+" << TotalCallNodes
+ O << "\nGraphs contain [" << TotalNumNodes << "+" << TotalCallNodes
<< "] nodes total" << std::endl;
}
Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp
diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.60 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.61
--- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.60 Sat Apr 2 13:17:18 2005
+++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- Steensgaard.cpp - Context Insensitive Alias Analysis ---------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This pass uses the data structure graphs to implement a simple context
@@ -59,7 +59,7 @@
//------------------------------------------------
// Implement the AliasAnalysis API
- //
+ //
AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);
@@ -140,12 +140,12 @@
for (std::list<DSCallSite>::iterator CI = Calls.begin(), E = Calls.end();
CI != E;) {
DSCallSite &CurCall = *CI++;
-
+
// Loop over the called functions, eliminating as many as possible...
std::vector<Function*> CallTargets;
if (CurCall.isDirectCall())
CallTargets.push_back(CurCall.getCalleeFunc());
- else
+ else
CurCall.getCalleeNode()->addFullFunctionList(CallTargets);
for (unsigned c = 0; c != CallTargets.size(); ) {
@@ -239,11 +239,11 @@
AliasAnalysis::ModRefResult
Steens::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
AliasAnalysis::ModRefResult Result = ModRef;
-
+
// Find the node in question.
DSGraph::ScalarMapTy &GSM = ResultGraph->getScalarMap();
DSGraph::ScalarMapTy::iterator I = GSM.find(P);
-
+
if (I != GSM.end() && !I->second.isNull()) {
DSNode *N = I->second.getNode();
if (N->isComplete()) {
@@ -253,7 +253,7 @@
if (Function *F = CS.getCalledFunction())
if (F->isExternal())
return NoModRef;
-
+
// Otherwise, if the node is complete, but it is only M or R, return this.
// This can be useful for globals that should be marked const but are not.
if (!N->isModified())
Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.88 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.89
--- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.88 Sat Apr 2 14:17:09 2005
+++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Thu Apr 21 16:07:28 2005
@@ -1,10 +1,10 @@
//===- TopDownClosure.cpp - Compute the top-down interprocedure closure ---===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the TDDataStructures class, which represents the
@@ -135,7 +135,7 @@
delete IndCallMap.begin()->second;
IndCallMap.erase(IndCallMap.begin());
}
-
+
ArgsRemainIncomplete.clear();
GlobalsGraph->removeTriviallyDeadNodes();
@@ -170,7 +170,7 @@
DSGraph &G = getOrCreateDSGraph(F);
if (Visited.count(&G)) return;
Visited.insert(&G);
-
+
// Recursively traverse all of the callee graphs.
for (DSGraph::fc_iterator CI = G.fc_begin(), CE = G.fc_end(); CI != CE; ++CI){
Instruction *CallI = CI->getCallSite().getInstruction();
@@ -214,12 +214,12 @@
// sites that call into this graph.
std::vector<CallerCallEdge> EdgesFromCaller;
std::map<DSGraph*, std::vector<CallerCallEdge> >::iterator
- CEI = CallerEdges.find(&DSG);
+ CEI = CallerEdges.find(&DSG);
if (CEI != CallerEdges.end()) {
std::swap(CEI->second, EdgesFromCaller);
CallerEdges.erase(CEI);
}
-
+
// Sort the caller sites to provide a by-caller-graph ordering.
std::sort(EdgesFromCaller.begin(), EdgesFromCaller.end());
@@ -267,7 +267,7 @@
getParent()->getParent()->getName() << "'");
DEBUG(std::cerr << ": " << CF.getFunctionType()->getNumParams()
<< " args\n");
-
+
// Get the formal argument and return nodes for the called function and
// merge them with the cloned subgraph.
DSCallSite T1 = DSG.getCallSiteForArguments(CF);
@@ -356,7 +356,7 @@
// so we build up a new, private, graph that represents the calls of all
// calls to this set of functions.
std::vector<Function*> Callees;
- for (BUDataStructures::ActualCalleesTy::const_iterator I =
+ for (BUDataStructures::ActualCalleesTy::const_iterator I =
BUInfo->callee_begin(CallI), E = BUInfo->callee_end(CallI);
I != E; ++I)
if (!I->second->isExternal())
More information about the llvm-commits
mailing list