diff options
author | Richard Trieu <rtrieu@google.com> | 2014-06-21 02:43:02 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2014-06-21 02:43:02 +0000 |
commit | 7921239c411aeeaef55998cc64495aa1ea1a3ea3 (patch) | |
tree | 5d606ccc0402f191214c7db4b647fa86d2b9ff0b /lib/Analysis | |
parent | 5d0ff9c9289fc4f9e99c7b27b7c8b42597cd8765 (diff) | |
download | llvm-7921239c411aeeaef55998cc64495aa1ea1a3ea3.tar.gz llvm-7921239c411aeeaef55998cc64495aa1ea1a3ea3.tar.bz2 llvm-7921239c411aeeaef55998cc64495aa1ea1a3ea3.tar.xz |
Add back functionality removed in r210497.
Instead of asserting, output a message stating that a null pointer was found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/IPA/CallGraphSCCPass.cpp | 6 | ||||
-rw-r--r-- | lib/Analysis/IVUsers.cpp | 6 | ||||
-rw-r--r-- | lib/Analysis/LoopPass.cpp | 6 | ||||
-rw-r--r-- | lib/Analysis/RegionPass.cpp | 6 |
4 files changed, 16 insertions, 8 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp index 0d9d0ef842..730eb7156d 100644 --- a/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -603,8 +603,10 @@ namespace { bool runOnSCC(CallGraphSCC &SCC) override { Out << Banner; for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) { - assert((*I)->getFunction() && "Expecting non-null Function"); - (*I)->getFunction()->print(Out); + if ((*I)->getFunction()) + (*I)->getFunction()->print(Out); + else + Out << "Printing <null> Function"; } return false; } diff --git a/lib/Analysis/IVUsers.cpp b/lib/Analysis/IVUsers.cpp index 0b94238e66..24655aa002 100644 --- a/lib/Analysis/IVUsers.cpp +++ b/lib/Analysis/IVUsers.cpp @@ -287,8 +287,10 @@ void IVUsers::print(raw_ostream &OS, const Module *M) const { OS << ")"; } OS << " in "; - assert(UI->getUser() != nullptr && "Expected non-null User"); - UI->getUser()->print(OS); + if (UI->getUser()) + UI->getUser()->print(OS); + else + OS << "Printing <null> User"; OS << '\n'; } } diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index 2c6e6e3fff..7bd866e73e 100644 --- a/lib/Analysis/LoopPass.cpp +++ b/lib/Analysis/LoopPass.cpp @@ -45,8 +45,10 @@ public: for (Loop::block_iterator b = L->block_begin(), be = L->block_end(); b != be; ++b) { - assert((*b) != nullptr && "Expecting non-null block"); - (*b)->print(Out); + if (*b) + (*b)->print(Out); + else + Out << "Printing <null> block"; } return false; } diff --git a/lib/Analysis/RegionPass.cpp b/lib/Analysis/RegionPass.cpp index d11b3323ca..71de14450b 100644 --- a/lib/Analysis/RegionPass.cpp +++ b/lib/Analysis/RegionPass.cpp @@ -196,8 +196,10 @@ public: bool runOnRegion(Region *R, RGPassManager &RGM) override { Out << Banner; for (const auto &BB : R->blocks()) { - assert(BB != nullptr && "Expecting non-null Block"); - BB->print(Out); + if (BB) + BB->print(Out); + else + Out << "Printing <null> Block"; } return false; |