blob: f024a1668c6a22d58d30414c243aa1c111420328 [file] [log] [blame]
Chris Lattneraf76e592009-08-22 20:48:53 +00001//===-- MCAsmInfoDarwin.cpp - Darwin asm properties -------------*- C++ -*-===//
Anton Korobeynikov745e8642008-07-19 13:14:46 +00002//
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
Chris Lattneraf76e592009-08-22 20:48:53 +000015#include "llvm/MC/MCAsmInfoDarwin.h"
Anton Korobeynikov745e8642008-07-19 13:14:46 +000016using namespace llvm;
17
Chris Lattnerc7b88142010-01-19 22:42:28 +000018MCAsmInfoDarwin::MCAsmInfoDarwin(bool isLittleEndian)
19 : MCAsmInfo(isLittleEndian) {
Chris Lattner4e0f25b2009-06-19 00:08:39 +000020 // Common settings for all Darwin targets.
21 // Syntax:
22 GlobalPrefix = "_";
23 PrivateGlobalPrefix = "L";
Chris Lattner8c6ed052009-09-16 01:46:41 +000024 LinkerPrivateGlobalPrefix = "l";
Chris Lattner4e0f25b2009-06-19 00:08:39 +000025 NeedsSet = true;
Chris Lattner4e0f25b2009-06-19 00:08:39 +000026 AllowQuotesInName = true;
27 HasSingleParameterDotFile = false;
28
Chris Lattnere28a2e82009-08-11 22:31:42 +000029 AlignmentIsInBytes = false;
Chris Lattnere2b06012009-08-11 22:39:40 +000030 InlineAsmStart = " InlineAsm Start";
31 InlineAsmEnd = " InlineAsm End";
Chris Lattnere28a2e82009-08-11 22:31:42 +000032
Chris Lattner4e0f25b2009-06-19 00:08:39 +000033 // Directives:
34 WeakDefDirective = "\t.weak_definition ";
35 WeakRefDirective = "\t.weak_reference ";
36 HiddenDirective = "\t.private_extern ";
Chris Lattnerb6ba9c32009-08-11 22:17:31 +000037 ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
Chris Lattneraac138e2010-01-19 02:09:44 +000038 HasMachoZeroFillDirective = true; // Uses .zerofill
Chris Lattner71eae712010-01-19 04:34:02 +000039 HasStaticCtorDtorReferenceInStaticMode = true;
Chris Lattnere2811a72009-08-11 22:22:44 +000040 SetDirective = "\t.set";
41 ProtectedDirective = "\t.globl\t";
Chris Lattnere28a2e82009-08-11 22:31:42 +000042 HasDotTypeDotSizeDirective = false;
43 UsedDirective = "\t.no_dead_strip\t";
Chris Lattner814819f2010-01-19 06:25:51 +000044 // Note: Even though darwin has the .lcomm directive, it is just a synonym for
45 // zerofill, so we prefer to use .zerofill.
Chris Lattnerc89ecc52009-08-11 22:06:07 +000046
Daniel Dunbarb42dad42009-08-13 17:03:38 +000047 // _foo.eh symbols are currently always exported so that the linker knows
48 // about them. This is not necessary on 10.6 and later, but it
49 // doesn't hurt anything.
50 // FIXME: I need to get this from Triple.
51 Is_EHSymbolPrivate = false;
Chris Lattnere28a2e82009-08-11 22:31:42 +000052 GlobalEHDirective = "\t.globl\t";
53 SupportsWeakOmittedEHFrame = false;
Anton Korobeynikov745e8642008-07-19 13:14:46 +000054}
55