From 92b8da75a1bed2f70079e970883b4e69e99d2330 Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Fri, 30 May 2008 06:24:07 +0000 Subject: 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 --- utils/TableGen/LLVMCConfigurationEmitter.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'utils/TableGen/LLVMCConfigurationEmitter.cpp') diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 45f6a13d23..9be9cfc98b 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; -- cgit v1.2.3