llir-opt
0.0.1
Low-Level Post-Link Optimiser for OCaml and C
|
7 #include <llvm/ADT/StringRef.h>
12 #include "core/adt/sexp.h"
13 #include "core/constant.h"
64 Lexer(llvm::StringRef buf);
78 bool AtEnd()
const {
return tk_ == Token::END; }
81 std::string_view
String()
const;
87 uint64_t
VReg()
const;
93 [[noreturn]]
void Error(
const std::string &msg);
94 [[noreturn]]
void Error(
Func *f,
const std::string &msg);
95 [[noreturn]]
void Error(
Func *f,
Block *b,
const std::string &msg);
103 llvm::StringRef buf_;
void Check(Token type)
Checks if the current token is of a specific type.
Definition: lexer.cpp:319
Lexer(llvm::StringRef buf)
Creates a lexer for a stream.
Definition: lexer.cpp:93
uint64_t VReg() const
Returns the current virtual register.
Definition: lexer.cpp:366
void Error(const std::string &msg)
Error reporting.
Definition: lexer.cpp:406
~Lexer()
Cleanup.
Definition: lexer.cpp:106
bool AtEnd() const
Checks whether the end of stream was reached.
Definition: lexer.h:78
Token
Enumeration of tokens extracted from the stream.
Definition: lexer.h:27
Token NextToken()
Fetches the next token.
Definition: lexer.cpp:111
Register Reg() const
Returns the current register.
Definition: lexer.cpp:360
int64_t Int() const
Returns the current integer.
Definition: lexer.cpp:354
Token GetToken() const
Returns the current token.
Definition: lexer.h:70
std::string_view String() const
Returns the current string.
Definition: lexer.cpp:348
SExp ParseSExp()
Parses an S-Expression.
Definition: lexer.cpp:372
void Expect(Token type)
Checks if the next character is of a specific type.
Definition: lexer.cpp:312