summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-06-01 07:02:51 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-06-01 07:02:51 +0000
commit5861659a1e1cc5131bfe67509df8b7207ed5e6fc (patch)
tree66c1fe95eae4527ab667a8898c73d0cea81de1c3 /llvm
parentcd8f67a1060c0ab57c9f6d6e42661827bddc1313 (diff)
downloadbcm5719-llvm-5861659a1e1cc5131bfe67509df8b7207ed5e6fc.tar.gz
bcm5719-llvm-5861659a1e1cc5131bfe67509df8b7207ed5e6fc.zip
Change from using a stub function to a stub variable for passing to the
IncludeFile hack to ensure linkage of analysis passes. This works around some -pedantic warnings about assigning an object to a function. llvm-svn: 28621
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Analysis/AliasAnalysis.h4
-rw-r--r--llvm/include/llvm/Analysis/CallGraph.h4
-rw-r--r--llvm/include/llvm/Analysis/Dominators.h4
-rw-r--r--llvm/include/llvm/Analysis/FindUsedTypes.h4
-rw-r--r--llvm/include/llvm/Analysis/LoopInfo.h4
-rw-r--r--llvm/include/llvm/Analysis/PostDominators.h4
-rw-r--r--llvm/include/llvm/Analysis/ValueNumbering.h4
-rw-r--r--llvm/lib/Analysis/AliasAnalysis.cpp2
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp2
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp2
-rw-r--r--llvm/lib/Analysis/IPA/FindUsedTypes.cpp2
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp2
-rw-r--r--llvm/lib/Analysis/PostDominators.cpp3
-rw-r--r--llvm/lib/Analysis/ValueNumbering.cpp2
-rw-r--r--llvm/lib/VMCore/Dominators.cpp2
15 files changed, 22 insertions, 23 deletions
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index 1cce4ea3930..0de7a7fd862 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -321,8 +321,8 @@ public:
// the risk of AliasAnalysis being used, but the default implementation not
// being linked into the tool that uses it.
//
-extern void BasicAAStub();
-static IncludeFile HDR_INCLUDE_BASICAA_CPP((void*)&BasicAAStub);
+extern int BasicAAStub;
+static IncludeFile HDR_INCLUDE_BASICAA_CPP(&BasicAAStub);
} // End llvm namespace
diff --git a/llvm/include/llvm/Analysis/CallGraph.h b/llvm/include/llvm/Analysis/CallGraph.h
index 734306015c0..5602cec26ec 100644
--- a/llvm/include/llvm/Analysis/CallGraph.h
+++ b/llvm/include/llvm/Analysis/CallGraph.h
@@ -155,7 +155,7 @@ public:
void dump() const;
// stub - dummy function, just ignore it
- static void stub();
+ static int stub;
protected:
// destroy - Release memory for the call graph
@@ -289,7 +289,7 @@ template<> struct GraphTraits<const CallGraph*> :
// Make sure that any clients of this file link in CallGraph.cpp
static IncludeFile
-CALLGRAPH_INCLUDE_FILE((void*)&CallGraph::stub);
+CALLGRAPH_INCLUDE_FILE(&CallGraph::stub);
extern void BasicCallGraphStub();
static IncludeFile HDR_INCLUDE_CALLGRAPH_CPP((void*)&BasicCallGraphStub);
diff --git a/llvm/include/llvm/Analysis/Dominators.h b/llvm/include/llvm/Analysis/Dominators.h
index d73b407d21f..224e529915f 100644
--- a/llvm/include/llvm/Analysis/Dominators.h
+++ b/llvm/include/llvm/Analysis/Dominators.h
@@ -276,7 +276,7 @@ public:
}
// stub - dummy function, just ignore it
- static void stub();
+ static int stub;
};
@@ -654,7 +654,7 @@ private:
// Make sure that any clients of this file link in Dominators.cpp
static IncludeFile
-DOMINATORS_INCLUDE_FILE((void*)&DominatorSet::stub);
+DOMINATORS_INCLUDE_FILE(&DominatorSet::stub);
} // End llvm namespace
#endif
diff --git a/llvm/include/llvm/Analysis/FindUsedTypes.h b/llvm/include/llvm/Analysis/FindUsedTypes.h
index 92f3677502d..e16fe9d7c30 100644
--- a/llvm/include/llvm/Analysis/FindUsedTypes.h
+++ b/llvm/include/llvm/Analysis/FindUsedTypes.h
@@ -55,12 +55,12 @@ public:
}
// stub - dummy function, just ignore it
- static void stub();
+ static int stub;
};
// Make sure that any clients of this file link in PostDominators.cpp
static IncludeFile
-FIND_USED_TYPES_INCLUDE_FILE((void*)(&FindUsedTypes::stub));
+FIND_USED_TYPES_INCLUDE_FILE(&FindUsedTypes::stub);
} // End llvm namespace
diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h
index 425c33f418b..065ce31d8bb 100644
--- a/llvm/include/llvm/Analysis/LoopInfo.h
+++ b/llvm/include/llvm/Analysis/LoopInfo.h
@@ -295,7 +295,7 @@ public:
/// BasicBlocks to loops.
void removeBlock(BasicBlock *BB);
- static void stub(); // Noop
+ static int stub; // Noop
private:
void Calculate(ETForest &EF);
Loop *ConsiderForLoop(BasicBlock *BB, ETForest &EF);
@@ -306,7 +306,7 @@ private:
// Make sure that any clients of this file link in LoopInfo.cpp
static IncludeFile
-LOOP_INFO_INCLUDE_FILE((void*)(&LoopInfo::stub));
+LOOP_INFO_INCLUDE_FILE(&LoopInfo::stub);
// Allow clients to walk the list of nested loops...
template <> struct GraphTraits<const Loop*> {
diff --git a/llvm/include/llvm/Analysis/PostDominators.h b/llvm/include/llvm/Analysis/PostDominators.h
index b9a1feb8ba3..1436be30375 100644
--- a/llvm/include/llvm/Analysis/PostDominators.h
+++ b/llvm/include/llvm/Analysis/PostDominators.h
@@ -129,7 +129,7 @@ struct PostDominanceFrontier : public DominanceFrontierBase {
}
// stub - dummy function, just ignore it
- static void stub();
+ static int stub;
private:
const DomSetType &calculate(const PostDominatorTree &DT,
@@ -138,7 +138,7 @@ private:
// Make sure that any clients of this file link in PostDominators.cpp
static IncludeFile
-POST_DOMINATOR_INCLUDE_FILE((void*)&PostDominanceFrontier::stub);
+POST_DOMINATOR_INCLUDE_FILE(&PostDominanceFrontier::stub);
} // End llvm namespace
diff --git a/llvm/include/llvm/Analysis/ValueNumbering.h b/llvm/include/llvm/Analysis/ValueNumbering.h
index 6169955d94c..2fc949766e7 100644
--- a/llvm/include/llvm/Analysis/ValueNumbering.h
+++ b/llvm/include/llvm/Analysis/ValueNumbering.h
@@ -65,9 +65,9 @@ struct ValueNumbering {
}
};
-extern void BasicValueNumberingStub();
+extern int BasicValueNumberingStub;
static IncludeFile
-HDR_INCLUDE_VALUENUMBERING_CPP((void*)&BasicValueNumberingStub);
+HDR_INCLUDE_VALUENUMBERING_CPP(&BasicValueNumberingStub);
} // End llvm namespace
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 15a27e7a477..6d5a37515de 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -189,6 +189,6 @@ bool AliasAnalysis::canInstructionRangeModify(const Instruction &I1,
// being linked into the tool that uses it.
//
namespace llvm {
- extern void BasicAAStub();
+ extern int BasicAAStub;
}
static IncludeFile INCLUDE_BASICAA_CPP((void*)&BasicAAStub);
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 2a37ab87fa4..3cda92e49f5 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -27,7 +27,7 @@
using namespace llvm;
// Make sure that anything that uses AliasAnalysis pulls in this file...
-void llvm::BasicAAStub() {}
+int llvm::BasicAAStub;
namespace {
/// NoAA - This class implements the -no-aa pass, which always returns "I
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index 9089afe1a97..71b303beca9 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -258,7 +258,7 @@ CallGraphNode *CallGraph::getOrInsertFunction(const Function *F) {
-void CallGraph::stub() {}
+int CallGraph::stub; // to ensure linkage of this file.
void CallGraphNode::print(std::ostream &OS) const {
if (Function *F = getFunction())
diff --git a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
index 09e14a87d40..f7efc7d3a41 100644
--- a/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -25,7 +25,7 @@ static RegisterAnalysis<FindUsedTypes>
X("printusedtypes", "Find Used Types");
// stub to help linkage
-void FindUsedTypes::stub() {}
+int FindUsedTypes::stub; // to ensure linkage of this file
// IncorporateType - Incorporate one type and all of its subtypes into the
// collection of used types.
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 2860aa492ce..f2ef17682fc 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -86,7 +86,7 @@ void Loop::dump() const {
//===----------------------------------------------------------------------===//
// LoopInfo implementation
//
-void LoopInfo::stub() {}
+int LoopInfo::stub;
bool LoopInfo::runOnFunction(Function &) {
releaseMemory();
diff --git a/llvm/lib/Analysis/PostDominators.cpp b/llvm/lib/Analysis/PostDominators.cpp
index b8b173e1ab4..611ea60a672 100644
--- a/llvm/lib/Analysis/PostDominators.cpp
+++ b/llvm/lib/Analysis/PostDominators.cpp
@@ -360,6 +360,5 @@ PostDominanceFrontier::calculate(const PostDominatorTree &DT,
}
// stub - a dummy function to make linking work ok.
-void PostDominanceFrontier::stub() {
-}
+int PostDominanceFrontier::stub;
diff --git a/llvm/lib/Analysis/ValueNumbering.cpp b/llvm/lib/Analysis/ValueNumbering.cpp
index 9a359378c8a..06482224544 100644
--- a/llvm/lib/Analysis/ValueNumbering.cpp
+++ b/llvm/lib/Analysis/ValueNumbering.cpp
@@ -239,4 +239,4 @@ void BVNImpl::handleTernaryInst(Instruction &I) {
}
-void llvm::BasicValueNumberingStub() { }
+int llvm::BasicValueNumberingStub; // to ensure linkage of this file
diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp
index 24b3e87cafd..a0a6d253b28 100644
--- a/llvm/lib/VMCore/Dominators.cpp
+++ b/llvm/lib/VMCore/Dominators.cpp
@@ -304,7 +304,7 @@ bool DominatorSet::runOnFunction(Function &F) {
return false;
}
-void DominatorSet::stub() {}
+int DominatorSet::stub;
namespace llvm {
static std::ostream &operator<<(std::ostream &o,
OpenPOWER on IntegriCloud