diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-30 06:24:07 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-30 06:24:07 +0000 |
commit | bf14dd7dc3c4b2833a23b0820b96b7033100d515 (patch) | |
tree | 06dbe35c1b68a7aed6c4129d5fd031c6e2ad98f4 /llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp | |
parent | f83f33e8d36c383e1b95663f999be2efa1ee312d (diff) | |
download | bcm5719-llvm-bf14dd7dc3c4b2833a23b0820b96b7033100d515.tar.gz bcm5719-llvm-bf14dd7dc3c4b2833a23b0820b96b7033100d515.zip |
Make it possible to test if the '-o' option is provided.
The following is now allowed:
(case (not_empty "o"), do_something, ...)
This didn't work previously because "-o" is built-in.
llvm-svn: 51751
Diffstat (limited to 'llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp index 45f6a13d230..9be9cfc98b0 100644 --- a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -691,11 +691,17 @@ bool EmitCaseTest1Arg(const std::string& TestName, O << "GetLanguage(inFile) == \"" << OptName << '\"'; return true; } else if (TestName == "not_empty") { - const GlobalOptionDescription& OptDesc = OptDescs.FindOption(OptName); - if (OptDesc.Type == OptionType::Switch) - throw OptName + ": incorrect option type!"; - O << '!' << OptDesc.GenVariableName() << ".empty()"; - return true; + if (OptName == "o") { + O << "!OutputFilename.empty()"; + return true; + } + else { + const GlobalOptionDescription& OptDesc = OptDescs.FindOption(OptName); + if (OptDesc.Type == OptionType::Switch) + throw OptName + ": incorrect option type!"; + O << '!' << OptDesc.GenVariableName() << ".empty()"; + return true; + } } return false; |