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/Support/DataTypes.h"
21 MCAsmInfo::MCAsmInfo() {
22 ZeroFillDirective
= 0;
23 NonexecutableStackDirective
= 0;
31 PrivateGlobalPrefix
= ".";
32 LinkerPrivateGlobalPrefix
= "";
33 PersonalityPrefix
= "";
34 PersonalitySuffix
= "";
35 NeedsIndirectEncoding
= false;
36 InlineAsmStart
= "APP";
37 InlineAsmEnd
= "NO_APP";
39 AllowQuotesInName
= false;
40 ZeroDirective
= "\t.zero\t";
41 ZeroDirectiveSuffix
= 0;
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;
53 JumpTableDirective
= 0;
54 PICJumpTableDirective
= 0;
55 GlobalDirective
= "\t.globl\t";
58 COMMDirective
= "\t.comm\t";
59 COMMDirectiveTakesAlignment
= true;
60 HasDotTypeDotSizeDirective
= true;
61 HasSingleParameterDotFile
= true;
65 // FIXME: These are ELFish - move to ELFMAI.
66 HiddenDirective
= "\t.hidden\t";
67 ProtectedDirective
= "\t.protected\t";
68 AbsoluteDebugSectionOffsets
= false;
69 AbsoluteEHSectionOffsets
= false;
71 HasDotLocAndDotFile
= false;
72 SupportsDebugInformation
= false;
73 ExceptionsType
= ExceptionHandling::None
;
74 DwarfRequiresFrameSection
= true;
75 DwarfUsesInlineInfoSection
= false;
76 Is_EHSymbolPrivate
= true;
77 GlobalEHDirective
= 0;
78 SupportsWeakOmittedEHFrame
= true;
79 DwarfSectionOffsetDirective
= 0;
84 MCAsmInfo::~MCAsmInfo() {
88 unsigned MCAsmInfo::getULEB128Size(unsigned Value
) {
92 Size
+= sizeof(int8_t);
97 unsigned MCAsmInfo::getSLEB128Size(int Value
) {
99 int Sign
= Value
>> (8 * sizeof(Value
) - 1);
103 unsigned Byte
= Value
& 0x7f;
105 IsMore
= Value
!= Sign
|| ((Byte
^ Sign
) & 0x40) != 0;
106 Size
+= sizeof(int8_t);