summaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetLoweringBase.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-12-19 00:20:33 +0000
committerMatthias Braun <matze@braunis.de>2017-12-19 00:20:33 +0000
commitea2d46a6f258af4e53707a4fa98331d19cbb8f22 (patch)
tree5d9426c308dcd47fb97751ddd944aedd546acbf1 /lib/CodeGen/TargetLoweringBase.cpp
parentd53e70262dba7d67668a2516e731085d27610ed7 (diff)
TargetLowering: Fix InitLibcallCallingConvs() overriding things set in InitLibcalls()
I missed the fact that the later called InitLibcallCallingConvs() overrides some things set in InitLibcalls() when I did the refactoring in r321036. Fix by merging InitLibcallCallingConvs() into InitLibcalls() and doing the initialization earlier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r--lib/CodeGen/TargetLoweringBase.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/CodeGen/TargetLoweringBase.cpp b/lib/CodeGen/TargetLoweringBase.cpp
index 133d0c5a497..8a3e6791034 100644
--- a/lib/CodeGen/TargetLoweringBase.cpp
+++ b/lib/CodeGen/TargetLoweringBase.cpp
@@ -117,6 +117,9 @@ void TargetLoweringBase::InitLibcalls(const Triple &TT) {
setLibcallName(RTLIB::code, name);
#include "llvm/CodeGen/RuntimeLibcalls.def"
#undef HANDLE_LIBCALL
+ // Initialize calling conventions to their default.
+ for (int LC = 0; LC < RTLIB::UNKNOWN_LIBCALL; ++LC)
+ setLibcallCallingConv((RTLIB::Libcall)LC, CallingConv::C);
// A few names are different on particular architectures or environments.
if (TT.isOSDarwin()) {
@@ -158,12 +161,6 @@ void TargetLoweringBase::InitLibcalls(const Triple &TT) {
}
}
-/// Set default libcall CallingConvs.
-static void InitLibcallCallingConvs(CallingConv::ID *CCs) {
- for (int LC = 0; LC < RTLIB::UNKNOWN_LIBCALL; ++LC)
- CCs[LC] = CallingConv::C;
-}
-
/// getFPEXT - Return the FPEXT_*_* value for the given types, or
/// UNKNOWN_LIBCALL if there is none.
RTLIB::Libcall RTLIB::getFPEXT(EVT OpVT, EVT RetVT) {
@@ -552,7 +549,6 @@ TargetLoweringBase::TargetLoweringBase(const TargetMachine &tm) : TM(tm) {
InitLibcalls(TM.getTargetTriple());
InitCmpLibcallCCs(CmpLibcallCCs);
- InitLibcallCallingConvs(LibcallCallingConvs);
}
void TargetLoweringBase::initActions() {