diff options
author | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2009-11-21 00:00:02 +0000 |
---|---|---|
committer | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2009-11-21 00:00:02 +0000 |
commit | 7dcca8f7fcfddb4d5591e8b7a0f0c0983de1ce07 (patch) | |
tree | b0a4e2ed4fa11271a4421826bc15fe1f21bfee6e /llvm/tools/lto/LTOCodeGenerator.cpp | |
parent | c2588c3bd9f45e8296ff2fb2f71b352e501b231e (diff) | |
download | bcm5719-llvm-7dcca8f7fcfddb4d5591e8b7a0f0c0983de1ce07.tar.gz bcm5719-llvm-7dcca8f7fcfddb4d5591e8b7a0f0c0983de1ce07.zip |
Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
llvm-svn: 89516
Diffstat (limited to 'llvm/tools/lto/LTOCodeGenerator.cpp')
-rw-r--r-- | llvm/tools/lto/LTOCodeGenerator.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/tools/lto/LTOCodeGenerator.cpp b/llvm/tools/lto/LTOCodeGenerator.cpp index 0b9cb2952e8..f079c2e3601 100644 --- a/llvm/tools/lto/LTOCodeGenerator.cpp +++ b/llvm/tools/lto/LTOCodeGenerator.cpp @@ -304,10 +304,17 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg) break; } + // Prepare subtarget feature set for the given command line options. + SubtargetFeatures features; + + // Set the rest of features by default. + // Note: Please keep this after all explict feature settings to make sure + // defaults will not override explicitly set options. + features.AddFeatures( + SubtargetFeatures::getDefaultSubtargetFeatures(llvm::Triple(Triple))); + // construct LTModule, hand over ownership of module and target - const std::string FeatureStr = - SubtargetFeatures::getDefaultSubtargetFeatures(llvm::Triple(Triple)); - _target = march->createTargetMachine(Triple, FeatureStr); + _target = march->createTargetMachine(Triple, features.getString()); } return false; } |