From f9f60c7adc51ad6e458d282d3cb5c9d35164fe59 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 12 May 2015 01:26:21 +0000 Subject: [PATCH] Remove the code that pulled soft float attributes out of the feature strings and remove the setting of TargetOptions::UseSoftFloat to match the code change in llvm r237079. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237080 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Targets.cpp | 16 ++++------------ lib/CodeGen/BackendUtil.cpp | 1 - test/CodeGen/function-target-features.c | 5 +++-- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index fe37caa83b..55f7c8c9f6 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -4271,12 +4271,10 @@ public: Features.push_back("-neonfp"); // Remove front-end specific options which the backend handles differently. - const StringRef FrontEndFeatures[] = { "+soft-float", "+soft-float-abi" }; - for (const auto &FEFeature : FrontEndFeatures) { - auto Feature = std::find(Features.begin(), Features.end(), FEFeature); - if (Feature != Features.end()) - Features.erase(Feature); - } + auto Feature = + std::find(Features.begin(), Features.end(), "+soft-float-abi"); + if (Feature != Features.end()) + Features.erase(Feature); return true; } @@ -6149,12 +6147,6 @@ public: IsNan2008 = false; } - // Remove front-end specific options. - std::vector::iterator it = - std::find(Features.begin(), Features.end(), "+soft-float"); - if (it != Features.end()) - Features.erase(it); - setDescriptionString(); return true; diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 20fd9af169..30030050df 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -531,7 +531,6 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { Options.NoNaNsFPMath = CodeGenOpts.NoNaNsFPMath; Options.NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS; Options.UnsafeFPMath = CodeGenOpts.UnsafeFPMath; - Options.UseSoftFloat = CodeGenOpts.SoftFloat; Options.StackAlignmentOverride = CodeGenOpts.StackAlignment; Options.DisableTailCalls = CodeGenOpts.DisableTailCalls; Options.TrapFuncName = CodeGenOpts.TrapFuncName; diff --git a/test/CodeGen/function-target-features.c b/test/CodeGen/function-target-features.c index b6cd4ca7a6..351c7f102b 100644 --- a/test/CodeGen/function-target-features.c +++ b/test/CodeGen/function-target-features.c @@ -9,7 +9,7 @@ // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -target-cpu corei7 -target-feature +avx | FileCheck %s -check-prefix=CORE-CPU-AND-FEATURES // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -target-cpu x86-64 | FileCheck %s -check-prefix=X86-64-CPU // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -target-cpu corei7-avx -target-feature -avx | FileCheck %s -check-prefix=AVX-MINUS-FEATURE -// RUN: %clang_cc1 -triple sparc-unknown-unknown -emit-llvm -o - %s -target-feature +soft-float | FileCheck %s -check-prefix=SOFT-FLOAT +// RUN: %clang_cc1 -triple sparc-unknown-unknown -emit-llvm -o - %s -target-feature +soft-float | FileCheck %s -check-prefix=NO-SOFT-FLOAT // RUN: %clang_cc1 -triple arm-unknown-unknown -emit-llvm -o - %s -target-feature +soft-float | FileCheck %s -check-prefix=SOFT-FLOAT // RUN: %clang_cc1 -triple mips-unknown-unknown -emit-llvm -o - %s -target-feature +soft-float | FileCheck %s -check-prefix=SOFT-FLOAT @@ -22,4 +22,5 @@ void foo() {} // CORE-CPU-AND-FEATURES: "target-cpu"="corei7" "target-features"={{.*}}+avx // X86-64-CPU: "target-cpu"="x86-64" // AVX-MINUS-FEATURE: "target-features"={{.*}}-avx -// SOFT-FLOAT-NOT: "target-features"={{.*}}+soft-float +// SOFT-FLOAT: "target-features"={{.*}}+soft-float +// NO-SOFT-FLOAT-NOT: "target-features"={{.*}}+soft-float -- 2.40.0