diff --git a/include/llvm/MC/MCParser/MCAsmParser.h b/include/llvm/MC/MCParser/MCAsmParser.h index c18bb39222c..414b9cc8932 100644 --- a/include/llvm/MC/MCParser/MCAsmParser.h +++ b/include/llvm/MC/MCParser/MCAsmParser.h @@ -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. diff --git a/include/llvm/MC/MCParser/MCAsmParserExtension.h b/include/llvm/MC/MCParser/MCAsmParserExtension.h index ad9ccf79d12..5b65f4e6a7a 100644 --- a/include/llvm/MC/MCParser/MCAsmParserExtension.h +++ b/include/llvm/MC/MCParser/MCAsmParserExtension.h @@ -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); - } - /// @} }; diff --git a/lib/MC/MCParser/ELFAsmParser.cpp b/lib/MC/MCParser/ELFAsmParser.cpp index 8bbc8b37cbf..6b9a6720d14 100644 --- a/lib/MC/MCParser/ELFAsmParser.cpp +++ b/lib/MC/MCParser/ELFAsmParser.cpp @@ -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 { diff --git a/lib/MC/MCParser/MCAsmParser.cpp b/lib/MC/MCParser/MCAsmParser.cpp index 39233aedde0..2544fcaf4bd 100644 --- a/lib/MC/MCParser/MCAsmParser.cpp +++ b/lib/MC/MCParser/MCAsmParser.cpp @@ -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; }