Skip to content

Commit 0609d37

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: c6a9b7e: [IGC OCL] Turn 2 asserts into warnings
Turn NumDebugCUs == 1 and llvm.dbg.declare count asserts into warnings
1 parent 788001e commit 0609d37

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

IGC/DebugInfo/DwarfDebug.cpp

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

53-
#include <iostream>
5453
#include <list>
5554
#include <optional>
5655
#include <unordered_set>
@@ -1077,11 +1076,8 @@ void DwarfDebug::beginModule() {
10771076
constructThenAddImportedEntityDIE(CU, IE);
10781077

10791078
[[maybe_unused]] auto NumDebugCUs = std::distance(M->debug_compile_units_begin(), M->debug_compile_units_end());
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
1079+
IGC_ASSERT_MESSAGE(NumDebugCUs == 1, "only Modules with one CU are supported at the moment");
1080+
10851081
// Prime section data.
10861082
SectionMap[Asm->GetTextSection()];
10871083

@@ -1556,11 +1552,8 @@ void DwarfDebug::collectVariableInfo(const Function *MF, SmallPtrSet<const MDNod
15561552
}
15571553
}
15581554

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
1555+
IGC_ASSERT_MESSAGE(!(History.size() > 1 && isa<DbgDeclareInst>(pInst)),
1556+
"We don't expect many llvm.dbg.declare calls for a single variable");
15641557

15651558
const Instruction *start = (*HI);
15661559
const Instruction *end = start;

0 commit comments

Comments
 (0)