]> granicus.if.org Git - clang/commitdiff
Set AAPCS-VFP calling convention accordingly and hard float ABI command handling.
authorSandeep Patel <deeppatel1987@gmail.com>
Tue, 5 Apr 2011 00:23:47 +0000 (00:23 +0000)
committerSandeep Patel <deeppatel1987@gmail.com>
Tue, 5 Apr 2011 00:23:47 +0000 (00:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128866 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp
lib/CodeGen/TargetInfo.cpp

index 6358b9fc154a9abf1bef3f93f8b42694e43b693f..1d2936072e1d254cc401d9593dbd3d1a6d778616 100644 (file)
@@ -190,7 +190,7 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
   }
 
   // Set float ABI type.
-  if (CodeGenOpts.FloatABI == "soft")
+  if (CodeGenOpts.FloatABI == "soft" || CodeGenOpts.FloatABI == "softfp")
     llvm::FloatABIType = llvm::FloatABI::Soft;
   else if (CodeGenOpts.FloatABI == "hard")
     llvm::FloatABIType = llvm::FloatABI::Hard;
index d8b0de67a626c1a3fa14b9ef3e1103cc40dff5da..5db9a8e640badd86a5c594e1f518d58bee0f4cc4 100644 (file)
@@ -16,6 +16,7 @@
 #include "ABIInfo.h"
 #include "CodeGenFunction.h"
 #include "clang/AST/RecordLayout.h"
+#include "clang/Frontend/CodeGenOptions.h"
 #include "llvm/Type.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/ADT/Triple.h"
@@ -2814,13 +2815,16 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
 
   case llvm::Triple::arm:
   case llvm::Triple::thumb:
-    // FIXME: We want to know the float calling convention as well.
-    if (strcmp(getContext().Target.getABI(), "apcs-gnu") == 0)
-      return *(TheTargetCodeGenInfo =
-               new ARMTargetCodeGenInfo(Types, ARMABIInfo::APCS));
+    {
+      ARMABIInfo::ABIKind Kind = ARMABIInfo::AAPCS;
+
+      if (strcmp(getContext().Target.getABI(), "apcs-gnu") == 0)
+        Kind = ARMABIInfo::APCS;
+      else if (CodeGenOpts.FloatABI == "hard")
+        Kind = ARMABIInfo::AAPCS_VFP;
 
-    return *(TheTargetCodeGenInfo =
-             new ARMTargetCodeGenInfo(Types, ARMABIInfo::AAPCS));
+      return *(TheTargetCodeGenInfo = new ARMTargetCodeGenInfo(Types, Kind));
+    }
 
   case llvm::Triple::ppc:
     return *(TheTargetCodeGenInfo = new PPC32TargetCodeGenInfo(Types));