[llvm-commits] [llvm] r77287 - in /llvm/trunk/tools/llvm-mc: AsmLexer.cpp AsmLexer.h
Daniel Dunbar
daniel at zuster.org
Mon Jul 27 17:58:51 PDT 2009
Author: ddunbar
Date: Mon Jul 27 19:58:50 2009
New Revision: 77287
URL: http://llvm.org/viewvc/llvm-project?rev=77287&view=rev
Log:
llvm-mc: Stop uniqueing string tokens, nothing actually uses this.
Modified:
llvm/trunk/tools/llvm-mc/AsmLexer.cpp
llvm/trunk/tools/llvm-mc/AsmLexer.h
Modified: llvm/trunk/tools/llvm-mc/AsmLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmLexer.cpp?rev=77287&r1=77286&r2=77287&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmLexer.cpp (original)
+++ llvm/trunk/tools/llvm-mc/AsmLexer.cpp Mon Jul 27 19:58:50 2009
@@ -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 @@
*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 @@
++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 @@
}
// Unique string, include quotes for now.
- CurStrVal = getSS(TheStringSet).GetOrCreateValue(StringRef(TokStart,
- CurPtr - TokStart),
- 0).getKeyData();
+ CurStrVal = StringRef(TokStart, CurPtr - TokStart);
return asmtok::String;
}
Modified: llvm/trunk/tools/llvm-mc/AsmLexer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmLexer.h?rev=77287&r1=77286&r2=77287&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmLexer.h (original)
+++ llvm/trunk/tools/llvm-mc/AsmLexer.h Mon Jul 27 19:58:50 2009
@@ -59,13 +59,11 @@
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
More information about the llvm-commits
mailing list