Skip to content

Commit 101216d

Browse files
authored
Revert "Emit DW_OP_lit0/1 for constant boolean values" (llvm#156172)
Reverts llvm#155539 Failing on buildbots with: ``` Step 7 (test-build-stage1-unified-tree-check-all) failure: test (failure) ******************** TEST 'LLVM :: DebugInfo/debug-bool-const-location.ll' FAILED ******************** Exit Code: 1 Command Output (stderr): -- /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage1/bin/llc /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/test/DebugInfo/debug-bool-const-location.ll -O3 -filetype=obj -o - | /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage1/bin/llvm-dwarfdump - | /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage1/bin/FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/test/DebugInfo/debug-bool-const-location.ll # RUN: at line 2 + /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage1/bin/llc /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/test/DebugInfo/debug-bool-const-location.ll -O3 -filetype=obj -o - + /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage1/bin/llvm-dwarfdump - + /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage1/bin/FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/test/DebugInfo/debug-bool-const-location.ll /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/test/DebugInfo/debug-bool-const-location.ll:7:10: error: CHECK: expected string not found in input ; CHECK: {{.*}} DW_OP_lit0 ^ <stdin>:27:54: note: scanning from here [0x0000000000000018, 0x0000000000000020): DW_OP_lit1, DW_OP_stack_value ^ <stdin>:28:41: note: possible intended match here [0x0000000000000020, 0x0000000000000034): DW_OP_reg3 X3) ^ Input file: <stdin> Check file: /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/test/DebugInfo/debug-bool-const-location.ll -dump-input=help explains the following input dump. Input was: <<<<<< . . . 22: DW_AT_decl_line (5) 23: DW_AT_external (true) 24: 25: 0x0000003f: DW_TAG_variable 26: DW_AT_location (0x00000000: 27: [0x0000000000000018, 0x0000000000000020): DW_OP_lit1, DW_OP_stack_value check:7'0 X~~~~~~~~~~~~~~~~~~~ error: no match found 28: [0x0000000000000020, 0x0000000000000034): DW_OP_reg3 X3) check:7'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ check:7'1 ? possible intended match 29: DW_AT_name ("arg") check:7'0 ~~~~~~~~~~~~~~~~~~~~ 30: DW_AT_decl_file ("test") check:7'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 31: DW_AT_decl_line (5) check:7'0 ~~~~~~~~~~~~~~~~~~~~~ 32: DW_AT_type (0x0000004f "bool") check:7'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33: check:7'0 ~ . ```
1 parent 1b37b9e commit 101216d

File tree

4 files changed

+2
-64
lines changed

4 files changed

+2
-64
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3111,10 +3111,8 @@ void DwarfDebug::emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT,
31113111
&AP](const DbgValueLocEntry &Entry,
31123112
DIExpressionCursor &Cursor) -> bool {
31133113
if (Entry.isInt()) {
3114-
if (BT && (BT->getEncoding() == dwarf::DW_ATE_boolean))
3115-
DwarfExpr.addBooleanConstant(Entry.getInt());
3116-
else if (BT && (BT->getEncoding() == dwarf::DW_ATE_signed ||
3117-
BT->getEncoding() == dwarf::DW_ATE_signed_char))
3114+
if (BT && (BT->getEncoding() == dwarf::DW_ATE_signed ||
3115+
BT->getEncoding() == dwarf::DW_ATE_signed_char))
31183116
DwarfExpr.addSignedConstant(Entry.getInt());
31193117
else
31203118
DwarfExpr.addUnsignedConstant(Entry.getInt());

llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,6 @@ void DwarfExpression::addStackValue() {
194194
emitOp(dwarf::DW_OP_stack_value);
195195
}
196196

197-
void DwarfExpression::addBooleanConstant(int64_t Value) {
198-
assert(isImplicitLocation() || isUnknownLocation());
199-
LocationKind = Implicit;
200-
if (Value == 0)
201-
emitOp(dwarf::DW_OP_lit0);
202-
else
203-
emitOp(dwarf::DW_OP_lit1);
204-
}
205-
206197
void DwarfExpression::addSignedConstant(int64_t Value) {
207198
assert(isImplicitLocation() || isUnknownLocation());
208199
LocationKind = Implicit;

llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,6 @@ class DwarfExpression {
229229
/// This needs to be called last to commit any pending changes.
230230
void finalize();
231231

232-
/// Emit a boolean constant.
233-
void addBooleanConstant(int64_t Value);
234-
235232
/// Emit a signed constant.
236233
void addSignedConstant(int64_t Value);
237234

llvm/test/DebugInfo/debug-bool-const-location.ll

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

0 commit comments

Comments
 (0)