projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[X86][Haswell][SchedModel] Add architecture specific scheduling models.
[oota-llvm.git]
/
lib
/
TableGen
/
TGLexer.h
diff --git
a/lib/TableGen/TGLexer.h
b/lib/TableGen/TGLexer.h
index d1bd70d2eca427caf9778ab51118bbf171d0cdde..1f750fcd8d96b6abe43e18c2e82ca1ba2228fd10 100644
(file)
--- a/
lib/TableGen/TGLexer.h
+++ b/
lib/TableGen/TGLexer.h
@@
-11,9
+11,10
@@
//
//===----------------------------------------------------------------------===//
//
//===----------------------------------------------------------------------===//
-#ifndef TGLEXER_H
-#define TGLEXER_H
+#ifndef
LLVM_LIB_TABLEGEN_
TGLEXER_H
+#define
LLVM_LIB_TABLEGEN_
TGLEXER_H
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/SMLoc.h"
#include <cassert>
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/SMLoc.h"
#include <cassert>
@@
-21,7
+22,6
@@
#include <string>
namespace llvm {
#include <string>
namespace llvm {
-class MemoryBuffer;
class SourceMgr;
class SMLoc;
class Twine;
class SourceMgr;
class SMLoc;
class Twine;
@@
-47,11
+47,15
@@
namespace tgtok {
MultiClass, String,
// !keywords.
MultiClass, String,
// !keywords.
- XConcat, XADD, X
SRA, XSRL, XSHL, XStrConcat, XCast, XSub
st,
- XForEach, XHead, XTail, XEmpty, XIf, XEq,
+ XConcat, XADD, X
AND, XSRA, XSRL, XSHL, XListConcat, XStrConcat, XCa
st,
+ X
Subst, X
ForEach, XHead, XTail, XEmpty, XIf, XEq,
// Integer value.
IntVal,
// Integer value.
IntVal,
+
+ // Binary constant. Note that these are sized according to the number of
+ // bits given.
+ BinaryIntVal,
// String valued tokens.
Id, StrVal, VarName, CodeFragment
// String valued tokens.
Id, StrVal, VarName, CodeFragment
@@
-63,7
+67,7
@@
class TGLexer {
SourceMgr &SrcMgr;
const char *CurPtr;
SourceMgr &SrcMgr;
const char *CurPtr;
-
const MemoryBuffer *
CurBuf;
+
StringRef
CurBuf;
// Information about the current token.
const char *TokStart;
// Information about the current token.
const char *TokStart;
@@
-73,7
+77,7
@@
class TGLexer {
/// CurBuffer - This is the current buffer index we're lexing from as managed
/// by the SourceMgr object.
/// CurBuffer - This is the current buffer index we're lexing from as managed
/// by the SourceMgr object.
-
int
CurBuffer;
+
unsigned
CurBuffer;
public:
typedef std::map<std::string, SMLoc> DependenciesMapTy;
public:
typedef std::map<std::string, SMLoc> DependenciesMapTy;
@@
-105,6
+109,11
@@
public:
assert(CurCode == tgtok::IntVal && "This token isn't an integer");
return CurIntVal;
}
assert(CurCode == tgtok::IntVal && "This token isn't an integer");
return CurIntVal;
}
+ std::pair<int64_t, unsigned> getCurBinaryIntVal() const {
+ assert(CurCode == tgtok::BinaryIntVal &&
+ "This token isn't a binary integer");
+ return std::make_pair(CurIntVal, (CurPtr - TokStart)-2);
+ }
SMLoc getLoc() const;
SMLoc getLoc() const;