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 JumpTableSpecialLabelPrefix = 0;
34 GlobalVarAddrPrefix = "";
35 GlobalVarAddrSuffix = "";
36 FunctionAddrPrefix = "";
37 FunctionAddrSuffix = "";
38 PersonalityPrefix = "";
39 PersonalitySuffix = "";
40 NeedsIndirectEncoding = false;
41 InlineAsmStart = "APP";
42 InlineAsmEnd = "NO_APP";
44 AllowQuotesInName = false;
45 ZeroDirective = "\t.zero\t";
46 ZeroDirectiveSuffix = 0;
47 AsciiDirective = "\t.ascii\t";
48 AscizDirective = "\t.asciz\t";
49 Data8bitsDirective = "\t.byte\t";
50 Data16bitsDirective = "\t.short\t";
51 Data32bitsDirective = "\t.long\t";
52 Data64bitsDirective = "\t.quad\t";
53 SunStyleELFSectionSwitchSyntax = false;
54 UsesELFSectionDirectiveForBSS = false;
55 AlignDirective = "\t.align\t";
56 AlignmentIsInBytes = true;
57 TextAlignFillValue = 0;
58 JumpTableDirective = 0;
59 PICJumpTableDirective = 0;
60 GlobalDirective = "\t.globl\t";
63 COMMDirective = "\t.comm\t";
64 COMMDirectiveTakesAlignment = true;
65 HasDotTypeDotSizeDirective = true;
66 HasSingleParameterDotFile = true;
70 // FIXME: These are ELFish - move to ELFMAI.
71 HiddenDirective = "\t.hidden\t";
72 ProtectedDirective = "\t.protected\t";
73 AbsoluteDebugSectionOffsets = false;
74 AbsoluteEHSectionOffsets = false;
76 HasDotLocAndDotFile = false;
77 SupportsDebugInformation = false;
78 ExceptionsType = ExceptionHandling::None;
79 DwarfRequiresFrameSection = true;
80 DwarfUsesInlineInfoSection = false;
81 Is_EHSymbolPrivate = true;
82 ForceEncodingOfFDETo32Bits = true;
83 GlobalEHDirective = 0;
84 SupportsWeakOmittedEHFrame = true;
85 DwarfSectionOffsetDirective = 0;
90 MCAsmInfo::~MCAsmInfo() {
94 unsigned MCAsmInfo::getULEB128Size(unsigned Value) {
98 Size += sizeof(int8_t);
103 unsigned MCAsmInfo::getSLEB128Size(int Value) {
105 int Sign = Value >> (8 * sizeof(Value) - 1);
109 unsigned Byte = Value & 0x7f;
111 IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
112 Size += sizeof(int8_t);