summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-06-07 22:00:26 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-06-07 22:00:26 +0000
commitbe535661cc81e5c4be116a9f342af9b061c4ea9e (patch)
treecc8cb97e9b8ea6a2bb5c9e49fabbedaac25bcefc /llvm/lib/Analysis/IPA
parentd4b795902c52cdbc9087b7c8a18fa8ec93acb2e9 (diff)
downloadbcm5719-llvm-be535661cc81e5c4be116a9f342af9b061c4ea9e.tar.gz
bcm5719-llvm-be535661cc81e5c4be116a9f342af9b061c4ea9e.zip
For 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. llvm-svn: 28715
Diffstat (limited to 'llvm/lib/Analysis/IPA')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp9
-rw-r--r--llvm/lib/Analysis/IPA/FindUsedTypes.cpp6
2 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index f8846d390a5..78bb735ffa2 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -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 @@ CallGraphNode *CallGraph::getOrInsertFunction(const Function *F) {
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 @@ void CallGraphNode::removeAnyCallEdgeTo(CallGraphNode *Callee) {
--i; --e;
}
}
+
+// Enuse that users of CallGraph.h also link with this file
+DEFINING_FILE_FOR(CallGraph)
diff --git a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
index f7efc7d3a41..725cec4c018 100644
--- a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -24,9 +24,6 @@ using namespace llvm;
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 @@ void FindUsedTypes::print(std::ostream &o, const Module *M) const {
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)
OpenPOWER on IntegriCloud