1 //===-- DarwinTargetAsmInfo.cpp - Darwin asm properties ---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines target asm properties related what form asm statements
11 // should take in general on Darwin-based targets
13 //===----------------------------------------------------------------------===//
15 #include "llvm/Target/DarwinTargetAsmInfo.h"
16 #include "llvm/ADT/Triple.h"
19 DarwinTargetAsmInfo::DarwinTargetAsmInfo(const Triple &Triple) {
20 // Common settings for all Darwin targets.
23 PrivateGlobalPrefix = "L";
24 LinkerPrivateGlobalPrefix = "l"; // Marker for some ObjC metadata
26 NeedsIndirectEncoding = true;
27 AllowQuotesInName = true;
28 HasSingleParameterDotFile = false;
30 AlignmentIsInBytes = false;
31 InlineAsmStart = " InlineAsm Start";
32 InlineAsmEnd = " InlineAsm End";
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";
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";
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;
57 // Leopard (10.5 aka darwin9) and later support aligned common symbols.
58 COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9;
60 GlobalEHDirective = "\t.globl\t";
61 SupportsWeakOmittedEHFrame = false;