projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adjust #includes to compensate for lost of DerivedTypes.h in
[oota-llvm.git]
/
utils
/
TableGen
/
FileLexer.l.cvs
diff --git
a/utils/TableGen/FileLexer.l.cvs
b/utils/TableGen/FileLexer.l.cvs
index 3b60099bc103233fb16d77c66a652138a31c9f1d..cc6825f5e07e1c29546cb2d5bc2517499656fb11 100644
(file)
--- a/
utils/TableGen/FileLexer.l.cvs
+++ b/
utils/TableGen/FileLexer.l.cvs
@@
-27,6
+27,8
@@
%x comment
%{
%x comment
%{
+#include "llvm/Config/config.h"
+#include "llvm/Support/Streams.h"
#include "Record.h"
typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
#include "FileParser.h"
#include "Record.h"
typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
#include "FileParser.h"
@@
-42,8
+44,8
@@
std::vector<std::string> IncludeDirectories;
///
static int ParseInt(const char *Str) {
if (Str[0] == '0' && Str[1] == 'b')
///
static int ParseInt(const char *Str) {
if (Str[0] == '0' && Str[1] == 'b')
- return strtol(Str+2, 0, 2);
- return strtol(Str, 0, 0);
+ return strtol
l
(Str+2, 0, 2);
+ return strtol
l
(Str, 0, 0);
}
static int CommentDepth = 0;
}
static int CommentDepth = 0;
@@
-62,14
+64,17
@@
struct IncludeRec {
static std::vector<IncludeRec> IncludeStack;
std::ostream &err() {
static std::vector<IncludeRec> IncludeStack;
std::ostream &err() {
- if (IncludeStack.empty())
- return std::cerr << "At end of input: ";
+ if (IncludeStack.empty()) {
+ cerr << "At end of input: ";
+ return *cerr.stream();
+ }
for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
- std::cerr << "Included from " << IncludeStack[i].Filename << ":"
- << IncludeStack[i].LineNo << ":\n";
- return std::cerr << "Parsing " << IncludeStack.back().Filename << ":"
- << Filelineno << ": ";
+ cerr << "Included from " << IncludeStack[i].Filename << ":"
+ << IncludeStack[i].LineNo << ":\n";
+ cerr << "Parsing " << IncludeStack.back().Filename << ":"
+ << Filelineno << ": ";
+ return *cerr.stream();
}
/// ParseFile - this function begins the parsing of the specified tablegen file.
}
/// ParseFile - this function begins the parsing of the specified tablegen file.
@@
-81,7
+86,7
@@
void ParseFile(const std::string &Filename,
F = fopen(Filename.c_str(), "r");
if (F == 0) {
F = fopen(Filename.c_str(), "r");
if (F == 0) {
-
std::
cerr << "Could not open input file '" + Filename + "'!\n";
+ cerr << "Could not open input file '" + Filename + "'!\n";
exit (1);
}
IncludeStack.push_back(IncludeRec(Filename, F));
exit (1);
}
IncludeStack.push_back(IncludeRec(Filename, F));
@@
-113,7
+118,7
@@
static void HandleInclude(const char *Buffer) {
}
assert(Length >= 2 && "Double quotes not found?");
std::string Filename(Buffer+1, Buffer+Length-1);
}
assert(Length >= 2 && "Double quotes not found?");
std::string Filename(Buffer+1, Buffer+Length-1);
- //
std::
cerr << "Filename = '" << Filename << "'\n";
+ //cerr << "Filename = '" << Filename << "'\n";
// Save the line number and lex buffer of the includer...
IncludeStack.back().LineNo = Filelineno;
// Save the line number and lex buffer of the includer...
IncludeStack.back().LineNo = Filelineno;
@@
-195,6
+200,8
@@
dag { return DAG; }
class { return CLASS; }
def { return DEF; }
class { return CLASS; }
def { return DEF; }
+defm { return DEFM; }
+multiclass { return MULTICLASS; }
field { return FIELD; }
let { return LET; }
in { return IN; }
field { return FIELD; }
let { return LET; }
in { return IN; }