llvm.org GIT mirror llvm / 89fc9e8
Enable CFI on OS X. Currently the output should be almost identical to the one produced by CodeGen to make the transition easier. The only two differences I know of are: * Some files get an extra advance loc of size 0. This will be fixed when relaxations are enabled. * The optimization of declaring an EH symbol as an external variable is not implemented. This is a subset of adding the nounwind attribute, so we if really this at -O0 we should probably do it at the IL level. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130623 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 8 years ago
9 changed file(s) with 27 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
10691069 // Dump out the dwarf file & directory tables and line tables.
10701070 if (getContext().hasDwarfFiles() && !UseLoc)
10711071 MCDwarfFileTable::Emit(this);
1072
1073 if (getNumFrameInfos() && !UseCFI)
1074 MCDwarfFrameEmitter::Emit(*this);
10721075 }
10731076
10741077 MCStreamer *llvm::createAsmStreamer(MCContext &Context,
376376 }
377377
378378 void MCMachOStreamer::Finish() {
379 if (getNumFrameInfos())
380 MCDwarfFrameEmitter::Emit(*this);
381
379382 // We have to set the fragment atom associations so we can relax properly for
380383 // Mach-O.
381384
7070 DwarfUsesInlineInfoSection = true;
7171
7272 // Exceptions handling
73 ExceptionsType = ExceptionHandling::DwarfTable;
73 ExceptionsType = ExceptionHandling::DwarfCFI;
7474 }
7575
7676 const MCExpr *
44 ; RUN: not grep add %t
55 ; RUN: grep mulhw %t | count 1
66
7 define i32 @mulhs(i32 %a, i32 %b) {
7 define i32 @mulhs(i32 %a, i32 %b) nounwind {
88 entry:
99 %tmp.1 = sext i32 %a to i64 ; [#uses=1]
1010 %tmp.3 = sext i32 %b to i64 ; [#uses=1]
None ; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin | grep {isNullOrNil].eh"} | count 2
0 ; RUN: llc < %s -disable-cfi -march=x86 -mtriple=i686-apple-darwin | grep {isNullOrNil].eh"} | FileCheck %s
1
2 ; CHECK: "_-[NSString(local) isNullOrNil].eh":
13
24 %struct.NSString = type { }
35 %struct._objc__method_prototype_list = type opaque
None ; RUN: llc < %s | FileCheck %s
0 ; RUN: llc < %s -disable-cfi | FileCheck %s
11 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
22 target triple = "i386-apple-darwin8"
33
None ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin9 | grep ^__Z1fv.eh
1 ; RUN: llc < %s -march=x86 -mtriple=i386-apple-darwin9 | grep ^__Z1fv.eh
0 ; RUN: llc < %s -disable-cfi -march=x86-64 -mtriple=x86_64-apple-darwin9 | grep ^__Z1fv.eh
1 ; RUN: llc < %s -disable-cfi -march=x86 -mtriple=i386-apple-darwin9 | grep ^__Z1fv.eh
22
33 define void @_Z1fv() {
44 entry:
None ; RUN: llc < %s -mtriple=i386-apple-darwin9 -relocation-model=pic -disable-fp-elim -unwind-tables | FileCheck %s
0 ; RUN: llc < %s -disable-cfi -mtriple=i386-apple-darwin9 -relocation-model=pic -disable-fp-elim -unwind-tables | FileCheck %s
11
22
33
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin9 -disable-cgp-branch-opts | FileCheck %s -check-prefix=X64
1 ; RUN: llc < %s -mtriple=i386-apple-darwin9 -disable-cgp-branch-opts | FileCheck %s -check-prefix=X32
0 ; RUN: llc < %s -disable-cfi -mtriple=x86_64-apple-darwin9 -disable-cgp-branch-opts | FileCheck %s -check-prefix=X64
1 ; RUN: llc < %s -disable-cfi -mtriple=i386-apple-darwin9 -disable-cgp-branch-opts | FileCheck %s -check-prefix=X32
22 ; PR1632
33
44 define void @_Z1fv() {
3737
3838 declare void @__cxa_end_catch()
3939
40 ; X64: Leh_frame_common_begin0:
41 ; X64: .long ___gxx_personality_v0@GOTPCREL+4
40 ; X64: zPLR
41 ; X64: .byte 155
42 ; X64-NEXT: .long ___gxx_personality_v0@GOTPCREL+4
4243
43 ; X32: Leh_frame_common_begin0:
44 ; X32: .long L___gxx_personality_v0$non_lazy_ptr-
45 ; ....
44 ; X32: .section __IMPORT,__pointers,non_lazy_symbol_pointers
45 ; X32-NEXT: L___gxx_personality_v0$non_lazy_ptr:
46 ; X32-NEXT: .indirect_symbol ___gxx_personality_v0
4647
47 ; X32: .section __IMPORT,__pointers,non_lazy_symbol_pointers
48 ; X32: L___gxx_personality_v0$non_lazy_ptr:
49 ; X32: .indirect_symbol ___gxx_personality_v0
48 ; X32: zPLR
49 ; X32: .byte 155
50 ; X32-NEXT: :
51 ; X32-NEXT: .long L___gxx_personality_v0$non_lazy_ptr-