aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CommandFlags.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/CommandFlags.cpp')
-rw-r--r--llvm/lib/CodeGen/CommandFlags.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
index 8fc65d7..9e42deb 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -624,12 +624,9 @@ std::string codegen::getFeaturesStr() {
// This is necessary for x86 where the CPU might not support all the
// features the autodetected CPU name lists in the target. For example,
// not all Sandybridge processors support AVX.
- if (getMCPU() == "native") {
- StringMap<bool> HostFeatures;
- if (sys::getHostCPUFeatures(HostFeatures))
- for (const auto &[Feature, IsEnabled] : HostFeatures)
- Features.AddFeature(Feature, IsEnabled);
- }
+ if (getMCPU() == "native")
+ for (const auto &[Feature, IsEnabled] : sys::getHostCPUFeatures())
+ Features.AddFeature(Feature, IsEnabled);
for (auto const &MAttr : getMAttrs())
Features.AddFeature(MAttr);
@@ -644,12 +641,9 @@ std::vector<std::string> codegen::getFeatureList() {
// This is necessary for x86 where the CPU might not support all the
// features the autodetected CPU name lists in the target. For example,
// not all Sandybridge processors support AVX.
- if (getMCPU() == "native") {
- StringMap<bool> HostFeatures;
- if (sys::getHostCPUFeatures(HostFeatures))
- for (const auto &[Feature, IsEnabled] : HostFeatures)
- Features.AddFeature(Feature, IsEnabled);
- }
+ if (getMCPU() == "native")
+ for (const auto &[Feature, IsEnabled] : sys::getHostCPUFeatures())
+ Features.AddFeature(Feature, IsEnabled);
for (auto const &MAttr : getMAttrs())
Features.AddFeature(MAttr);