[llvm-commits] [llvm-gcc-4.2] r59833 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Devang Patel
dpatel at apple.com
Fri Nov 21 11:09:20 PST 2008
Author: dpatel
Date: Fri Nov 21 13:09:20 2008
New Revision: 59833
URL: http://llvm.org/viewvc/llvm-project?rev=59833&view=rev
Log:
Supply target specific -mllvm options to llvm after llvm target is set up.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=59833&r1=59832&r2=59833&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Fri Nov 21 13:09:20 2008
@@ -172,11 +172,6 @@
ArgStrings.push_back(Arg);
}
- if (llvm_optns) {
- std::string Opts = llvm_optns;
- for (std::string Opt = getToken(Opts); !Opt.empty(); Opt = getToken(Opts))
- ArgStrings.push_back(Opt);
- }
for (unsigned i = 0, e = ArgStrings.size(); i != e; ++i)
Args.push_back(ArgStrings[i].c_str());
Args.push_back(0); // Null terminator.
@@ -244,6 +239,18 @@
RegisterRegAlloc::setDefault(createLinearScanRegisterAllocator);
else
RegisterRegAlloc::setDefault(createLocalRegisterAllocator);
+
+ Args.clear();
+ if (llvm_optns) {
+ std::string Opts = llvm_optns;
+ for (std::string Opt = getToken(Opts); !Opt.empty(); Opt = getToken(Opts))
+ Args.push_back(Opt.c_str());
+ }
+ if (!Args.empty()) {
+ Args.push_back(0); // Null terminator.
+ pseudo_argc = Args.size()-1;
+ cl::ParseCommandLineOptions(pseudo_argc, (char**)&Args[0]);
+ }
if (!optimize && debug_info_level > DINFO_LEVEL_NONE)
TheDebugInfo = new DebugInfo(TheModule);
More information about the llvm-commits
mailing list