From: Evan Cheng Date: Fri, 8 Jul 2011 06:40:11 +0000 (+0000) Subject: Fix a FIXME in clang ARM driver that was exposed as a bug with ARM backend X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f972b26368570e5fbbb23e1302b28bbf81c15c69;p=clang Fix a FIXME in clang ARM driver that was exposed as a bug with ARM backend change. Previously clang was passing the following feature strings to the ARM backend when CPU is cortex-a8: +neon,-vfp2,-vfp3 This used to work because -vfp2,-vfp3 had no effect after +neon. Now that the features are controlled by individual bits (with implied hierarchy), the net effect is all three features will be turned off. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134691 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 9863676575..b98baaa938 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -1967,11 +1967,6 @@ public: void getDefaultFeatures(const std::string &CPU, llvm::StringMap &Features) const { - // FIXME: This should not be here. - Features["vfp2"] = false; - Features["vfp3"] = false; - Features["neon"] = false; - if (CPU == "arm1136jf-s" || CPU == "arm1176jzf-s" || CPU == "mpcore") Features["vfp2"] = true; else if (CPU == "cortex-a8" || CPU == "cortex-a9") @@ -1981,12 +1976,8 @@ public: virtual bool setFeatureEnabled(llvm::StringMap &Features, const std::string &Name, bool Enabled) const { - if (Name == "soft-float" || Name == "soft-float-abi") { - Features[Name] = Enabled; - } else if (Name == "vfp2" || Name == "vfp3" || Name == "neon") { - // These effectively are a single option, reset them when any is enabled. - if (Enabled) - Features["vfp2"] = Features["vfp3"] = Features["neon"] = false; + if (Name == "soft-float" || Name == "soft-float-abi" || + Name == "vfp2" || Name == "vfp3" || Name == "neon") { Features[Name] = Enabled; } else return false;