aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/DataStructure/DSGraph.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-04 00:03:57 +0000
committerChris Lattner <sabre@nondot.org>2003-02-04 00:03:57 +0000
commitf52ade928c256e6336356b55b7d07c0f56d6a96a (patch)
treeda954253d5f937716906f2fff7fab67259adcf3f /include/llvm/Analysis/DataStructure/DSGraph.h
parente6c0b5dba4b43f90fd489a1a7819b8d9d827bb06 (diff)
Add sanity check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5489 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructure/DSGraph.h')
-rw-r--r--include/llvm/Analysis/DataStructure/DSGraph.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/Analysis/DataStructure/DSGraph.h b/include/llvm/Analysis/DataStructure/DSGraph.h
index 0126e2d44f..c5e9396a16 100644
--- a/include/llvm/Analysis/DataStructure/DSGraph.h
+++ b/include/llvm/Analysis/DataStructure/DSGraph.h
@@ -53,7 +53,10 @@ public:
~DSGraph();
bool hasFunction() const { return Func != 0; }
- Function &getFunction() const { return *Func; }
+ Function &getFunction() const {
+ assert(hasFunction() && "Cannot call getFunction on graph without a fn!");
+ return *Func;
+ }
DSGraph *getGlobalsGraph() const { return GlobalsGraph; }
void setGlobalsGraph(DSGraph *G) { GlobalsGraph = G; }