diff --git a/llvm/tools/llvmc2/AutoGenerated.cpp b/llvm/tools/llvmc2/AutoGenerated.cpp index 213db01e0bce..30aeb8f75eae 100644 --- a/llvm/tools/llvmc2/AutoGenerated.cpp +++ b/llvm/tools/llvmc2/AutoGenerated.cpp @@ -29,5 +29,7 @@ namespace llvmc { extern const std::string& GetLanguage(const sys::Path& File); } +extern cl::opt OutputFilename; + // The auto-generated file #include "AutoGenerated.inc" diff --git a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp index 45f6a13d2305..9be9cfc98b0a 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;