[cfe-commits] r128866 - in /cfe/trunk/lib/CodeGen: BackendUtil.cpp TargetInfo.cpp
Sandeep Patel
deeppatel1987 at gmail.com
Mon Apr 4 17:23:47 PDT 2011
Author: sandeep
Date: Mon Apr 4 19:23:47 2011
New Revision: 128866
URL: http://llvm.org/viewvc/llvm-project?rev=128866&view=rev
Log:
Set AAPCS-VFP calling convention accordingly and hard float ABI command handling.
Modified:
cfe/trunk/lib/CodeGen/BackendUtil.cpp
cfe/trunk/lib/CodeGen/TargetInfo.cpp
Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=128866&r1=128865&r2=128866&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Mon Apr 4 19:23:47 2011
@@ -190,7 +190,7 @@
}
// 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;
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=128866&r1=128865&r2=128866&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Mon Apr 4 19:23:47 2011
@@ -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 @@
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));
More information about the cfe-commits
mailing list