diff options
author | John Criswell <criswell@uiuc.edu> | 2003-08-27 13:41:57 +0000 |
---|---|---|
committer | John Criswell <criswell@uiuc.edu> | 2003-08-27 13:41:57 +0000 |
commit | 96b4beda5c180f4091d55752bc22129f15d4030c (patch) | |
tree | c16bfa341903be2ffca3cf16a24afd9094477031 /utils/TableGen/TableGen.cpp | |
parent | 065c0b95a3960f228f8898f520100b053e243fb6 (diff) |
Added an option to TableGen that allows users to specify a directory in which
to find include files. TableGen will load include files from this directory if
it cannot find them in the current directory.
This feature was needed for building code inside the object tree (a la autoconf
style).
TODO: Allow for multiple -I options to specify a list of directories to search.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/TableGen.cpp')
-rw-r--r-- | utils/TableGen/TableGen.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp index 85a63ceaf6..67efdb46c8 100644 --- a/utils/TableGen/TableGen.cpp +++ b/utils/TableGen/TableGen.cpp @@ -64,10 +64,14 @@ namespace { cl::opt<std::string> InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-")); + + cl::opt<std::string> + IncludeDir("I", cl::desc("Directory of include files"), + cl::value_desc("directory"), cl::init("")); } -void ParseFile(const std::string &Filename); +void ParseFile(const std::string &Filename, const std::string & IncludeDir); RecordKeeper Records; @@ -398,7 +402,7 @@ static void ParseMachineCode() { int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv); - ParseFile(InputFilename); + ParseFile(InputFilename, IncludeDir); std::ostream *Out = &std::cout; if (OutputFilename != "-") { |