}
#endif
-bool DIType::Verify() const {
- auto *N = dyn_cast_or_null<MDType>(DbgNode);
- if (!N)
- return false;
-
- if (isCompositeType())
- return DICompositeType(DbgNode).Verify();
- return true;
-}
-
+bool DIType::Verify() const { return isType(); }
bool DIBasicType::Verify() const { return isBasicType(); }
bool DIDerivedType::Verify() const { return isDerivedType(); }
-
-bool DICompositeType::Verify() const {
- auto *N = dyn_cast_or_null<MDCompositeTypeBase>(DbgNode);
- return N && !(isLValueReference() && isRValueReference());
-}
+bool DICompositeType::Verify() const { return isCompositeType(); }
bool DISubprogram::Verify() const {
auto *N = dyn_cast_or_null<MDSubprogram>(DbgNode);
if (!N)
return false;
- if (isLValueReference() && isRValueReference())
- return false;
-
// If a DISubprogram has an llvm::Function*, then scope chains from all
// instructions within the function should lead to this DISubprogram.
if (auto *F = getFunction()) {
}
}
+static bool hasConflictingReferenceFlags(unsigned Flags) {
+ return (Flags & DebugNode::FlagLValueReference) &&
+ (Flags & DebugNode::FlagRValueReference);
+}
+
void Verifier::visitMDCompositeType(const MDCompositeType &N) {
// Common derived type checks.
visitMDDerivedTypeBase(N);
N.getRawVTableHolder());
Assert(!N.getRawElements() || isa<MDTuple>(N.getRawElements()),
"invalid composite elements", &N, N.getRawElements());
+ Assert(!hasConflictingReferenceFlags(N.getFlags()), "invalid reference flags",
+ &N);
}
void Verifier::visitMDSubroutineType(const MDSubroutineType &N) {
Assert(isTypeRef(Ty), "invalid subroutine type ref", &N, Types, Ty);
}
}
+ Assert(!hasConflictingReferenceFlags(N.getFlags()), "invalid reference flags",
+ &N);
}
void Verifier::visitMDFile(const MDFile &N) {
Op);
}
}
+ Assert(!hasConflictingReferenceFlags(N.getFlags()), "invalid reference flags",
+ &N);
}
void Verifier::visitMDLexicalBlockBase(const MDLexicalBlockBase &N) {