Centralize the information about which object format we are using.
[oota-llvm.git] / include / llvm / MC / MCAsmInfo.h
index 3dd27934c1446acd6f4c578951ce05de63231980..9bb0fa63c523f6a2d693fcad458e8dc264d2c348 100644 (file)
@@ -27,7 +27,6 @@ class MCSection;
 class MCStreamer;
 class MCSymbol;
 class MCContext;
-class LLVMTargetMachine;
 
 namespace WinEH {
 enum class EncodingType {
@@ -156,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.
@@ -389,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;
   }
 
@@ -407,6 +410,10 @@ 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;
+
   bool usesSunStyleELFSectionSwitchSyntax() const {
     return SunStyleELFSectionSwitchSyntax;
   }
@@ -457,6 +464,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;
   }
@@ -546,11 +554,6 @@ public:
   }
 
   bool shouldUseLogicalShr() const { return UseLogicalShr; }
-
-  /// Finish initialization of this object. Few targets will need to use this
-  /// but it's useful when the assembly syntax is ABI dependant as is the case
-  /// for Mips.
-  virtual void finishInit(const LLVMTargetMachine &) {}
 };
 }