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