aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2015-03-10 23:55:38 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2015-03-10 23:55:38 +0000
commitb93fb82b3f8efa33ca1dbb4b47876369cc5297b8 (patch)
tree703c72e3299d820aa09d4481df3da4bb23819350 /llvm/lib/IR/Value.cpp
parent433c432b7e43ce8092a8e097530f36731d3ad6e0 (diff)
downloadllvm-b93fb82b3f8efa33ca1dbb4b47876369cc5297b8.zip
llvm-b93fb82b3f8efa33ca1dbb4b47876369cc5297b8.tar.gz
llvm-b93fb82b3f8efa33ca1dbb4b47876369cc5297b8.tar.bz2
Fix Value dangling reference debug output
llvm-svn: 231889
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 00ec81f..2d9c306 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -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!");