[llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp FindUsedTypes.cpp

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



Changes in directory llvm/lib/Analysis/IPA:

CallGraph.cpp updated: 1.53 -> 1.54
FindUsedTypes.cpp updated: 1.35 -> 1.36
---
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:  (+6 -9)

 CallGraph.cpp     |    9 +++------
 FindUsedTypes.cpp |    6 +++---
 2 files changed, 6 insertions(+), 9 deletions(-)


Index: llvm/lib/Analysis/IPA/CallGraph.cpp
diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.53 llvm/lib/Analysis/IPA/CallGraph.cpp:1.54
--- llvm/lib/Analysis/IPA/CallGraph.cpp:1.53	Thu Jun  1 12:17:37 2006
+++ llvm/lib/Analysis/IPA/CallGraph.cpp	Wed Jun  7 17:00:26 2006
@@ -19,8 +19,6 @@
 #include <iostream>
 using namespace llvm;
 
-int llvm::BasicCallGraphStub;
-
 static bool isOnlyADirectCall(Function *F, CallSite CS) {
   if (!CS.getInstruction()) return false;
   for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I)
@@ -256,10 +254,6 @@
   return CGN = new CallGraphNode(const_cast<Function*>(F));
 }
 
-
-
-int CallGraph::stub; // to ensure linkage of this file.
-
 void CallGraphNode::print(std::ostream &OS) const {
   if (Function *F = getFunction())
     OS << "Call graph node for function: '" << F->getName() <<"'\n";
@@ -297,3 +291,6 @@
       --i; --e;
     }
 }
+
+// Enuse that users of CallGraph.h also link with this file
+DEFINING_FILE_FOR(CallGraph)


Index: llvm/lib/Analysis/IPA/FindUsedTypes.cpp
diff -u llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.35 llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.36
--- llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.35	Thu Jun  1 02:02:51 2006
+++ llvm/lib/Analysis/IPA/FindUsedTypes.cpp	Wed Jun  7 17:00:26 2006
@@ -24,9 +24,6 @@
 static RegisterAnalysis<FindUsedTypes>
 X("printusedtypes", "Find Used Types");
 
-// stub to help linkage
-int FindUsedTypes::stub; // to ensure linkage of this file
-
 // IncorporateType - Incorporate one type and all of its subtypes into the
 // collection of used types.
 //
@@ -104,3 +101,6 @@
            E = UsedTypes.end(); I != E; ++I)
       o << "  " << **I << "\n";
 }
+
+// Ensure that this file gets linked in when FindUsedTypes.h is used.
+DEFINING_FILE_FOR(FindUsedTypes)






More information about the llvm-commits mailing list