diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-30 16:50:26 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-30 16:50:26 +0000 |
| commit | 3867383db07123b5d0932f12886bc4883fe4405b (patch) | |
| tree | be07ae78e12e0fcbca83d29ccb598179ad7e6350 /llvm/tools/llvm-upgrade/UpgradeParser.y.cvs | |
| parent | b12ab5fadb59918f811cf53450603ab8e5485433 (diff) | |
| download | bcm5719-llvm-3867383db07123b5d0932f12886bc4883fe4405b.tar.gz bcm5719-llvm-3867383db07123b5d0932f12886bc4883fe4405b.zip | |
Allow llvm-upgrade to read from stdin. Configure the lexer for reading
from C++ std::istream.
llvm-svn: 32041
Diffstat (limited to 'llvm/tools/llvm-upgrade/UpgradeParser.y.cvs')
| -rw-r--r-- | llvm/tools/llvm-upgrade/UpgradeParser.y.cvs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs b/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs index 48ea0b7f1a9..924af647811 100644 --- a/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs +++ b/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs @@ -1,4 +1,4 @@ -//===-- upgradeParser.y - Upgrade parser for llvm assmbly -------*- C++ -*-===// +//===-- UpgradeParser.y - Upgrade parser for llvm assmbly -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file implements the bison parser for LLVM assembly language upgrade. +// This file implements the bison parser for LLVM 1.9 assembly language. // //===----------------------------------------------------------------------===// @@ -17,12 +17,12 @@ #include "ParserInternals.h" #include <llvm/ADT/StringExtras.h> -#include <llvm/System/MappedFile.h> #include <algorithm> #include <list> #include <utility> #include <iostream> +#define YYINCLUDED_STDLIB_H int yylex(); // declaration" of xxx warnings. int yyparse(); @@ -31,19 +31,14 @@ static std::string CurFilename; static std::ostream *O = 0; -void UpgradeAssembly(const std::string &infile, std::ostream &out) +std::istream* LexInput = 0; + +void UpgradeAssembly(const std::string &infile, std::istream& in, + std::ostream &out) { Upgradelineno = 1; CurFilename = infile; - llvm::sys::Path p(infile); - llvm::sys::MappedFile mf; - mf.open(p); - mf.map(); - const char* base = mf.charBase(); - size_t sz = mf.size(); - - set_scan_bytes(base, sz); - + LexInput = ∈ O = &out; if (yyparse()) { |

