diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-07-24 19:57:19 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-07-24 19:57:19 +0000 |
commit | dbfc010691ef35ff76e73192c3f734fc5e47ebc8 (patch) | |
tree | 10038f28cc21a2a843f2536e02415481f1070455 /llvm/lib | |
parent | df9c9ff43bd634cbeda6d18bad3ad003cffd0e0e (diff) | |
download | bcm5719-llvm-dbfc010691ef35ff76e73192c3f734fc5e47ebc8.tar.gz bcm5719-llvm-dbfc010691ef35ff76e73192c3f734fc5e47ebc8.zip |
Verifier: Sink filename check into visitMDCompositeType(), NFC
We really only want to check this for unions and classes (all the other
tags have been ruled out), so simplify the check and move it to the
right place.
llvm-svn: 243150
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index a970cf18163..670fb1017b0 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -786,25 +786,6 @@ void Verifier::visitDIDerivedTypeBase(const DIDerivedTypeBase &N) { Assert(isScopeRef(N, N.getScope()), "invalid scope", &N, N.getScope()); Assert(isTypeRef(N, N.getBaseType()), "invalid base type", &N, N.getBaseType()); - - // FIXME: Sink this into the subclass verifies. - if (!N.getFile() || N.getFile()->getFilename().empty()) { - // Check whether the filename is allowed to be empty. - uint16_t Tag = N.getTag(); - Assert( - Tag == dwarf::DW_TAG_const_type || Tag == dwarf::DW_TAG_volatile_type || - Tag == dwarf::DW_TAG_pointer_type || - Tag == dwarf::DW_TAG_ptr_to_member_type || - Tag == dwarf::DW_TAG_reference_type || - Tag == dwarf::DW_TAG_rvalue_reference_type || - Tag == dwarf::DW_TAG_restrict_type || - Tag == dwarf::DW_TAG_array_type || - Tag == dwarf::DW_TAG_enumeration_type || - Tag == dwarf::DW_TAG_inheritance || Tag == dwarf::DW_TAG_friend || - Tag == dwarf::DW_TAG_structure_type || - Tag == dwarf::DW_TAG_member || Tag == dwarf::DW_TAG_typedef, - "derived/composite type requires a filename", &N, N.getFile()); - } } void Verifier::visitDIDerivedType(const DIDerivedType &N) { @@ -864,6 +845,12 @@ void Verifier::visitDICompositeType(const DICompositeType &N) { &N); if (auto *Params = N.getRawTemplateParams()) visitTemplateParams(N, *Params); + + if (N.getTag() == dwarf::DW_TAG_class_type || + N.getTag() == dwarf::DW_TAG_union_type) { + Assert(N.getFile() && !N.getFile()->getFilename().empty(), + "class/union requires a filename", &N, N.getFile()); + } } void Verifier::visitDISubroutineType(const DISubroutineType &N) { |