mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-20 09:30:43 +00:00
Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26486 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d9f5d90af1
commit
c1d6e4eba7
@ -489,7 +489,7 @@ goto find_rule; \
|
|||||||
#define YY_MORE_ADJ 0
|
#define YY_MORE_ADJ 0
|
||||||
#define YY_RESTORE_YY_MORE_OFFSET
|
#define YY_RESTORE_YY_MORE_OFFSET
|
||||||
char *yytext;
|
char *yytext;
|
||||||
#line 1 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 1 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
#define INITIAL 0
|
#define INITIAL 0
|
||||||
/*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
|
/*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
|
||||||
//
|
//
|
||||||
@ -507,7 +507,7 @@ char *yytext;
|
|||||||
#define YY_NEVER_INTERACTIVE 1
|
#define YY_NEVER_INTERACTIVE 1
|
||||||
#define comment 1
|
#define comment 1
|
||||||
|
|
||||||
#line 30 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 30 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
#include "Record.h"
|
#include "Record.h"
|
||||||
typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
|
typedef std::pair<llvm::Record*, std::vector<llvm::Init*>*> SubClassRefTy;
|
||||||
#include "FileParser.h"
|
#include "FileParser.h"
|
||||||
@ -517,7 +517,7 @@ int Fileparse();
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
// Global variable recording the location of the include directory
|
// Global variable recording the location of the include directory
|
||||||
std::string IncludeDirectory;
|
std::vector<std::string> IncludeDirectories;
|
||||||
|
|
||||||
/// ParseInt - This has to handle the special case of binary numbers 0b0101
|
/// ParseInt - This has to handle the special case of binary numbers 0b0101
|
||||||
///
|
///
|
||||||
@ -555,7 +555,8 @@ std::ostream &err() {
|
|||||||
|
|
||||||
/// ParseFile - this function begins the parsing of the specified tablegen file.
|
/// ParseFile - this function begins the parsing of the specified tablegen file.
|
||||||
///
|
///
|
||||||
void ParseFile(const std::string &Filename, const std::string & IncludeDir) {
|
void ParseFile(const std::string &Filename,
|
||||||
|
const std::vector<std::string> &IncludeDirs) {
|
||||||
FILE *F = stdin;
|
FILE *F = stdin;
|
||||||
if (Filename != "-") {
|
if (Filename != "-") {
|
||||||
F = fopen(Filename.c_str(), "r");
|
F = fopen(Filename.c_str(), "r");
|
||||||
@ -571,7 +572,7 @@ void ParseFile(const std::string &Filename, const std::string & IncludeDir) {
|
|||||||
|
|
||||||
// Record the location of the include directory so that the lexer can find
|
// Record the location of the include directory so that the lexer can find
|
||||||
// it later.
|
// it later.
|
||||||
IncludeDirectory = IncludeDir;
|
IncludeDirectories = IncludeDirs;
|
||||||
|
|
||||||
Filein = F;
|
Filein = F;
|
||||||
Filelineno = 1;
|
Filelineno = 1;
|
||||||
@ -605,10 +606,13 @@ static void HandleInclude(const char *Buffer) {
|
|||||||
// If we couldn't find the file in the current directory, look for it in
|
// If we couldn't find the file in the current directory, look for it in
|
||||||
// the include directories.
|
// the include directories.
|
||||||
//
|
//
|
||||||
// NOTE: Right now, there is only one directory. We need to eventually add
|
std::string NextFilename;
|
||||||
// support for more.
|
for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
|
||||||
std::string NextFilename = IncludeDirectory + "/" + Filename;
|
NextFilename = IncludeDirectories[i] + "/" + Filename;
|
||||||
yyin = fopen(NextFilename.c_str(), "r");
|
if (yyin = fopen(NextFilename.c_str(), "r"))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (yyin == 0) {
|
if (yyin == 0) {
|
||||||
err() << "Could not find include file '" << Filename << "'!\n";
|
err() << "Could not find include file '" << Filename << "'!\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -644,7 +648,7 @@ int yywrap(void) {
|
|||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
#line 648 "Lexer.cpp"
|
#line 652 "Lexer.cpp"
|
||||||
|
|
||||||
/* Macros after this point can all be overridden by user definitions in
|
/* Macros after this point can all be overridden by user definitions in
|
||||||
* section 1.
|
* section 1.
|
||||||
@ -795,10 +799,10 @@ YY_DECL
|
|||||||
register char *yy_cp, *yy_bp;
|
register char *yy_cp, *yy_bp;
|
||||||
register int yy_act;
|
register int yy_act;
|
||||||
|
|
||||||
#line 176 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 180 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
|
|
||||||
|
|
||||||
#line 802 "Lexer.cpp"
|
#line 806 "Lexer.cpp"
|
||||||
|
|
||||||
if ( yy_init )
|
if ( yy_init )
|
||||||
{
|
{
|
||||||
@ -891,168 +895,168 @@ do_action: /* This label is used only to access EOF actions. */
|
|||||||
{ /* beginning of action switch */
|
{ /* beginning of action switch */
|
||||||
case 1:
|
case 1:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 178 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 182 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ /* Ignore comments */ }
|
{ /* Ignore comments */ }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 2:
|
case 2:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 180 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 184 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ HandleInclude(yytext); }
|
{ HandleInclude(yytext); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 3:
|
case 3:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 181 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 185 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
|
{ Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
|
||||||
return CODEFRAGMENT; }
|
return CODEFRAGMENT; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 4:
|
case 4:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 184 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 188 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return INT; }
|
{ return INT; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 5:
|
case 5:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 185 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 189 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return BIT; }
|
{ return BIT; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 6:
|
case 6:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 186 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 190 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return BITS; }
|
{ return BITS; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 7:
|
case 7:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 187 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 191 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return STRING; }
|
{ return STRING; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 8:
|
case 8:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 188 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 192 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return LIST; }
|
{ return LIST; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 9:
|
case 9:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 189 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 193 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return CODE; }
|
{ return CODE; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 10:
|
case 10:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 190 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 194 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return DAG; }
|
{ return DAG; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 11:
|
case 11:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 192 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 196 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return CLASS; }
|
{ return CLASS; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 12:
|
case 12:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 193 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 197 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return DEF; }
|
{ return DEF; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 13:
|
case 13:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 194 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 198 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return FIELD; }
|
{ return FIELD; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 14:
|
case 14:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 195 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 199 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return LET; }
|
{ return LET; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 15:
|
case 15:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 196 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 200 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return IN; }
|
{ return IN; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 16:
|
case 16:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 198 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 202 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return SRATOK; }
|
{ return SRATOK; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 17:
|
case 17:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 199 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 203 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return SRLTOK; }
|
{ return SRLTOK; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 18:
|
case 18:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 200 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 204 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return SHLTOK; }
|
{ return SHLTOK; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 19:
|
case 19:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 203 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 207 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ Filelval.StrVal = new std::string(yytext, yytext+yyleng);
|
{ Filelval.StrVal = new std::string(yytext, yytext+yyleng);
|
||||||
return ID; }
|
return ID; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 20:
|
case 20:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 205 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 209 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
|
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
|
||||||
return VARNAME; }
|
return VARNAME; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 21:
|
case 21:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 208 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 212 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
|
{ Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
|
||||||
return STRVAL; }
|
return STRVAL; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 22:
|
case 22:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 211 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 215 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
|
{ Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 23:
|
case 23:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 213 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 217 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ /* Ignore whitespace */ }
|
{ /* Ignore whitespace */ }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 24:
|
case 24:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 216 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 220 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ BEGIN(comment); CommentDepth++; }
|
{ BEGIN(comment); CommentDepth++; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 25:
|
case 25:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 217 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 221 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{} /* eat anything that's not a '*' or '/' */
|
{} /* eat anything that's not a '*' or '/' */
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 26:
|
case 26:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 218 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 222 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{} /* eat up '*'s not followed by '/'s */
|
{} /* eat up '*'s not followed by '/'s */
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 27:
|
case 27:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 219 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 223 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ ++CommentDepth; }
|
{ ++CommentDepth; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 28:
|
case 28:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 220 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 224 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{} /* eat up /'s not followed by *'s */
|
{} /* eat up /'s not followed by *'s */
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 29:
|
case 29:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 221 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 225 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ if (!--CommentDepth) { BEGIN(INITIAL); } }
|
{ if (!--CommentDepth) { BEGIN(INITIAL); } }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case YY_STATE_EOF(comment):
|
case YY_STATE_EOF(comment):
|
||||||
#line 222 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 226 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ err() << "Unterminated comment!\n"; exit(1); }
|
{ err() << "Unterminated comment!\n"; exit(1); }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 30:
|
case 30:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 224 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 228 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
{ return Filetext[0]; }
|
{ return Filetext[0]; }
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 31:
|
case 31:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 226 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 230 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
YY_FATAL_ERROR( "flex scanner jammed" );
|
YY_FATAL_ERROR( "flex scanner jammed" );
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
#line 1056 "Lexer.cpp"
|
#line 1060 "Lexer.cpp"
|
||||||
case YY_STATE_EOF(INITIAL):
|
case YY_STATE_EOF(INITIAL):
|
||||||
yyterminate();
|
yyterminate();
|
||||||
|
|
||||||
@ -1936,6 +1940,6 @@ int main()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#line 226 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
|
#line 230 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileLexer.l"
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ int Fileparse();
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
// Global variable recording the location of the include directory
|
// Global variable recording the location of the include directory
|
||||||
std::string IncludeDirectory;
|
std::vector<std::string> IncludeDirectories;
|
||||||
|
|
||||||
/// ParseInt - This has to handle the special case of binary numbers 0b0101
|
/// ParseInt - This has to handle the special case of binary numbers 0b0101
|
||||||
///
|
///
|
||||||
@ -74,7 +74,8 @@ std::ostream &err() {
|
|||||||
|
|
||||||
/// ParseFile - this function begins the parsing of the specified tablegen file.
|
/// ParseFile - this function begins the parsing of the specified tablegen file.
|
||||||
///
|
///
|
||||||
void ParseFile(const std::string &Filename, const std::string & IncludeDir) {
|
void ParseFile(const std::string &Filename,
|
||||||
|
const std::vector<std::string> &IncludeDirs) {
|
||||||
FILE *F = stdin;
|
FILE *F = stdin;
|
||||||
if (Filename != "-") {
|
if (Filename != "-") {
|
||||||
F = fopen(Filename.c_str(), "r");
|
F = fopen(Filename.c_str(), "r");
|
||||||
@ -90,7 +91,7 @@ void ParseFile(const std::string &Filename, const std::string & IncludeDir) {
|
|||||||
|
|
||||||
// Record the location of the include directory so that the lexer can find
|
// Record the location of the include directory so that the lexer can find
|
||||||
// it later.
|
// it later.
|
||||||
IncludeDirectory = IncludeDir;
|
IncludeDirectories = IncludeDirs;
|
||||||
|
|
||||||
Filein = F;
|
Filein = F;
|
||||||
Filelineno = 1;
|
Filelineno = 1;
|
||||||
@ -124,10 +125,13 @@ static void HandleInclude(const char *Buffer) {
|
|||||||
// If we couldn't find the file in the current directory, look for it in
|
// If we couldn't find the file in the current directory, look for it in
|
||||||
// the include directories.
|
// the include directories.
|
||||||
//
|
//
|
||||||
// NOTE: Right now, there is only one directory. We need to eventually add
|
std::string NextFilename;
|
||||||
// support for more.
|
for (unsigned i = 0, e = IncludeDirectories.size(); i != e; ++i) {
|
||||||
std::string NextFilename = IncludeDirectory + "/" + Filename;
|
NextFilename = IncludeDirectories[i] + "/" + Filename;
|
||||||
yyin = fopen(NextFilename.c_str(), "r");
|
if (yyin = fopen(NextFilename.c_str(), "r"))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (yyin == 0) {
|
if (yyin == 0) {
|
||||||
err() << "Could not find include file '" << Filename << "'!\n";
|
err() << "Could not find include file '" << Filename << "'!\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user