1 //===-- MCAsmInfo.cpp - Asm Info -------------------------------------------==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines target asm properties related what form asm statements
13 //===----------------------------------------------------------------------===//
15 #include "llvm/MC/MCAsmInfo.h"
16 #include "llvm/MC/MCExpr.h"
17 #include "llvm/MC/MCStreamer.h"
18 #include "llvm/Support/DataTypes.h"
23 MCAsmInfo::MCAsmInfo() {
24 HasSubsectionsViaSymbols = false;
25 HasMachoZeroFillDirective = false;
26 HasMachoTBSSDirective = false;
27 HasStaticCtorDtorReferenceInStaticMode = false;
28 LinkerRequiresNonEmptyDwarfLines = false;
31 SeparatorString = ";";
36 PrivateGlobalPrefix = ".";
37 LinkerPrivateGlobalPrefix = "";
38 InlineAsmStart = "APP";
39 InlineAsmEnd = "NO_APP";
41 AllowQuotesInName = false;
42 AllowNameToStartWithDigit = false;
43 AllowPeriodsInName = true;
44 ZeroDirective = "\t.zero\t";
45 AsciiDirective = "\t.ascii\t";
46 AscizDirective = "\t.asciz\t";
47 Data8bitsDirective = "\t.byte\t";
48 Data16bitsDirective = "\t.short\t";
49 Data32bitsDirective = "\t.long\t";
50 Data64bitsDirective = "\t.quad\t";
51 SunStyleELFSectionSwitchSyntax = false;
52 UsesELFSectionDirectiveForBSS = false;
53 AlignDirective = "\t.align\t";
54 AlignmentIsInBytes = true;
55 TextAlignFillValue = 0;
57 GlobalDirective = "\t.globl\t";
58 HasSetDirective = true;
59 HasAggressiveSymbolFolding = true;
60 HasLCOMMDirective = false;
61 COMMDirectiveAlignmentIsInBytes = true;
62 HasDotTypeDotSizeDirective = true;
63 HasSingleParameterDotFile = true;
64 HasNoDeadStrip = false;
65 HasSymbolResolver = false;
68 LinkOnceDirective = 0;
69 HiddenVisibilityAttr = MCSA_Hidden;
70 HiddenDeclarationVisibilityAttr = MCSA_Hidden;
71 ProtectedVisibilityAttr = MCSA_Protected;
73 SupportsDebugInformation = false;
74 ExceptionsType = ExceptionHandling::None;
75 DwarfRequiresFrameSection = true;
76 DwarfUsesInlineInfoSection = false;
77 DwarfUsesAbsoluteLabelForStmtList = true;
78 DwarfSectionOffsetDirective = 0;
79 DwarfUsesLabelOffsetForRanges = true;
80 HasMicrosoftFastStdCallMangling = false;
85 MCAsmInfo::~MCAsmInfo() {
89 unsigned MCAsmInfo::getULEB128Size(unsigned Value) {
93 Size += sizeof(int8_t);
98 unsigned MCAsmInfo::getSLEB128Size(int Value) {
100 int Sign = Value >> (8 * sizeof(Value) - 1);
104 unsigned Byte = Value & 0x7f;
106 IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
107 Size += sizeof(int8_t);
113 MCAsmInfo::getExprForPersonalitySymbol(const MCSymbol *Sym,
114 MCStreamer &Streamer) const {
115 return MCSymbolRefExpr::Create(Sym, Streamer.getContext());