Skip to content

Commit a6fe8c1

Browse files
Merge pull request #45 from adrian-prantl/fast-forward-fixup
Cherry-pick more commits
2 parents d07eb80 + 2121984 commit a6fe8c1

File tree

7 files changed

+158
-71
lines changed

7 files changed

+158
-71
lines changed

lld/test/COFF/s_udt.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,23 +173,23 @@ main: # @main
173173
.short 1 # Flags
174174
.asciz "argc"
175175
.Ltmp13:
176-
.cv_def_range .Ltmp0 .Ltmp1, "B\021\f\000\000\000"
176+
.cv_def_range .Ltmp0 .Ltmp1, frame_ptr_rel, 12
177177
.short .Ltmp15-.Ltmp14 # Record length
178178
.Ltmp14:
179179
.short 4414 # Record kind: S_LOCAL
180180
.long 4096 # TypeIndex
181181
.short 1 # Flags
182182
.asciz "argv"
183183
.Ltmp15:
184-
.cv_def_range .Ltmp0 .Ltmp1, "B\021\020\000\000\000"
184+
.cv_def_range .Ltmp0 .Ltmp1, frame_ptr_rel, 16
185185
.short .Ltmp17-.Ltmp16 # Record length
186186
.Ltmp16:
187187
.short 4414 # Record kind: S_LOCAL
188188
.long 4101 # TypeIndex
189189
.short 0 # Flags
190190
.asciz "SPtr"
191191
.Ltmp17:
192-
.cv_def_range .Ltmp0 .Ltmp1, "B\021\000\000\000\000"
192+
.cv_def_range .Ltmp0 .Ltmp1, frame_ptr_rel, 0
193193
.short .Ltmp19-.Ltmp18 # Record length
194194
.Ltmp18:
195195
.short 4360 # Record kind: S_UDT

lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ GlobalSSEC: # @GlobalSSEC
165165
.short 1 # Flags
166166
.asciz "argc"
167167
.Ltmp13:
168-
.cv_def_range .Ltmp0 .Ltmp1, "B\021\004\000\000\000"
168+
.cv_def_range .Ltmp0 .Ltmp1, frame_ptr_rel, 4
169169
.short .Ltmp15-.Ltmp14 # Record length
170170
.Ltmp14:
171171
.short 4414 # Record kind: S_LOCAL
172172
.long 4096 # TypeIndex
173173
.short 1 # Flags
174174
.asciz "argv"
175175
.Ltmp15:
176-
.cv_def_range .Ltmp0 .Ltmp1, "B\021\b\000\000\000"
176+
.cv_def_range .Ltmp0 .Ltmp1, frame_ptr_rel, 8
177177
.short 2 # Record length
178178
.short 4431 # Record kind: S_PROC_ID_END
179179
.Ltmp7:

lldb/scripts/generate-vers.pl

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

lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,14 +641,14 @@ VariableInfo lldb_private::npdb::GetVariableLocationInfo(
641641
llvm::StringRef program;
642642
if (GetFrameDataProgram(index, ranges, program)) {
643643
result.location =
644-
MakeVFrameRelLocationExpression(program, loc.Offset, module);
644+
MakeVFrameRelLocationExpression(program, loc.Hdr.Offset, module);
645645
result.ranges = std::move(ranges);
646646
} else {
647647
// invalid variable
648648
}
649649
} else {
650650
result.location =
651-
MakeRegRelLocationExpression(base_reg, loc.Offset, module);
651+
MakeRegRelLocationExpression(base_reg, loc.Hdr.Offset, module);
652652
result.ranges = std::move(ranges);
653653
}
654654
} else if (loc_specifier_cvs.kind() == S_DEFRANGE_REGISTER_REL) {

lldb/tools/debugserver/source/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,8 @@ endif()
140140

141141
set(DEBUGSERVER_VERS_GENERATED_FILE ${CMAKE_CURRENT_BINARY_DIR}/debugserver_vers.c)
142142
set_source_files_properties(${DEBUGSERVER_VERS_GENERATED_FILE} PROPERTIES GENERATED 1)
143-
144-
add_custom_command(OUTPUT ${DEBUGSERVER_VERS_GENERATED_FILE}
145-
COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
146-
${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj debugserver
147-
> ${DEBUGSERVER_VERS_GENERATED_FILE}
148-
DEPENDS ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl
149-
${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj
150-
)
143+
configure_file(debugserver_vers.c.in
144+
${DEBUGSERVER_VERS_GENERATED_FILE} @ONLY)
151145

152146
set(lldbDebugserverCommonSources
153147
DNBArch.cpp
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const unsigned char debugserverVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:LLDB PROJECT:lldb-@LLDB_VERSION_MAJOR@.@LLDB_VERSION_MINOR@.@LLDB_VERSION_PATCH@" "\n";
2+
const double debugserverVersionNumber __attribute__ ((used)) = (double)@LLDB_VERSION_MAJOR@.@LLDB_VERSION_MINOR@;

llvm/test/DebugInfo/COFF/nrvo.ll

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
; XFAIL: *
2+
; missing unidentified cherry-pick.
3+
4+
; RUN: llc < %s | FileCheck %s --check-prefix=ASM
5+
; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s --check-prefix=OBJ
6+
7+
; C++ source to regenerate:
8+
; struct Foo {
9+
; Foo() = default;
10+
; Foo(Foo &&other) { x = other.x; }
11+
; int x;
12+
; };
13+
; void some_function(int);
14+
; Foo getFoo() {
15+
; Foo foo;
16+
; foo.x = 41;
17+
; some_function(foo.x);
18+
; return foo;
19+
; }
20+
;
21+
; int main() {
22+
; Foo bar = getFoo();
23+
; return bar.x;
24+
; }
25+
; $ clang t.cpp -S -emit-llvm -g -o t.ll
26+
27+
; ASM-LABEL: .long 241 # Symbol subsection for GetFoo
28+
; ASM: .short 4414 # Record kind: S_LOCAL
29+
; ASM-NEXT: .long 4113 # TypeIndex
30+
; ASM-NEXT: .short 0 # Flags
31+
; ASM-NEXT: .asciz "foo"
32+
; ASM-NEXT: .p2align 2
33+
; ASM-NEXT: .Ltmp
34+
; ASM: .cv_def_range .Ltmp{{.*}} .Ltmp{{.*}}, frame_ptr_rel, 40
35+
36+
; OBJ: Subsection [
37+
; OBJ: SubSectionType: Symbols (0xF1)
38+
; OBJ: LocalSym {
39+
; OBJ: Kind: S_LOCAL (0x113E)
40+
; OBJ: Type: Foo& (0x1011)
41+
; OBJ: Flags [ (0x0)
42+
; OBJ: ]
43+
; OBJ: VarName: foo
44+
; OBJ: }
45+
; OBJ: DefRangeFramePointerRelSym {
46+
; OBJ: Kind: S_DEFRANGE_FRAMEPOINTER_REL (0x1142)
47+
; OBJ: Offset: 40
48+
; OBJ: LocalVariableAddrRange {
49+
; OBJ: OffsetStart: .text+0x1D
50+
; OBJ: ISectStart: 0x0
51+
; OBJ: Range: 0x16
52+
; OBJ: }
53+
54+
; ModuleID = 't.cpp'
55+
source_filename = "t.cpp"
56+
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
57+
target triple = "x86_64-pc-windows-msvc19.16.27030"
58+
59+
%struct.Foo = type { i32 }
60+
61+
; Function Attrs: noinline nounwind optnone uwtable
62+
define dso_local void @"?some_function@@YAXH@Z"(i32) #0 !dbg !8 {
63+
entry:
64+
%.addr = alloca i32, align 4
65+
store i32 %0, i32* %.addr, align 4
66+
call void @llvm.dbg.declare(metadata i32* %.addr, metadata !12, metadata !DIExpression()), !dbg !13
67+
ret void, !dbg !13
68+
}
69+
70+
; Function Attrs: nounwind readnone speculatable
71+
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
72+
73+
; Function Attrs: noinline nounwind optnone uwtable
74+
define dso_local void @"?GetFoo@@YA?AUFoo@@XZ"(%struct.Foo* noalias sret %agg.result) #0 !dbg !14 {
75+
entry:
76+
%result.ptr = alloca i8*, align 8
77+
%0 = bitcast %struct.Foo* %agg.result to i8*
78+
store i8* %0, i8** %result.ptr, align 8
79+
call void @llvm.dbg.declare(metadata i8** %result.ptr, metadata !28, metadata !DIExpression(DW_OP_deref)), !dbg !29
80+
%x = getelementptr inbounds %struct.Foo, %struct.Foo* %agg.result, i32 0, i32 0, !dbg !30
81+
store i32 41, i32* %x, align 4, !dbg !30
82+
%x1 = getelementptr inbounds %struct.Foo, %struct.Foo* %agg.result, i32 0, i32 0, !dbg !31
83+
%1 = load i32, i32* %x1, align 4, !dbg !31
84+
call void @"?some_function@@YAXH@Z"(i32 %1), !dbg !31
85+
ret void, !dbg !32
86+
}
87+
88+
; Function Attrs: noinline norecurse nounwind optnone uwtable
89+
define dso_local i32 @main() #2 !dbg !33 {
90+
entry:
91+
%retval = alloca i32, align 4
92+
%bar = alloca %struct.Foo, align 4
93+
store i32 0, i32* %retval, align 4
94+
call void @llvm.dbg.declare(metadata %struct.Foo* %bar, metadata !36, metadata !DIExpression()), !dbg !37
95+
call void @"?GetFoo@@YA?AUFoo@@XZ"(%struct.Foo* sret %bar), !dbg !37
96+
%x = getelementptr inbounds %struct.Foo, %struct.Foo* %bar, i32 0, i32 0, !dbg !38
97+
%0 = load i32, i32* %x, align 4, !dbg !38
98+
ret i32 %0, !dbg !38
99+
}
100+
101+
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
102+
attributes #1 = { nounwind readnone speculatable }
103+
attributes #2 = { noinline norecurse nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
104+
105+
!llvm.dbg.cu = !{!0}
106+
!llvm.module.flags = !{!3, !4, !5, !6}
107+
!llvm.ident = !{!7}
108+
109+
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 9.0.0 (https://github.com/llvm/llvm-project.git c19ebebac4bf853e77a69c74abe9f7fce98c1d17)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
110+
!1 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Ctesting\5Cnrvo", checksumkind: CSK_MD5, checksum: "52a5a20c02c102dfd255d5615680a8bd")
111+
!2 = !{}
112+
!3 = !{i32 2, !"CodeView", i32 1}
113+
!4 = !{i32 2, !"Debug Info Version", i32 3}
114+
!5 = !{i32 1, !"wchar_size", i32 2}
115+
!6 = !{i32 7, !"PIC Level", i32 2}
116+
!7 = !{!"clang version 9.0.0 (https://github.com/llvm/llvm-project.git c19ebebac4bf853e77a69c74abe9f7fce98c1d17)"}
117+
!8 = distinct !DISubprogram(name: "some_function", linkageName: "?some_function@@YAXH@Z", scope: !1, file: !1, line: 13, type: !9, scopeLine: 13, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
118+
!9 = !DISubroutineType(types: !10)
119+
!10 = !{null, !11}
120+
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
121+
!12 = !DILocalVariable(arg: 1, scope: !8, file: !1, line: 13, type: !11)
122+
!13 = !DILocation(line: 13, scope: !8)
123+
!14 = distinct !DISubprogram(name: "GetFoo", linkageName: "?GetFoo@@YA?AUFoo@@XZ", scope: !1, file: !1, line: 15, type: !15, scopeLine: 15, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
124+
!15 = !DISubroutineType(types: !16)
125+
!16 = !{!17}
126+
!17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: !1, line: 1, size: 32, flags: DIFlagTypePassByReference | DIFlagNonTrivial, elements: !18, identifier: ".?AUFoo@@")
127+
!18 = !{!19, !20, !24}
128+
!19 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !17, file: !1, line: 4, baseType: !11, size: 32)
129+
!20 = !DISubprogram(name: "Foo", scope: !17, file: !1, line: 2, type: !21, scopeLine: 2, flags: DIFlagPrototyped, spFlags: 0)
130+
!21 = !DISubroutineType(types: !22)
131+
!22 = !{null, !23}
132+
!23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !17, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
133+
!24 = !DISubprogram(name: "Foo", scope: !17, file: !1, line: 3, type: !25, scopeLine: 3, flags: DIFlagPrototyped, spFlags: 0)
134+
!25 = !DISubroutineType(types: !26)
135+
!26 = !{null, !23, !27}
136+
!27 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !17, size: 64)
137+
!28 = !DILocalVariable(name: "foo", scope: !14, file: !1, line: 17, type: !17)
138+
!29 = !DILocation(line: 17, scope: !14)
139+
!30 = !DILocation(line: 18, scope: !14)
140+
!31 = !DILocation(line: 19, scope: !14)
141+
!32 = !DILocation(line: 21, scope: !14)
142+
!33 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 23, type: !34, scopeLine: 23, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
143+
!34 = !DISubroutineType(types: !35)
144+
!35 = !{!11}
145+
!36 = !DILocalVariable(name: "bar", scope: !33, file: !1, line: 24, type: !17)
146+
!37 = !DILocation(line: 24, scope: !33)
147+
!38 = !DILocation(line: 25, scope: !33)

0 commit comments

Comments
 (0)