summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/MC/MCParser/MCAsmLexer.h6
-rw-r--r--llvm/include/llvm/MC/MCParser/MCAsmParser.h42
-rw-r--r--llvm/include/llvm/Support/SMLoc.h2
3 files changed, 7 insertions, 43 deletions
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmLexer.h b/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
index ad5bcc481cc..3097a0c9a29 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
@@ -144,7 +144,6 @@ protected: // Can only create subclasses.
const char *TokStart;
bool SkipSpace;
bool AllowAtInIdentifier;
- bool IsAtStartOfStatement;
MCAsmLexer();
@@ -164,8 +163,6 @@ public:
/// the main input file has been reached.
const AsmToken &Lex() {
assert(!CurTok.empty());
- // Mark if we parsing out a EndOfStatement.
- IsAtStartOfStatement = CurTok.front().getKind() == AsmToken::EndOfStatement;
CurTok.erase(CurTok.begin());
// LexToken may generate multiple tokens via UnLex but will always return
// the first one. Place returned value at head of CurTok vector.
@@ -177,12 +174,9 @@ public:
}
void UnLex(AsmToken const &Token) {
- IsAtStartOfStatement = false;
CurTok.insert(CurTok.begin(), Token);
}
- bool isAtStartOfStatement() { return IsAtStartOfStatement; }
-
virtual StringRef LexUntilEndOfStatement() = 0;
/// Get the current source location.
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParser.h b/llvm/include/llvm/MC/MCParser/MCAsmParser.h
index 1106185b04c..3efa8a88808 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmParser.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmParser.h
@@ -11,9 +11,7 @@
#define LLVM_MC_MCPARSER_MCASMPARSER_H
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCParser/AsmLexer.h"
#include "llvm/Support/DataTypes.h"
@@ -69,12 +67,6 @@ public:
typedef std::pair<MCAsmParserExtension*, DirectiveHandler>
ExtensionDirectiveHandler;
- struct MCPendingError {
- SMLoc Loc;
- SmallString<64> Msg;
- SMRange Range;
- };
-
private:
MCAsmParser(const MCAsmParser &) = delete;
void operator=(const MCAsmParser &) = delete;
@@ -86,11 +78,6 @@ private:
protected: // Can only create subclasses.
MCAsmParser();
- bool HadError;
-
- SmallVector<MCPendingError, 1> PendingErrors;
- /// Flag tracking whether any errors have been encountered.
-
public:
virtual ~MCAsmParser();
@@ -135,36 +122,21 @@ public:
const MCInstPrinter *IP, MCAsmParserSemaCallback &SI) = 0;
/// \brief Emit a note at the location \p L, with the message \p Msg.
- virtual void Note(SMLoc L, const Twine &Msg, SMRange Range = None) = 0;
+ virtual void Note(SMLoc L, const Twine &Msg,
+ ArrayRef<SMRange> Ranges = None) = 0;
/// \brief Emit a warning at the location \p L, with the message \p Msg.
///
/// \return The return value is true, if warnings are fatal.
- virtual bool Warning(SMLoc L, const Twine &Msg, SMRange Range = None) = 0;
-
- /// \brief Return an error at the location \p L, with the message \p Msg. This
- /// may be modified before being emitted.
- ///
- /// \return The return value is always true, as an idiomatic convenience to
- /// clients.
- bool Error(SMLoc L, const Twine &Msg, SMRange Range = None);
+ virtual bool Warning(SMLoc L, const Twine &Msg,
+ ArrayRef<SMRange> Ranges = None) = 0;
/// \brief Emit an error at the location \p L, with the message \p Msg.
///
/// \return The return value is always true, as an idiomatic convenience to
/// clients.
- virtual bool printError(SMLoc L, const Twine &Msg, SMRange Range = None) = 0;
-
- bool hasPendingError() { return !PendingErrors.empty(); }
-
- bool printPendingErrors() {
- bool rv = !PendingErrors.empty();
- for (auto Err : PendingErrors) {
- printError(Err.Loc, Twine(Err.Msg), Err.Range);
- }
- PendingErrors.clear();
- return rv;
- }
+ virtual bool Error(SMLoc L, const Twine &Msg,
+ ArrayRef<SMRange> Ranges = None) = 0;
/// \brief Get the next AsmToken in the stream, possibly handling file
/// inclusion first.
@@ -174,7 +146,7 @@ public:
const AsmToken &getTok() const;
/// \brief Report an error at the current lexer location.
- bool TokError(const Twine &Msg, SMRange Range = None);
+ bool TokError(const Twine &Msg, ArrayRef<SMRange> Ranges = None);
bool parseTokenLoc(SMLoc &Loc);
bool parseToken(AsmToken::TokenKind T, const Twine &Msg);
diff --git a/llvm/include/llvm/Support/SMLoc.h b/llvm/include/llvm/Support/SMLoc.h
index 7f32d8d3037..c6e9a14e82a 100644
--- a/llvm/include/llvm/Support/SMLoc.h
+++ b/llvm/include/llvm/Support/SMLoc.h
@@ -15,7 +15,6 @@
#ifndef LLVM_SUPPORT_SMLOC_H
#define LLVM_SUPPORT_SMLOC_H
-#include "llvm/ADT/None.h"
#include <cassert>
namespace llvm {
@@ -51,7 +50,6 @@ public:
SMLoc Start, End;
SMRange() {}
- SMRange(NoneType) : Start(), End() {}
SMRange(SMLoc St, SMLoc En) : Start(St), End(En) {
assert(Start.isValid() == End.isValid() &&
"Start and end should either both be valid or both be invalid!");
OpenPOWER on IntegriCloud