blob: 2cf982f39389672a687b1abd3c11ca3c1e768dbe [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 Lattner8eeba352010-01-20 06:34:14 +000018MCAsmInfoDarwin::MCAsmInfoDarwin() {
Chris Lattner4e0f25b2009-06-19 00:08:39 +000019 // Common settings for all Darwin targets.
20 // Syntax:
21 GlobalPrefix = "_";
22 PrivateGlobalPrefix = "L";
Chris Lattner8c6ed052009-09-16 01:46:41 +000023 LinkerPrivateGlobalPrefix = "l";
Chris Lattner4e0f25b2009-06-19 00:08:39 +000024 AllowQuotesInName = true;
25 HasSingleParameterDotFile = false;
Chris Lattnerf9f93e42010-01-23 07:21:06 +000026 HasSubsectionsViaSymbols = true;
Chris Lattner4e0f25b2009-06-19 00:08:39 +000027
Chris Lattnere28a2e82009-08-11 22:31:42 +000028 AlignmentIsInBytes = false;
Chris Lattnere2b06012009-08-11 22:39:40 +000029 InlineAsmStart = " InlineAsm Start";
30 InlineAsmEnd = " InlineAsm End";
Chris Lattnere28a2e82009-08-11 22:31:42 +000031
Chris Lattner4e0f25b2009-06-19 00:08:39 +000032 // Directives:
33 WeakDefDirective = "\t.weak_definition ";
34 WeakRefDirective = "\t.weak_reference ";
Chris Lattnerb6ba9c32009-08-11 22:17:31 +000035 ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
Chris Lattneraac138e2010-01-19 02:09:44 +000036 HasMachoZeroFillDirective = true; // Uses .zerofill
Chris Lattner71eae712010-01-19 04:34:02 +000037 HasStaticCtorDtorReferenceInStaticMode = true;
Chris Lattnere2811a72009-08-11 22:22:44 +000038 SetDirective = "\t.set";
Chris Lattner152a29b2010-01-23 06:53:23 +000039
40 HiddenVisibilityAttr = MCSA_PrivateExtern;
41 // Doesn't support protected visibility.
42 ProtectedVisibilityAttr = MCSA_Global;
43
44
Chris Lattnere28a2e82009-08-11 22:31:42 +000045 HasDotTypeDotSizeDirective = false;
Chris Lattner3a9be0e2010-01-23 05:51:36 +000046 HasNoDeadStrip = true;
Chris Lattner814819f2010-01-19 06:25:51 +000047 // Note: Even though darwin has the .lcomm directive, it is just a synonym for
48 // zerofill, so we prefer to use .zerofill.
Chris Lattnerc89ecc52009-08-11 22:06:07 +000049
Daniel Dunbarb42dad42009-08-13 17:03:38 +000050 // _foo.eh symbols are currently always exported so that the linker knows
51 // about them. This is not necessary on 10.6 and later, but it
52 // doesn't hurt anything.
53 // FIXME: I need to get this from Triple.
54 Is_EHSymbolPrivate = false;
Chris Lattnere28a2e82009-08-11 22:31:42 +000055 GlobalEHDirective = "\t.globl\t";
56 SupportsWeakOmittedEHFrame = false;
Anton Korobeynikov745e8642008-07-19 13:14:46 +000057}
58