On 28 October 2013 23:28, Lang Hames <[email protected]> wrote:
> Hi Rafael,
>
> I noticed that as a consequence of this patch, clang is issuing the
> following warning when assembling for arm:
>
> "'+soft-float-abi' is not a recognized feature for this target (ignoring
> feature)"
>
> You can reproduce this (at least on Darwin, and I expect on Linux too) by
> creating an empty foo.s file and running:
>
> clang -arch armv7 -c foo.s
>
> It looks like the cause of the warning is that both Clang::ConstructJob and
> ClangAs::ConstructJob are both calling getARMTargetFeatures (indirectly via
> getTargetFeatures), and getARMTargetFeatures always adds the abi-appropriate
> flag, even when the driver was being invoked as an assembler.
>
> I'm not very familiar with the driver code, so I didn't want to jump in and
> undo any of the useful parts of your refactor to fix this.
>
> Do you have any thoughts on the right way to omit this flag when assembling?

Good question. These are odd "feature, but not really". It looks like
the driver passes them as features because that is all that TargetInfo
in "clang -cc1" will see. Some options would be

* Don't pass this information as features. Call them TargetOptions or
something like that and add a  virtual bool handleTargetOption.
* Make them real features (attached patch).
* Pass a flag to getARMTargetFeatures so that it knows the target
features are being collected for the assembler.

Daniel, you added this back in r91755 along with the "this is a hack"
FIXME. What was the direction you wanted this to take?

Cheers,
Rafael
diff --git a/lib/Target/ARM/ARM.td b/lib/Target/ARM/ARM.td
index bf12c32..3b91805 100644
--- a/lib/Target/ARM/ARM.td
+++ b/lib/Target/ARM/ARM.td
@@ -27,6 +27,11 @@ def ModeThumb  : SubtargetFeature<"thumb-mode", "InThumbMode", "true",
 // ARM Subtarget features.
 //
 
+def FeatureSoftFloat : SubtargetFeature<"soft-float", "HasSoftFloat", "false",
+                                        "?">;
+def FeatureSoftFloatABI : SubtargetFeature<"soft-float-abi", "HasSoftFloat",
+                                           "false", "?">;
+
 def FeatureVFP2 : SubtargetFeature<"vfp2", "HasVFPv2", "true",
                                    "Enable VFP2 instructions">;
 def FeatureVFP3 : SubtargetFeature<"vfp3", "HasVFPv3", "true",
diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h
index b9a55fb..c085f08 100644
--- a/lib/Target/ARM/ARMSubtarget.h
+++ b/lib/Target/ARM/ARMSubtarget.h
@@ -57,6 +57,8 @@ protected:
 
   /// HasVFPv2, HasVFPv3, HasVFPv4, HasFPARMv8, HasNEON - Specify what
   /// floating point ISAs are supported.
+  bool HasSoftFloat;
+  bool HasSoftFloatABI;
   bool HasVFPv2;
   bool HasVFPv3;
   bool HasVFPv4;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to