summaryrefslogtreecommitdiff
path: root/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IR/DebugInfo.cpp')
-rw-r--r--lib/IR/DebugInfo.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp
index f9bc63b389..c9d68afa44 100644
--- a/lib/IR/DebugInfo.cpp
+++ b/lib/IR/DebugInfo.cpp
@@ -429,8 +429,10 @@ static bool fieldIsTypeRef(const MDNode *DbgNode, unsigned Elt) {
/// Check if a value can be a ScopeRef.
static bool isScopeRef(const Value *Val) {
return !Val ||
- (isa<MDString>(Val) && !cast<MDString>(Val)->getString().empty()) ||
- isa<MDNode>(Val);
+ (isa<MDString>(Val) && !cast<MDString>(Val)->getString().empty()) ||
+ // Not checking for Val->isScope() here, because it would work
+ // only for lexical scopes and not all subclasses of DIScope.
+ isa<MDNode>(Val);
}
/// Check if a field at position Elt of a MDNode can be a ScopeRef.