diff options
author | Chris Lattner <sabre@nondot.org> | 2006-12-04 21:22:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-12-04 21:22:45 +0000 |
commit | 12d38bfca012f20781db894244ef4a6a1216961f (patch) | |
tree | bbf1030148e56f2ebc05b94fb41926144f835ba7 /lib/Analysis/IPA/CallGraph.cpp | |
parent | 0eb776f10b7ee30602f97a790c3bec2d4aa99ebe (diff) |
Add a comment and fix a memory leak. Thanks to Vikram for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r-- | lib/Analysis/IPA/CallGraph.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index 9c22b7cc5e..61d00f0252 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/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; } }; |