Skip to content

Commit edd36e9

Browse files
committed
Move DW_OP_lit0/1 related change to separate PR
1 parent 143a30d commit edd36e9

File tree

5 files changed

+15
-82
lines changed

5 files changed

+15
-82
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,10 +3110,8 @@ void DwarfDebug::emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT,
31103110
&AP](const DbgValueLocEntry &Entry,
31113111
DIExpressionCursor &Cursor) -> bool {
31123112
if (Entry.isInt()) {
3113-
if (BT && (BT->getEncoding() == dwarf::DW_ATE_boolean))
3114-
DwarfExpr.addBooleanConstant(Entry.getInt());
3115-
else if (BT && (BT->getEncoding() == dwarf::DW_ATE_signed ||
3116-
BT->getEncoding() == dwarf::DW_ATE_signed_char))
3113+
if (BT && (BT->getEncoding() == dwarf::DW_ATE_signed ||
3114+
BT->getEncoding() == dwarf::DW_ATE_signed_char))
31173115
DwarfExpr.addSignedConstant(Entry.getInt());
31183116
else
31193117
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/NVPTX/debug-bool-const-location.ll

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
; RUN: llc < %s -asm-verbose -mattr=+ptx76 | FileCheck %s
2-
; RUN: %if ptxas %{ llc < %s -asm-verbose -mattr=+ptx76 | %ptxas-verify %}
1+
; REQUIRES: object-emission
2+
; RUN: %llc_dwarf %s -filetype=obj -o - | llvm-dwarfdump - | FileCheck %s
33

4-
target triple = "nvptx64-nvidia-cuda"
5-
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-i128:128:128-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
64

7-
; CHECK: {{.*}}section {{.*}}debug_info
85
; CHECK: {{.*}}DW_TAG_variable
9-
; CHECK-NEXT: {{.*}} DW_AT_address_class
10-
; CHECK-NEXT: .b8 1{{.*}} DW_AT_const_value
11-
; CHECK-NEXT: {{.*}} DW_AT_name
6+
; CHECK-NEXT: {{.*}} DW_AT_name ("global_bool_const")
7+
; CHECK: {{.*}} DW_AT_const_value (1)
8+
; CHECK: {{.*}}DW_TAG_variable
9+
; CHECK-NEXT: {{.*}} DW_AT_const_value (1)
10+
; CHECK-NEXT: {{.*}} DW_AT_name ("arg")
1211

1312
define void @test() !dbg !5
1413
{
1514
entry:
16-
%arg = alloca i1
17-
store i1 true, i1* %arg, !dbg !6
1815
call void @"llvm.dbg.value"(metadata i1 true, metadata !7, metadata !8), !dbg !6
1916
ret void, !dbg !6
2017
}
@@ -23,15 +20,16 @@ declare void @"llvm.dbg.value"(metadata %".1", metadata %".2", metadata %".3")
2320

2421
!llvm.dbg.cu = !{ !2 }
2522
!llvm.module.flags = !{ !9, !10 }
26-
!nvvm.annotations = !{}
27-
28-
!1 = !DIFile(directory: "/source/dir", filename: "test.cu")
29-
!2 = distinct !DICompileUnit(emissionKind: FullDebug, file: !1, isOptimized: false, language: DW_LANG_C_plus_plus, runtimeVersion: 0)
23+
!0 = !{ !11 }
24+
!1 = !DIFile(directory: "", filename: "test")
25+
!2 = distinct !DICompileUnit(emissionKind: FullDebug, file: !1, isOptimized: false, language: DW_LANG_C_plus_plus, runtimeVersion: 0, globals: !0)
3026
!3 = !DIBasicType(encoding: DW_ATE_boolean, name: "bool", size: 8)
3127
!4 = !DISubroutineType(types: !{null})
3228
!5 = distinct !DISubprogram(file: !1, isDefinition: true, isLocal: false, isOptimized: false, line: 5, linkageName: "test", name: "test", scope: !1, scopeLine: 5, type: !4, unit: !2)
3329
!6 = !DILocation(column: 1, line: 5, scope: !5)
3430
!7 = !DILocalVariable(arg: 0, file: !1, line: 5, name: "arg", scope: !5, type: !3)
3531
!8 = !DIExpression()
3632
!9 = !{ i32 2, !"Dwarf Version", i32 4 }
37-
!10 = !{ i32 2, !"Debug Info Version", i32 3 }
33+
!10 = !{ i32 2, !"Debug Info Version", i32 3 }
34+
!11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression(DW_OP_consts, 18446744073709551615, DW_OP_stack_value))
35+
!12 = distinct !DIGlobalVariable(name: "global_bool_const", scope: !2, file: !1, line: 1, type: !3, isLocal: false, isDefinition: true)

0 commit comments

Comments
 (0)