Skip to content

Commit 157b626

Browse files
committed
Revert "[DebugInfo][RemoveDIs] Don't pointlessly scan funcs for debug-info (#79327)"
This reverts commit c23608b. It looks like this depends on #79345, which isn't going to land today, so revert for now.
1 parent 9058503 commit 157b626

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

llvm/include/llvm/IR/BasicBlock.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,12 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
8181
/// intrinsics into DPMarker / DPValue records. Deletes all dbg.values in
8282
/// the process and sets IsNewDbgInfoFormat = true. Only takes effect if
8383
/// the UseNewDbgInfoFormat LLVM command line option is given.
84-
/// \param HasNoDebugInfo Flag indicating the scan of instructions should be
85-
/// skipped as the function is known to have no debug-info.
86-
void convertToNewDbgValues(bool HasNoDebugInfo = false);
84+
void convertToNewDbgValues();
8785

8886
/// Convert variable location debugging information stored in DPMarkers and
8987
/// DPValues into the dbg.value intrinsic representation. Sets
9088
/// IsNewDbgInfoFormat = false.
91-
/// \param HasNoDebugInfo Flag indicating the scan of instructions should be
92-
/// skipped as the function is known to have no debug-info.
93-
void convertFromNewDbgValues(bool HasNoDebugInfo = false);
89+
void convertFromNewDbgValues();
9490

9591
/// Ensure the block is in "old" dbg.value format (\p NewFlag == false) or
9692
/// in the new format (\p NewFlag == true), converting to the desired format

llvm/lib/IR/BasicBlock.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,13 @@ DPMarker *BasicBlock::createMarker(InstListType::iterator It) {
6060
return DPM;
6161
}
6262

63-
void BasicBlock::convertToNewDbgValues(bool HasNoDebugInfo) {
63+
void BasicBlock::convertToNewDbgValues() {
6464
// Is the command line option set?
6565
if (!UseNewDbgInfoFormat)
6666
return;
6767

6868
IsNewDbgInfoFormat = true;
6969

70-
// If the caller knows there's no debug-info in this function, do nothing.
71-
if (HasNoDebugInfo)
72-
return;
73-
7470
// Iterate over all instructions in the instruction list, collecting dbg.value
7571
// instructions and converting them to DPValues. Once we find a "real"
7672
// instruction, attach all those DPValues to a DPMarker in that instruction.
@@ -97,14 +93,10 @@ void BasicBlock::convertToNewDbgValues(bool HasNoDebugInfo) {
9793
}
9894
}
9995

100-
void BasicBlock::convertFromNewDbgValues(bool HasNoDebugInfo) {
96+
void BasicBlock::convertFromNewDbgValues() {
10197
invalidateOrders();
10298
IsNewDbgInfoFormat = false;
10399

104-
// If the caller knows there's no debug-info in this function, do nothing.
105-
if (HasNoDebugInfo)
106-
return;
107-
108100
// Iterate over the block, finding instructions annotated with DPMarkers.
109101
// Convert any attached DPValues to dbg.values and insert ahead of the
110102
// instruction.

llvm/lib/IR/Function.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,15 @@ static cl::opt<unsigned> NonGlobalValueMaxNameSize(
8383

8484
void Function::convertToNewDbgValues() {
8585
IsNewDbgInfoFormat = true;
86-
bool HasNoDebugInfo = getSubprogram() == nullptr;
8786
for (auto &BB : *this) {
88-
BB.convertToNewDbgValues(HasNoDebugInfo);
87+
BB.convertToNewDbgValues();
8988
}
9089
}
9190

9291
void Function::convertFromNewDbgValues() {
9392
IsNewDbgInfoFormat = false;
94-
bool HasNoDebugInfo = getSubprogram() == nullptr;
9593
for (auto &BB : *this) {
96-
BB.convertFromNewDbgValues(HasNoDebugInfo);
94+
BB.convertFromNewDbgValues();
9795
}
9896
}
9997

0 commit comments

Comments
 (0)