* Eliminate boolean arguments in favor of using enums
authorChris Lattner <sabre@nondot.org>
Thu, 23 Jan 2003 22:06:33 +0000 (22:06 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 23 Jan 2003 22:06:33 +0000 (22:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5420 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DSGraph.h
include/llvm/Analysis/DataStructure/DSGraph.h
lib/Analysis/DataStructure/IPModRef.cpp
lib/Analysis/IPA/IPModRef.cpp

index a1725dec16c822eb5819f1be238575a077755cbd..8e11dc010aaba2426304b3cf3b085aa0c88bc6ee 100644 (file)
@@ -137,15 +137,20 @@ public:
   // the scope of current analysis may have modified it), the 'Incomplete' flag
   // is added to the NodeType.
   //
-  void markIncompleteNodes(bool markFormalArgs = true);
+  enum MarkIncompleteFlags {
+    MarkFormalArgs = 1, IgnoreFormalArgs = 0,
+  };
+  void markIncompleteNodes(unsigned Flags);
 
-  // removeDeadNodes - Use a more powerful reachability analysis to eliminate
-  // subgraphs that are unreachable.  This often occurs because the data
-  // structure doesn't "escape" into it's caller, and thus should be eliminated
-  // from the caller's graph entirely.  This is only appropriate to use when
-  // inlining graphs.
+  // removeDeadNodes - Use a reachability analysis to eliminate subgraphs that
+  // are unreachable.  This often occurs because the data structure doesn't
+  // "escape" into it's caller, and thus should be eliminated from the caller's
+  // graph entirely.  This is only appropriate to use when inlining graphs.
   //
-  void removeDeadNodes();
+  enum RemoveDeadNodesFlags {
+    RemoveUnreachableGlobals = 1, KeepUnreachableGlobals = 0,
+  };
+  void removeDeadNodes(unsigned Flags);
 
   // CloneFlags enum - Bits that may be passed into the cloneInto method to
   // specify how to clone the function graph.
index a1725dec16c822eb5819f1be238575a077755cbd..8e11dc010aaba2426304b3cf3b085aa0c88bc6ee 100644 (file)
@@ -137,15 +137,20 @@ public:
   // the scope of current analysis may have modified it), the 'Incomplete' flag
   // is added to the NodeType.
   //
-  void markIncompleteNodes(bool markFormalArgs = true);
+  enum MarkIncompleteFlags {
+    MarkFormalArgs = 1, IgnoreFormalArgs = 0,
+  };
+  void markIncompleteNodes(unsigned Flags);
 
-  // removeDeadNodes - Use a more powerful reachability analysis to eliminate
-  // subgraphs that are unreachable.  This often occurs because the data
-  // structure doesn't "escape" into it's caller, and thus should be eliminated
-  // from the caller's graph entirely.  This is only appropriate to use when
-  // inlining graphs.
+  // removeDeadNodes - Use a reachability analysis to eliminate subgraphs that
+  // are unreachable.  This often occurs because the data structure doesn't
+  // "escape" into it's caller, and thus should be eliminated from the caller's
+  // graph entirely.  This is only appropriate to use when inlining graphs.
   //
-  void removeDeadNodes();
+  enum RemoveDeadNodesFlags {
+    RemoveUnreachableGlobals = 1, KeepUnreachableGlobals = 0,
+  };
+  void removeDeadNodes(unsigned Flags);
 
   // CloneFlags enum - Bits that may be passed into the cloneInto method to
   // specify how to clone the function graph.
index 8c507e9323a0654d969d285e153bc423386b9d27..48452fe8b16f465059ae7ac6a8bc5709d987fd3a 100644 (file)
@@ -175,7 +175,7 @@ DSGraph* FunctionModRefInfo::ResolveCallSiteModRefInfo(CallInst &CI,
     assert(0 && "See error message");
 
   // Remove dead nodes aggressively to match the caller's original graph.
-  Result->removeDeadNodes();
+  Result->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
 
   // Step #4: Return the clone + the mapping (by ref)
   return Result;
@@ -393,7 +393,7 @@ FunctionModRefInfo& IPModRef::getFuncInfo(const Function& func,
       // The memory for this graph clone will be freed by FunctionModRefInfo.
       DSGraph* funcTDGraph =
         new DSGraph(getAnalysis<TDDataStructures>().getDSGraph(func));
-      funcTDGraph->removeDeadNodes();
+      funcTDGraph->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
 
       funcInfo = new FunctionModRefInfo(func, *this, funcTDGraph); //auto-insert
       funcInfo->computeModRef(func);  // computes the mod/ref info
index 8c507e9323a0654d969d285e153bc423386b9d27..48452fe8b16f465059ae7ac6a8bc5709d987fd3a 100644 (file)
@@ -175,7 +175,7 @@ DSGraph* FunctionModRefInfo::ResolveCallSiteModRefInfo(CallInst &CI,
     assert(0 && "See error message");
 
   // Remove dead nodes aggressively to match the caller's original graph.
-  Result->removeDeadNodes();
+  Result->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
 
   // Step #4: Return the clone + the mapping (by ref)
   return Result;
@@ -393,7 +393,7 @@ FunctionModRefInfo& IPModRef::getFuncInfo(const Function& func,
       // The memory for this graph clone will be freed by FunctionModRefInfo.
       DSGraph* funcTDGraph =
         new DSGraph(getAnalysis<TDDataStructures>().getDSGraph(func));
-      funcTDGraph->removeDeadNodes();
+      funcTDGraph->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
 
       funcInfo = new FunctionModRefInfo(func, *this, funcTDGraph); //auto-insert
       funcInfo->computeModRef(func);  // computes the mod/ref info