Move CheckForValidSection to the MCAsmParser interface.
authorEli Bendersky <eliben@google.com>
Mon, 14 Jan 2013 19:15:01 +0000 (19:15 +0000)
committerEli Bendersky <eliben@google.com>
Mon, 14 Jan 2013 19:15:01 +0000 (19:15 +0000)
Now that it behaves itself in terms of streamer independence (r172450), this
method can be moved to MCAsmParser to be available to all extensions,
overriding, etc.

-- -This line, and those below, will be ignored--

M    lib/MC/MCParser/AsmParser.cpp
M    include/llvm/MC/MCParser/MCAsmParser.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172451 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCParser/MCAsmParser.h
lib/MC/MCParser/AsmParser.cpp

index cb8476d2cee56d75ce26656cca9a86ba262e0372..eeeacbc2fc02d13564c503be0950f59f4f115439 100644 (file)
@@ -174,6 +174,10 @@ public:
   /// on error.
   /// @result - False on success.
   virtual bool ParseAbsoluteExpression(int64_t &Res) = 0;
+
+  /// CheckForValidSection - Ensure that we have a valid section set in the
+  /// streamer. Otherwise, report and error and switch to .text.
+  virtual void CheckForValidSection() = 0;
 };
 
 /// \brief Create an MCAsmParser instance.
index 262cb2ca6188f8fd505e9a146095523f868ed6b0..45aaa2ec754037038f4054079730b05405045f35 100644 (file)
@@ -233,10 +233,10 @@ public:
   virtual bool MacrosEnabled() {return MacrosEnabledFlag;}
   virtual void SetMacrosEnabled(bool flag) {MacrosEnabledFlag = flag;}
 
+  virtual void CheckForValidSection();
   /// }
 
 private:
-  void CheckForValidSection();
 
   bool ParseStatement(ParseStatementInfo &Info);
   void EatToEndOfLine();