diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-18 19:46:02 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-02-18 19:46:02 +0000 |
commit | 8551d25fa909dca97222c56812e19ad37ff1a24b (patch) | |
tree | cfb44c41675ef51500ee78e0a9b8116c9533472f /llvm/lib/IR/DebugInfo.cpp | |
parent | 2a78e9bcb5b0f05e60e9a4820c40ca3c53664221 (diff) | |
download | bcm5719-llvm-8551d25fa909dca97222c56812e19ad37ff1a24b.tar.gz bcm5719-llvm-8551d25fa909dca97222c56812e19ad37ff1a24b.zip |
IR: isScopeRef() should check isScope()
r229733 removed an invalid use of `DIScopeRef`, so now we can enforce
that a `DIScopeRef` is actually a scope.
llvm-svn: 229734
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 32521b160a2..c39c11988a2 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -418,7 +418,9 @@ static bool isScopeRef(const Metadata *MD) { return true; if (auto *S = dyn_cast<MDString>(MD)) return !S->getString().empty(); - return isa<MDNode>(MD); + if (auto *N = dyn_cast<MDNode>(MD)) + return DIScope(N).isScope(); + return false; } /// \brief Check if a field at position Elt of a MDNode can be a ScopeRef. |