X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMC%2FMCAsmInfo.h;h=384584ef4ef0e06ee984c50951e9a2bdfa0aec6b;hb=16f83af7618a4dfb4ef1891b07adb23cc54e4c86;hp=05da1d1871fc2d2beabb3e8fa6846b7c175bf341;hpb=dac39b1fefefc2861de25455826ad23d357ab30b;p=oota-llvm.git diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h index 05da1d1871f..384584ef4ef 100644 --- a/include/llvm/MC/MCAsmInfo.h +++ b/include/llvm/MC/MCAsmInfo.h @@ -18,7 +18,6 @@ #include "llvm/MC/MCDirectives.h" #include "llvm/MC/MCDwarf.h" -#include "llvm/MC/MachineLocation.h" #include #include @@ -37,6 +36,7 @@ enum class EncodingType { ARM, /// Windows NT (Windows on ARM) CE, /// Windows CE ARM, PowerPC, SH3, SH4 Itanium, /// Windows x64, Windows Itanium (IA-64) + X86, /// Windows x86, uses no CFI, just EH tables MIPS = Alpha, }; } @@ -155,6 +155,10 @@ protected: /// Defaults to false. bool AllowAtInName; + /// If this is true, symbol names with invalid characters will be printed in + /// quotes. + bool SupportsQuotedNames; + /// This is true if data region markers should be printed as /// ".data_region/.end_data_region" directives. If false, use "$d/$a" labels /// instead. @@ -228,7 +232,7 @@ protected: /// True if the expression /// .long f - g - /// uses an relocation but it can be supressed by writting + /// uses a relocation but it can be suppressed by writing /// a = f - g /// .long a bool SetDirectiveSuppressesReloc; @@ -256,7 +260,7 @@ protected: /// argument and how it is interpreted. Defaults to NoAlignment. LCOMM::LCOMMType LCOMMDirectiveAlignmentType; - // True if the target allows .align directives on funtions. This is true for + // True if the target allows .align directives on functions. This is true for // most targets, so defaults to true. bool HasFunctionAlignment; @@ -388,7 +392,7 @@ public: /// Targets can implement this method to specify a section to switch to if the /// translation unit doesn't have any trampolines that require an executable /// stack. - virtual const MCSection *getNonexecutableStackSection(MCContext &Ctx) const { + virtual MCSection *getNonexecutableStackSection(MCContext &Ctx) const { return nullptr; } @@ -406,6 +410,19 @@ public: unsigned Encoding, MCStreamer &Streamer) const; + /// Return true if the identifier \p Name does not need quotes to be + /// syntactically correct. + virtual bool isValidUnquotedName(StringRef Name) const; + + /// Return true if the .section directive should be omitted when + /// emitting \p SectionName. For example: + /// + /// shouldOmitSectionDirective(".text") + /// + /// returns false => .section .text,#alloc,#execinstr + /// returns true => .text + virtual bool shouldOmitSectionDirective(StringRef SectionName) const; + bool usesSunStyleELFSectionSwitchSyntax() const { return SunStyleELFSectionSwitchSyntax; } @@ -456,6 +473,7 @@ public: const char *getCode64Directive() const { return Code64Directive; } unsigned getAssemblerDialect() const { return AssemblerDialect; } bool doesAllowAtInName() const { return AllowAtInName; } + bool supportsNameQuoting() const { return SupportsQuotedNames; } bool doesSupportDataRegionDirectives() const { return UseDataRegionDirectives; } @@ -506,12 +524,13 @@ public: /// frame information to unwind. bool usesCFIForEH() const { return (ExceptionsType == ExceptionHandling::DwarfCFI || - ExceptionsType == ExceptionHandling::ARM || - ExceptionsType == ExceptionHandling::WinEH); + ExceptionsType == ExceptionHandling::ARM || usesWindowsCFI()); } bool usesWindowsCFI() const { - return ExceptionsType == ExceptionHandling::WinEH; + return ExceptionsType == ExceptionHandling::WinEH && + (WinEHEncodingType != WinEH::EncodingType::Invalid && + WinEHEncodingType != WinEH::EncodingType::X86); } bool doesDwarfUseRelocationsAcrossSections() const {