Fix option parsing in the gold plugin.

This was broken when options were moved up in r191680. No test because this is
specific LLVMgold.so/libLTO.so.

Patch by Tom Roeder!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2013-10-02 14:36:23 +00:00
parent 1a1d7c4f4c
commit 0e95b3aba9
3 changed files with 27 additions and 5 deletions

View File

@ -264,11 +264,6 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
if (TargetMach != NULL)
return true;
// if options were requested, set them
if (!CodegenOptions.empty())
cl::ParseCommandLineOptions(CodegenOptions.size(),
const_cast<char **>(&CodegenOptions[0]));
std::string TripleStr = Linker.getModule()->getTargetTriple();
if (TripleStr.empty())
TripleStr = sys::getDefaultTargetTriple();
@ -473,3 +468,10 @@ void LTOCodeGenerator::setCodeGenDebugOptions(const char *options) {
CodegenOptions.push_back(strdup(o.first.str().c_str()));
}
}
void LTOCodeGenerator::parseCodeGenDebugOptions() {
// if options were requested, set them
if (!CodegenOptions.empty())
cl::ParseCommandLineOptions(CodegenOptions.size(),
const_cast<char **>(&CodegenOptions[0]));
}