[llvm-commits] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h CallGraph.h Dominators.h FindUsedTypes.h LoopInfo.h PostDominators.h ValueNumbering.h

Reid Spencer reid at x10sys.com
Wed Jun 7 15:00:42 PDT 2006



Changes in directory llvm/include/llvm/Analysis:

AliasAnalysis.h updated: 1.25 -> 1.26
CallGraph.h updated: 1.48 -> 1.49
Dominators.h updated: 1.57 -> 1.58
FindUsedTypes.h updated: 1.27 -> 1.28
LoopInfo.h updated: 1.53 -> 1.54
PostDominators.h updated: 1.13 -> 1.14
ValueNumbering.h updated: 1.9 -> 1.10
---
Log message:

For PR780: http://llvm.cs.uiuc.edu/PR780 :
1. Fix the macros in IncludeFile.h to put everything in the llvm namespace
2. Replace the previous explicit mechanism in all the .h and .cpp files
   with the macros in IncludeFile.h
This gets us a consistent mechanism throughout LLVM for ensuring linkage.
Next step is to make sure its used in enough places.


---
Diffs of the changes:  (+22 -38)

 AliasAnalysis.h  |    9 ++++-----
 CallGraph.h      |   10 +++-------
 Dominators.h     |    6 +++---
 FindUsedTypes.h  |   10 +++-------
 LoopInfo.h       |    8 +++-----
 PostDominators.h |   10 +++-------
 ValueNumbering.h |    7 +++----
 7 files changed, 22 insertions(+), 38 deletions(-)


Index: llvm/include/llvm/Analysis/AliasAnalysis.h
diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.25 llvm/include/llvm/Analysis/AliasAnalysis.h:1.26
--- llvm/include/llvm/Analysis/AliasAnalysis.h:1.25	Wed Jun  7 15:00:19 2006
+++ llvm/include/llvm/Analysis/AliasAnalysis.h	Wed Jun  7 17:00:25 2006
@@ -318,14 +318,13 @@
   }
 };
 
+} // End llvm namespace
+
 // Because of the way .a files work, we must force the BasicAA implementation to
 // be pulled in if the AliasAnalysis header is included.  Otherwise we run
 // the risk of AliasAnalysis being used, but the default implementation not
 // being linked into the tool that uses it.
-//
-extern int BasicAAStub;
-static IncludeFile HDR_INCLUDE_BASICAA_CPP(&BasicAAStub);
-
-} // End llvm namespace
+FORCE_DEFINING_FILE_TO_BE_LINKED(AliasAnalysis)
+FORCE_DEFINING_FILE_TO_BE_LINKED(BasicAliasAnalysis)
 
 #endif


Index: llvm/include/llvm/Analysis/CallGraph.h
diff -u llvm/include/llvm/Analysis/CallGraph.h:1.48 llvm/include/llvm/Analysis/CallGraph.h:1.49
--- llvm/include/llvm/Analysis/CallGraph.h:1.48	Thu Jun  1 12:17:46 2006
+++ llvm/include/llvm/Analysis/CallGraph.h	Wed Jun  7 17:00:25 2006
@@ -287,13 +287,9 @@
   static nodes_iterator nodes_end  (const CallGraph *CG) { return CG->end(); }
 };
 
-// Make sure that any clients of this file link in CallGraph.cpp
-static IncludeFile
-CALLGRAPH_INCLUDE_FILE(&CallGraph::stub);
-
-extern int BasicCallGraphStub;
-static IncludeFile HDR_INCLUDE_CALLGRAPH_CPP(&BasicCallGraphStub);
-
 } // End llvm namespace
 
+// Make sure that any clients of this file link in CallGraph.cpp
+FORCE_DEFINING_FILE_TO_BE_LINKED(CallGraph)
+
 #endif


Index: llvm/include/llvm/Analysis/Dominators.h
diff -u llvm/include/llvm/Analysis/Dominators.h:1.57 llvm/include/llvm/Analysis/Dominators.h:1.58
--- llvm/include/llvm/Analysis/Dominators.h:1.57	Thu Jun  1 02:02:51 2006
+++ llvm/include/llvm/Analysis/Dominators.h	Wed Jun  7 17:00:25 2006
@@ -652,9 +652,9 @@
 };
 
 
-// Make sure that any clients of this file link in Dominators.cpp
-static IncludeFile
-DOMINATORS_INCLUDE_FILE(&DominatorSet::stub);
 } // End llvm namespace
 
+// Make sure that any clients of this file link in Dominators.cpp
+FORCE_DEFINING_FILE_TO_BE_LINKED(DominatorSet)
+
 #endif


Index: llvm/include/llvm/Analysis/FindUsedTypes.h
diff -u llvm/include/llvm/Analysis/FindUsedTypes.h:1.27 llvm/include/llvm/Analysis/FindUsedTypes.h:1.28
--- llvm/include/llvm/Analysis/FindUsedTypes.h:1.27	Thu Jun  1 02:02:51 2006
+++ llvm/include/llvm/Analysis/FindUsedTypes.h	Wed Jun  7 17:00:25 2006
@@ -53,15 +53,11 @@
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
   }
-
-  // stub - dummy function, just ignore it
-  static int stub;
 };
 
-// Make sure that any clients of this file link in PostDominators.cpp
-static IncludeFile
-FIND_USED_TYPES_INCLUDE_FILE(&FindUsedTypes::stub);
-
 } // End llvm namespace
 
+// Make sure that any clients of this file link in PostDominators.cpp
+FORCE_DEFINING_FILE_TO_BE_LINKED(FindUsedTypes)
+
 #endif


Index: llvm/include/llvm/Analysis/LoopInfo.h
diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.53 llvm/include/llvm/Analysis/LoopInfo.h:1.54
--- llvm/include/llvm/Analysis/LoopInfo.h:1.53	Thu Jun  1 02:02:51 2006
+++ llvm/include/llvm/Analysis/LoopInfo.h	Wed Jun  7 17:00:25 2006
@@ -295,7 +295,6 @@
   /// BasicBlocks to loops.
   void removeBlock(BasicBlock *BB);
 
-  static int stub;  // Noop
 private:
   void Calculate(ETForest &EF);
   Loop *ConsiderForLoop(BasicBlock *BB, ETForest &EF);
@@ -304,10 +303,6 @@
 };
 
 
-// Make sure that any clients of this file link in LoopInfo.cpp
-static IncludeFile
-LOOP_INFO_INCLUDE_FILE(&LoopInfo::stub);
-
 // Allow clients to walk the list of nested loops...
 template <> struct GraphTraits<const Loop*> {
   typedef const Loop NodeType;
@@ -337,4 +332,7 @@
 
 } // End llvm namespace
 
+// Make sure that any clients of this file link in LoopInfo.cpp
+FORCE_DEFINING_FILE_TO_BE_LINKED(LoopInfo)
+
 #endif


Index: llvm/include/llvm/Analysis/PostDominators.h
diff -u llvm/include/llvm/Analysis/PostDominators.h:1.13 llvm/include/llvm/Analysis/PostDominators.h:1.14
--- llvm/include/llvm/Analysis/PostDominators.h:1.13	Thu Jun  1 02:02:51 2006
+++ llvm/include/llvm/Analysis/PostDominators.h	Wed Jun  7 17:00:25 2006
@@ -128,18 +128,14 @@
     AU.addRequired<PostDominatorTree>();
   }
 
-  // stub - dummy function, just ignore it
-  static int stub;
-
 private:
   const DomSetType &calculate(const PostDominatorTree &DT,
                               const DominatorTree::Node *Node);
 };
 
-// Make sure that any clients of this file link in PostDominators.cpp
-static IncludeFile
-POST_DOMINATOR_INCLUDE_FILE(&PostDominanceFrontier::stub);
-
 } // End llvm namespace
 
+// Make sure that any clients of this file link in PostDominators.cpp
+FORCE_DEFINING_FILE_TO_BE_LINKED(PostDominanceFrontier)
+
 #endif


Index: llvm/include/llvm/Analysis/ValueNumbering.h
diff -u llvm/include/llvm/Analysis/ValueNumbering.h:1.9 llvm/include/llvm/Analysis/ValueNumbering.h:1.10
--- llvm/include/llvm/Analysis/ValueNumbering.h:1.9	Thu Jun  1 02:02:51 2006
+++ llvm/include/llvm/Analysis/ValueNumbering.h	Wed Jun  7 17:00:25 2006
@@ -65,10 +65,9 @@
   }
 };
 
-extern int BasicValueNumberingStub;
-static IncludeFile
-HDR_INCLUDE_VALUENUMBERING_CPP(&BasicValueNumberingStub);
-
 } // End llvm namespace
 
+// Force any file including this header to get the implementation as well
+FORCE_DEFINING_FILE_TO_BE_LINKED(BasicValueNumbering)
+
 #endif






More information about the llvm-commits mailing list