Make it possible to set the flags passed to the assembler.

Nick, please review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110705 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2010-08-10 18:55:09 +00:00
parent 9db3ea46cb
commit 98197e55c1
5 changed files with 43 additions and 0 deletions

View File

@@ -126,6 +126,14 @@ void LTOCodeGenerator::setAssemblerPath(const char* path)
_assemblerPath = new sys::Path(path);
}
void LTOCodeGenerator::setAssemblerArgs(const char** args, int nargs)
{
for (int i = 0; i < nargs; ++i) {
const char *arg = args[i];
_assemblerArgs.push_back(arg);
}
}
void LTOCodeGenerator::addMustPreserveSymbol(const char* sym)
{
_mustPreserveSymbols[sym] = 1;
@@ -257,6 +265,11 @@ bool LTOCodeGenerator::assemble(const std::string& asmPath,
args.push_back("-c");
args.push_back("-x");
args.push_back("assembler");
} else {
for (std::vector<std::string>::iterator I = _assemblerArgs.begin(),
E = _assemblerArgs.end(); I != E; ++I) {
args.push_back(I->c_str());
}
}
args.push_back("-o");
args.push_back(objPath.c_str());