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 | 92b8da75a1bed2f70079e970883b4e69e99d2330 (patch) | |
tree | 446ab37f1a4175b35bcf53eef8f3174ee1319966 /utils | |
parent | 34f376281f0bf013a6a0559193e17074e3d3647b (diff) | |
download | external_llvm-92b8da75a1bed2f70079e970883b4e69e99d2330.zip external_llvm-92b8da75a1bed2f70079e970883b4e69e99d2330.tar.gz external_llvm-92b8da75a1bed2f70079e970883b4e69e99d2330.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/LLVMCConfigurationEmitter.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 45f6a13..9be9cfc 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/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; |