summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-06-09 22:53:16 +0000
committerRichard Trieu <rtrieu@google.com>2014-06-09 22:53:16 +0000
commita23043cb9c1ef021a9cf05cd62cce76cd03c0ba2 (patch)
tree65eda585bf8ca912429cd6c56f02c614337aa6a2 /llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
parentd3d017cf00714c7d376a3cf87d2a17002e12cac7 (diff)
downloadbcm5719-llvm-a23043cb9c1ef021a9cf05cd62cce76cd03c0ba2.tar.gz
bcm5719-llvm-a23043cb9c1ef021a9cf05cd62cce76cd03c0ba2.zip
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. llvm-svn: 210497
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
index bfab744d479..0d9d0ef842c 100644
--- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/llvm/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;
}
};
OpenPOWER on IntegriCloud