blob: 7c271a9e824b910e2900062a126f11b5a6239561 [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"
Rafael Espindolabfa27cc2011-04-28 16:09:09 +000016#include "llvm/MC/MCContext.h"
17#include "llvm/MC/MCExpr.h"
18#include "llvm/MC/MCStreamer.h"
Anton Korobeynikov745e8642008-07-19 13:14:46 +000019using namespace llvm;
20
Jim Grosbach2684d9e2012-05-11 01:41:30 +000021void MCAsmInfoDarwin::anchor() { }
David Blaikie2d24e2a2011-12-20 02:50:00 +000022
Chris Lattner8eeba352010-01-20 06:34:14 +000023MCAsmInfoDarwin::MCAsmInfoDarwin() {
Chris Lattner4e0f25b2009-06-19 00:08:39 +000024 // Common settings for all Darwin targets.
25 // Syntax:
26 GlobalPrefix = "_";
27 PrivateGlobalPrefix = "L";
Chris Lattner8c6ed052009-09-16 01:46:41 +000028 LinkerPrivateGlobalPrefix = "l";
Chris Lattner4e0f25b2009-06-19 00:08:39 +000029 AllowQuotesInName = true;
30 HasSingleParameterDotFile = false;
Chris Lattnerf9f93e42010-01-23 07:21:06 +000031 HasSubsectionsViaSymbols = true;
Chris Lattner4e0f25b2009-06-19 00:08:39 +000032
Chris Lattnere28a2e82009-08-11 22:31:42 +000033 AlignmentIsInBytes = false;
Rafael Espindola2e2563b2010-01-26 20:21:43 +000034 COMMDirectiveAlignmentIsInBytes = false;
Chris Lattnere2b06012009-08-11 22:39:40 +000035 InlineAsmStart = " InlineAsm Start";
36 InlineAsmEnd = " InlineAsm End";
Chris Lattnere28a2e82009-08-11 22:31:42 +000037
Chris Lattner4e0f25b2009-06-19 00:08:39 +000038 // Directives:
39 WeakDefDirective = "\t.weak_definition ";
40 WeakRefDirective = "\t.weak_reference ";
Chris Lattnerb6ba9c32009-08-11 22:17:31 +000041 ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
Chris Lattneraac138e2010-01-19 02:09:44 +000042 HasMachoZeroFillDirective = true; // Uses .zerofill
Eric Christopherc1a887d2010-05-20 00:49:07 +000043 HasMachoTBSSDirective = true; // Uses .tbss
Chris Lattner71eae712010-01-19 04:34:02 +000044 HasStaticCtorDtorReferenceInStaticMode = true;
Rafael Espindola767b1be2010-12-04 00:31:13 +000045
46 // FIXME: Darwin 10 and newer don't need this.
47 LinkerRequiresNonEmptyDwarfLines = true;
Rafael Espindola0bbe0b42010-12-06 17:27:56 +000048
Rafael Espindola90a5a0c2010-12-22 21:51:29 +000049 // FIXME: Change this once MC is the system assembler.
50 HasAggressiveSymbolFolding = false;
51
Chris Lattner152a29b2010-01-23 06:53:23 +000052 HiddenVisibilityAttr = MCSA_PrivateExtern;
Stuart Hastings5129bde2011-02-23 02:27:05 +000053 HiddenDeclarationVisibilityAttr = MCSA_Invalid;
Bill Wendling6ea04672011-11-29 02:39:58 +000054
Chris Lattner152a29b2010-01-23 06:53:23 +000055 // Doesn't support protected visibility.
Bill Wendling6ea04672011-11-29 02:39:58 +000056 ProtectedVisibilityAttr = MCSA_Invalid;
Jim Grosbach2684d9e2012-05-11 01:41:30 +000057
Chris Lattnere28a2e82009-08-11 22:31:42 +000058 HasDotTypeDotSizeDirective = false;
Chris Lattner3a9be0e2010-01-23 05:51:36 +000059 HasNoDeadStrip = true;
Kevin Enderbye8e98d72010-11-19 18:39:33 +000060 HasSymbolResolver = true;
Devang Patelae84d5b2010-08-31 23:50:19 +000061
Rafael Espindoladc52ecf2011-05-10 20:35:05 +000062 DwarfRequiresRelocationForSectionOffset = false;
Nick Lewyckyffccd922012-06-22 01:25:12 +000063 DwarfUsesRelocationsAcrossSections = false;
Nick Lewycky390c40d2011-10-27 06:44:11 +000064 DwarfUsesRelocationsForStringPool = false;
Anton Korobeynikov745e8642008-07-19 13:14:46 +000065}