1 //===-- TargetAsmInfo.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/Target/TargetAsmInfo.h"
20 TargetAsmInfo::TargetAsmInfo() {
21 ZeroFillDirective = 0;
22 NonexecutableStackDirective = 0;
29 FirstOperandColumn = 0;
32 PrivateGlobalPrefix = ".";
33 LinkerPrivateGlobalPrefix = "";
34 JumpTableSpecialLabelPrefix = 0;
35 GlobalVarAddrPrefix = "";
36 GlobalVarAddrSuffix = "";
37 FunctionAddrPrefix = "";
38 FunctionAddrSuffix = "";
39 PersonalityPrefix = "";
40 PersonalitySuffix = "";
41 NeedsIndirectEncoding = false;
42 InlineAsmStart = "#APP";
43 InlineAsmEnd = "#NO_APP";
45 AllowQuotesInName = false;
46 ZeroDirective = "\t.zero\t";
47 ZeroDirectiveSuffix = 0;
48 AsciiDirective = "\t.ascii\t";
49 AscizDirective = "\t.asciz\t";
50 Data8bitsDirective = "\t.byte\t";
51 Data16bitsDirective = "\t.short\t";
52 Data32bitsDirective = "\t.long\t";
53 Data64bitsDirective = "\t.quad\t";
54 AlignDirective = "\t.align\t";
55 AlignmentIsInBytes = true;
56 TextAlignFillValue = 0;
57 SwitchToSectionDirective = "\t.section\t";
58 TextSectionStartSuffix = "";
59 DataSectionStartSuffix = "";
60 SectionEndDirectiveSuffix = 0;
61 JumpTableDirective = 0;
62 GlobalDirective = "\t.globl\t";
65 COMMDirective = "\t.comm\t";
66 COMMDirectiveTakesAlignment = true;
67 HasDotTypeDotSizeDirective = true;
68 HasSingleParameterDotFile = true;
72 // FIXME: These are ELFish - move to ELFTAI.
73 HiddenDirective = "\t.hidden\t";
74 ProtectedDirective = "\t.protected\t";
75 AbsoluteDebugSectionOffsets = false;
76 AbsoluteEHSectionOffsets = false;
78 HasDotLocAndDotFile = false;
79 SupportsDebugInformation = false;
80 SupportsExceptionHandling = false;
81 DwarfRequiresFrameSection = true;
82 DwarfUsesInlineInfoSection = false;
83 Is_EHSymbolPrivate = true;
84 GlobalEHDirective = 0;
85 SupportsWeakOmittedEHFrame = true;
86 DwarfSectionOffsetDirective = 0;
87 DwarfAbbrevSection = ".debug_abbrev";
88 DwarfInfoSection = ".debug_info";
89 DwarfLineSection = ".debug_line";
90 DwarfFrameSection = ".debug_frame";
91 DwarfPubNamesSection = ".debug_pubnames";
92 DwarfPubTypesSection = ".debug_pubtypes";
93 DwarfDebugInlineSection = ".debug_inlined";
94 DwarfStrSection = ".debug_str";
95 DwarfLocSection = ".debug_loc";
96 DwarfARangesSection = ".debug_aranges";
97 DwarfRangesSection = ".debug_ranges";
98 DwarfMacroInfoSection = ".debug_macinfo";
102 TargetAsmInfo::~TargetAsmInfo() {
106 unsigned TargetAsmInfo::getULEB128Size(unsigned Value) {
110 Size += sizeof(int8_t);
115 unsigned TargetAsmInfo::getSLEB128Size(int Value) {
117 int Sign = Value >> (8 * sizeof(Value) - 1);
121 unsigned Byte = Value & 0x7f;
123 IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0;
124 Size += sizeof(int8_t);