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/System/DataTypes.h"
21 MCAsmInfo::MCAsmInfo() {
22 HasSubsectionsViaSymbols = false;
23 HasMachoZeroFillDirective = false;
24 HasStaticCtorDtorReferenceInStaticMode = false;
31 PrivateGlobalPrefix = ".";
32 LinkerPrivateGlobalPrefix = "";
33 InlineAsmStart = "APP";
34 InlineAsmEnd = "NO_APP";
36 AllowQuotesInName = false;
37 AllowNameToStartWithDigit = false;
38 AllowPeriodsInName = true;
39 ZeroDirective = "\t.zero\t";
40 AsciiDirective = "\t.ascii\t";
41 AscizDirective = "\t.asciz\t";
42 Data8bitsDirective = "\t.byte\t";
43 Data16bitsDirective = "\t.short\t";
44 Data32bitsDirective = "\t.long\t";
45 Data64bitsDirective = "\t.quad\t";
46 SunStyleELFSectionSwitchSyntax = false;
47 UsesELFSectionDirectiveForBSS = false;
48 AlignDirective = "\t.align\t";
49 AlignmentIsInBytes = true;
50 TextAlignFillValue = 0;
52 GlobalDirective = "\t.globl\t";
53 HasSetDirective = true;
54 HasLCOMMDirective = false;
55 COMMDirectiveAlignmentIsInBytes = true;
56 HasDotTypeDotSizeDirective = true;
57 HasSingleParameterDotFile = true;
58 HasNoDeadStrip = false;
61 LinkOnceDirective = 0;
62 HiddenVisibilityAttr = MCSA_Hidden;
63 ProtectedVisibilityAttr = MCSA_Protected;
65 HasDotLocAndDotFile = false;
66 SupportsDebugInformation = false;
67 ExceptionsType = ExceptionHandling::None;
68 DwarfRequiresFrameSection = true;
69 DwarfUsesInlineInfoSection = false;
70 DwarfSectionOffsetDirective = 0;
71 HasMicrosoftFastStdCallMangling = false;
76 MCAsmInfo::~MCAsmInfo() {
80 unsigned MCAsmInfo::getULEB128Size(unsigned Value) {
84 Size += sizeof(int8_t);
89 unsigned MCAsmInfo::getSLEB128Size(int Value) {
91 int Sign = Value >> (8 * sizeof(Value) - 1);
95 unsigned Byte = Value & 0x7f;
97 IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
98 Size += sizeof(int8_t);