diff options
author | Sandeep Patel <deeppatel1987@gmail.com> | 2011-04-05 00:23:47 +0000 |
---|---|---|
committer | Sandeep Patel <deeppatel1987@gmail.com> | 2011-04-05 00:23:47 +0000 |
commit | 45df3dd3fe49a4b4e832405e7f791f2108713c3c (patch) | |
tree | df633464bbc39c8285b2e195c0e996c620f6dac1 /clang/lib/CodeGen/TargetInfo.cpp | |
parent | 75bb01b47d52d5a7c8c2016528e845df9560b87f (diff) | |
download | bcm5719-llvm-45df3dd3fe49a4b4e832405e7f791f2108713c3c.tar.gz bcm5719-llvm-45df3dd3fe49a4b4e832405e7f791f2108713c3c.zip |
Set AAPCS-VFP calling convention accordingly and hard float ABI command handling.
llvm-svn: 128866
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index d8b0de67a62..5db9a8e640b 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -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)); |