MCAsmInfoDarwin.cpp revision 234353
1//===-- MCAsmInfoDarwin.cpp - Darwin asm properties -------------*- C++ -*-===//
2//
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
15#include "llvm/MC/MCAsmInfoDarwin.h"
16#include "llvm/MC/MCContext.h"
17#include "llvm/MC/MCExpr.h"
18#include "llvm/MC/MCStreamer.h"
19using namespace llvm;
20
21void MCAsmInfoDarwin::anchor() { }
22
23MCAsmInfoDarwin::MCAsmInfoDarwin() {
24  // Common settings for all Darwin targets.
25  // Syntax:
26  GlobalPrefix = "_";
27  PrivateGlobalPrefix = "L";
28  LinkerPrivateGlobalPrefix = "l";
29  AllowQuotesInName = true;
30  HasSingleParameterDotFile = false;
31  HasSubsectionsViaSymbols = true;
32
33  AlignmentIsInBytes = false;
34  COMMDirectiveAlignmentIsInBytes = false;
35  InlineAsmStart = " InlineAsm Start";
36  InlineAsmEnd = " InlineAsm End";
37
38  // Directives:
39  WeakDefDirective = "\t.weak_definition ";
40  WeakRefDirective = "\t.weak_reference ";
41  ZeroDirective = "\t.space\t";  // ".space N" emits N zeros.
42  HasMachoZeroFillDirective = true;  // Uses .zerofill
43  HasMachoTBSSDirective = true; // Uses .tbss
44  HasStaticCtorDtorReferenceInStaticMode = true;
45
46  CodeBegin = "L$start$code$";
47  DataBegin = "L$start$data$";
48  JT8Begin  = "L$start$jt8$";
49  JT16Begin = "L$start$jt16$";
50  JT32Begin = "L$start$jt32$";
51  SupportsDataRegions = true;
52
53  // FIXME: Darwin 10 and newer don't need this.
54  LinkerRequiresNonEmptyDwarfLines = true;
55
56  // FIXME: Change this once MC is the system assembler.
57  HasAggressiveSymbolFolding = false;
58
59  HiddenVisibilityAttr = MCSA_PrivateExtern;
60  HiddenDeclarationVisibilityAttr = MCSA_Invalid;
61
62  // Doesn't support protected visibility.
63  ProtectedVisibilityAttr = MCSA_Invalid;
64
65  HasDotTypeDotSizeDirective = false;
66  HasNoDeadStrip = true;
67  HasSymbolResolver = true;
68
69  DwarfRequiresRelocationForSectionOffset = false;
70  DwarfUsesLabelOffsetForRanges = false;
71  DwarfUsesRelocationsForStringPool = false;
72}
73