Commit d14ea71e authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r367039 and r367103:

------------------------------------------------------------------------
r367039 | erichkeane | 2019-07-25 19:14:45 +0200 (Thu, 25 Jul 2019) | 6 lines

Remove CallingConvMethodType

This seems to be an old vestage of a previous implementation of getting
the default calling convention, and everything is now using
CXXABI/ASTContext's getDefaultCallingConvention.  Remove it, since it
isn't doing anything.
------------------------------------------------------------------------

------------------------------------------------------------------------
r367103 | erichkeane | 2019-07-26 14:36:12 +0200 (Fri, 26 Jul 2019) | 6 lines

Make the CXXABIs respect the target's default calling convention.

SPIR targets need to have all functions be SPIR calling convention,
however the CXXABIs were just returning CC_C in all non-'this-CC' cases.

https://reviews.llvm.org/D65294
------------------------------------------------------------------------

llvm-svn: 367129
parent 8f23294b
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -1249,15 +1249,9 @@ public:
  bool isBigEndian() const { return BigEndian; }
  bool isLittleEndian() const { return !BigEndian; }

  enum CallingConvMethodType {
    CCMT_Unknown,
    CCMT_Member,
    CCMT_NonMember
  };

  /// Gets the default calling convention for the given target and
  /// declaration context.
  virtual CallingConv getDefaultCallingConv(CallingConvMethodType MT) const {
  virtual CallingConv getDefaultCallingConv() const {
    // Not all targets will specify an explicit calling convention that we can
    // express.  This will always do the right thing, even though it's not
    // an explicit calling convention.
+1 −1
Original line number Diff line number Diff line
@@ -10035,7 +10035,7 @@ CallingConv ASTContext::getDefaultCallingConvention(bool IsVariadic,
      break;
    }
  }
  return Target->getDefaultCallingConv(TargetInfo::CCMT_Unknown);
  return Target->getDefaultCallingConv();
}

bool ASTContext::isNearlyEmpty(const CXXRecordDecl *RD) const {
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ public:
    if (!isVariadic && T.isWindowsGNUEnvironment() &&
        T.getArch() == llvm::Triple::x86)
      return CC_X86ThisCall;
    return CC_C;
    return Context.getTargetInfo().getDefaultCallingConv();
  }

  // We cheat and just check that the class has a vtable pointer, and that it's
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public:
    if (!isVariadic &&
        Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86)
      return CC_X86ThisCall;
    return CC_C;
    return Context.getTargetInfo().getDefaultCallingConv();
  }

  bool isNearlyEmpty(const CXXRecordDecl *RD) const override {
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public:
                                                            : CCCR_Warning;
  }

  CallingConv getDefaultCallingConv(CallingConvMethodType MT) const override {
  CallingConv getDefaultCallingConv() const override {
    return CC_SpirFunction;
  }

Loading