[lld] [ELF] Added `struct Token` and changed `next()` and `peek()` to return Token (PR #100180)
Daniel Thornburgh via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 24 10:56:14 PDT 2024
================
@@ -9,23 +9,33 @@
#ifndef LLD_ELF_SCRIPT_LEXER_H
#define LLD_ELF_SCRIPT_LEXER_H
+#include "ScriptToken.h"
#include "lld/Common/LLVM.h"
+#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/MemoryBufferRef.h"
#include <vector>
namespace lld::elf {
-
class ScriptLexer {
public:
+ static const llvm::StringMap<Tok> keywordTokMap;
+ struct Token {
+ Tok kind;
+ StringRef val;
+ inline bool operator==(StringRef other) { return val == other; }
----------------
mysterymath wrote:
`inline` is redundant here and below; function definitions within class definitions are implicitly inline.
https://github.com/llvm/llvm-project/pull/100180
More information about the llvm-commits
mailing list