summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-07 07:06:20 +0000
committerChris Lattner <sabre@nondot.org>2002-11-07 07:06:20 +0000
commit5e865cdbe26bb91abc903300bfc231cd1e14a91c (patch)
tree08c8c3a2a3bbca59a889088bcaac55e9264241ae /llvm/lib
parentdf307e6fd0964dc81dd8cbc8bfefb6ace6298508 (diff)
downloadbcm5719-llvm-5e865cdbe26bb91abc903300bfc231cd1e14a91c.tar.gz
bcm5719-llvm-5e865cdbe26bb91abc903300bfc231cd1e14a91c.zip
Instead of using a bool that constant has to be explained, use a self
explanitory enum instead. llvm-svn: 4600
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp4
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp11
-rw-r--r--llvm/lib/Analysis/DataStructure/TopDownClosure.cpp2
3 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
index cbe53ce68e2..ed9336d2b73 100644
--- a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -93,7 +93,7 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
DEBUG(std::cerr << "\t[BU] Self Inlining: " << F.getName() << "\n");
// Handle self recursion by resolving the arguments and return value
- Graph->mergeInGraph(Call, *Graph, true);
+ Graph->mergeInGraph(Call, *Graph, DSGraph::StripAllocaBit);
// Erase the entry in the callees vector
Callees.erase(Callees.begin()+c--);
@@ -120,7 +120,7 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
CallSitesForFunc.back().setCallee(0);
// Handle self recursion by resolving the arguments and return value
- Graph->mergeInGraph(Call, GI, true);
+ Graph->mergeInGraph(Call, GI, DSGraph::StripAllocaBit);
// Erase the entry in the Callees vector
Callees.erase(Callees.begin()+c--);
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index 41cd7185ec9..31ff0a91b24 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
@@ -526,7 +526,7 @@ void DSNode::remapLinks(std::map<const DSNode*, DSNode*> &OldNodeMap) {
DSNodeHandle DSGraph::cloneInto(const DSGraph &G,
std::map<Value*, DSNodeHandle> &OldValMap,
std::map<const DSNode*, DSNode*> &OldNodeMap,
- bool StripAllocas) {
+ AllocaBit StripAllocas) {
assert(OldNodeMap.empty() && "Returned OldNodeMap should be empty!");
unsigned FN = Nodes.size(); // First new node...
@@ -544,11 +544,10 @@ DSNodeHandle DSGraph::cloneInto(const DSGraph &G,
for (unsigned i = FN, e = Nodes.size(); i != e; ++i)
Nodes[i]->remapLinks(OldNodeMap);
- // Remove local markers as specified
- unsigned char StripBits = StripAllocas ? DSNode::AllocaNode : 0;
- if (StripBits)
+ // Remove alloca markers as specified
+ if (StripAllocas == StripAllocaBit)
for (unsigned i = FN, e = Nodes.size(); i != e; ++i)
- Nodes[i]->NodeType &= ~StripBits;
+ Nodes[i]->NodeType &= ~DSNode::AllocaNode;
// Copy the value map... and merge all of the global nodes...
for (std::map<Value*, DSNodeHandle>::const_iterator I = G.ScalarMap.begin(),
@@ -580,7 +579,7 @@ DSNodeHandle DSGraph::cloneInto(const DSGraph &G,
/// graph.
///
void DSGraph::mergeInGraph(DSCallSite &CS, const DSGraph &Graph,
- bool StripAllocas) {
+ AllocaBit StripAllocas) {
std::map<Value*, DSNodeHandle> OldValMap;
DSNodeHandle RetVal;
std::map<Value*, DSNodeHandle> *ScalarMap = &OldValMap;
diff --git a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
index 817e734a9cc..a37ccd98fab 100644
--- a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
@@ -177,7 +177,7 @@ DSGraph &TDDataStructures::calculateGraph(Function &F) {
// Strip scalars but not allocas since they are alive in callee.
//
DSNodeHandle RetVal = Graph->cloneInto(CG, OldValMap, OldNodeMap,
- /*StripAllocas*/ false);
+ DSGraph::KeepAllocaBit);
ResolveCallSite(*Graph, DSCallSite(CallSiteInCG, OldNodeMap));
}
OpenPOWER on IntegriCloud