1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Fix Value dangling reference debug output

llvm-svn: 231889
This commit is contained in:
Andrew Kaylor 2015-03-10 23:55:38 +00:00
parent 91c4e41987
commit 741018c537
2 changed files with 5 additions and 7 deletions

View File

@ -68,7 +68,7 @@ void TypeFinder::run(const Module &M, bool onlyNamed) {
// instructions with this loop.)
for (User::const_op_iterator OI = I.op_begin(), OE = I.op_end();
OI != OE; ++OI)
if (!isa<Instruction>(OI))
if (*OI && !isa<Instruction>(OI))
incorporateValue(*OI);
// Incorporate types hiding in metadata.

View File

@ -69,15 +69,13 @@ Value::~Value() {
#ifndef NDEBUG // Only in -g mode...
// Check to make sure that there are no uses of this value that are still
// around when the value is destroyed. If there are, then we have a dangling
// reference and something is wrong. This code is here to print out what is
// still being referenced. The value in question should be printed as
// a <badref>
// reference and something is wrong. This code is here to print out where
// the value is still being referenced.
//
if (!use_empty()) {
dbgs() << "While deleting: " << *VTy << " %" << getName() << "\n";
for (use_iterator I = use_begin(), E = use_end(); I != E; ++I)
dbgs() << "Use still stuck around after Def is destroyed:"
<< **I << "\n";
for (auto *U : users())
dbgs() << "Use still stuck around after Def is destroyed:" << *U << "\n";
}
#endif
assert(use_empty() && "Uses remain when a value is destroyed!");