forked from OSchip/llvm-project
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
This commit is contained in:
parent
2a78e9bcb5
commit
8551d25fa9
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue