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 InlineAsmStart = "APP";
34 InlineAsmEnd = "NO_APP";
36 AllowQuotesInName = false;
37 ZeroDirective = "\t.zero\t";
38 ZeroDirectiveSuffix = 0;
39 AsciiDirective = "\t.ascii\t";
40 AscizDirective = "\t.asciz\t";
41 Data8bitsDirective = "\t.byte\t";
42 Data16bitsDirective = "\t.short\t";
43 Data32bitsDirective = "\t.long\t";
44 Data64bitsDirective = "\t.quad\t";
45 SunStyleELFSectionSwitchSyntax = false;
46 UsesELFSectionDirectiveForBSS = false;
47 AlignDirective = "\t.align\t";
48 AlignmentIsInBytes = true;
49 TextAlignFillValue = 0;
50 JumpTableDirective = 0;
51 PICJumpTableDirective = 0;
52 GlobalDirective = "\t.globl\t";
55 COMMDirective = "\t.comm\t";
56 COMMDirectiveTakesAlignment = true;
57 HasDotTypeDotSizeDirective = true;
58 HasSingleParameterDotFile = true;
62 // FIXME: These are ELFish - move to ELFMAI.
63 HiddenDirective = "\t.hidden\t";
64 ProtectedDirective = "\t.protected\t";
65 AbsoluteDebugSectionOffsets = false;
66 AbsoluteEHSectionOffsets = false;
68 HasDotLocAndDotFile = false;
69 SupportsDebugInformation = false;
70 ExceptionsType = ExceptionHandling::None;
71 DwarfRequiresFrameSection = true;
72 DwarfUsesInlineInfoSection = false;
73 Is_EHSymbolPrivate = true;
74 GlobalEHDirective = 0;
75 SupportsWeakOmittedEHFrame = true;
76 DwarfSectionOffsetDirective = 0;
81 MCAsmInfo::~MCAsmInfo() {
85 unsigned MCAsmInfo::getULEB128Size(unsigned Value) {
89 Size += sizeof(int8_t);
94 unsigned MCAsmInfo::getSLEB128Size(int Value) {
96 int Sign = Value >> (8 * sizeof(Value) - 1);
100 unsigned Byte = Value & 0x7f;
102 IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
103 Size += sizeof(int8_t);