Skip to content

Commit c6a9b7e

Browse files
obrotowyigcbot
authored andcommitted
Turn 2 asserts into warnings
Turn NumDebugCUs == 1 and llvm.dbg.declare count asserts into warnings
1 parent 133bd77 commit c6a9b7e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

IGC/DebugInfo/DwarfDebug.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ See LICENSE.TXT for details.
5050
#include "VISADebugInfo.hpp"
5151
#include "VISAModule.hpp"
5252

53+
#include <iostream>
5354
#include <list>
5455
#include <optional>
5556
#include <unordered_set>
@@ -1076,8 +1077,11 @@ void DwarfDebug::beginModule() {
10761077
constructThenAddImportedEntityDIE(CU, IE);
10771078

10781079
[[maybe_unused]] auto NumDebugCUs = std::distance(M->debug_compile_units_begin(), M->debug_compile_units_end());
1079-
IGC_ASSERT_MESSAGE(NumDebugCUs == 1, "only Modules with one CU are supported at the moment");
1080-
1080+
#ifdef NDEBUG
1081+
if (NumDebugCUs != 1) {
1082+
std::cerr << "Warning: Module contains " << NumDebugCUs << " debug compile units. Only modules with one CU are supported currently.\n";
1083+
}
1084+
#endif
10811085
// Prime section data.
10821086
SectionMap[Asm->GetTextSection()];
10831087

@@ -1552,8 +1556,11 @@ void DwarfDebug::collectVariableInfo(const Function *MF, SmallPtrSet<const MDNod
15521556
}
15531557
}
15541558

1555-
IGC_ASSERT_MESSAGE(!(History.size() > 1 && isa<DbgDeclareInst>(pInst)),
1556-
"We don't expect many llvm.dbg.declare calls for a single variable");
1559+
#ifdef NDEBUG
1560+
if (!(History.size() > 1 && isa<DbgDeclareInst>(pInst))) {
1561+
std::cerr << "Warning: We don't expect many llvm.dbg.declare calls for a single variable.\n";
1562+
}
1563+
#endif
15571564

15581565
const Instruction *start = (*HI);
15591566
const Instruction *end = start;

0 commit comments

Comments
 (0)