MC/AsmParser: Fix TokError() to accept a Twine.
authorDaniel Dunbar <daniel@zuster.org>
Sun, 18 Jul 2010 18:31:42 +0000 (18:31 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 18 Jul 2010 18:31:42 +0000 (18:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108647 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCParser/MCAsmParser.h
include/llvm/MC/MCParser/MCAsmParserExtension.h
lib/MC/MCParser/ELFAsmParser.cpp
lib/MC/MCParser/MCAsmParser.cpp

index c18bb39222c9ca5c097ff0237acfe662e85d4c75..414b9cc8932dcafd615dcc51a21d3bb8388faa74 100644 (file)
@@ -83,7 +83,7 @@ public:
   const AsmToken &getTok();
 
   /// \brief Report an error at the current lexer location.
-  bool TokError(const char *Msg);
+  bool TokError(const Twine &Msg);
 
   /// ParseIdentifier - Parse an identifier or string (as a quoted identifier)
   /// and set \arg Res to the identifier contents.
index ad9ccf79d12a10464d6a8f897c987f3c51ef3ad8..5b65f4e6a7aba1d65cb43debf45e50bc8e57ce20 100644 (file)
@@ -14,6 +14,7 @@
 #include "llvm/Support/SMLoc.h"
 
 namespace llvm {
+class Twine;
 
 /// \brief Generic interface for extending the MCAsmParser,
 /// which is implemented by target and object file assembly parser
@@ -49,15 +50,14 @@ public:
   bool Error(SMLoc L, const Twine &Msg) {
     return getParser().Error(L, Msg);
   }
+  bool TokError(const Twine &Msg) {
+    return getParser().TokError(Msg);
+  }
 
   const AsmToken &Lex() { return getParser().Lex(); }
 
   const AsmToken &getTok() { return getParser().getTok(); }
 
-  bool TokError(const char *Msg) {
-    return getParser().TokError(Msg);
-  }
-
   /// @}
 };
 
index 8bbc8b37cbf162492b3cc7336a09b4211e4289d7..6b9a6720d148d8c38f750ba9d69e7438bec83e4f 100644 (file)
@@ -14,6 +14,7 @@
 #include "llvm/MC/MCParser/MCAsmLexer.h"
 #include "llvm/MC/MCSectionELF.h"
 #include "llvm/MC/MCStreamer.h"
+#include "llvm/ADT/Twine.h"
 using namespace llvm;
 
 namespace {
index 39233aedde0590891119533f04773b8ff8442025..2544fcaf4bd298d8edfb3478857d358f5af66a02 100644 (file)
@@ -31,7 +31,7 @@ const AsmToken &MCAsmParser::getTok() {
   return getLexer().getTok();
 }
 
-bool MCAsmParser::TokError(const char *Msg) {
+bool MCAsmParser::TokError(const Twine &Msg) {
   Error(getLexer().getLoc(), Msg);
   return true;
 }