blob: 4dd1d44af5d255449b93686dd4d4d7c41e8dc8e6 [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
Chris Lattner8eeba352010-01-20 06:34:14 +000021MCAsmInfoDarwin::MCAsmInfoDarwin() {
Chris Lattner4e0f25b2009-06-19 00:08:39 +000022 // Common settings for all Darwin targets.
23 // Syntax:
24 GlobalPrefix = "_";
25 PrivateGlobalPrefix = "L";
Chris Lattner8c6ed052009-09-16 01:46:41 +000026 LinkerPrivateGlobalPrefix = "l";
Chris Lattner4e0f25b2009-06-19 00:08:39 +000027 AllowQuotesInName = true;
28 HasSingleParameterDotFile = false;
Chris Lattnerf9f93e42010-01-23 07:21:06 +000029 HasSubsectionsViaSymbols = true;
Chris Lattner4e0f25b2009-06-19 00:08:39 +000030
Chris Lattnere28a2e82009-08-11 22:31:42 +000031 AlignmentIsInBytes = false;
Rafael Espindola2e2563b2010-01-26 20:21:43 +000032 COMMDirectiveAlignmentIsInBytes = false;
Chris Lattnere2b06012009-08-11 22:39:40 +000033 InlineAsmStart = " InlineAsm Start";
34 InlineAsmEnd = " InlineAsm End";
Chris Lattnere28a2e82009-08-11 22:31:42 +000035
Chris Lattner4e0f25b2009-06-19 00:08:39 +000036 // Directives:
37 WeakDefDirective = "\t.weak_definition ";
38 WeakRefDirective = "\t.weak_reference ";
Chris Lattnerb6ba9c32009-08-11 22:17:31 +000039 ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
Chris Lattneraac138e2010-01-19 02:09:44 +000040 HasMachoZeroFillDirective = true; // Uses .zerofill
Eric Christopherc1a887d2010-05-20 00:49:07 +000041 HasMachoTBSSDirective = true; // Uses .tbss
Chris Lattner71eae712010-01-19 04:34:02 +000042 HasStaticCtorDtorReferenceInStaticMode = true;
Rafael Espindola767b1be2010-12-04 00:31:13 +000043
44 // FIXME: Darwin 10 and newer don't need this.
45 LinkerRequiresNonEmptyDwarfLines = true;
Rafael Espindola0bbe0b42010-12-06 17:27:56 +000046
Rafael Espindola90a5a0c2010-12-22 21:51:29 +000047 // FIXME: Change this once MC is the system assembler.
48 HasAggressiveSymbolFolding = false;
49
Chris Lattner152a29b2010-01-23 06:53:23 +000050 HiddenVisibilityAttr = MCSA_PrivateExtern;
Stuart Hastings5129bde2011-02-23 02:27:05 +000051 HiddenDeclarationVisibilityAttr = MCSA_Invalid;
Chris Lattner152a29b2010-01-23 06:53:23 +000052 // Doesn't support protected visibility.
53 ProtectedVisibilityAttr = MCSA_Global;
Chris Lattner152a29b2010-01-23 06:53:23 +000054
Chris Lattnere28a2e82009-08-11 22:31:42 +000055 HasDotTypeDotSizeDirective = false;
Chris Lattner3a9be0e2010-01-23 05:51:36 +000056 HasNoDeadStrip = true;
Kevin Enderbye8e98d72010-11-19 18:39:33 +000057 HasSymbolResolver = true;
Devang Patelae84d5b2010-08-31 23:50:19 +000058
59 DwarfUsesAbsoluteLabelForStmtList = false;
Devang Patelb1fcfbe2010-09-02 16:43:44 +000060 DwarfUsesLabelOffsetForRanges = false;
Anton Korobeynikov745e8642008-07-19 13:14:46 +000061}