Coverage Report

Created: 2018-07-19 03:59

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/MC/MCAsmInfo.h
Line
Count
Source (jump to first uncovered line)
1
//===-- llvm/MC/MCAsmInfo.h - Asm info --------------------------*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// This file contains a class to be used as the basis for target specific
11
// asm writers.  This class primarily takes care of global printing constants,
12
// which are used in very similar ways across all targets.
13
//
14
//===----------------------------------------------------------------------===//
15
16
#ifndef LLVM_MC_MCASMINFO_H
17
#define LLVM_MC_MCASMINFO_H
18
19
#include "llvm/ADT/StringRef.h"
20
#include "llvm/MC/MCDirectives.h"
21
#include "llvm/MC/MCDwarf.h"
22
#include "llvm/MC/MCTargetOptions.h"
23
#include <vector>
24
25
namespace llvm {
26
27
class MCContext;
28
class MCExpr;
29
class MCSection;
30
class MCStreamer;
31
class MCSymbol;
32
33
namespace WinEH {
34
35
enum class EncodingType {
36
  Invalid, /// Invalid
37
  Alpha,   /// Windows Alpha
38
  Alpha64, /// Windows AXP64
39
  ARM,     /// Windows NT (Windows on ARM)
40
  CE,      /// Windows CE ARM, PowerPC, SH3, SH4
41
  Itanium, /// Windows x64, Windows Itanium (IA-64)
42
  X86,     /// Windows x86, uses no CFI, just EH tables
43
  MIPS = Alpha,
44
};
45
46
} // end namespace WinEH
47
48
namespace LCOMM {
49
50
enum LCOMMType { NoAlignment, ByteAlignment, Log2Alignment };
51
52
} // end namespace LCOMM
53
54
/// This class is intended to be used as a base class for asm
55
/// properties and features specific to the target.
56
class MCAsmInfo {
57
protected:
58
  //===------------------------------------------------------------------===//
59
  // Properties to be set by the target writer, used to configure asm printer.
60
  //
61
62
  /// Code pointer size in bytes.  Default is 4.
63
  unsigned CodePointerSize = 4;
64
65
  /// Size of the stack slot reserved for callee-saved registers, in bytes.
66
  /// Default is same as pointer size.
67
  unsigned CalleeSaveStackSlotSize = 4;
68
69
  /// True if target is little endian.  Default is true.
70
  bool IsLittleEndian = true;
71
72
  /// True if target stack grow up.  Default is false.
73
  bool StackGrowsUp = false;
74
75
  /// True if this target has the MachO .subsections_via_symbols directive.
76
  /// Default is false.
77
  bool HasSubsectionsViaSymbols = false;
78
79
  /// True if this is a MachO target that supports the macho-specific .zerofill
80
  /// directive for emitting BSS Symbols.  Default is false.
81
  bool HasMachoZeroFillDirective = false;
82
83
  /// True if this is a MachO target that supports the macho-specific .tbss
84
  /// directive for emitting thread local BSS Symbols.  Default is false.
85
  bool HasMachoTBSSDirective = false;
86
87
  /// True if this is a non-GNU COFF target. The COFF port of the GNU linker
88
  /// doesn't handle associative comdats in the way that we would like to use
89
  /// them.
90
  bool HasCOFFAssociativeComdats = false;
91
92
  /// This is the maximum possible length of an instruction, which is needed to
93
  /// compute the size of an inline asm.  Defaults to 4.
94
  unsigned MaxInstLength = 4;
95
96
  /// Every possible instruction length is a multiple of this value.  Factored
97
  /// out in .debug_frame and .debug_line.  Defaults to 1.
98
  unsigned MinInstAlignment = 1;
99
100
  /// The '$' token, when not referencing an identifier or constant, refers to
101
  /// the current PC.  Defaults to false.
102
  bool DollarIsPC = false;
103
104
  /// This string, if specified, is used to separate instructions from each
105
  /// other when on the same line.  Defaults to ';'
106
  const char *SeparatorString;
107
108
  /// This indicates the comment character used by the assembler.  Defaults to
109
  /// "#"
110
  StringRef CommentString;
111
112
  /// This is appended to emitted labels.  Defaults to ":"
113
  const char *LabelSuffix;
114
115
  // Print the EH begin symbol with an assignment. Defaults to false.
116
  bool UseAssignmentForEHBegin = false;
117
118
  // Do we need to create a local symbol for .size?
119
  bool NeedsLocalForSize = false;
120
121
  /// This prefix is used for globals like constant pool entries that are
122
  /// completely private to the .s file and should not have names in the .o
123
  /// file.  Defaults to "L"
124
  StringRef PrivateGlobalPrefix;
125
126
  /// This prefix is used for labels for basic blocks. Defaults to the same as
127
  /// PrivateGlobalPrefix.
128
  StringRef PrivateLabelPrefix;
129
130
  /// This prefix is used for symbols that should be passed through the
131
  /// assembler but be removed by the linker.  This is 'l' on Darwin, currently
132
  /// used for some ObjC metadata.  The default of "" meast that for this system
133
  /// a plain private symbol should be used.  Defaults to "".
134
  StringRef LinkerPrivateGlobalPrefix;
135
136
  /// If these are nonempty, they contain a directive to emit before and after
137
  /// an inline assembly statement.  Defaults to "#APP\n", "#NO_APP\n"
138
  const char *InlineAsmStart;
139
  const char *InlineAsmEnd;
140
141
  /// These are assembly directives that tells the assembler to interpret the
142
  /// following instructions differently.  Defaults to ".code16", ".code32",
143
  /// ".code64".
144
  const char *Code16Directive;
145
  const char *Code32Directive;
146
  const char *Code64Directive;
147
148
  /// Which dialect of an assembler variant to use.  Defaults to 0
149
  unsigned AssemblerDialect = 0;
150
151
  /// This is true if the assembler allows @ characters in symbol names.
152
  /// Defaults to false.
153
  bool AllowAtInName = false;
154
155
  /// If this is true, symbol names with invalid characters will be printed in
156
  /// quotes.
157
  bool SupportsQuotedNames = true;
158
159
  /// This is true if data region markers should be printed as
160
  /// ".data_region/.end_data_region" directives. If false, use "$d/$a" labels
161
  /// instead.
162
  bool UseDataRegionDirectives = false;
163
164
  //===--- Data Emission Directives -------------------------------------===//
165
166
  /// This should be set to the directive used to get some number of zero bytes
167
  /// emitted to the current section.  Common cases are "\t.zero\t" and
168
  /// "\t.space\t".  If this is set to null, the Data*bitsDirective's will be
169
  /// used to emit zero bytes.  Defaults to "\t.zero\t"
170
  const char *ZeroDirective;
171
172
  /// This directive allows emission of an ascii string with the standard C
173
  /// escape characters embedded into it.  If a target doesn't support this, it
174
  /// can be set to null. Defaults to "\t.ascii\t"
175
  const char *AsciiDirective;
176
177
  /// If not null, this allows for special handling of zero terminated strings
178
  /// on this target.  This is commonly supported as ".asciz".  If a target
179
  /// doesn't support this, it can be set to null.  Defaults to "\t.asciz\t"
180
  const char *AscizDirective;
181
182
  /// These directives are used to output some unit of integer data to the
183
  /// current section.  If a data directive is set to null, smaller data
184
  /// directives will be used to emit the large sizes.  Defaults to "\t.byte\t",
185
  /// "\t.short\t", "\t.long\t", "\t.quad\t"
186
  const char *Data8bitsDirective;
187
  const char *Data16bitsDirective;
188
  const char *Data32bitsDirective;
189
  const char *Data64bitsDirective;
190
191
  /// If non-null, a directive that is used to emit a word which should be
192
  /// relocated as a 64-bit GP-relative offset, e.g. .gpdword on Mips.  Defaults
193
  /// to nullptr.
194
  const char *GPRel64Directive = nullptr;
195
196
  /// If non-null, a directive that is used to emit a word which should be
197
  /// relocated as a 32-bit GP-relative offset, e.g. .gpword on Mips or .gprel32
198
  /// on Alpha.  Defaults to nullptr.
199
  const char *GPRel32Directive = nullptr;
200
201
  /// If non-null, directives that are used to emit a word/dword which should
202
  /// be relocated as a 32/64-bit DTP/TP-relative offset, e.g. .dtprelword/
203
  /// .dtpreldword/.tprelword/.tpreldword on Mips.
204
  const char *DTPRel32Directive = nullptr;
205
  const char *DTPRel64Directive = nullptr;
206
  const char *TPRel32Directive = nullptr;
207
  const char *TPRel64Directive = nullptr;
208
209
  /// This is true if this target uses "Sun Style" syntax for section switching
210
  /// ("#alloc,#write" etc) instead of the normal ELF syntax (,"a,w") in
211
  /// .section directives.  Defaults to false.
212
  bool SunStyleELFSectionSwitchSyntax = false;
213
214
  /// This is true if this target uses ELF '.section' directive before the
215
  /// '.bss' one. It's used for PPC/Linux which doesn't support the '.bss'
216
  /// directive only.  Defaults to false.
217
  bool UsesELFSectionDirectiveForBSS = false;
218
219
  bool NeedsDwarfSectionOffsetDirective = false;
220
221
  //===--- Alignment Information ----------------------------------------===//
222
223
  /// If this is true (the default) then the asmprinter emits ".align N"
224
  /// directives, where N is the number of bytes to align to.  Otherwise, it
225
  /// emits ".align log2(N)", e.g. 3 to align to an 8 byte boundary.  Defaults
226
  /// to true.
227
  bool AlignmentIsInBytes = true;
228
229
  /// If non-zero, this is used to fill the executable space created as the
230
  /// result of a alignment directive.  Defaults to 0
231
  unsigned TextAlignFillValue = 0;
232
233
  //===--- Global Variable Emission Directives --------------------------===//
234
235
  /// This is the directive used to declare a global entity. Defaults to
236
  /// ".globl".
237
  const char *GlobalDirective;
238
239
  /// True if the expression
240
  ///   .long f - g
241
  /// uses a relocation but it can be suppressed by writing
242
  ///   a = f - g
243
  ///   .long a
244
  bool SetDirectiveSuppressesReloc = false;
245
246
  /// False if the assembler requires that we use
247
  /// \code
248
  ///   Lc = a - b
249
  ///   .long Lc
250
  /// \endcode
251
  //
252
  /// instead of
253
  //
254
  /// \code
255
  ///   .long a - b
256
  /// \endcode
257
  ///
258
  ///  Defaults to true.
259
  bool HasAggressiveSymbolFolding = true;
260
261
  /// True is .comm's and .lcomms optional alignment is to be specified in bytes
262
  /// instead of log2(n).  Defaults to true.
263
  bool COMMDirectiveAlignmentIsInBytes = true;
264
265
  /// Describes if the .lcomm directive for the target supports an alignment
266
  /// argument and how it is interpreted.  Defaults to NoAlignment.
267
  LCOMM::LCOMMType LCOMMDirectiveAlignmentType = LCOMM::NoAlignment;
268
269
  // True if the target allows .align directives on functions. This is true for
270
  // most targets, so defaults to true.
271
  bool HasFunctionAlignment = true;
272
273
  /// True if the target has .type and .size directives, this is true for most
274
  /// ELF targets.  Defaults to true.
275
  bool HasDotTypeDotSizeDirective = true;
276
277
  /// True if the target has a single parameter .file directive, this is true
278
  /// for ELF targets.  Defaults to true.
279
  bool HasSingleParameterDotFile = true;
280
281
  /// True if the target has a .ident directive, this is true for ELF targets.
282
  /// Defaults to false.
283
  bool HasIdentDirective = false;
284
285
  /// True if this target supports the MachO .no_dead_strip directive.  Defaults
286
  /// to false.
287
  bool HasNoDeadStrip = false;
288
289
  /// True if this target supports the MachO .alt_entry directive.  Defaults to
290
  /// false.
291
  bool HasAltEntry = false;
292
293
  /// Used to declare a global as being a weak symbol. Defaults to ".weak".
294
  const char *WeakDirective;
295
296
  /// This directive, if non-null, is used to declare a global as being a weak
297
  /// undefined symbol.  Defaults to nullptr.
298
  const char *WeakRefDirective = nullptr;
299
300
  /// True if we have a directive to declare a global as being a weak defined
301
  /// symbol.  Defaults to false.
302
  bool HasWeakDefDirective = false;
303
304
  /// True if we have a directive to declare a global as being a weak defined
305
  /// symbol that can be hidden (unexported).  Defaults to false.
306
  bool HasWeakDefCanBeHiddenDirective = false;
307
308
  /// True if we have a .linkonce directive.  This is used on cygwin/mingw.
309
  /// Defaults to false.
310
  bool HasLinkOnceDirective = false;
311
312
  /// This attribute, if not MCSA_Invalid, is used to declare a symbol as having
313
  /// hidden visibility.  Defaults to MCSA_Hidden.
314
  MCSymbolAttr HiddenVisibilityAttr = MCSA_Hidden;
315
316
  /// This attribute, if not MCSA_Invalid, is used to declare an undefined
317
  /// symbol as having hidden visibility. Defaults to MCSA_Hidden.
318
  MCSymbolAttr HiddenDeclarationVisibilityAttr = MCSA_Hidden;
319
320
  /// This attribute, if not MCSA_Invalid, is used to declare a symbol as having
321
  /// protected visibility.  Defaults to MCSA_Protected
322
  MCSymbolAttr ProtectedVisibilityAttr = MCSA_Protected;
323
324
  //===--- Dwarf Emission Directives -----------------------------------===//
325
326
  /// True if target supports emission of debugging information.  Defaults to
327
  /// false.
328
  bool SupportsDebugInformation = false;
329
330
  /// Exception handling format for the target.  Defaults to None.
331
  ExceptionHandling ExceptionsType = ExceptionHandling::None;
332
333
  /// Windows exception handling data (.pdata) encoding.  Defaults to Invalid.
334
  WinEH::EncodingType WinEHEncodingType = WinEH::EncodingType::Invalid;
335
336
  /// True if Dwarf2 output generally uses relocations for references to other
337
  /// .debug_* sections.
338
  bool DwarfUsesRelocationsAcrossSections = true;
339
340
  /// True if DWARF FDE symbol reference relocations should be replaced by an
341
  /// absolute difference.
342
  bool DwarfFDESymbolsUseAbsDiff = false;
343
344
  /// True if dwarf register numbers are printed instead of symbolic register
345
  /// names in .cfi_* directives.  Defaults to false.
346
  bool DwarfRegNumForCFI = false;
347
348
  /// True if target uses parens to indicate the symbol variant instead of @.
349
  /// For example, foo(plt) instead of foo@plt.  Defaults to false.
350
  bool UseParensForSymbolVariant = false;
351
352
  /// True if the target supports flags in ".loc" directive, false if only
353
  /// location is allowed.
354
  bool SupportsExtendedDwarfLocDirective = true;
355
356
  //===--- Prologue State ----------------------------------------------===//
357
358
  std::vector<MCCFIInstruction> InitialFrameState;
359
360
  //===--- Integrated Assembler Information ----------------------------===//
361
362
  /// Should we use the integrated assembler?
363
  /// The integrated assembler should be enabled by default (by the
364
  /// constructors) when failing to parse a valid piece of assembly (inline
365
  /// or otherwise) is considered a bug. It may then be overridden after
366
  /// construction (see LLVMTargetMachine::initAsmInfo()).
367
  bool UseIntegratedAssembler;
368
369
  /// Preserve Comments in assembly
370
  bool PreserveAsmComments;
371
372
  /// Compress DWARF debug sections. Defaults to no compression.
373
  DebugCompressionType CompressDebugSections = DebugCompressionType::None;
374
375
  /// True if the integrated assembler should interpret 'a >> b' constant
376
  /// expressions as logical rather than arithmetic.
377
  bool UseLogicalShr = true;
378
379
  // If true, emit GOTPCRELX/REX_GOTPCRELX instead of GOTPCREL, on
380
  // X86_64 ELF.
381
  bool RelaxELFRelocations = true;
382
383
  // If true, then the lexer and expression parser will support %neg(),
384
  // %hi(), and similar unary operators.
385
  bool HasMipsExpressions = false;
386
387
public:
388
  explicit MCAsmInfo();
389
  virtual ~MCAsmInfo();
390
391
  /// Get the code pointer size in bytes.
392
2.49M
  unsigned getCodePointerSize() const { return CodePointerSize; }
393
394
  /// Get the callee-saved register stack slot
395
  /// size in bytes.
396
176k
  unsigned getCalleeSaveStackSlotSize() const {
397
176k
    return CalleeSaveStackSlotSize;
398
176k
  }
399
400
  /// True if the target is little endian.
401
7.44M
  bool isLittleEndian() const { return IsLittleEndian; }
402
403
  /// True if target stack grow up.
404
176k
  bool isStackGrowthDirectionUp() const { return StackGrowsUp; }
405
406
10.0M
  bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; }
407
408
  // Data directive accessors.
409
410
166k
  const char *getData8bitsDirective() const { return Data8bitsDirective; }
411
40.5k
  const char *getData16bitsDirective() const { return Data16bitsDirective; }
412
240k
  const char *getData32bitsDirective() const { return Data32bitsDirective; }
413
37.7k
  const char *getData64bitsDirective() const { return Data64bitsDirective; }
414
33
  const char *getGPRel64Directive() const { return GPRel64Directive; }
415
4.16k
  const char *getGPRel32Directive() const { return GPRel32Directive; }
416
3
  const char *getDTPRel64Directive() const { return DTPRel64Directive; }
417
3
  const char *getDTPRel32Directive() const { return DTPRel32Directive; }
418
2
  const char *getTPRel64Directive() const { return TPRel64Directive; }
419
2
  const char *getTPRel32Directive() const { return TPRel32Directive; }
420
421
  /// Targets can implement this method to specify a section to switch to if the
422
  /// translation unit doesn't have any trampolines that require an executable
423
  /// stack.
424
16.4k
  virtual MCSection *getNonexecutableStackSection(MCContext &Ctx) const {
425
16.4k
    return nullptr;
426
16.4k
  }
427
428
  /// True if the section is atomized using the symbols in it.
429
  /// This is false if the section is not atomized at all (most ELF sections) or
430
  /// if it is atomized based on its contents (MachO' __TEXT,__cstring for
431
  /// example).
432
  virtual bool isSectionAtomizableBySymbols(const MCSection &Section) const;
433
434
  virtual const MCExpr *getExprForPersonalitySymbol(const MCSymbol *Sym,
435
                                                    unsigned Encoding,
436
                                                    MCStreamer &Streamer) const;
437
438
  virtual const MCExpr *getExprForFDESymbol(const MCSymbol *Sym,
439
                                            unsigned Encoding,
440
                                            MCStreamer &Streamer) const;
441
442
  /// Return true if the identifier \p Name does not need quotes to be
443
  /// syntactically correct.
444
  virtual bool isValidUnquotedName(StringRef Name) const;
445
446
  /// Return true if the .section directive should be omitted when
447
  /// emitting \p SectionName.  For example:
448
  ///
449
  /// shouldOmitSectionDirective(".text")
450
  ///
451
  /// returns false => .section .text,#alloc,#execinstr
452
  /// returns true  => .text
453
  virtual bool shouldOmitSectionDirective(StringRef SectionName) const;
454
455
76.2k
  bool usesSunStyleELFSectionSwitchSyntax() const {
456
76.2k
    return SunStyleELFSectionSwitchSyntax;
457
76.2k
  }
458
459
1.70k
  bool usesELFSectionDirectiveForBSS() const {
460
1.70k
    return UsesELFSectionDirectiveForBSS;
461
1.70k
  }
462
463
564k
  bool needsDwarfSectionOffsetDirective() const {
464
564k
    return NeedsDwarfSectionOffsetDirective;
465
564k
  }
466
467
  // Accessors.
468
469
34.1k
  bool hasMachoZeroFillDirective() const { return HasMachoZeroFillDirective; }
470
357
  bool hasMachoTBSSDirective() const { return HasMachoTBSSDirective; }
471
364
  bool hasCOFFAssociativeComdats() const { return HasCOFFAssociativeComdats; }
472
3.95k
  unsigned getMaxInstLength() const { return MaxInstLength; }
473
3.67M
  unsigned getMinInstAlignment() const { return MinInstAlignment; }
474
11
  bool getDollarIsPC() const { return DollarIsPC; }
475
25.3M
  const char *getSeparatorString() const { return SeparatorString; }
476
477
  /// This indicates the column (zero-based) at which asm comments should be
478
  /// printed.
479
1.58M
  unsigned getCommentColumn() const { return 40; }
480
481
14.9M
  StringRef getCommentString() const { return CommentString; }
482
423k
  const char *getLabelSuffix() const { return LabelSuffix; }
483
484
49.9k
  bool useAssignmentForEHBegin() const { return UseAssignmentForEHBegin; }
485
456k
  bool needsLocalForSize() const { return NeedsLocalForSize; }
486
7.27M
  StringRef getPrivateGlobalPrefix() const { return PrivateGlobalPrefix; }
487
1.17M
  StringRef getPrivateLabelPrefix() const { return PrivateLabelPrefix; }
488
489
35.8k
  bool hasLinkerPrivateGlobalPrefix() const {
490
35.8k
    return LinkerPrivateGlobalPrefix[0] != '\0';
491
35.8k
  }
492
493
35.8k
  StringRef getLinkerPrivateGlobalPrefix() const {
494
35.8k
    if (hasLinkerPrivateGlobalPrefix())
495
35.8k
      return LinkerPrivateGlobalPrefix;
496
0
    return getPrivateGlobalPrefix();
497
0
  }
498
499
22.5k
  const char *getInlineAsmStart() const { return InlineAsmStart; }
500
22.5k
  const char *getInlineAsmEnd() const { return InlineAsmEnd; }
501
5.53k
  const char *getCode16Directive() const { return Code16Directive; }
502
8.00k
  const char *getCode32Directive() const { return Code32Directive; }
503
2
  const char *getCode64Directive() const { return Code64Directive; }
504
1.10M
  unsigned getAssemblerDialect() const { return AssemblerDialect; }
505
10
  bool doesAllowAtInName() const { return AllowAtInName; }
506
2.82k
  bool supportsNameQuoting() const { return SupportsQuotedNames; }
507
508
3.29k
  bool doesSupportDataRegionDirectives() const {
509
3.29k
    return UseDataRegionDirectives;
510
3.29k
  }
511
512
16.6k
  const char *getZeroDirective() const { return ZeroDirective; }
513
1.12k
  const char *getAsciiDirective() const { return AsciiDirective; }
514
16.5k
  const char *getAscizDirective() const { return AscizDirective; }
515
1.32k
  bool getAlignmentIsInBytes() const { return AlignmentIsInBytes; }
516
181k
  unsigned getTextAlignFillValue() const { return TextAlignFillValue; }
517
189k
  const char *getGlobalDirective() const { return GlobalDirective; }
518
519
405k
  bool doesSetDirectiveSuppressReloc() const {
520
405k
    return SetDirectiveSuppressesReloc;
521
405k
  }
522
523
191k
  bool hasAggressiveSymbolFolding() const { return HasAggressiveSymbolFolding; }
524
525
2.65k
  bool getCOMMDirectiveAlignmentIsInBytes() const {
526
2.65k
    return COMMDirectiveAlignmentIsInBytes;
527
2.65k
  }
528
529
455
  LCOMM::LCOMMType getLCOMMDirectiveAlignmentType() const {
530
455
    return LCOMMDirectiveAlignmentType;
531
455
  }
532
533
456k
  bool hasFunctionAlignment() const { return HasFunctionAlignment; }
534
2.33M
  bool hasDotTypeDotSizeDirective() const { return HasDotTypeDotSizeDirective; }
535
32.1k
  bool hasSingleParameterDotFile() const { return HasSingleParameterDotFile; }
536
32.0k
  bool hasIdentDirective() const { return HasIdentDirective; }
537
1.17k
  bool hasNoDeadStrip() const { return HasNoDeadStrip; }
538
351
  bool hasAltEntry() const { return HasAltEntry; }
539
395
  const char *getWeakDirective() const { return WeakDirective; }
540
32.3k
  const char *getWeakRefDirective() const { return WeakRefDirective; }
541
244k
  bool hasWeakDefDirective() const { return HasWeakDefDirective; }
542
543
243k
  bool hasWeakDefCanBeHiddenDirective() const {
544
243k
    return HasWeakDefCanBeHiddenDirective;
545
243k
  }
546
547
701
  bool hasLinkOnceDirective() const { return HasLinkOnceDirective; }
548
549
37.1k
  MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr; }
550
551
600
  MCSymbolAttr getHiddenDeclarationVisibilityAttr() const {
552
600
    return HiddenDeclarationVisibilityAttr;
553
600
  }
554
555
56
  MCSymbolAttr getProtectedVisibilityAttr() const {
556
56
    return ProtectedVisibilityAttr;
557
56
  }
558
559
32.1k
  bool doesSupportDebugInformation() const { return SupportsDebugInformation; }
560
561
155
  bool doesSupportExceptionHandling() const {
562
155
    return ExceptionsType != ExceptionHandling::None;
563
155
  }
564
565
1.50M
  ExceptionHandling getExceptionHandlingType() const { return ExceptionsType; }
566
630
  WinEH::EncodingType getWinEHEncodingType() const { return WinEHEncodingType; }
567
568
1.54k
  void setExceptionsType(ExceptionHandling EH) {
569
1.54k
    ExceptionsType = EH;
570
1.54k
  }
571
572
  /// Returns true if the exception handling method for the platform uses call
573
  /// frame information to unwind.
574
453k
  bool usesCFIForEH() const {
575
453k
    return (ExceptionsType == ExceptionHandling::DwarfCFI ||
576
453k
            
ExceptionsType == ExceptionHandling::ARM9.96k
||
usesWindowsCFI()9.91k
);
577
453k
  }
578
579
1.02M
  bool usesWindowsCFI() const {
580
1.02M
    return ExceptionsType == ExceptionHandling::WinEH &&
581
1.02M
           
(21.7k
WinEHEncodingType != WinEH::EncodingType::Invalid21.7k
&&
582
21.7k
            
WinEHEncodingType != WinEH::EncodingType::X8621.6k
);
583
1.02M
  }
584
585
401k
  bool doesDwarfUseRelocationsAcrossSections() const {
586
401k
    return DwarfUsesRelocationsAcrossSections;
587
401k
  }
588
589
32.7k
  bool doDwarfFDESymbolsUseAbsDiff() const { return DwarfFDESymbolsUseAbsDiff; }
590
21.4k
  bool useDwarfRegNumForCFI() const { return DwarfRegNumForCFI; }
591
10.1M
  bool useParensForSymbolVariant() const { return UseParensForSymbolVariant; }
592
1.38k
  bool supportsExtendedDwarfLocDirective() const {
593
1.38k
    return SupportsExtendedDwarfLocDirective;
594
1.38k
  }
595
596
76.3k
  void addInitialFrameState(const MCCFIInstruction &Inst) {
597
76.3k
    InitialFrameState.push_back(Inst);
598
76.3k
  }
599
600
173k
  const std::vector<MCCFIInstruction> &getInitialFrameState() const {
601
173k
    return InitialFrameState;
602
173k
  }
603
604
  /// Return true if assembly (inline or otherwise) should be parsed.
605
11.2k
  bool useIntegratedAssembler() const { return UseIntegratedAssembler; }
606
607
  /// Set whether assembly (inline or otherwise) should be parsed.
608
169
  virtual void setUseIntegratedAssembler(bool Value) {
609
169
    UseIntegratedAssembler = Value;
610
169
  }
611
612
  /// Return true if assembly (inline or otherwise) should be parsed.
613
798k
  bool preserveAsmComments() const { return PreserveAsmComments; }
614
615
  /// Set whether assembly (inline or otherwise) should be parsed.
616
52.5k
  virtual void setPreserveAsmComments(bool Value) {
617
52.5k
    PreserveAsmComments = Value;
618
52.5k
  }
619
620
407k
  DebugCompressionType compressDebugSections() const {
621
407k
    return CompressDebugSections;
622
407k
  }
623
624
45.9k
  void setCompressDebugSections(DebugCompressionType CompressDebugSections) {
625
45.9k
    this->CompressDebugSections = CompressDebugSections;
626
45.9k
  }
627
628
561k
  bool shouldUseLogicalShr() const { return UseLogicalShr; }
629
630
163
  bool canRelaxRelocations() const { return RelaxELFRelocations; }
631
53.2k
  void setRelaxELFRelocations(bool V) { RelaxELFRelocations = V; }
632
353k
  bool hasMipsExpressions() const { return HasMipsExpressions; }
633
};
634
635
} // end namespace llvm
636
637
#endif // LLVM_MC_MCASMINFO_H