summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/CallGraph.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-12-04 21:22:45 +0000
committerChris Lattner <sabre@nondot.org>2006-12-04 21:22:45 +0000
commitbaf6c54410144de3ed5025e0319a5dfe66237d4e (patch)
treebda7f23eb6651013976b81a04535465779cbf304 /llvm/lib/Analysis/IPA/CallGraph.cpp
parenta6cfd60a8c9aa215ddce2753ffc5d20a7ea7f6ed (diff)
downloadbcm5719-llvm-baf6c54410144de3ed5025e0319a5dfe66237d4e.tar.gz
bcm5719-llvm-baf6c54410144de3ed5025e0319a5dfe66237d4e.zip
Add a comment and fix a memory leak. Thanks to Vikram for pointing this out.
llvm-svn: 32196
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index 9c22b7cc5e2..61d00f02528 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -20,6 +20,9 @@
#include <ostream>
using namespace llvm;
+/// isOnlyADirectCall - Return true if this callsite is *just* a direct call to
+/// the specified function. Specifically return false if the callsite also
+/// takes the address of the function.
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)
@@ -179,10 +182,8 @@ private:
//
// destroy - Release memory for the call graph
virtual void destroy() {
- if (!CallsExternalNode) {
- delete CallsExternalNode;
- CallsExternalNode = 0;
- }
+ delete CallsExternalNode;
+ CallsExternalNode = 0;
}
};
OpenPOWER on IntegriCloud