summaryrefslogtreecommitdiff
path: root/utils/TableGen/TableGen.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-30 19:48:02 +0000
committerChris Lattner <sabre@nondot.org>2003-07-30 19:48:02 +0000
commit90523906fa31c8f4e156dc7ef4a433a50d4b706d (patch)
tree87e30faa14fcfd36792a0c53aff7a0de5ddd7ab4 /utils/TableGen/TableGen.cpp
parent35c7444e52efaeae5d9cc1024350edb25dae5447 (diff)
downloadllvm-90523906fa31c8f4e156dc7ef4a433a50d4b706d.tar.gz
llvm-90523906fa31c8f4e156dc7ef4a433a50d4b706d.tar.bz2
llvm-90523906fa31c8f4e156dc7ef4a433a50d4b706d.tar.xz
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
Diffstat (limited to 'utils/TableGen/TableGen.cpp')
-rw-r--r--utils/TableGen/TableGen.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp
index 17f2b2e718..70d2ef9b18 100644
--- a/utils/TableGen/TableGen.cpp
+++ b/utils/TableGen/TableGen.cpp
@@ -29,13 +29,16 @@ namespace {
Class("class", cl::desc("Print Enum list for this class"),
cl::value_desc("class name"));
- cl::opt<std::string>
- OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"),
- cl::init("-"));
+ cl::opt<std::string>
+ OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"),
+ cl::init("-"));
+
+ cl::opt<std::string>
+ InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"));
}
-void ParseFile();
+void ParseFile(const std::string &Filename);
RecordKeeper Records;
@@ -379,7 +382,7 @@ static void ParseMachineCode() {
int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv);
- ParseFile();
+ ParseFile(InputFilename);
std::ostream *Out = &std::cout;
if (OutputFilename != "-") {