summaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis
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
commit4f1bd9e9963239c119db70070db1d68286b3de7e (patch)
treed1606a0f29f57d16f5db895bb11a151a83cf0f11 /include/llvm/Analysis
parent6296b3cac5448afe910e9dd7953fb10082721c77 (diff)
downloadexternal_llvm-4f1bd9e9963239c119db70070db1d68286b3de7e.zip
external_llvm-4f1bd9e9963239c119db70070db1d68286b3de7e.tar.gz
external_llvm-4f1bd9e9963239c119db70070db1d68286b3de7e.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r--include/llvm/Analysis/AliasAnalysis.h9
-rw-r--r--include/llvm/Analysis/CallGraph.h10
-rw-r--r--include/llvm/Analysis/Dominators.h6
-rw-r--r--include/llvm/Analysis/FindUsedTypes.h10
-rw-r--r--include/llvm/Analysis/LoopInfo.h8
-rw-r--r--include/llvm/Analysis/PostDominators.h10
-rw-r--r--include/llvm/Analysis/ValueNumbering.h7
7 files changed, 22 insertions, 38 deletions
diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h
index d715e08..2fff774 100644
--- a/include/llvm/Analysis/AliasAnalysis.h
+++ b/include/llvm/Analysis/AliasAnalysis.h
@@ -318,14 +318,13 @@ public:
}
};
+} // 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
diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h
index e51a3c7..94cea10 100644
--- a/include/llvm/Analysis/CallGraph.h
+++ b/include/llvm/Analysis/CallGraph.h
@@ -287,13 +287,9 @@ template<> struct GraphTraits<const CallGraph*> :
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
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 224e529..31b8562 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -652,9 +652,9 @@ private:
};
-// 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
diff --git a/include/llvm/Analysis/FindUsedTypes.h b/include/llvm/Analysis/FindUsedTypes.h
index e16fe9d..fbf41de 100644
--- a/include/llvm/Analysis/FindUsedTypes.h
+++ b/include/llvm/Analysis/FindUsedTypes.h
@@ -53,15 +53,11 @@ public:
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
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index 065ce31..06b007c 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -295,7 +295,6 @@ public:
/// 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 @@ private:
};
-// 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 @@ template <> struct GraphTraits<Loop*> {
} // End llvm namespace
+// Make sure that any clients of this file link in LoopInfo.cpp
+FORCE_DEFINING_FILE_TO_BE_LINKED(LoopInfo)
+
#endif
diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h
index 1436be3..4d8d140 100644
--- a/include/llvm/Analysis/PostDominators.h
+++ b/include/llvm/Analysis/PostDominators.h
@@ -128,18 +128,14 @@ struct PostDominanceFrontier : public DominanceFrontierBase {
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
diff --git a/include/llvm/Analysis/ValueNumbering.h b/include/llvm/Analysis/ValueNumbering.h
index 2fc9497..f708f48 100644
--- a/include/llvm/Analysis/ValueNumbering.h
+++ b/include/llvm/Analysis/ValueNumbering.h
@@ -65,10 +65,9 @@ struct ValueNumbering {
}
};
-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