summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorViktor Kutuzov <vkutuzov@accesssoftek.com>2009-11-21 00:00:02 +0000
committerViktor Kutuzov <vkutuzov@accesssoftek.com>2009-11-21 00:00:02 +0000
commit054b52c366256e7cde9c937006df944372e09acc (patch)
tree615c3364433fbbdeecfce5a3a5c0dceb7673b46c /tools
parent00621efb40edb7fe16bf2af6d4699c9d024a28e7 (diff)
downloadllvm-054b52c366256e7cde9c937006df944372e09acc.tar.gz
llvm-054b52c366256e7cde9c937006df944372e09acc.tar.bz2
llvm-054b52c366256e7cde9c937006df944372e09acc.tar.xz
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/lto/LTOCodeGenerator.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 0b9cb2952e..f079c2e360 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/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;
}