aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/llvmc2/AutoGenerated.cpp2
-rw-r--r--utils/TableGen/LLVMCConfigurationEmitter.cpp16
2 files changed, 13 insertions, 5 deletions
diff --git a/tools/llvmc2/AutoGenerated.cpp b/tools/llvmc2/AutoGenerated.cpp
index 213db01e0b..30aeb8f75e 100644
--- a/tools/llvmc2/AutoGenerated.cpp
+++ b/tools/llvmc2/AutoGenerated.cpp
@@ -29,5 +29,7 @@ namespace llvmc {
extern const std::string& GetLanguage(const sys::Path& File);
}
+extern cl::opt<std::string> OutputFilename;
+
// The auto-generated file
#include "AutoGenerated.inc"
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;