Imported Upstream version 5.18.0.234

Former-commit-id: 8071ec1a8c5eaa9be24b41745add19297608001f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-01-08 08:22:36 +00:00
parent f32dbaf0b2
commit 212f6bafcb
28494 changed files with 359 additions and 3867025 deletions

View File

@@ -1,64 +0,0 @@
; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
; C++ source to regenerate:
; struct S {
; int x;
; struct { int a; } ;
; } s;
; CHECK: CodeViewTypes [
; CHECK: FieldList ([[S_fl:.*]]) {
; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK: DataMember {
; CHECK: Type: int (0x74)
; CHECK: FieldOffset: 0x0
; CHECK: Name: x
; CHECK: }
; CHECK: DataMember {
; CHECK: Type: int (0x74)
; CHECK: FieldOffset: 0x4
; CHECK: Name: a
; CHECK: }
; CHECK: }
; CHECK: Struct ({{.*}}) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 2
; CHECK: Properties [ (0x0)
; CHECK: ]
; CHECK: FieldList: <field list> ([[S_fl]])
; CHECK: SizeOf: 8
; CHECK: Name: S
; CHECK: }
source_filename = "test/DebugInfo/COFF/anonymous-struct.ll"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-pc-windows-msvc18.0.0"
%struct.S = type { i32, %struct.anon }
%struct.anon = type { i32 }
@s = common global %struct.S zeroinitializer, align 4, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!15, !16}
!llvm.ident = !{!17}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "s", scope: !2, file: !6, line: 5, type: !7, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 274261) (llvm/trunk 274262)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "-", directory: "/usr/local/google/home/majnemer/llvm/src")
!4 = !{}
!5 = !{!0}
!6 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !6, line: 2, size: 64, align: 32, elements: !8)
!8 = !{!9, !11}
!9 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !7, file: !6, line: 3, baseType: !10, size: 32, align: 32)
!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!11 = !DIDerivedType(tag: DW_TAG_member, scope: !7, file: !6, line: 4, baseType: !12, size: 32, align: 32, offset: 32)
!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !7, file: !6, line: 4, size: 32, align: 32, elements: !13)
!13 = !{!14}
!14 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !12, file: !6, line: 4, baseType: !10, size: 32, align: 32)
!15 = !{i32 2, !"CodeView", i32 1}
!16 = !{i32 2, !"Debug Info Version", i32 3}
!17 = !{!"clang version 3.9.0 (trunk 274261) (llvm/trunk 274262)"}

View File

@@ -1,96 +0,0 @@
; This tests that emitting CodeView arrays doesn't assert when an ODR violation
; makes our array dimension size calculations inaccurate. (PR32383)
; Here was the scenario:
; $ cat a.cpp
; typedef union YYSTYPE { int x; } YYSTYPE;
; YYSTYPE a;
; $ cat b.cpp
; typedef union YYSTYPE { char x; } YYSTYPE;
; void fn1() { YYSTYPE a[1]; }
; $ clang-cl -c -Zi -flto a.cpp b.cpp
; $ llvm-link a.obj b.obj -S -o t.ll # This is the test case IR.
; $ llc t.ll # Used to assert
; RUN: llc < %s | FileCheck %s
; FIXME: sizeof(a) in the user program is 1, but we claim it is 4 because
; sometimes the frontend lies to us. See array-types-advanced.ll for an example.
;
; CHECK: Array ({{.*}}) {
; CHECK: TypeLeafKind: LF_ARRAY (0x1503)
; CHECK: ElementType: YYSTYPE ({{.*}})
; CHECK: IndexType: unsigned __int64 (0x23)
; CHECK: SizeOf: 4
; CHECK: Name:
; CHECK: }
; sizeof(YYSTYPE) == 4
; CHECK: Union ({{.*}}) {
; CHECK: TypeLeafKind: LF_UNION (0x1506)
; CHECK: MemberCount: 1
; CHECK: Properties [ (0x600)
; CHECK: HasUniqueName (0x200)
; CHECK: Sealed (0x400)
; CHECK: ]
; CHECK: FieldList: <field list>
; CHECK: SizeOf: 4
; CHECK: Name: YYSTYPE
; CHECK: LinkageName: .?ATYYSTYPE@@
; CHECK: }
; ModuleID = 'llvm-link'
source_filename = "llvm-link"
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.10.24728"
%union.YYSTYPE = type { i32 }
%union.YYSTYPE.0 = type { i8 }
@"\01?a@@3TYYSTYPE@@A" = global %union.YYSTYPE zeroinitializer, align 4, !dbg !0
; Function Attrs: noinline nounwind sspstrong uwtable
define void @"\01?fn1@@YAXXZ"() #0 !dbg !21 {
entry:
%a = alloca [1 x %union.YYSTYPE.0], align 1
call void @llvm.dbg.declare(metadata [1 x %union.YYSTYPE.0]* %a, metadata !24, metadata !29), !dbg !30
ret void, !dbg !30
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
attributes #0 = { noinline nounwind sspstrong uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "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"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = !{!2, !11}
!llvm.ident = !{!13, !13}
!llvm.module.flags = !{!18, !19, !20}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "a", linkageName: "\01?a@@3TYYSTYPE@@A", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 5.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "a.cpp", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "c0005139aa3df153c30d8c6953390a4b")
!4 = !{}
!5 = !{!0}
!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "YYSTYPE", file: !3, line: 1, baseType: !7)
!7 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "YYSTYPE", file: !3, line: 1, size: 32, elements: !8, identifier: ".?ATYYSTYPE@@")
!8 = !{!9}
!9 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !7, file: !3, line: 1, baseType: !10, size: 32)
!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!11 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !12, producer: "clang version 5.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)
!12 = !DIFile(filename: "b.cpp", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "9cfd390d8827beab36769147bb037abc")
!13 = !{!"clang version 5.0.0 "}
!18 = !{i32 2, !"CodeView", i32 1}
!19 = !{i32 2, !"Debug Info Version", i32 3}
!20 = !{i32 1, !"PIC Level", i32 2}
!21 = distinct !DISubprogram(name: "fn1", linkageName: "\01?fn1@@YAXXZ", scope: !12, file: !12, line: 2, type: !22, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !11, variables: !4)
!22 = !DISubroutineType(types: !23)
!23 = !{null}
!24 = !DILocalVariable(name: "a", scope: !21, file: !12, line: 2, type: !25)
!25 = !DICompositeType(tag: DW_TAG_array_type, baseType: !26, size: 8, elements: !27)
!26 = !DIDerivedType(tag: DW_TAG_typedef, name: "YYSTYPE", file: !12, line: 1, baseType: !7)
!27 = !{!28}
!28 = !DISubrange(count: 1)
!29 = !DIExpression()
!30 = !DILocation(line: 2, scope: !21)

View File

@@ -1,94 +0,0 @@
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
; This LL file was generated by running clang on the following code with
; -fsanitize=address
; D:\asan.c:
; 1 int foo(void) {
; 2 return 0;
; 3 }
; The module ctor has no debug info. All we have to do is don't crash.
; X86: _asan.module_ctor:
; X86-NEXT: L{{.*}}:
; X86: # %bb.
; X86-NEXT: calll ___asan_init_v3
; X86-NEXT: retl
; Make sure we don't put any DWARF debug info for ASan-instrumented modules.
; X86-NOT: DWARF
; ModuleID = 'asan.c'
target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
target triple = "i686-pc-win32"
@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }]
; Function Attrs: nounwind sanitize_address
define i32 @foo() #0 !dbg !4 {
entry:
ret i32 0, !dbg !10
}
define internal void @asan.module_ctor() {
call void @__asan_init_v3()
ret void
}
declare void @__asan_init_v3()
declare void @__asan_report_load1(i32)
declare void @__asan_report_load2(i32)
declare void @__asan_report_load4(i32)
declare void @__asan_report_load8(i32)
declare void @__asan_report_load16(i32)
declare void @__asan_report_store1(i32)
declare void @__asan_report_store2(i32)
declare void @__asan_report_store4(i32)
declare void @__asan_report_store8(i32)
declare void @__asan_report_store16(i32)
declare void @__asan_report_load_n(i32, i32)
declare void @__asan_report_store_n(i32, i32)
declare void @__asan_handle_no_return()
declare void @__sanitizer_cov()
declare void @__sanitizer_ptr_cmp(i32, i32)
declare void @__sanitizer_ptr_sub(i32, i32)
declare void @__asan_before_dynamic_init(i32)
declare void @__asan_after_dynamic_init()
declare void @__asan_register_globals(i32, i32)
declare void @__asan_unregister_globals(i32, i32)
attributes #0 = { nounwind sanitize_address "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!7, !8}
!llvm.ident = !{!9}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: LineTablesOnly, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
!1 = !DIFile(filename: "asan.c", directory: "D:\5C")
!2 = !{}
!4 = distinct !DISubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, variables: !2)
!5 = !DIFile(filename: "asan.c", directory: "D:C")
!6 = !DISubroutineType(types: !2)
!7 = !{i32 2, !"CodeView", i32 1}
!8 = !{i32 1, !"Debug Info Version", i32 3}
!9 = !{!"clang version 3.5.0 "}
!10 = !DILocation(line: 2, scope: !4)

View File

@@ -1,53 +0,0 @@
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
; This LL file was generated by running clang on the following code with
; -fsanitize=address
; D:\asan.c:
; 1 unsigned char c = 42;
;
; This file defines no functions, so just make sure we don't try to emit
; the line table for functions of zero size.
; X86-NOT: .section .debug$S,"rn"
; ModuleID = 'asan.c'
target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
target triple = "i686-pc-win32"
@c = global { i8, [63 x i8] } { i8 42, [63 x i8] zeroinitializer }, align 32
@llvm.global_ctors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_ctor }]
@__asan_gen_ = private constant [7 x i8] c"asan.c\00", align 1
@__asan_gen_1 = private unnamed_addr constant [2 x i8] c"c\00", align 1
@0 = internal global [1 x { i32, i32, i32, i32, i32, i32 }] [{ i32, i32, i32, i32, i32, i32 } { i32 ptrtoint ({ i8, [63 x i8] }* @c to i32), i32 1, i32 64, i32 ptrtoint ([2 x i8]* @__asan_gen_1 to i32), i32 ptrtoint ([7 x i8]* @__asan_gen_ to i32), i32 0 }]
@llvm.global_dtors = appending global [1 x { i32, void ()* }] [{ i32, void ()* } { i32 1, void ()* @asan.module_dtor }]
define internal void @asan.module_ctor() {
call void @__asan_init_v3()
call void @__asan_register_globals(i32 ptrtoint ([1 x { i32, i32, i32, i32, i32, i32 }]* @0 to i32), i32 1)
ret void
}
declare void @__asan_init_v3()
declare void @__asan_before_dynamic_init(i32)
declare void @__asan_after_dynamic_init()
declare void @__asan_register_globals(i32, i32)
declare void @__asan_unregister_globals(i32, i32)
define internal void @asan.module_dtor() {
call void @__asan_unregister_globals(i32 ptrtoint ([1 x { i32, i32, i32, i32, i32, i32 }]* @0 to i32), i32 1)
ret void
}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: LineTablesOnly, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
!1 = !DIFile(filename: "asan.c", directory: "D:\5C")
!2 = !{}
!3 = !{i32 2, !"CodeView", i32 1}
!4 = !{i32 1, !"Debug Info Version", i32 3}
!5 = !{!"clang version 3.5.0 "}

View File

@@ -1,167 +0,0 @@
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview | FileCheck --check-prefix=OBJ32 %s
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview | FileCheck --check-prefix=OBJ64 %s
; This LL file was generated by running clang on the following code:
; D:\asm.c:
; 1 void g(void);
; 2
; 3 void f(void) {
; 4 __asm align 4;
; 5 g();
; 6 }
; X86-LABEL: _f:
; X86: .cv_file 1 "D:\\asm.c"
; X86: .cv_loc 0 1 4 0 is_stmt 0
; X86: .cv_loc 0 1 5 0
; X86: calll _g
; X86: .cv_loc 0 1 6 0
; X86: ret
; X86: [[END_OF_F:.?Lfunc_end.*]]:
; Line table
; X86: .cv_linetable 0, _f, [[END_OF_F]]
; File index to string table offset subsection
; X86-NEXT: .cv_filechecksums
; String table
; X86-NEXT: .cv_stringtable
; OBJ32: Section {
; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53)
; OBJ32: Characteristics [ (0x42300040)
; OBJ32: ]
; OBJ32: CodeViewDebugInfo [
; OBJ32: Subsection [
; OBJ32-NEXT: SubSectionType: Symbols (0xF1)
; OBJ32: {{.*}}Proc{{.*}}Sym {
; OBJ32: CodeSize: 0x6
; OBJ32: DisplayName: f
; OBJ32: LinkageName: _f
; OBJ32: }
; OBJ32: ProcEnd {
; OBJ32: }
; OBJ32-NEXT: ]
; OBJ32: FunctionLineTable [
; OBJ32-NEXT: Name: _f
; OBJ32-NEXT: Flags: 0x0
; OBJ32-NEXT: CodeSize: 0x6
; OBJ32-NEXT: FilenameSegment [
; OBJ32-NEXT: Filename: D:\asm.c
; FIXME: An empty __asm stmt creates an extra entry.
; We seem to know that these offsets are the same statically during the
; execution of endModule(). See PR18679 for the details.
; OBJ32-NEXT: +0x0 [
; OBJ32-NEXT: LineNumberStart: 4
; OBJ32-NEXT: LineNumberEndDelta: 0
; OBJ32-NEXT: IsStatement: No
; OBJ32-NEXT: ]
; OBJ32-NEXT: +0x0 [
; OBJ32-NEXT: LineNumberStart: 5
; OBJ32-NEXT: LineNumberEndDelta: 0
; OBJ32-NEXT: IsStatement: No
; OBJ32-NEXT: ]
; OBJ32-NEXT: +0x5 [
; OBJ32-NEXT: LineNumberStart: 6
; OBJ32-NEXT: LineNumberEndDelta: 0
; OBJ32-NEXT: IsStatement: No
; OBJ32-NEXT: ]
; OBJ32-NEXT: ]
; X64-LABEL: f:
; X64: .cv_file 1 "D:\\asm.c"
; X64: .cv_loc 0 1 3 0 is_stmt 0
; X64: subq $40, %rsp
; X64: .cv_loc 0 1 4 0
; X64: .cv_loc 0 1 5 0
; X64: callq g
; X64: .cv_loc 0 1 6 0
; X64: addq $40, %rsp
; X64-NEXT: ret
; X64: [[END_OF_F:.?Lfunc_end.*]]:
; Line table
; X64: .cv_linetable 0, f, [[END_OF_F]]
; File index to string table offset subsection
; X64-NEXT: .cv_filechecksums
; String table
; X64-NEXT: .cv_stringtable
; OBJ64: Section {
; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53)
; OBJ64: Characteristics [ (0x42300040)
; OBJ64: ]
; OBJ64: Subsection [
; OBJ64-NEXT: SubSectionType: Symbols (0xF1)
; OBJ64: {{.*}}Proc{{.*}}Sym {
; OBJ64: CodeSize: 0xE
; OBJ64: DisplayName: f
; OBJ64: LinkageName: f
; OBJ64: }
; OBJ64-NEXT: ProcEnd {
; OBJ64: }
; OBJ64-NEXT: ]
; OBJ64: FunctionLineTable [
; OBJ64-NEXT: Name: f
; OBJ64-NEXT: Flags: 0x0
; OBJ64-NEXT: CodeSize: 0xE
; OBJ64-NEXT: FilenameSegment [
; OBJ64-NEXT: Filename: D:\asm.c
; FIXME: An empty __asm stmt creates an extra entry.
; See PR18679 for the details.
; OBJ64-NEXT: +0x0 [
; OBJ64-NEXT: LineNumberStart: 3
; OBJ64-NEXT: LineNumberEndDelta: 0
; OBJ64-NEXT: IsStatement: No
; OBJ64-NEXT: ]
; OBJ64-NEXT: +0x4 [
; OBJ64-NEXT: LineNumberStart: 4
; OBJ64-NEXT: LineNumberEndDelta: 0
; OBJ64-NEXT: IsStatement: No
; OBJ64-NEXT: ]
; OBJ64-NEXT: +0x4 [
; OBJ64-NEXT: LineNumberStart: 5
; OBJ64-NEXT: LineNumberEndDelta: 0
; OBJ64-NEXT: IsStatement: No
; OBJ64-NEXT: ]
; OBJ64-NEXT: +0x9 [
; OBJ64-NEXT: LineNumberStart: 6
; OBJ64-NEXT: LineNumberEndDelta: 0
; OBJ64-NEXT: IsStatement: No
; OBJ64-NEXT: ]
; OBJ64-NEXT: ]
; OBJ64-NEXT: ]
; Function Attrs: nounwind
define void @f() #0 !dbg !4 {
entry:
call void asm sideeffect inteldialect ".align 4", "~{dirflag},~{fpsr},~{flags}"() #2, !dbg !12
call void @g(), !dbg !13
ret void, !dbg !14
}
declare void @g() #1
attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!9, !10}
!llvm.ident = !{!11}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
!1 = !DIFile(filename: "<unknown>", directory: "D:\5C")
!2 = !{}
!4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2)
!5 = !DIFile(filename: "asm.c", directory: "D:\5C")
!6 = !DIFile(filename: "asm.c", directory: "D:C")
!7 = !DISubroutineType(types: !8)
!8 = !{null}
!9 = !{i32 2, !"CodeView", i32 1}
!10 = !{i32 1, !"Debug Info Version", i32 3}
!11 = !{!"clang version 3.5 "}
!12 = !DILocation(line: 4, scope: !4)
!13 = !DILocation(line: 5, scope: !4)
!14 = !DILocation(line: 6, scope: !4)

View File

@@ -1 +0,0 @@
d0096622ca8d7d695072a060e4c8364150698b29

View File

@@ -1,233 +0,0 @@
; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
; C++ source to regenerate:
; $ cat t.cpp
; #pragma pack(1)
; struct S0 {
; char : 8;
; short : 8;
; short x : 8;
; } s0;
;
; #pragma pack(1)
; struct S1 {
; char x1[2];
; char x2;
; int y : 23;
; int z : 23;
; int w : 2;
; struct { char c; short s; } v;
; short u : 3;
; } s1;
;
; #pragma pack(1)
; struct S2 {
; char : 0;
; int y : 1;
; } s2;
; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
; CHECK: CodeViewTypes [
; CHECK: BitField ([[S0_x:.*]]) {
; CHECK: TypeLeafKind: LF_BITFIELD (0x1205)
; CHECK: Type: short (0x11)
; CHECK: BitSize: 8
; CHECK: BitOffset: 8
; CHECK: }
; CHECK: FieldList ([[S0_fl:.*]]) {
; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK: DataMember {
; CHECK: Type: [[S0_x:.*]]
; CHECK: FieldOffset: 0x1
; CHECK: Name: x
; CHECK: }
; CHECK: }
; CHECK: Struct ({{.*}}) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 1
; CHECK: Properties [ (0x0)
; CHECK: ]
; CHECK: FieldList: <field list> ([[S0_fl]])
; CHECK: SizeOf: 3
; CHECK: Name: S0
; CHECK: }
; CHECK: BitField ([[S1_y_z:.*]]) {
; CHECK: TypeLeafKind: LF_BITFIELD (0x1205)
; CHECK: Type: int (0x74)
; CHECK: BitSize: 23
; CHECK: BitOffset: 0
; CHECK: }
; CHECK: BitField ([[S1_w:.*]]) {
; CHECK: TypeLeafKind: LF_BITFIELD (0x1205)
; CHECK: Type: int (0x74)
; CHECK: BitSize: 2
; CHECK: BitOffset: 23
; CHECK: }
; CHECK: Struct ([[anon_ty:.*]]) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 0
; CHECK: Properties [ (0x88)
; CHECK: ForwardReference (0x80)
; CHECK: Nested (0x8)
; CHECK: ]
; CHECK: FieldList: 0x0
; CHECK: SizeOf: 0
; CHECK: Name: S1::<unnamed-tag>
; CHECK: }
; CHECK: BitField ([[S1_u:.*]]) {
; CHECK: TypeLeafKind: LF_BITFIELD (0x1205)
; CHECK: Type: short (0x11)
; CHECK: BitSize: 3
; CHECK: BitOffset: 0
; CHECK: }
; CHECK: FieldList ([[S1_fl:.*]]) {
; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK: DataMember {
; CHECK: FieldOffset: 0x0
; CHECK: Name: x1
; CHECK: }
; CHECK: DataMember {
; CHECK: Type: char (0x70)
; CHECK: FieldOffset: 0x2
; CHECK: Name: x2
; CHECK: }
; CHECK: DataMember {
; CHECK: Type: [[S1_y_z]]
; CHECK: FieldOffset: 0x3
; CHECK: Name: y
; CHECK: }
; CHECK: DataMember {
; CHECK: Type: [[S1_y_z]]
; CHECK: FieldOffset: 0x7
; CHECK: Name: z
; CHECK: }
; CHECK: DataMember {
; CHECK: Type: [[S1_w]]
; CHECK: FieldOffset: 0x7
; CHECK: Name: w
; CHECK: }
; CHECK: DataMember {
; CHECK: Type: S1::<unnamed-tag> ([[anon_ty]])
; CHECK: FieldOffset: 0xB
; CHECK: Name: v
; CHECK: }
; CHECK: DataMember {
; CHECK: Type: [[S1_u]]
; CHECK: FieldOffset: 0xE
; CHECK: Name: u
; CHECK: }
; CHECK: }
; CHECK: Struct ({{.*}}) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 7
; CHECK: Properties [ (0x0)
; CHECK: ]
; CHECK: FieldList: <field list> ([[S1_fl]])
; CHECK: SizeOf: 16
; CHECK: Name: S1
; CHECK: }
; CHECK: FieldList ([[anon_fl:.*]]) {
; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK: DataMember {
; CHECK: Type: char (0x70)
; CHECK: FieldOffset: 0x0
; CHECK: Name: c
; CHECK: }
; CHECK: DataMember {
; CHECK: Type: short (0x11)
; CHECK: FieldOffset: 0x1
; CHECK: Name: s
; CHECK: }
; CHECK: }
; CHECK: Struct ({{.*}}) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 2
; CHECK: Properties [ (0x8)
; CHECK: Nested (0x8)
; CHECK: ]
; CHECK: FieldList: <field list> ([[anon_fl]])
; CHECK: SizeOf: 3
; CHECK: Name: S1::<unnamed-tag>
; CHECK: }
; CHECK: BitField ([[S2_y:.*]]) {
; CHECK: TypeLeafKind: LF_BITFIELD (0x1205)
; CHECK: Type: int (0x74)
; CHECK: BitSize: 1
; CHECK: BitOffset: 0
; CHECK: }
; CHECK: FieldList ([[S2_fl:.*]]) {
; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK: DataMember {
; CHECK: Type: [[S2_y]]
; CHECK: FieldOffset: 0x0
; CHECK: Name: y
; CHECK: }
; CHECK: }
; CHECK: Struct ({{.*}}) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 1
; CHECK: Properties [ (0x0)
; CHECK: ]
; CHECK: FieldList: <field list> ([[S2_fl]])
; CHECK: SizeOf: 4
; CHECK: Name: S2
; CHECK: }
source_filename = "test/DebugInfo/COFF/bitfields.ll"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "x86_64-pc-windows-msvc18.0.0"
%struct.S0 = type <{ i8, i16 }>
%struct.S1 = type <{ [2 x i8], i8, i32, i32, %struct.anon, i16 }>
%struct.anon = type <{ i8, i16 }>
%struct.S2 = type { i32 }
@s0 = common global %struct.S0 zeroinitializer, align 1, !dbg !0
@s1 = common global %struct.S1 zeroinitializer, align 1, !dbg !6
@s2 = common global %struct.S2 zeroinitializer, align 1, !dbg !28
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!36, !37, !38}
!llvm.ident = !{!39}
!0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "s0", scope: !2, file: !8, line: 7, type: !33, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.9.0 (trunk 273812) (llvm/trunk 273843)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "-", directory: "/usr/local/google/home/majnemer/llvm/src")
!4 = !{}
!5 = !{!0, !6, !28}
!6 = distinct !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
!7 = !DIGlobalVariable(name: "s1", scope: !2, file: !8, line: 18, type: !9, isLocal: false, isDefinition: true)
!8 = !DIFile(filename: "<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S1", file: !8, line: 10, size: 128, elements: !10)
!10 = !{!11, !16, !17, !19, !20, !21, !27}
!11 = !DIDerivedType(tag: DW_TAG_member, name: "x1", scope: !9, file: !8, line: 11, baseType: !12, size: 16)
!12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 16, elements: !14)
!13 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
!14 = !{!15}
!15 = !DISubrange(count: 2)
!16 = !DIDerivedType(tag: DW_TAG_member, name: "x2", scope: !9, file: !8, line: 12, baseType: !13, size: 8, offset: 16)
!17 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !9, file: !8, line: 13, baseType: !18, size: 23, offset: 24, flags: DIFlagBitField, extraData: i64 24)
!18 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!19 = !DIDerivedType(tag: DW_TAG_member, name: "z", scope: !9, file: !8, line: 14, baseType: !18, size: 23, offset: 56, flags: DIFlagBitField, extraData: i64 56)
!20 = !DIDerivedType(tag: DW_TAG_member, name: "w", scope: !9, file: !8, line: 15, baseType: !18, size: 2, offset: 79, flags: DIFlagBitField, extraData: i64 56)
!21 = !DIDerivedType(tag: DW_TAG_member, name: "v", scope: !9, file: !8, line: 16, baseType: !22, size: 24, offset: 88)
!22 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !9, file: !8, line: 16, size: 24, elements: !23)
!23 = !{!24, !25}
!24 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !22, file: !8, line: 16, baseType: !13, size: 8)
!25 = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: !22, file: !8, line: 16, baseType: !26, size: 16, offset: 8)
!26 = !DIBasicType(name: "short", size: 16, encoding: DW_ATE_signed)
!27 = !DIDerivedType(tag: DW_TAG_member, name: "u", scope: !9, file: !8, line: 17, baseType: !26, size: 3, offset: 112, flags: DIFlagBitField, extraData: i64 112)
!28 = distinct !DIGlobalVariableExpression(var: !29, expr: !DIExpression())
!29 = !DIGlobalVariable(name: "s2", scope: !2, file: !8, line: 24, type: !30, isLocal: false, isDefinition: true)
!30 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S2", file: !8, line: 21, size: 32, elements: !31)
!31 = !{!32}
!32 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !30, file: !8, line: 23, baseType: !18, size: 1, flags: DIFlagBitField, extraData: i64 0)
!33 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S0", file: !8, line: 3, size: 24, elements: !34)
!34 = !{!35}
!35 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !33, file: !8, line: 6, baseType: !26, size: 8, offset: 16, flags: DIFlagBitField, extraData: i64 8)
!36 = !{i32 2, !"CodeView", i32 1}
!37 = !{i32 2, !"Debug Info Version", i32 3}
!38 = !{i32 1, !"PIC Level", i32 2}
!39 = !{!"clang version 3.9.0 (trunk 273812) (llvm/trunk 273843)"}

View File

@@ -1,196 +0,0 @@
; RUN: llc < %s | FileCheck %s
; Verify that we get *two* .debug$S sections, the main one describing bar and
; main, and one for f and fin$f, which is comdat with f.
; Start in the main symbol section describing bar and main.
; CHECK: .section .debug$S,"dr"{{$}}
; CHECK: .long 4 # Debug section magic
; CHECK: # Symbol subsection for bar
; CHECK-NOT: Debug section magic
; CHECK: # Symbol subsection for main
; Emit symbol info for f and its associated code in a separate associated
; section.
; CHECK: .section .debug$S,"dr",associative,f{{$}}
; CHECK: .long 4 # Debug section magic
; CHECK: # Symbol subsection for f
; CHECK-NOT: Debug section magic
; CHECK: # Symbol subsection for ?fin$0@0@f@@
; Switch back to the main section for the shared file checksum table and string
; table.
; CHECK: .section .debug$S,"dr"{{$}}
; CHECK-NOT: Debug section magic
; CHECK: .cv_filechecksums
; CHECK: .cv_stringtable
; CHECK-NOT: .section .debug$S,
; Generated with this C++ source:
; void foo();
; void bar();
; extern volatile int x;
; inline void __declspec(noinline) f(bool c) {
; x++;
; if (c) {
; __try {
; foo();
; } __finally {
; x++;
; }
; } else
; bar();
; x++;
; }
; void bar() {
; x++;
; }
; int main() {
; f(true);
; }
; ModuleID = 't.cpp'
source_filename = "t.cpp"
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.0.23918"
$f = comdat any
@x = external global i32, align 4
; Function Attrs: norecurse nounwind uwtable
define void @bar() #0 !dbg !7 {
entry:
%0 = load volatile i32, i32* @x, align 4, !dbg !10, !tbaa !11
%inc = add nsw i32 %0, 1, !dbg !10
store volatile i32 %inc, i32* @x, align 4, !dbg !10, !tbaa !11
ret void, !dbg !15
}
; Function Attrs: nounwind uwtable
define i32 @main() #1 !dbg !16 {
entry:
tail call void @f(i32 1), !dbg !20
ret i32 0, !dbg !21
}
; Function Attrs: inlinehint noinline nounwind uwtable
define linkonce_odr void @f(i32 %c) #2 comdat personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) !dbg !22 {
entry:
tail call void @llvm.dbg.value(metadata i32 %c, metadata !26, metadata !27), !dbg !28
%0 = load volatile i32, i32* @x, align 4, !dbg !29, !tbaa !11
%inc = add nsw i32 %0, 1, !dbg !29
store volatile i32 %inc, i32* @x, align 4, !dbg !29, !tbaa !11
%tobool = icmp eq i32 %c, 0, !dbg !30
br i1 %tobool, label %if.else, label %if.then, !dbg !32
if.then: ; preds = %entry
invoke void bitcast (void (...)* @foo to void ()*)() #6
to label %invoke.cont unwind label %ehcleanup, !dbg !33
invoke.cont: ; preds = %if.then
tail call fastcc void @"\01?fin$0@0@f@@"() #7, !dbg !36
br label %if.end, !dbg !37
ehcleanup: ; preds = %if.then
%1 = cleanuppad within none [], !dbg !36
tail call fastcc void @"\01?fin$0@0@f@@"() #7 [ "funclet"(token %1) ], !dbg !36
cleanupret from %1 unwind to caller, !dbg !36
if.else: ; preds = %entry
tail call void @bar(), !dbg !38
br label %if.end
if.end: ; preds = %if.else, %invoke.cont
%2 = load volatile i32, i32* @x, align 4, !dbg !39, !tbaa !11
%inc1 = add nsw i32 %2, 1, !dbg !39
store volatile i32 %inc1, i32* @x, align 4, !dbg !39, !tbaa !11
ret void, !dbg !40
}
; Function Attrs: nounwind
define internal fastcc void @"\01?fin$0@0@f@@"() unnamed_addr #3 comdat($f) !dbg !41 {
entry:
tail call void @llvm.dbg.value(metadata i8* null, metadata !44, metadata !27), !dbg !48
tail call void @llvm.dbg.value(metadata i8 0, metadata !46, metadata !27), !dbg !48
%0 = load volatile i32, i32* @x, align 4, !dbg !49, !tbaa !11
%inc = add nsw i32 %0, 1, !dbg !49
store volatile i32 %inc, i32* @x, align 4, !dbg !49, !tbaa !11
ret void, !dbg !51
}
declare void @foo(...) #4
declare i32 @__C_specific_handler(...)
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, metadata, metadata) #5
attributes #0 = { norecurse nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { inlinehint noinline nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #3 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #4 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #5 = { nounwind readnone }
attributes #6 = { noinline }
attributes #7 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
!2 = !{}
!3 = !{i32 2, !"CodeView", i32 1}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"PIC Level", i32 2}
!6 = !{!"clang version 3.9.0 "}
!7 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 19, type: !8, isLocal: false, isDefinition: true, scopeLine: 19, isOptimized: true, unit: !0, variables: !2)
!8 = !DISubroutineType(types: !9)
!9 = !{null}
!10 = !DILocation(line: 20, column: 4, scope: !7)
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C/C++ TBAA"}
!15 = !DILocation(line: 21, column: 1, scope: !7)
!16 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 22, type: !17, isLocal: false, isDefinition: true, scopeLine: 22, isOptimized: true, unit: !0, variables: !2)
!17 = !DISubroutineType(types: !18)
!18 = !{!19}
!19 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!20 = !DILocation(line: 23, column: 3, scope: !16)
!21 = !DILocation(line: 24, column: 1, scope: !16)
!22 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 5, type: !23, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !25)
!23 = !DISubroutineType(types: !24)
!24 = !{null, !19}
!25 = !{!26}
!26 = !DILocalVariable(name: "c", arg: 1, scope: !22, file: !1, line: 5, type: !19)
!27 = !DIExpression()
!28 = !DILocation(line: 5, column: 40, scope: !22)
!29 = !DILocation(line: 6, column: 4, scope: !22)
!30 = !DILocation(line: 7, column: 7, scope: !31)
!31 = distinct !DILexicalBlock(scope: !22, file: !1, line: 7, column: 7)
!32 = !DILocation(line: 7, column: 7, scope: !22)
!33 = !DILocation(line: 9, column: 7, scope: !34)
!34 = distinct !DILexicalBlock(scope: !35, file: !1, line: 8, column: 11)
!35 = distinct !DILexicalBlock(scope: !31, file: !1, line: 7, column: 10)
!36 = !DILocation(line: 10, column: 5, scope: !34)
!37 = !DILocation(line: 13, column: 3, scope: !35)
!38 = !DILocation(line: 14, column: 5, scope: !31)
!39 = !DILocation(line: 15, column: 4, scope: !22)
!40 = !DILocation(line: 16, column: 1, scope: !22)
!41 = distinct !DISubprogram(linkageName: "\01?fin$0@0@f@@", scope: !1, file: !1, line: 10, type: !42, isLocal: true, isDefinition: true, scopeLine: 10, flags: DIFlagArtificial, isOptimized: true, unit: !0, variables: !43)
!42 = !DISubroutineType(types: !2)
!43 = !{!44, !46}
!44 = !DILocalVariable(name: "frame_pointer", arg: 2, scope: !41, type: !45, flags: DIFlagArtificial)
!45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64, align: 64)
!46 = !DILocalVariable(name: "abnormal_termination", arg: 1, scope: !41, type: !47, flags: DIFlagArtificial | DIFlagObjectPointer)
!47 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
!48 = !DILocation(line: 0, scope: !41)
!49 = !DILocation(line: 11, column: 8, scope: !50)
!50 = distinct !DILexicalBlock(scope: !41, file: !1, line: 10, column: 17)
!51 = !DILocation(line: 12, column: 5, scope: !41)

View File

@@ -1,83 +0,0 @@
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 -filetype=obj < %s \
; RUN: | llvm-readobj -codeview | FileCheck %s
; C++ source to regenerate:
; namespace foo {
; int bar(int x) { return x * 2; }
; }
; template <typename T, int (*)(int)>
; void fn_tmpl() {}
; template void fn_tmpl<int, foo::bar>();
; void f() {
; fn_tmpl<int, foo::bar>();
; }
; CHECK: {{.*}}Proc{{.*}}Sym {
; CHECK: FunctionType: bar ({{.*}})
; CHECK: DisplayName: foo::bar{{$}}
; CHECK-NEXT: LinkageName: ?bar@foo@@YAHH@Z
; CHECK: {{.*}}Proc{{.*}}Sym {
; CHECK: FunctionType: fn_tmpl ({{.*}})
; CHECK: DisplayName: foo::fn_tmpl<int,&foo::bar>
; CHECK-NEXT: LinkageName: ??$fn_tmpl@H$1?bar@foo@@YAHH@Z@foo@@YAXXZ
; ModuleID = 't.cpp'
source_filename = "t.cpp"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i386-pc-windows-msvc19.0.23918"
$"\01??$fn_tmpl@H$1?bar@foo@@YAHH@Z@foo@@YAXXZ" = comdat any
; Function Attrs: nounwind
define i32 @"\01?bar@foo@@YAHH@Z"(i32 %x) #0 !dbg !6 {
entry:
%x.addr = alloca i32, align 4
store i32 %x, i32* %x.addr, align 4
call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !11, metadata !12), !dbg !13
%0 = load i32, i32* %x.addr, align 4, !dbg !14
%mul = mul nsw i32 %0, 2, !dbg !15
ret i32 %mul, !dbg !16
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind
define weak_odr void @"\01??$fn_tmpl@H$1?bar@foo@@YAHH@Z@foo@@YAXXZ"() #0 comdat !dbg !17 {
entry:
ret void, !dbg !24
}
attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
!2 = !{}
!3 = !{i32 2, !"CodeView", i32 1}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{!"clang version 3.9.0 "}
!6 = distinct !DISubprogram(name: "bar", linkageName: "\01?bar@foo@@YAHH@Z", scope: !7, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!7 = !DINamespace(name: "foo", scope: null)
!8 = !DISubroutineType(types: !9)
!9 = !{!10, !10}
!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!11 = !DILocalVariable(name: "x", arg: 1, scope: !6, file: !1, line: 2, type: !10)
!12 = !DIExpression()
!13 = !DILocation(line: 2, column: 13, scope: !6)
!14 = !DILocation(line: 2, column: 25, scope: !6)
!15 = !DILocation(line: 2, column: 27, scope: !6)
!16 = !DILocation(line: 2, column: 18, scope: !6)
!17 = distinct !DISubprogram(name: "fn_tmpl<int,&foo::bar>", linkageName: "\01??$fn_tmpl@H$1?bar@foo@@YAHH@Z@foo@@YAXXZ", scope: !7, file: !1, line: 4, type: !18, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, templateParams: !20, variables: !2)
!18 = !DISubroutineType(types: !19)
!19 = !{null}
!20 = !{!21, !22}
!21 = !DITemplateTypeParameter(name: "T", type: !10)
!22 = !DITemplateValueParameter(type: !23, value: i32 (i32)* @"\01?bar@foo@@YAHH@Z")
!23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 32, align: 32)
!24 = !DILocation(line: 4, column: 17, scope: !17)

View File

@@ -1,210 +0,0 @@
; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
; Both A and B should get forward declarations and complete definitions for this
; example.
; C++ source to regenerate:
; $ cat t.cpp
; struct B { int b; };
; struct A { B *b; };
; int f(A *p) { return p->b->b; }
; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
; CHECK: CodeViewTypes [
; CHECK: Section: .debug$T (6)
; CHECK: Magic: 0x4
; CHECK: Struct (0x1000) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 0
; CHECK: Properties [ (0x280)
; CHECK: ForwardReference (0x80)
; CHECK: HasUniqueName (0x200)
; CHECK: ]
; CHECK: FieldList: 0x0
; CHECK: DerivedFrom: 0x0
; CHECK: VShape: 0x0
; CHECK: SizeOf: 0
; CHECK: Name: A
; CHECK: LinkageName: .?AUA@@
; CHECK: }
; CHECK: Pointer (0x1001) {
; CHECK: TypeLeafKind: LF_POINTER (0x1002)
; CHECK: PointeeType: A (0x1000)
; CHECK: PointerAttributes: 0x1000C
; CHECK: PtrType: Near64 (0xC)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: SizeOf: 8
; CHECK: }
; CHECK: ArgList (0x1002) {
; CHECK: TypeLeafKind: LF_ARGLIST (0x1201)
; CHECK: NumArgs: 1
; CHECK: Arguments [
; CHECK: ArgType: A* (0x1001)
; CHECK: ]
; CHECK: }
; CHECK: Procedure (0x1003) {
; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
; CHECK: ReturnType: int (0x74)
; CHECK: CallingConvention: NearC (0x0)
; CHECK: FunctionOptions [ (0x0)
; CHECK: ]
; CHECK: NumParameters: 1
; CHECK: ArgListType: (A*) (0x1002)
; CHECK: }
; CHECK: Struct (0x1004) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 0
; CHECK: Properties [ (0x280)
; CHECK: ForwardReference (0x80)
; CHECK: HasUniqueName (0x200)
; CHECK: ]
; CHECK: FieldList: 0x0
; CHECK: DerivedFrom: 0x0
; CHECK: VShape: 0x0
; CHECK: SizeOf: 0
; CHECK: Name: B
; CHECK: LinkageName: .?AUB@@
; CHECK: }
; CHECK: Pointer (0x1005) {
; CHECK: TypeLeafKind: LF_POINTER (0x1002)
; CHECK: PointeeType: B (0x1004)
; CHECK: PointerAttributes: 0x1000C
; CHECK: PtrType: Near64 (0xC)
; CHECK: PtrMode: Pointer (0x0)
; CHECK: IsFlat: 0
; CHECK: IsConst: 0
; CHECK: IsVolatile: 0
; CHECK: IsUnaligned: 0
; CHECK: SizeOf: 8
; CHECK: }
; CHECK: FieldList (0x1006) {
; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK: DataMember {
; CHECK: AccessSpecifier: Public (0x3)
; CHECK: Type: B* (0x1005)
; CHECK: FieldOffset: 0x0
; CHECK: Name: b
; CHECK: }
; CHECK: }
; CHECK: Struct (0x1007) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 1
; CHECK: Properties [ (0x200)
; CHECK: HasUniqueName (0x200)
; CHECK: ]
; CHECK: FieldList: <field list> (0x1006)
; CHECK: DerivedFrom: 0x0
; CHECK: VShape: 0x0
; CHECK: SizeOf: 8
; CHECK: Name: A
; CHECK: LinkageName: .?AUA@@
; CHECK: }
; CHECK: StringId (0x1008) {
; CHECK: TypeLeafKind: LF_STRING_ID (0x1605)
; CHECK: Id: 0x0
; CHECK: StringData: D:\src\llvm\build\t.cpp
; CHECK: }
; CHECK: UdtSourceLine (0x1009) {
; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
; CHECK: UDT: A (0x1007)
; CHECK: SourceFile: D:\src\llvm\build\t.cpp (0x1008)
; CHECK: LineNumber: 2
; CHECK: }
; CHECK: FieldList (0x100A) {
; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK: DataMember {
; CHECK: AccessSpecifier: Public (0x3)
; CHECK: Type: int (0x74)
; CHECK: FieldOffset: 0x0
; CHECK: Name: b
; CHECK: }
; CHECK: }
; CHECK: Struct (0x100B) {
; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
; CHECK: MemberCount: 1
; CHECK: Properties [ (0x200)
; CHECK: HasUniqueName (0x200)
; CHECK: ]
; CHECK: FieldList: <field list> (0x100A)
; CHECK: DerivedFrom: 0x0
; CHECK: VShape: 0x0
; CHECK: SizeOf: 4
; CHECK: Name: B
; CHECK: LinkageName: .?AUB@@
; CHECK: }
; CHECK: UdtSourceLine (0x100C) {
; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
; CHECK: UDT: B (0x100B)
; CHECK: SourceFile: D:\src\llvm\build\t.cpp (0x1008)
; CHECK: LineNumber: 1
; CHECK: }
; CHECK: FuncId (0x100D) {
; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
; CHECK: ParentScope: 0x0
; CHECK: FunctionType: int (A*) (0x1003)
; CHECK: Name: f
; CHECK: }
; CHECK: ]
; ModuleID = 't.cpp'
source_filename = "t.cpp"
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.0.23918"
%struct.A = type { %struct.B* }
%struct.B = type { i32 }
; Function Attrs: nounwind uwtable
define i32 @"\01?f@@YAHPEAUA@@@Z"(%struct.A* %p) #0 !dbg !7 {
entry:
%p.addr = alloca %struct.A*, align 8
store %struct.A* %p, %struct.A** %p.addr, align 8
call void @llvm.dbg.declare(metadata %struct.A** %p.addr, metadata !19, metadata !20), !dbg !21
%0 = load %struct.A*, %struct.A** %p.addr, align 8, !dbg !22
%b = getelementptr inbounds %struct.A, %struct.A* %0, i32 0, i32 0, !dbg !23
%1 = load %struct.B*, %struct.B** %b, align 8, !dbg !23
%b1 = getelementptr inbounds %struct.B, %struct.B* %1, i32 0, i32 0, !dbg !24
%2 = load i32, i32* %b1, align 4, !dbg !24
ret i32 %2, !dbg !25
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
!2 = !{}
!3 = !{i32 2, !"CodeView", i32 1}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"PIC Level", i32 2}
!6 = !{!"clang version 3.9.0 "}
!7 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAHPEAUA@@@Z", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!8 = !DISubroutineType(types: !9)
!9 = !{!10, !11}
!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64)
!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 2, size: 64, align: 64, elements: !13, identifier: ".?AUA@@")
!13 = !{!14}
!14 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !12, file: !1, line: 2, baseType: !15, size: 64, align: 64)
!15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64, align: 64)
!16 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !1, line: 1, size: 32, align: 32, elements: !17, identifier: ".?AUB@@")
!17 = !{!18}
!18 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !16, file: !1, line: 1, baseType: !10, size: 32, align: 32)
!19 = !DILocalVariable(name: "p", arg: 1, scope: !7, file: !1, line: 3, type: !11)
!20 = !DIExpression()
!21 = !DILocation(line: 3, column: 10, scope: !7)
!22 = !DILocation(line: 3, column: 22, scope: !7)
!23 = !DILocation(line: 3, column: 25, scope: !7)
!24 = !DILocation(line: 3, column: 28, scope: !7)
!25 = !DILocation(line: 3, column: 15, scope: !7)

View File

@@ -1,41 +0,0 @@
; RUN: llc < %s | FileCheck %s --check-prefix=ASM
; RUN: llc -filetype=obj < %s | llvm-readobj -codeview | FileCheck %s --check-prefix=OBJ
; ASM: .short 4412 # Record kind: S_COMPILE3
; ASM-NEXT: .long 68 # Flags and language
; ASM-NEXT: .short 208 # CPUType
; OBJ-LABEL: Compile3Sym {
; OBJ-NEXT: Kind: S_COMPILE3 (0x113C)
; OBJ-NEXT: Language: D (0x44)
; OBJ-NEXT: Flags [ (0x0)
; OBJ-NEXT: ]
; OBJ-NEXT: Machine: X64 (0xD0)
; OBJ-NEXT: FrontendVersion: {{[0-9.]*}}
; OBJ-NEXT: BackendVersion: {{[0-9.]*}}
; OBJ-NEXT: VersionName: LDC version 6.0.0
; OBJ-NEXT: }
; ModuleID = 't.c'
source_filename = "t.c"
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.0.24215"
define void @f() !dbg !8 {
entry:
ret void, !dbg !11
}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!0 = distinct !DICompileUnit(language: DW_LANG_D, file: !1, producer: "LDC version 6.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.d", directory: "asdf")
!2 = !{}
!3 = !{i32 2, !"CodeView", i32 1}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!8 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, variables: !2)
!9 = !DISubroutineType(types: !10)
!10 = !{null}
!11 = !DILocation(line: 1, column: 11, scope: !8)

View File

@@ -1,51 +0,0 @@
; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
; Generated from the following C++ source:
; enum E : int { BLAH };
; E e;
; CHECK: CodeViewTypes [
; CHECK: FieldList (0x1000) {
; CHECK-NEXT: TypeLeafKind: LF_FIELDLIST (0x1203)
; CHECK-NEXT: Enumerator {
; CHECK-NEXT: TypeLeafKind: LF_ENUMERATE (0x1502)
; CHECK-NEXT: AccessSpecifier: Public (0x3)
; CHECK-NEXT: EnumValue: 0
; CHECK-NEXT: Name: BLAH
; CHECK-NEXT: }
; CHECK-NEXT: }
; CHECK-NEXT: Enum (0x1001) {
; CHECK-NEXT: TypeLeafKind: LF_ENUM (0x1507)
; CHECK-NEXT: NumEnumerators: 1
; CHECK-NEXT: Properties [ (0x0)
; CHECK-NEXT: ]
; CHECK-NEXT: UnderlyingType: int (0x74)
; CHECK-NEXT: FieldListType: <field list> (0x1000)
; CHECK-NEXT: Name: E
; CHECK-NEXT: }
source_filename = "test/DebugInfo/COFF/enum.ll"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-pc-windows-msvc18.0.0"
@"\01?e@@3W4E@@A" = global i32 0, align 4, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!11, !12}
!llvm.ident = !{!13}
!0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "e", linkageName: "\01?e@@3W4E@@A", scope: !2, file: !6, line: 2, type: !5, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 272790) (llvm/trunk 272813)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !10)
!3 = !DIFile(filename: "-", directory: "/")
!4 = !{!5}
!5 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "E", file: !6, line: 1, baseType: !7, size: 32, align: 32, elements: !8)
!6 = !DIFile(filename: "<stdin>", directory: "/")
!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !{!9}
!9 = !DIEnumerator(name: "BLAH", value: 0)
!10 = !{!0}
!11 = !{i32 2, !"CodeView", i32 1}
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{!"clang version 3.9.0 (trunk 272790) (llvm/trunk 272813)"}

View File

@@ -1,46 +0,0 @@
; RUN: llc -mtriple=i686-windows-msvc < %s | FileCheck %s --check-prefix=ASM
; RUN: llc -mtriple=i686-windows-msvc < %s -filetype=obj | llvm-readobj -codeview - | FileCheck %s --check-prefix=OBJ
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-pc-windows-msvc18.0.0"
define double @f(double %p1) !dbg !4 {
entry:
%sub = fsub double -0.000000e+00, %p1, !dbg !16
tail call void @llvm.dbg.value(metadata double %sub, metadata !10, metadata !14), !dbg !15
ret double %sub
}
; ASM: .cv_def_range Lfunc_begin0 Lfunc_end0, "A\021\200\000\000\000"
; OBJ: DefRangeRegisterSym {
; OBJ: Register: ST0 (0x80)
; OBJ: MayHaveNoName: 0
; OBJ: LocalVariableAddrRange {
; OBJ: OffsetStart: .text+0x0
; OBJ: ISectStart: 0x0
; OBJ: Range: 0x7
; OBJ: }
; OBJ: }
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, metadata, metadata)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!11, !12}
!llvm.ident = !{!13}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 261537) (llvm/trunk 261463)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "<stdin>", directory: "/")
!2 = !{}
!4 = distinct !DISubprogram(name: "f", linkageName: "f", scope: !5, file: !5, line: 2, type: !6, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !9)
!5 = !DIFile(filename: "t.ii", directory: "/")
!6 = !DISubroutineType(types: !7)
!7 = !{null, !8}
!8 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)
!9 = !{!10}
!10 = !DILocalVariable(name: "p1", arg: 1, scope: !4, file: !5, line: 2, type: !8)
!11 = !{i32 2, !"CodeView", i32 1}
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{!"clang version 3.9.0 (trunk 261537) (llvm/trunk 261463)"}
!14 = !DIExpression()
!15 = !DILocation(line: 2, scope: !4)
!16 = !DILocation(line: 3, scope: !4)

View File

@@ -1,454 +0,0 @@
; RUN: llc < %s | grep cv_fpo_proc | FileCheck %s
; C++ source:
; extern "C" {
; extern int g;
;
; void cdecl1(int a) { g += a; }
; void cdecl2(int a, int b) { g += a + b; }
; void cdecl3(int a, int b, int c) { g += a + b + c; }
;
; void __fastcall fastcall1(int a) { g += a; }
; void __fastcall fastcall2(int a, int b) { g += a + b; }
; void __fastcall fastcall3(int a, int b, int c) { g += a + b + c; }
;
; void __stdcall stdcall1(int a) { g += a; }
; void __stdcall stdcall2(int a, int b) { g += a + b; }
; void __stdcall stdcall3(int a, int b, int c) { g += a + b + c; }
; }
;
; struct Foo {
; void thiscall1(int a);
; void thiscall2(int a, int b);
; void thiscall3(int a, int b, int c);
; };
;
; void Foo::thiscall1(int a) { g += a; }
; void Foo::thiscall2(int a, int b) { g += a + b; }
; void Foo::thiscall3(int a, int b, int c) { g += a + b + c; }
; CHECK: .cv_fpo_proc _cdecl1 4
; CHECK: .cv_fpo_proc _cdecl2 8
; CHECK: .cv_fpo_proc _cdecl3 12
; First two args are in registers and don't count.
; CHECK: .cv_fpo_proc @fastcall1@4 0
; CHECK: .cv_fpo_proc @fastcall2@8 0
; CHECK: .cv_fpo_proc @fastcall3@12 4
; CHECK: .cv_fpo_proc _stdcall1@4 4
; CHECK: .cv_fpo_proc _stdcall2@8 8
; CHECK: .cv_fpo_proc _stdcall3@12 12
; 'this' is in ecx and doesn't count.
; CHECK: .cv_fpo_proc "?thiscall1@Foo@@QAEXH@Z" 4
; CHECK: .cv_fpo_proc "?thiscall2@Foo@@QAEXHH@Z" 8
; CHECK: .cv_fpo_proc "?thiscall3@Foo@@QAEXHHH@Z" 12
; ModuleID = 't.c'
source_filename = "t.c"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i386-pc-windows-msvc19.11.25508"
%struct.Foo = type { i8 }
@g = external global i32, align 4
; Function Attrs: noinline nounwind optnone
define void @cdecl1(i32 %a) #0 !dbg !8 {
entry:
%a.addr = alloca i32, align 4
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !12, metadata !DIExpression()), !dbg !13
%0 = load i32, i32* %a.addr, align 4, !dbg !14
%1 = load i32, i32* @g, align 4, !dbg !15
%add = add nsw i32 %1, %0, !dbg !15
store i32 %add, i32* @g, align 4, !dbg !15
ret void, !dbg !16
}
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: noinline nounwind optnone
define void @cdecl2(i32 %a, i32 %b) #0 !dbg !17 {
entry:
%b.addr = alloca i32, align 4
%a.addr = alloca i32, align 4
store i32 %b, i32* %b.addr, align 4
call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !20, metadata !DIExpression()), !dbg !21
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !22, metadata !DIExpression()), !dbg !23
%0 = load i32, i32* %a.addr, align 4, !dbg !24
%1 = load i32, i32* %b.addr, align 4, !dbg !25
%add = add nsw i32 %0, %1, !dbg !26
%2 = load i32, i32* @g, align 4, !dbg !27
%add1 = add nsw i32 %2, %add, !dbg !27
store i32 %add1, i32* @g, align 4, !dbg !27
ret void, !dbg !28
}
; Function Attrs: noinline nounwind optnone
define void @cdecl3(i32 %a, i32 %b, i32 %c) #0 !dbg !29 {
entry:
%c.addr = alloca i32, align 4
%b.addr = alloca i32, align 4
%a.addr = alloca i32, align 4
store i32 %c, i32* %c.addr, align 4
call void @llvm.dbg.declare(metadata i32* %c.addr, metadata !32, metadata !DIExpression()), !dbg !33
store i32 %b, i32* %b.addr, align 4
call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !34, metadata !DIExpression()), !dbg !35
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !36, metadata !DIExpression()), !dbg !37
%0 = load i32, i32* %a.addr, align 4, !dbg !38
%1 = load i32, i32* %b.addr, align 4, !dbg !39
%add = add nsw i32 %0, %1, !dbg !40
%2 = load i32, i32* %c.addr, align 4, !dbg !41
%add1 = add nsw i32 %add, %2, !dbg !42
%3 = load i32, i32* @g, align 4, !dbg !43
%add2 = add nsw i32 %3, %add1, !dbg !43
store i32 %add2, i32* @g, align 4, !dbg !43
ret void, !dbg !44
}
; Function Attrs: noinline nounwind optnone
define x86_fastcallcc void @"\01@fastcall1@4"(i32 inreg %a) #0 !dbg !45 {
entry:
%a.addr = alloca i32, align 4
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !47, metadata !DIExpression()), !dbg !48
%0 = load i32, i32* %a.addr, align 4, !dbg !49
%1 = load i32, i32* @g, align 4, !dbg !50
%add = add nsw i32 %1, %0, !dbg !50
store i32 %add, i32* @g, align 4, !dbg !50
ret void, !dbg !51
}
; Function Attrs: noinline nounwind optnone
define x86_fastcallcc void @"\01@fastcall2@8"(i32 inreg %a, i32 inreg %b) #0 !dbg !52 {
entry:
%b.addr = alloca i32, align 4
%a.addr = alloca i32, align 4
store i32 %b, i32* %b.addr, align 4
call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !54, metadata !DIExpression()), !dbg !55
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !56, metadata !DIExpression()), !dbg !57
%0 = load i32, i32* %a.addr, align 4, !dbg !58
%1 = load i32, i32* %b.addr, align 4, !dbg !59
%add = add nsw i32 %0, %1, !dbg !60
%2 = load i32, i32* @g, align 4, !dbg !61
%add1 = add nsw i32 %2, %add, !dbg !61
store i32 %add1, i32* @g, align 4, !dbg !61
ret void, !dbg !62
}
; Function Attrs: noinline nounwind optnone
define x86_fastcallcc void @"\01@fastcall3@12"(i32 inreg %a, i32 inreg %b, i32 %c) #0 !dbg !63 {
entry:
%c.addr = alloca i32, align 4
%b.addr = alloca i32, align 4
%a.addr = alloca i32, align 4
store i32 %c, i32* %c.addr, align 4
call void @llvm.dbg.declare(metadata i32* %c.addr, metadata !65, metadata !DIExpression()), !dbg !66
store i32 %b, i32* %b.addr, align 4
call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !67, metadata !DIExpression()), !dbg !68
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !69, metadata !DIExpression()), !dbg !70
%0 = load i32, i32* %a.addr, align 4, !dbg !71
%1 = load i32, i32* %b.addr, align 4, !dbg !72
%add = add nsw i32 %0, %1, !dbg !73
%2 = load i32, i32* %c.addr, align 4, !dbg !74
%add1 = add nsw i32 %add, %2, !dbg !75
%3 = load i32, i32* @g, align 4, !dbg !76
%add2 = add nsw i32 %3, %add1, !dbg !76
store i32 %add2, i32* @g, align 4, !dbg !76
ret void, !dbg !77
}
; Function Attrs: noinline nounwind optnone
define x86_stdcallcc void @"\01_stdcall1@4"(i32 %a) #0 !dbg !78 {
entry:
%a.addr = alloca i32, align 4
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !80, metadata !DIExpression()), !dbg !81
%0 = load i32, i32* %a.addr, align 4, !dbg !82
%1 = load i32, i32* @g, align 4, !dbg !83
%add = add nsw i32 %1, %0, !dbg !83
store i32 %add, i32* @g, align 4, !dbg !83
ret void, !dbg !84
}
; Function Attrs: noinline nounwind optnone
define x86_stdcallcc void @"\01_stdcall2@8"(i32 %a, i32 %b) #0 !dbg !85 {
entry:
%b.addr = alloca i32, align 4
%a.addr = alloca i32, align 4
store i32 %b, i32* %b.addr, align 4
call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !87, metadata !DIExpression()), !dbg !88
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !89, metadata !DIExpression()), !dbg !90
%0 = load i32, i32* %a.addr, align 4, !dbg !91
%1 = load i32, i32* %b.addr, align 4, !dbg !92
%add = add nsw i32 %0, %1, !dbg !93
%2 = load i32, i32* @g, align 4, !dbg !94
%add1 = add nsw i32 %2, %add, !dbg !94
store i32 %add1, i32* @g, align 4, !dbg !94
ret void, !dbg !95
}
; Function Attrs: noinline nounwind optnone
define x86_stdcallcc void @"\01_stdcall3@12"(i32 %a, i32 %b, i32 %c) #0 !dbg !96 {
entry:
%c.addr = alloca i32, align 4
%b.addr = alloca i32, align 4
%a.addr = alloca i32, align 4
store i32 %c, i32* %c.addr, align 4
call void @llvm.dbg.declare(metadata i32* %c.addr, metadata !98, metadata !DIExpression()), !dbg !99
store i32 %b, i32* %b.addr, align 4
call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !100, metadata !DIExpression()), !dbg !101
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !102, metadata !DIExpression()), !dbg !103
%0 = load i32, i32* %a.addr, align 4, !dbg !104
%1 = load i32, i32* %b.addr, align 4, !dbg !105
%add = add nsw i32 %0, %1, !dbg !106
%2 = load i32, i32* %c.addr, align 4, !dbg !107
%add1 = add nsw i32 %add, %2, !dbg !108
%3 = load i32, i32* @g, align 4, !dbg !109
%add2 = add nsw i32 %3, %add1, !dbg !109
store i32 %add2, i32* @g, align 4, !dbg !109
ret void, !dbg !110
}
; Function Attrs: noinline nounwind optnone
define x86_thiscallcc void @"\01?thiscall1@Foo@@QAEXH@Z"(%struct.Foo* %this, i32 %a) #0 align 2 !dbg !111 {
entry:
%a.addr = alloca i32, align 4
%this.addr = alloca %struct.Foo*, align 4
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !124, metadata !DIExpression()), !dbg !125
store %struct.Foo* %this, %struct.Foo** %this.addr, align 4
call void @llvm.dbg.declare(metadata %struct.Foo** %this.addr, metadata !126, metadata !DIExpression()), !dbg !128
%this1 = load %struct.Foo*, %struct.Foo** %this.addr, align 4
%0 = load i32, i32* %a.addr, align 4, !dbg !129
%1 = load i32, i32* @g, align 4, !dbg !130
%add = add nsw i32 %1, %0, !dbg !130
store i32 %add, i32* @g, align 4, !dbg !130
ret void, !dbg !131
}
; Function Attrs: noinline nounwind optnone
define x86_thiscallcc void @"\01?thiscall2@Foo@@QAEXHH@Z"(%struct.Foo* %this, i32 %a, i32 %b) #0 align 2 !dbg !132 {
entry:
%b.addr = alloca i32, align 4
%a.addr = alloca i32, align 4
%this.addr = alloca %struct.Foo*, align 4
store i32 %b, i32* %b.addr, align 4
call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !133, metadata !DIExpression()), !dbg !134
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !135, metadata !DIExpression()), !dbg !136
store %struct.Foo* %this, %struct.Foo** %this.addr, align 4
call void @llvm.dbg.declare(metadata %struct.Foo** %this.addr, metadata !137, metadata !DIExpression()), !dbg !138
%this1 = load %struct.Foo*, %struct.Foo** %this.addr, align 4
%0 = load i32, i32* %a.addr, align 4, !dbg !139
%1 = load i32, i32* %b.addr, align 4, !dbg !140
%add = add nsw i32 %0, %1, !dbg !141
%2 = load i32, i32* @g, align 4, !dbg !142
%add2 = add nsw i32 %2, %add, !dbg !142
store i32 %add2, i32* @g, align 4, !dbg !142
ret void, !dbg !143
}
; Function Attrs: noinline nounwind optnone
define x86_thiscallcc void @"\01?thiscall3@Foo@@QAEXHHH@Z"(%struct.Foo* %this, i32 %a, i32 %b, i32 %c) #0 align 2 !dbg !144 {
entry:
%c.addr = alloca i32, align 4
%b.addr = alloca i32, align 4
%a.addr = alloca i32, align 4
%this.addr = alloca %struct.Foo*, align 4
store i32 %c, i32* %c.addr, align 4
call void @llvm.dbg.declare(metadata i32* %c.addr, metadata !145, metadata !DIExpression()), !dbg !146
store i32 %b, i32* %b.addr, align 4
call void @llvm.dbg.declare(metadata i32* %b.addr, metadata !147, metadata !DIExpression()), !dbg !148
store i32 %a, i32* %a.addr, align 4
call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !149, metadata !DIExpression()), !dbg !150
store %struct.Foo* %this, %struct.Foo** %this.addr, align 4
call void @llvm.dbg.declare(metadata %struct.Foo** %this.addr, metadata !151, metadata !DIExpression()), !dbg !152
%this1 = load %struct.Foo*, %struct.Foo** %this.addr, align 4
%0 = load i32, i32* %a.addr, align 4, !dbg !153
%1 = load i32, i32* %b.addr, align 4, !dbg !154
%add = add nsw i32 %0, %1, !dbg !155
%2 = load i32, i32* %c.addr, align 4, !dbg !156
%add2 = add nsw i32 %add, %2, !dbg !157
%3 = load i32, i32* @g, align 4, !dbg !158
%add3 = add nsw i32 %3, %add2, !dbg !158
store i32 %add3, i32* @g, align 4, !dbg !158
ret void, !dbg !159
}
attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "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"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone speculatable }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5, !6}
!llvm.ident = !{!7}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.c", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "0ce3e4edcf2f8511157da4edb99fcdf4")
!2 = !{}
!3 = !{i32 1, !"NumRegisterParameters", i32 0}
!4 = !{i32 2, !"CodeView", i32 1}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = !{i32 1, !"wchar_size", i32 2}
!7 = !{!"clang version 6.0.0 "}
!8 = distinct !DISubprogram(name: "cdecl1", scope: !1, file: !1, line: 4, type: !9, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!9 = !DISubroutineType(types: !10)
!10 = !{null, !11}
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !1, line: 4, type: !11)
!13 = !DILocation(line: 4, column: 17, scope: !8)
!14 = !DILocation(line: 4, column: 27, scope: !8)
!15 = !DILocation(line: 4, column: 24, scope: !8)
!16 = !DILocation(line: 4, column: 30, scope: !8)
!17 = distinct !DISubprogram(name: "cdecl2", scope: !1, file: !1, line: 5, type: !18, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!18 = !DISubroutineType(types: !19)
!19 = !{null, !11, !11}
!20 = !DILocalVariable(name: "b", arg: 2, scope: !17, file: !1, line: 5, type: !11)
!21 = !DILocation(line: 5, column: 24, scope: !17)
!22 = !DILocalVariable(name: "a", arg: 1, scope: !17, file: !1, line: 5, type: !11)
!23 = !DILocation(line: 5, column: 17, scope: !17)
!24 = !DILocation(line: 5, column: 34, scope: !17)
!25 = !DILocation(line: 5, column: 38, scope: !17)
!26 = !DILocation(line: 5, column: 36, scope: !17)
!27 = !DILocation(line: 5, column: 31, scope: !17)
!28 = !DILocation(line: 5, column: 41, scope: !17)
!29 = distinct !DISubprogram(name: "cdecl3", scope: !1, file: !1, line: 6, type: !30, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!30 = !DISubroutineType(types: !31)
!31 = !{null, !11, !11, !11}
!32 = !DILocalVariable(name: "c", arg: 3, scope: !29, file: !1, line: 6, type: !11)
!33 = !DILocation(line: 6, column: 31, scope: !29)
!34 = !DILocalVariable(name: "b", arg: 2, scope: !29, file: !1, line: 6, type: !11)
!35 = !DILocation(line: 6, column: 24, scope: !29)
!36 = !DILocalVariable(name: "a", arg: 1, scope: !29, file: !1, line: 6, type: !11)
!37 = !DILocation(line: 6, column: 17, scope: !29)
!38 = !DILocation(line: 6, column: 41, scope: !29)
!39 = !DILocation(line: 6, column: 45, scope: !29)
!40 = !DILocation(line: 6, column: 43, scope: !29)
!41 = !DILocation(line: 6, column: 49, scope: !29)
!42 = !DILocation(line: 6, column: 47, scope: !29)
!43 = !DILocation(line: 6, column: 38, scope: !29)
!44 = !DILocation(line: 6, column: 52, scope: !29)
!45 = distinct !DISubprogram(name: "fastcall1", linkageName: "\01@fastcall1@4", scope: !1, file: !1, line: 8, type: !46, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!46 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !10)
!47 = !DILocalVariable(name: "a", arg: 1, scope: !45, file: !1, line: 8, type: !11)
!48 = !DILocation(line: 8, column: 31, scope: !45)
!49 = !DILocation(line: 8, column: 41, scope: !45)
!50 = !DILocation(line: 8, column: 38, scope: !45)
!51 = !DILocation(line: 8, column: 44, scope: !45)
!52 = distinct !DISubprogram(name: "fastcall2", linkageName: "\01@fastcall2@8", scope: !1, file: !1, line: 9, type: !53, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!53 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !19)
!54 = !DILocalVariable(name: "b", arg: 2, scope: !52, file: !1, line: 9, type: !11)
!55 = !DILocation(line: 9, column: 38, scope: !52)
!56 = !DILocalVariable(name: "a", arg: 1, scope: !52, file: !1, line: 9, type: !11)
!57 = !DILocation(line: 9, column: 31, scope: !52)
!58 = !DILocation(line: 9, column: 48, scope: !52)
!59 = !DILocation(line: 9, column: 52, scope: !52)
!60 = !DILocation(line: 9, column: 50, scope: !52)
!61 = !DILocation(line: 9, column: 45, scope: !52)
!62 = !DILocation(line: 9, column: 55, scope: !52)
!63 = distinct !DISubprogram(name: "fastcall3", linkageName: "\01@fastcall3@12", scope: !1, file: !1, line: 10, type: !64, isLocal: false, isDefinition: true, scopeLine: 10, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!64 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !31)
!65 = !DILocalVariable(name: "c", arg: 3, scope: !63, file: !1, line: 10, type: !11)
!66 = !DILocation(line: 10, column: 45, scope: !63)
!67 = !DILocalVariable(name: "b", arg: 2, scope: !63, file: !1, line: 10, type: !11)
!68 = !DILocation(line: 10, column: 38, scope: !63)
!69 = !DILocalVariable(name: "a", arg: 1, scope: !63, file: !1, line: 10, type: !11)
!70 = !DILocation(line: 10, column: 31, scope: !63)
!71 = !DILocation(line: 10, column: 55, scope: !63)
!72 = !DILocation(line: 10, column: 59, scope: !63)
!73 = !DILocation(line: 10, column: 57, scope: !63)
!74 = !DILocation(line: 10, column: 63, scope: !63)
!75 = !DILocation(line: 10, column: 61, scope: !63)
!76 = !DILocation(line: 10, column: 52, scope: !63)
!77 = !DILocation(line: 10, column: 66, scope: !63)
!78 = distinct !DISubprogram(name: "stdcall1", linkageName: "\01_stdcall1@4", scope: !1, file: !1, line: 12, type: !79, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!79 = !DISubroutineType(cc: DW_CC_BORLAND_stdcall, types: !10)
!80 = !DILocalVariable(name: "a", arg: 1, scope: !78, file: !1, line: 12, type: !11)
!81 = !DILocation(line: 12, column: 29, scope: !78)
!82 = !DILocation(line: 12, column: 39, scope: !78)
!83 = !DILocation(line: 12, column: 36, scope: !78)
!84 = !DILocation(line: 12, column: 42, scope: !78)
!85 = distinct !DISubprogram(name: "stdcall2", linkageName: "\01_stdcall2@8", scope: !1, file: !1, line: 13, type: !86, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!86 = !DISubroutineType(cc: DW_CC_BORLAND_stdcall, types: !19)
!87 = !DILocalVariable(name: "b", arg: 2, scope: !85, file: !1, line: 13, type: !11)
!88 = !DILocation(line: 13, column: 36, scope: !85)
!89 = !DILocalVariable(name: "a", arg: 1, scope: !85, file: !1, line: 13, type: !11)
!90 = !DILocation(line: 13, column: 29, scope: !85)
!91 = !DILocation(line: 13, column: 46, scope: !85)
!92 = !DILocation(line: 13, column: 50, scope: !85)
!93 = !DILocation(line: 13, column: 48, scope: !85)
!94 = !DILocation(line: 13, column: 43, scope: !85)
!95 = !DILocation(line: 13, column: 53, scope: !85)
!96 = distinct !DISubprogram(name: "stdcall3", linkageName: "\01_stdcall3@12", scope: !1, file: !1, line: 14, type: !97, isLocal: false, isDefinition: true, scopeLine: 14, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!97 = !DISubroutineType(cc: DW_CC_BORLAND_stdcall, types: !31)
!98 = !DILocalVariable(name: "c", arg: 3, scope: !96, file: !1, line: 14, type: !11)
!99 = !DILocation(line: 14, column: 43, scope: !96)
!100 = !DILocalVariable(name: "b", arg: 2, scope: !96, file: !1, line: 14, type: !11)
!101 = !DILocation(line: 14, column: 36, scope: !96)
!102 = !DILocalVariable(name: "a", arg: 1, scope: !96, file: !1, line: 14, type: !11)
!103 = !DILocation(line: 14, column: 29, scope: !96)
!104 = !DILocation(line: 14, column: 53, scope: !96)
!105 = !DILocation(line: 14, column: 57, scope: !96)
!106 = !DILocation(line: 14, column: 55, scope: !96)
!107 = !DILocation(line: 14, column: 61, scope: !96)
!108 = !DILocation(line: 14, column: 59, scope: !96)
!109 = !DILocation(line: 14, column: 50, scope: !96)
!110 = !DILocation(line: 14, column: 64, scope: !96)
!111 = distinct !DISubprogram(name: "thiscall1", linkageName: "\01?thiscall1@Foo@@QAEXH@Z", scope: !112, file: !1, line: 23, type: !115, isLocal: false, isDefinition: true, scopeLine: 23, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !114, variables: !2)
!112 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: !1, line: 17, size: 8, elements: !113, identifier: ".?AUFoo@@")
!113 = !{!114, !118, !121}
!114 = !DISubprogram(name: "thiscall1", linkageName: "\01?thiscall1@Foo@@QAEXH@Z", scope: !112, file: !1, line: 18, type: !115, isLocal: false, isDefinition: false, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: false)
!115 = !DISubroutineType(cc: DW_CC_BORLAND_thiscall, types: !116)
!116 = !{null, !117, !11}
!117 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !112, size: 32, flags: DIFlagArtificial | DIFlagObjectPointer)
!118 = !DISubprogram(name: "thiscall2", linkageName: "\01?thiscall2@Foo@@QAEXHH@Z", scope: !112, file: !1, line: 19, type: !119, isLocal: false, isDefinition: false, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false)
!119 = !DISubroutineType(cc: DW_CC_BORLAND_thiscall, types: !120)
!120 = !{null, !117, !11, !11}
!121 = !DISubprogram(name: "thiscall3", linkageName: "\01?thiscall3@Foo@@QAEXHHH@Z", scope: !112, file: !1, line: 20, type: !122, isLocal: false, isDefinition: false, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: false)
!122 = !DISubroutineType(cc: DW_CC_BORLAND_thiscall, types: !123)
!123 = !{null, !117, !11, !11, !11}
!124 = !DILocalVariable(name: "a", arg: 2, scope: !111, file: !1, line: 23, type: !11)
!125 = !DILocation(line: 23, column: 25, scope: !111)
!126 = !DILocalVariable(name: "this", arg: 1, scope: !111, type: !127, flags: DIFlagArtificial | DIFlagObjectPointer)
!127 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !112, size: 32)
!128 = !DILocation(line: 0, scope: !111)
!129 = !DILocation(line: 23, column: 35, scope: !111)
!130 = !DILocation(line: 23, column: 32, scope: !111)
!131 = !DILocation(line: 23, column: 38, scope: !111)
!132 = distinct !DISubprogram(name: "thiscall2", linkageName: "\01?thiscall2@Foo@@QAEXHH@Z", scope: !112, file: !1, line: 24, type: !119, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !118, variables: !2)
!133 = !DILocalVariable(name: "b", arg: 3, scope: !132, file: !1, line: 24, type: !11)
!134 = !DILocation(line: 24, column: 32, scope: !132)
!135 = !DILocalVariable(name: "a", arg: 2, scope: !132, file: !1, line: 24, type: !11)
!136 = !DILocation(line: 24, column: 25, scope: !132)
!137 = !DILocalVariable(name: "this", arg: 1, scope: !132, type: !127, flags: DIFlagArtificial | DIFlagObjectPointer)
!138 = !DILocation(line: 0, scope: !132)
!139 = !DILocation(line: 24, column: 42, scope: !132)
!140 = !DILocation(line: 24, column: 46, scope: !132)
!141 = !DILocation(line: 24, column: 44, scope: !132)
!142 = !DILocation(line: 24, column: 39, scope: !132)
!143 = !DILocation(line: 24, column: 49, scope: !132)
!144 = distinct !DISubprogram(name: "thiscall3", linkageName: "\01?thiscall3@Foo@@QAEXHHH@Z", scope: !112, file: !1, line: 25, type: !122, isLocal: false, isDefinition: true, scopeLine: 25, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !121, variables: !2)
!145 = !DILocalVariable(name: "c", arg: 4, scope: !144, file: !1, line: 25, type: !11)
!146 = !DILocation(line: 25, column: 39, scope: !144)
!147 = !DILocalVariable(name: "b", arg: 3, scope: !144, file: !1, line: 25, type: !11)
!148 = !DILocation(line: 25, column: 32, scope: !144)
!149 = !DILocalVariable(name: "a", arg: 2, scope: !144, file: !1, line: 25, type: !11)
!150 = !DILocation(line: 25, column: 25, scope: !144)
!151 = !DILocalVariable(name: "this", arg: 1, scope: !144, type: !127, flags: DIFlagArtificial | DIFlagObjectPointer)
!152 = !DILocation(line: 0, scope: !144)
!153 = !DILocation(line: 25, column: 49, scope: !144)
!154 = !DILocation(line: 25, column: 53, scope: !144)
!155 = !DILocation(line: 25, column: 51, scope: !144)
!156 = !DILocation(line: 25, column: 57, scope: !144)
!157 = !DILocation(line: 25, column: 55, scope: !144)
!158 = !DILocation(line: 25, column: 46, scope: !144)
!159 = !DILocation(line: 25, column: 60, scope: !144)

File diff suppressed because it is too large Load Diff

View File

@@ -1,85 +0,0 @@
; RUN: llc < %s | FileCheck %s
; C++ source:
; void g();
; void f() {
; try {
; g();
; } catch (...) {
; g();
; }
; }
; CHECK: "?f@@YAXXZ": # @"\01?f@@YAXXZ"
; CHECK: .cv_fpo_proc "?f@@YAXXZ" 0
; CHECK: pushl %ebp
; CHECK: .cv_fpo_pushreg %ebp
; CHECK: movl %esp, %ebp
; CHECK: .cv_fpo_setframe %ebp
; ...
; CHECK: .cv_fpo_endprologue
; CHECK: retl
; No FPO directives in the catchpad for now.
; CHECK: "?catch$2@?0??f@@YAXXZ@4HA":
; CHECK-NOT: .cv_fpo
; CHECK: retl # CATCHRET
; FIXME: This endproc is for the parent function. To get FPO data for
; funclets we'd have to emit it first so the scopes don't nest.
; CHECK: .cv_fpo_endproc
; CHECK-NOT: .cv_fpo_data
; CHECK: .cv_fpo_data "?f@@YAXXZ"
; CHECK-NOT: .cv_fpo_data
; ModuleID = 't.cpp'
source_filename = "t.cpp"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i386-pc-windows-msvc19.11.25508"
define void @"\01?f@@YAXXZ"() local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) !dbg !8 {
entry:
invoke void @"\01?g@@YAXXZ"()
to label %try.cont unwind label %catch.dispatch, !dbg !11
catch.dispatch: ; preds = %entry
%0 = catchswitch within none [label %catch] unwind to caller, !dbg !13
catch: ; preds = %catch.dispatch
%1 = catchpad within %0 [i8* null, i32 64, i8* null], !dbg !13
call void @"\01?g@@YAXXZ"() [ "funclet"(token %1) ], !dbg !14
catchret from %1 to label %try.cont, !dbg !16
try.cont: ; preds = %entry, %catch
ret void, !dbg !17
}
declare void @"\01?g@@YAXXZ"() local_unnamed_addr #1
declare i32 @__CxxFrameHandler3(...)
attributes #0 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "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"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5, !6}
!llvm.ident = !{!7}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "1e688e4021b6626d049b9899f9d53a2a")
!2 = !{}
!3 = !{i32 1, !"NumRegisterParameters", i32 0}
!4 = !{i32 2, !"CodeView", i32 1}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = !{i32 1, !"wchar_size", i32 2}
!7 = !{!"clang version 6.0.0 "}
!8 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !1, file: !1, line: 2, type: !9, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
!9 = !DISubroutineType(types: !10)
!10 = !{null}
!11 = !DILocation(line: 4, column: 5, scope: !12)
!12 = distinct !DILexicalBlock(scope: !8, file: !1, line: 3, column: 7)
!13 = !DILocation(line: 5, column: 3, scope: !12)
!14 = !DILocation(line: 6, column: 5, scope: !15)
!15 = distinct !DILexicalBlock(scope: !8, file: !1, line: 5, column: 17)
!16 = !DILocation(line: 7, column: 3, scope: !15)
!17 = !DILocation(line: 8, column: 1, scope: !8)

View File

@@ -1,110 +0,0 @@
; RUN: llc < %s | FileCheck %s
; C source:
; void usethings(double *, void *p);
; int realign_and_alloca(int n) {
; double d = 0;
; void *p = __builtin_alloca(n);
; usethings(&d, p);
; return 0;
; }
; CHECK: _realign_and_alloca: # @realign_and_alloca
; CHECK: .cv_fpo_proc _realign_and_alloca 4
; CHECK: pushl %ebp
; CHECK: .cv_fpo_pushreg %ebp
; CHECK: movl %esp, %ebp
; CHECK: .cv_fpo_setframe %ebp
; CHECK: pushl %esi
; CHECK: .cv_fpo_pushreg %esi
; We don't seem to need to describe this AND because at this point CSRs
; are stored relative to EBP, but it's suspicious.
; CHECK: andl $-16, %esp
; CHECK: subl $32, %esp
; CHECK: .cv_fpo_stackalloc 32
; CHECK: .cv_fpo_endprologue
; CHECK: movl %esp, %esi
; CHECK: leal 8(%esi),
; CHECK: calll _usethings
; CHECK: addl $8, %esp
; CHECK: xorl %eax, %eax
; CHECK: leal -4(%ebp), %esp
; CHECK: popl %esi
; CHECK: popl %ebp
; CHECK: retl
; CHECK: .cv_fpo_endproc
; ModuleID = 't.c'
source_filename = "t.c"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i386-pc-windows-msvc19.11.25508"
; Function Attrs: nounwind
define i32 @realign_and_alloca(i32 %n) local_unnamed_addr #0 !dbg !8 {
entry:
%d = alloca double, align 8
tail call void @llvm.dbg.value(metadata i32 %n, metadata !13, metadata !DIExpression()), !dbg !18
%0 = bitcast double* %d to i8*, !dbg !19
call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull %0) #4, !dbg !19
tail call void @llvm.dbg.value(metadata double 0.000000e+00, metadata !14, metadata !DIExpression()), !dbg !20
store double 0.000000e+00, double* %d, align 8, !dbg !20, !tbaa !21
%1 = alloca i8, i32 %n, align 16, !dbg !25
tail call void @llvm.dbg.value(metadata i8* %1, metadata !16, metadata !DIExpression()), !dbg !26
tail call void @llvm.dbg.value(metadata double* %d, metadata !14, metadata !DIExpression()), !dbg !20
call void @usethings(double* nonnull %d, i8* nonnull %1) #4, !dbg !27
call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0) #4, !dbg !28
ret i32 0, !dbg !29
}
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
declare void @usethings(double*, i8*) local_unnamed_addr #2
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #3
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "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"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind }
attributes #2 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #3 = { nounwind readnone speculatable }
attributes #4 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5, !6}
!llvm.ident = !{!7}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.c", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "cfdc2deff5dc50f95e287f877660d4dd")
!2 = !{}
!3 = !{i32 1, !"NumRegisterParameters", i32 0}
!4 = !{i32 2, !"CodeView", i32 1}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = !{i32 1, !"wchar_size", i32 2}
!7 = !{!"clang version 6.0.0 "}
!8 = distinct !DISubprogram(name: "realign_and_alloca", scope: !1, file: !1, line: 2, type: !9, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !12)
!9 = !DISubroutineType(types: !10)
!10 = !{!11, !11}
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !{!13, !14, !16}
!13 = !DILocalVariable(name: "n", arg: 1, scope: !8, file: !1, line: 2, type: !11)
!14 = !DILocalVariable(name: "d", scope: !8, file: !1, line: 3, type: !15)
!15 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)
!16 = !DILocalVariable(name: "p", scope: !8, file: !1, line: 4, type: !17)
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 32)
!18 = !DILocation(line: 2, column: 28, scope: !8)
!19 = !DILocation(line: 3, column: 3, scope: !8)
!20 = !DILocation(line: 3, column: 10, scope: !8)
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !23, i64 0}
!23 = !{!"omnipotent char", !24, i64 0}
!24 = !{!"Simple C/C++ TBAA"}
!25 = !DILocation(line: 4, column: 13, scope: !8)
!26 = !DILocation(line: 4, column: 9, scope: !8)
!27 = !DILocation(line: 5, column: 3, scope: !8)
!28 = !DILocation(line: 7, column: 1, scope: !8)
!29 = !DILocation(line: 6, column: 3, scope: !8)

View File

@@ -1,154 +0,0 @@
; RUN: llc -enable-shrink-wrap=true < %s | FileCheck %s --check-prefix=ASM
; RUN: llc -enable-shrink-wrap=true -filetype=obj < %s | llvm-readobj -codeview | FileCheck %s --check-prefix=OBJ
; C source:
; int doSomething(int*);
; int __fastcall shrink_wrap_basic(int a, int b, int c, int d) {
; if (a < b)
; return a;
; for (int i = c; i < d; ++i)
; doSomething(&c);
; return doSomething(&c);
; }
; ASM: @shrink_wrap_basic@16: # @"\01@shrink_wrap_basic@16"
; ASM: .cv_fpo_proc @shrink_wrap_basic@16 8
; ASM: .cv_loc 0 1 3 9 # t.c:3:9
; ASM: movl %ecx, %eax
; ASM: cmpl %edx, %eax
; ASM: jl [[EPILOGUE:LBB0_[0-9]+]]
; ASM: pushl %ebx
; ASM: .cv_fpo_pushreg %ebx
; ASM: pushl %edi
; ASM: .cv_fpo_pushreg %edi
; ASM: pushl %esi
; ASM: .cv_fpo_pushreg %esi
; ASM: .cv_fpo_endprologue
; ASM: calll _doSomething
; ASM: popl %esi
; ASM: popl %edi
; ASM: popl %ebx
; ASM: [[EPILOGUE]]: # %return
; ASM: retl $8
; ASM: Ltmp11:
; ASM: .cv_fpo_endproc
; Note how RvaStart advances 7 bytes to skip the shrink-wrapped portion.
; OBJ: SubSectionType: FrameData (0xF5)
; OBJ: FrameData {
; OBJ: RvaStart: 0x0
; OBJ: CodeSize: 0x34
; OBJ: FrameFunc: $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + =
; OBJ: PrologSize: 0x9
; OBJ: }
; OBJ: FrameData {
; OBJ: RvaStart: 0x7
; OBJ: CodeSize: 0x2D
; OBJ: FrameFunc: $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebx $T0 4 - ^ =
; OBJ: PrologSize: 0x2
; OBJ: }
; OBJ: FrameData {
; OBJ: RvaStart: 0x8
; OBJ: CodeSize: 0x2C
; OBJ: FrameFunc: $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebx $T0 4 - ^ = $edi $T0 8 - ^ =
; OBJ: PrologSize: 0x1
; OBJ: }
; OBJ: FrameData {
; OBJ: RvaStart: 0x9
; OBJ: CodeSize: 0x2B
; OBJ: FrameFunc: $T0 .raSearch = $eip $T0 ^ = $esp $T0 4 + = $ebx $T0 4 - ^ = $edi $T0 8 - ^ = $esi $T0 12 - ^ =
; OBJ: PrologSize: 0x0
; OBJ: }
; OBJ-NOT: FrameData
; ModuleID = 't.c'
source_filename = "t.c"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i386-pc-windows-msvc19.11.25508"
; Function Attrs: nounwind
define x86_fastcallcc i32 @"\01@shrink_wrap_basic@16"(i32 inreg %a, i32 inreg %b, i32 %c, i32 %d) local_unnamed_addr #0 !dbg !8 {
entry:
%c.addr = alloca i32, align 4
tail call void @llvm.dbg.value(metadata i32 %d, metadata !13, metadata !DIExpression()), !dbg !19
tail call void @llvm.dbg.value(metadata i32 %c, metadata !14, metadata !DIExpression()), !dbg !20
store i32 %c, i32* %c.addr, align 4, !tbaa !21
tail call void @llvm.dbg.value(metadata i32 %b, metadata !15, metadata !DIExpression()), !dbg !25
tail call void @llvm.dbg.value(metadata i32 %a, metadata !16, metadata !DIExpression()), !dbg !26
%cmp = icmp slt i32 %a, %b, !dbg !27
br i1 %cmp, label %return, label %for.cond.preheader, !dbg !29
for.cond.preheader: ; preds = %entry
br label %for.cond, !dbg !30
for.cond: ; preds = %for.cond.preheader, %for.cond
%i.0 = phi i32 [ %inc, %for.cond ], [ %c, %for.cond.preheader ]
call void @llvm.dbg.value(metadata i32 %i.0, metadata !17, metadata !DIExpression()), !dbg !32
%cmp1 = icmp slt i32 %i.0, %d, !dbg !30
call void @llvm.dbg.value(metadata i32* %c.addr, metadata !14, metadata !DIExpression()), !dbg !20
%call = call i32 @doSomething(i32* nonnull %c.addr) #3, !dbg !33
%inc = add nsw i32 %i.0, 1, !dbg !34
call void @llvm.dbg.value(metadata i32 %inc, metadata !17, metadata !DIExpression()), !dbg !32
br i1 %cmp1, label %for.cond, label %return, !dbg !35, !llvm.loop !36
return: ; preds = %for.cond, %entry
%retval.0 = phi i32 [ %a, %entry ], [ %call, %for.cond ]
ret i32 %retval.0, !dbg !38
}
declare i32 @doSomething(i32*) local_unnamed_addr #1
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "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"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { nounwind readnone speculatable }
attributes #3 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5, !6}
!llvm.ident = !{!7}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.c", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "32f118fd5dd7e65ff7733c49b2f804ef")
!2 = !{}
!3 = !{i32 1, !"NumRegisterParameters", i32 0}
!4 = !{i32 2, !"CodeView", i32 1}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = !{i32 1, !"wchar_size", i32 2}
!7 = !{!"clang version 6.0.0 "}
!8 = distinct !DISubprogram(name: "shrink_wrap_basic", linkageName: "\01@shrink_wrap_basic@16", scope: !1, file: !1, line: 2, type: !9, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !12)
!9 = !DISubroutineType(cc: DW_CC_BORLAND_msfastcall, types: !10)
!10 = !{!11, !11, !11, !11, !11}
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !{!13, !14, !15, !16, !17}
!13 = !DILocalVariable(name: "d", arg: 4, scope: !8, file: !1, line: 2, type: !11)
!14 = !DILocalVariable(name: "c", arg: 3, scope: !8, file: !1, line: 2, type: !11)
!15 = !DILocalVariable(name: "b", arg: 2, scope: !8, file: !1, line: 2, type: !11)
!16 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !1, line: 2, type: !11)
!17 = !DILocalVariable(name: "i", scope: !18, file: !1, line: 5, type: !11)
!18 = distinct !DILexicalBlock(scope: !8, file: !1, line: 5, column: 3)
!19 = !DILocation(line: 2, column: 59, scope: !8)
!20 = !DILocation(line: 2, column: 52, scope: !8)
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !23, i64 0}
!23 = !{!"omnipotent char", !24, i64 0}
!24 = !{!"Simple C/C++ TBAA"}
!25 = !DILocation(line: 2, column: 45, scope: !8)
!26 = !DILocation(line: 2, column: 38, scope: !8)
!27 = !DILocation(line: 3, column: 9, scope: !28)
!28 = distinct !DILexicalBlock(scope: !8, file: !1, line: 3, column: 7)
!29 = !DILocation(line: 3, column: 7, scope: !8)
!30 = !DILocation(line: 5, column: 21, scope: !31)
!31 = distinct !DILexicalBlock(scope: !18, file: !1, line: 5, column: 3)
!32 = !DILocation(line: 5, column: 12, scope: !18)
!33 = !DILocation(line: 0, scope: !8)
!34 = !DILocation(line: 5, column: 26, scope: !31)
!35 = !DILocation(line: 5, column: 3, scope: !18)
!36 = distinct !{!36, !35, !37}
!37 = !DILocation(line: 6, column: 19, scope: !18)
!38 = !DILocation(line: 8, column: 1, scope: !8)

View File

@@ -1,114 +0,0 @@
; RUN: llc < %s | FileCheck %s
; C source:
; void escape(int *);
; int ssp(int a) {
; int arr[4] = {a, a, a, a};
; escape(&arr[0]);
; return a;
; }
; CHECK: _ssp: # @ssp
; CHECK: .cv_fpo_proc _ssp 4
; CHECK: pushl %esi
; CHECK: .cv_fpo_pushreg %esi
; CHECK: subl $20, %esp
; CHECK: .cv_fpo_stackalloc 20
; CHECK: .cv_fpo_endprologue
; CHECK: ___security_cookie
; CHECK: movl 28(%esp), %esi
; CHECK: movl %esi, {{[0-9]*}}(%esp)
; CHECK: movl %esi, {{[0-9]*}}(%esp)
; CHECK: movl %esi, {{[0-9]*}}(%esp)
; CHECK: movl %esi, {{[0-9]*}}(%esp)
; CHECK: calll _escape
; CHECK: calll @__security_check_cookie@4
; CHECK: movl %esi, %eax
; CHECK: addl $20, %esp
; CHECK: popl %esi
; CHECK: retl
; CHECK: Ltmp2:
; CHECK: .cv_fpo_endproc
; ModuleID = 't.c'
source_filename = "t.c"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i386-pc-windows-msvc19.11.25508"
; Function Attrs: nounwind sspstrong
define i32 @ssp(i32 returned %a) local_unnamed_addr #0 !dbg !8 {
entry:
%arr = alloca [4 x i32], align 4
tail call void @llvm.dbg.value(metadata i32 %a, metadata !13, metadata !DIExpression()), !dbg !18
%0 = bitcast [4 x i32]* %arr to i8*, !dbg !19
call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %0) #4, !dbg !19
tail call void @llvm.dbg.declare(metadata [4 x i32]* %arr, metadata !14, metadata !DIExpression()), !dbg !20
%arrayinit.begin = getelementptr inbounds [4 x i32], [4 x i32]* %arr, i32 0, i32 0, !dbg !21
store i32 %a, i32* %arrayinit.begin, align 4, !dbg !21, !tbaa !22
%arrayinit.element = getelementptr inbounds [4 x i32], [4 x i32]* %arr, i32 0, i32 1, !dbg !21
store i32 %a, i32* %arrayinit.element, align 4, !dbg !21, !tbaa !22
%arrayinit.element1 = getelementptr inbounds [4 x i32], [4 x i32]* %arr, i32 0, i32 2, !dbg !21
store i32 %a, i32* %arrayinit.element1, align 4, !dbg !21, !tbaa !22
%arrayinit.element2 = getelementptr inbounds [4 x i32], [4 x i32]* %arr, i32 0, i32 3, !dbg !21
store i32 %a, i32* %arrayinit.element2, align 4, !dbg !21, !tbaa !22
call void @escape(i32* nonnull %arrayinit.begin) #4, !dbg !26
call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %0) #4, !dbg !27
ret i32 %a, !dbg !28
}
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #2
declare void @escape(i32*) local_unnamed_addr #3
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #2
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
attributes #0 = { nounwind sspstrong "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "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"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone speculatable }
attributes #2 = { argmemonly nounwind }
attributes #3 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #4 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5, !6}
!llvm.ident = !{!7}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.c", directory: "C:\5Csrc\5Cllvm-project\5Cbuild", checksumkind: CSK_MD5, checksum: "df0c1a43acd19a1255d45a3f2802cf9f")
!2 = !{}
!3 = !{i32 1, !"NumRegisterParameters", i32 0}
!4 = !{i32 2, !"CodeView", i32 1}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = !{i32 1, !"wchar_size", i32 2}
!7 = !{!"clang version 6.0.0 "}
!8 = distinct !DISubprogram(name: "ssp", scope: !1, file: !1, line: 2, type: !9, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !12)
!9 = !DISubroutineType(types: !10)
!10 = !{!11, !11}
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !{!13, !14}
!13 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !1, line: 2, type: !11)
!14 = !DILocalVariable(name: "arr", scope: !8, file: !1, line: 3, type: !15)
!15 = !DICompositeType(tag: DW_TAG_array_type, baseType: !11, size: 128, elements: !16)
!16 = !{!17}
!17 = !DISubrange(count: 4)
!18 = !DILocation(line: 2, column: 13, scope: !8)
!19 = !DILocation(line: 3, column: 3, scope: !8)
!20 = !DILocation(line: 3, column: 7, scope: !8)
!21 = !DILocation(line: 3, column: 16, scope: !8)
!22 = !{!23, !23, i64 0}
!23 = !{!"int", !24, i64 0}
!24 = !{!"omnipotent char", !25, i64 0}
!25 = !{!"Simple C/C++ TBAA"}
!26 = !DILocation(line: 4, column: 3, scope: !8)
!27 = !DILocation(line: 6, column: 1, scope: !8)
!28 = !DILocation(line: 5, column: 3, scope: !8)

View File

@@ -1,32 +0,0 @@
; RUN: llc < %s | FileCheck %s
; CHECK-NOT: S_GDATA32
source_filename = "test/DebugInfo/COFF/global-dllimport.ll"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-pc-windows-msvc"
@"\01?id@?$numpunct@D@@0HA" = available_externally dllimport global i32 0, align 4, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!14, !15}
!llvm.ident = !{!16}
!0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "id", linkageName: "\01?id@?$numpunct@D@@0HA", scope: !2, file: !6, line: 4, type: !7, isLocal: false, isDefinition: true, declaration: !8)
!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 3.9.0 (trunk 272628) (llvm/trunk 272566)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/<stdin>", directory: "/usr/local/google/home/majnemer/llvm/src")
!4 = !{}
!5 = !{!0}
!6 = !DIFile(filename: "/usr/local/google/home/majnemer/Downloads/t.ii", directory: "/usr/local/google/home/majnemer/llvm/src")
!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !DIDerivedType(tag: DW_TAG_member, name: "id", scope: !9, file: !6, line: 2, baseType: !7, flags: DIFlagStaticMember)
!9 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "numpunct<char>", file: !6, line: 2, size: 8, align: 8, elements: !10, templateParams: !11)
!10 = !{!8}
!11 = !{!12}
!12 = !DITemplateTypeParameter(type: !13)
!13 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
!14 = !{i32 2, !"CodeView", i32 1}
!15 = !{i32 2, !"Debug Info Version", i32 3}
!16 = !{!"clang version 3.9.0 (trunk 272628) (llvm/trunk 272566)"}

Some files were not shown because too many files have changed in this diff Show More