IR: isScopeRef() should check isScope()

r229733 removed an invalid use of `DIScopeRef`, so now we can enforce
that a `DIScopeRef` is actually a scope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229734 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-02-18 19:46:02 +00:00
parent 1cfad01081
commit 510ccd20a9

View File

@ -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.