mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
eliminate the Records global variable, patch by Garrison Venn!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121659 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -173,9 +173,6 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
// FIXME: Eliminate globals from tblgen.
|
||||
RecordKeeper llvm::Records;
|
||||
|
||||
static SourceMgr SrcMgr;
|
||||
|
||||
void llvm::PrintError(SMLoc ErrorLoc, const Twine &Msg) {
|
||||
@@ -188,7 +185,8 @@ void llvm::PrintError(SMLoc ErrorLoc, const Twine &Msg) {
|
||||
/// file.
|
||||
static bool ParseFile(const std::string &Filename,
|
||||
const std::vector<std::string> &IncludeDirs,
|
||||
SourceMgr &SrcMgr) {
|
||||
SourceMgr &SrcMgr,
|
||||
RecordKeeper& Records) {
|
||||
error_code ec;
|
||||
MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), ec);
|
||||
if (F == 0) {
|
||||
@@ -204,19 +202,21 @@ static bool ParseFile(const std::string &Filename,
|
||||
// it later.
|
||||
SrcMgr.setIncludeDirs(IncludeDirs);
|
||||
|
||||
TGParser Parser(SrcMgr);
|
||||
TGParser Parser(SrcMgr, Records);
|
||||
|
||||
return Parser.ParseFile();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
RecordKeeper Records;
|
||||
|
||||
sys::PrintStackTraceOnErrorSignal();
|
||||
PrettyStackTraceProgram X(argc, argv);
|
||||
cl::ParseCommandLineOptions(argc, argv);
|
||||
|
||||
|
||||
// Parse the input file.
|
||||
if (ParseFile(InputFilename, IncludeDirs, SrcMgr))
|
||||
if (ParseFile(InputFilename, IncludeDirs, SrcMgr, Records))
|
||||
return 1;
|
||||
|
||||
std::string Error;
|
||||
|
||||
Reference in New Issue
Block a user