mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Make tablegen take an input filename to parse if one is specified, otherwise
use stdin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7431 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -24,12 +24,24 @@ typedef std::pair<Record*, std::vector<Init*>*> SubClassRefTy;
|
||||
static std::vector<std::pair<std::pair<std::string, std::vector<unsigned>*>,
|
||||
Init*> > SetStack;
|
||||
|
||||
void ParseFile() {
|
||||
void ParseFile(const std::string &Filename) {
|
||||
FILE *F = stdin;
|
||||
if (Filename != "-") {
|
||||
F = fopen(Filename.c_str(), "r");
|
||||
|
||||
if (F == 0) {
|
||||
std::cerr << "Could not open input file '" + Filename + "'!\n";
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Filein = F;
|
||||
Filelineno = 1;
|
||||
Fileparse();
|
||||
|
||||
if (F != stdin)
|
||||
fclose(F);
|
||||
Filein = stdin;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user