mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
make the lexer unique strings it lexes instead of passing them back as
std::strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74036 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -55,20 +55,24 @@ class AsmLexer {
|
||||
|
||||
const char *CurPtr;
|
||||
const MemoryBuffer *CurBuf;
|
||||
// A llvm::StringSet<>, which provides uniqued and null-terminated strings.
|
||||
void *TheStringSet;
|
||||
|
||||
// Information about the current token.
|
||||
const char *TokStart;
|
||||
asmtok::TokKind CurKind;
|
||||
std::string CurStrVal; // This is valid for Identifier.
|
||||
const char *CurStrVal; // This is valid for Identifier.
|
||||
int64_t CurIntVal;
|
||||
|
||||
/// CurBuffer - This is the current buffer index we're lexing from as managed
|
||||
/// by the SourceMgr object.
|
||||
int CurBuffer;
|
||||
|
||||
void operator=(const AsmLexer&); // DO NOT IMPLEMENT
|
||||
AsmLexer(const AsmLexer&); // DO NOT IMPLEMENT
|
||||
public:
|
||||
AsmLexer(SourceMgr &SrcMgr);
|
||||
~AsmLexer() {}
|
||||
~AsmLexer();
|
||||
|
||||
asmtok::TokKind Lex() {
|
||||
return CurKind = LexToken();
|
||||
@@ -78,7 +82,7 @@ public:
|
||||
bool is(asmtok::TokKind K) const { return CurKind == K; }
|
||||
bool isNot(asmtok::TokKind K) const { return CurKind != K; }
|
||||
|
||||
const std::string &getCurStrVal() const {
|
||||
const char *getCurStrVal() const {
|
||||
assert((CurKind == asmtok::Identifier || CurKind == asmtok::Register ||
|
||||
CurKind == asmtok::String) &&
|
||||
"This token doesn't have a string value");
|
||||
|
Reference in New Issue
Block a user