Skip to content

Commit 4e2a2b1

Browse files
committed
Remove check that Subrange must have count or upper bound.
Also removed related tests.
1 parent 3d9cb04 commit 4e2a2b1

File tree

5 files changed

+0
-52
lines changed

5 files changed

+0
-52
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,6 @@ class Verifier : public InstVisitor<Verifier>, VerifierSupport {
359359
/// Whether the current function has a DISubprogram attached to it.
360360
bool HasDebugInfo = false;
361361

362-
/// The current source language.
363-
dwarf::SourceLanguage CurrentSourceLang = dwarf::DW_LANG_lo_user;
364-
365362
/// Stores the count of how many objects were passed to llvm.localescape for a
366363
/// given function and the largest index passed to llvm.localrecover.
367364
DenseMap<Function *, std::pair<unsigned, unsigned>> FrameEscapeInfo;
@@ -1156,10 +1153,6 @@ void Verifier::visitDIScope(const DIScope &N) {
11561153

11571154
void Verifier::visitDISubrange(const DISubrange &N) {
11581155
CheckDI(N.getTag() == dwarf::DW_TAG_subrange_type, "invalid tag", &N);
1159-
bool HasAssumedSizedArraySupport = dwarf::isFortran(CurrentSourceLang);
1160-
CheckDI(HasAssumedSizedArraySupport || N.getRawCountNode() ||
1161-
N.getRawUpperBound(),
1162-
"Subrange must contain count or upperBound", &N);
11631156
CheckDI(!N.getRawCountNode() || !N.getRawUpperBound(),
11641157
"Subrange can have any one of count or upperBound", &N);
11651158
auto *CBound = N.getRawCountNode();
@@ -1188,8 +1181,6 @@ void Verifier::visitDISubrange(const DISubrange &N) {
11881181

11891182
void Verifier::visitDIGenericSubrange(const DIGenericSubrange &N) {
11901183
CheckDI(N.getTag() == dwarf::DW_TAG_generic_subrange, "invalid tag", &N);
1191-
CheckDI(N.getRawCountNode() || N.getRawUpperBound(),
1192-
"GenericSubrange must contain count or upperBound", &N);
11931184
CheckDI(!N.getRawCountNode() || !N.getRawUpperBound(),
11941185
"GenericSubrange can have any one of count or upperBound", &N);
11951186
auto *CBound = N.getRawCountNode();
@@ -1413,8 +1404,6 @@ void Verifier::visitDICompileUnit(const DICompileUnit &N) {
14131404
CheckDI(!N.getFile()->getFilename().empty(), "invalid filename", &N,
14141405
N.getFile());
14151406

1416-
CurrentSourceLang = (dwarf::SourceLanguage)N.getSourceLanguage();
1417-
14181407
CheckDI((N.getEmissionKind() <= DICompileUnit::LastEmissionKind),
14191408
"invalid emission kind", &N);
14201409

@@ -1494,8 +1483,6 @@ void Verifier::visitDISubprogram(const DISubprogram &N) {
14941483
CheckDI(N.isDistinct(), "subprogram definitions must be distinct", &N);
14951484
CheckDI(Unit, "subprogram definitions must have a compile unit", &N);
14961485
CheckDI(isa<DICompileUnit>(Unit), "invalid unit type", &N, Unit);
1497-
if (auto *CU = dyn_cast_or_null<DICompileUnit>(Unit))
1498-
CurrentSourceLang = (dwarf::SourceLanguage)CU->getSourceLanguage();
14991486
// There's no good way to cross the CU boundary to insert a nested
15001487
// DISubprogram definition in one CU into a type defined in another CU.
15011488
auto *CT = dyn_cast_or_null<DICompositeType>(N.getRawScope());

llvm/test/Assembler/invalid-disubrange-count-missing.ll

Lines changed: 0 additions & 5 deletions
This file was deleted.

llvm/test/DebugInfo/fortran-empty-subrange.ll

Lines changed: 0 additions & 24 deletions
This file was deleted.

llvm/test/Verifier/digenericsubrange-missing-upperBound.ll

Lines changed: 0 additions & 5 deletions
This file was deleted.

llvm/test/Verifier/disubrange-missing-upperBound.ll

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)