diff options
author | Richard Trieu <rtrieu@google.com> | 2014-06-09 22:53:16 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2014-06-09 22:53:16 +0000 |
commit | f31ecd39273231fccc53785f518023d70f85a02a (patch) | |
tree | c6f05f5eef00db27c074ec3b5e900c63df3e0c7c /lib/Analysis/IPA | |
parent | 8aeca44558234ae3703c565854c31d38034e56cb (diff) | |
download | llvm-f31ecd39273231fccc53785f518023d70f85a02a.tar.gz llvm-f31ecd39273231fccc53785f518023d70f85a02a.tar.bz2 llvm-f31ecd39273231fccc53785f518023d70f85a02a.tar.xz |
Removing an "if (!this)" check from two print methods. The condition will
never be true in a well-defined context. The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r-- | lib/Analysis/IPA/CallGraphSCCPass.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp index bfab744d47..0d9d0ef842 100644 --- a/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -602,8 +602,10 @@ namespace { bool runOnSCC(CallGraphSCC &SCC) override { Out << Banner; - for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) + for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { + assert((*I)->getFunction() && "Expecting non-null Function"); (*I)->getFunction()->print(Out); + } return false; } }; |