fix a minor fixme. When building with SL and later tools, the ".eh" symbols
[oota-llvm.git] / lib / Target / DarwinTargetAsmInfo.cpp
1 //===-- DarwinTargetAsmInfo.cpp - Darwin asm properties ---------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines target asm properties related what form asm statements
11 // should take in general on Darwin-based targets
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "llvm/Target/DarwinTargetAsmInfo.h"
16 #include "llvm/ADT/Triple.h"
17 using namespace llvm;
18
19 DarwinTargetAsmInfo::DarwinTargetAsmInfo(const Triple &Triple) {
20   // Common settings for all Darwin targets.
21   // Syntax:
22   GlobalPrefix = "_";
23   PrivateGlobalPrefix = "L";
24   LinkerPrivateGlobalPrefix = "l";  // Marker for some ObjC metadata
25   NeedsSet = true;
26   NeedsIndirectEncoding = true;
27   AllowQuotesInName = true;
28   HasSingleParameterDotFile = false;
29
30   AlignmentIsInBytes = false;
31   InlineAsmStart = " InlineAsm Start";
32   InlineAsmEnd = " InlineAsm End";
33
34   // In non-PIC modes, emit a special label before jump tables so that the
35   // linker can perform more accurate dead code stripping.  We do not check the
36   // relocation model here since it can be overridden later.
37   JumpTableSpecialLabelPrefix = "l";
38     
39   // Directives:
40   WeakDefDirective = "\t.weak_definition ";
41   WeakRefDirective = "\t.weak_reference ";
42   HiddenDirective = "\t.private_extern ";
43   LCOMMDirective = "\t.lcomm\t";
44   ZeroDirective = "\t.space\t";  // ".space N" emits N zeros.
45   ZeroFillDirective = "\t.zerofill\t";  // Uses .zerofill
46   SetDirective = "\t.set";
47   ProtectedDirective = "\t.globl\t";
48   HasDotTypeDotSizeDirective = false;
49   UsedDirective = "\t.no_dead_strip\t";
50
51   // On Leoaprd (10.5 aka darwin9) and earlier, _foo.eh symbols must be exported
52   // so that the linker knows about them.  This is not necessary on 10.6 and
53   // later, but it doesn't hurt anything.
54   if (Triple.getDarwinMajorNumber() >= 10)
55     Is_EHSymbolPrivate = false;
56   
57   // Leopard (10.5 aka darwin9) and later support aligned common symbols.
58   COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9;
59   
60   GlobalEHDirective = "\t.globl\t";
61   SupportsWeakOmittedEHFrame = false;
62 }
63