mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-12 06:06:19 +00:00
llvm-mc: Stop uniqueing string tokens, nothing actually uses this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77287 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
04d5544034
commit
825e385ffe
@ -12,7 +12,6 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "AsmLexer.h"
|
||||
#include "llvm/ADT/StringSet.h"
|
||||
#include "llvm/Support/SourceMgr.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Config/config.h" // for strtoull.
|
||||
@ -21,21 +20,14 @@
|
||||
#include <cstdlib>
|
||||
using namespace llvm;
|
||||
|
||||
static StringSet<> &getSS(void *TheSS) {
|
||||
return *(StringSet<>*)TheSS;
|
||||
}
|
||||
|
||||
AsmLexer::AsmLexer(SourceMgr &SM) : SrcMgr(SM) {
|
||||
CurBuffer = 0;
|
||||
CurBuf = SrcMgr.getMemoryBuffer(CurBuffer);
|
||||
CurPtr = CurBuf->getBufferStart();
|
||||
TokStart = 0;
|
||||
|
||||
TheStringSet = new StringSet<>();
|
||||
}
|
||||
|
||||
AsmLexer::~AsmLexer() {
|
||||
delete &getSS(TheStringSet);
|
||||
}
|
||||
|
||||
SMLoc AsmLexer::getLoc() const {
|
||||
@ -107,9 +99,7 @@ asmtok::TokKind AsmLexer::LexIdentifier() {
|
||||
*CurPtr == '.' || *CurPtr == '@')
|
||||
++CurPtr;
|
||||
// Unique string.
|
||||
CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
|
||||
CurPtr - TokStart),
|
||||
0).getKeyData();
|
||||
CurStrVal = StringRef(TokStart, CurPtr - TokStart);
|
||||
return asmtok::Identifier;
|
||||
}
|
||||
|
||||
@ -122,9 +112,7 @@ asmtok::TokKind AsmLexer::LexPercent() {
|
||||
++CurPtr;
|
||||
|
||||
// Unique string.
|
||||
CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
|
||||
CurPtr - TokStart),
|
||||
0).getKeyData();
|
||||
CurStrVal = StringRef(TokStart, CurPtr - TokStart);
|
||||
return asmtok::Register;
|
||||
}
|
||||
|
||||
@ -251,9 +239,7 @@ asmtok::TokKind AsmLexer::LexQuote() {
|
||||
}
|
||||
|
||||
// Unique string, include quotes for now.
|
||||
CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
|
||||
CurPtr - TokStart),
|
||||
0).getKeyData();
|
||||
CurStrVal = StringRef(TokStart, CurPtr - TokStart);
|
||||
return asmtok::String;
|
||||
}
|
||||
|
||||
|
@ -59,13 +59,11 @@ class AsmLexer : public MCAsmLexer {
|
||||
|
||||
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;
|
||||
const char *CurStrVal; // This is valid for Identifier.
|
||||
StringRef CurStrVal; // This is valid for Identifier.
|
||||
int64_t CurIntVal;
|
||||
|
||||
/// CurBuffer - This is the current buffer index we're lexing from as managed
|
||||
|
Loading…
Reference in New Issue
Block a user