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 HasMachoTBSSDirective
= false;
25 HasStaticCtorDtorReferenceInStaticMode
= false;
33 PrivateGlobalPrefix
= ".";
34 LinkerPrivateGlobalPrefix
= "";
35 InlineAsmStart
= "APP";
36 InlineAsmEnd
= "NO_APP";
38 AllowQuotesInName
= false;
39 AllowNameToStartWithDigit
= false;
40 AllowPeriodsInName
= true;
41 ZeroDirective
= "\t.zero\t";
42 AsciiDirective
= "\t.ascii\t";
43 AscizDirective
= "\t.asciz\t";
44 Data8bitsDirective
= "\t.byte\t";
45 Data16bitsDirective
= "\t.short\t";
46 Data32bitsDirective
= "\t.long\t";
47 Data64bitsDirective
= "\t.quad\t";
48 SunStyleELFSectionSwitchSyntax
= false;
49 UsesELFSectionDirectiveForBSS
= false;
50 AlignDirective
= "\t.align\t";
51 AlignmentIsInBytes
= true;
52 TextAlignFillValue
= 0;
54 GlobalDirective
= "\t.globl\t";
55 HasSetDirective
= true;
56 HasLCOMMDirective
= false;
57 COMMDirectiveAlignmentIsInBytes
= true;
58 HasDotTypeDotSizeDirective
= true;
59 HasSingleParameterDotFile
= true;
60 HasNoDeadStrip
= false;
63 LinkOnceDirective
= 0;
64 HiddenVisibilityAttr
= MCSA_Hidden
;
65 ProtectedVisibilityAttr
= MCSA_Protected
;
67 HasDotLocAndDotFile
= false;
68 SupportsDebugInformation
= false;
69 ExceptionsType
= ExceptionHandling::None
;
70 DwarfRequiresFrameSection
= true;
71 DwarfUsesInlineInfoSection
= false;
72 DwarfUsesAbsoluteLabelForStmtList
= true;
73 DwarfSectionOffsetDirective
= 0;
74 DwarfUsesLabelOffsetForRanges
= true;
75 HasMicrosoftFastStdCallMangling
= false;
80 MCAsmInfo::~MCAsmInfo() {
84 unsigned MCAsmInfo::getULEB128Size(unsigned Value
) {
88 Size
+= sizeof(int8_t);
93 unsigned MCAsmInfo::getSLEB128Size(int Value
) {
95 int Sign
= Value
>> (8 * sizeof(Value
) - 1);
99 unsigned Byte
= Value
& 0x7f;
101 IsMore
= Value
!= Sign
|| ((Byte
^ Sign
) & 0x40) != 0;
102 Size
+= sizeof(int8_t);