[llvm-branch-commits] [cfe-branch] r235841 - Merging r229680:

Daniel Sanders daniel.sanders at imgtec.com
Mon Apr 27 01:14:13 PDT 2015


Author: dsanders
Date: Mon Apr 27 03:14:13 2015
New Revision: 235841

URL: http://llvm.org/viewvc/llvm-project?rev=235841&view=rev
Log:
Merging r229680:
------------------------------------------------------------------------
r229680 | zjovanovic | 2015-02-18 15:21:35 +0000 (Wed, 18 Feb 2015) | 3 lines

Change representation of member function pointers for MIPS targets
Differential Revision: http://reviews.llvm.org/D7148

------------------------------------------------------------------------

Modified:
    cfe/branches/release_36/   (props changed)
    cfe/branches/release_36/include/clang/Basic/TargetCXXABI.h
    cfe/branches/release_36/lib/AST/ASTContext.cpp
    cfe/branches/release_36/lib/Basic/TargetInfo.cpp
    cfe/branches/release_36/lib/Basic/Targets.cpp
    cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp
    cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp
    cfe/branches/release_36/test/CodeGenCXX/member-function-pointers.cpp

Propchange: cfe/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 27 03:14:13 2015
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:226008,226049,226136,226282,226382,226384,226624,226707,226754,226863,226877,227062,227088,227220,227251,227278,227295,227368,227393,227861,227979,228053,228464,228785,228792,228918,229408,229719,230255,230469,231245,231280,231986,232389,233819,234629,234636
+/cfe/trunk:226008,226049,226136,226282,226382,226384,226624,226707,226754,226863,226877,227062,227088,227220,227251,227278,227295,227368,227393,227861,227979,228053,228464,228785,228792,228918,229408,229680,229719,230255,230469,231245,231280,231986,232389,233819,234629,234636
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_36/include/clang/Basic/TargetCXXABI.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/include/clang/Basic/TargetCXXABI.h?rev=235841&r1=235840&r2=235841&view=diff
==============================================================================
--- cfe/branches/release_36/include/clang/Basic/TargetCXXABI.h (original)
+++ cfe/branches/release_36/include/clang/Basic/TargetCXXABI.h Mon Apr 27 03:14:13 2015
@@ -79,6 +79,12 @@ public:
     ///   - guard variables  are smaller.
     GenericAArch64,
 
+    /// The generic Mips ABI is a modified version of the Itanium ABI.
+    ///
+    /// At the moment, only change from the generic ABI in this case is:
+    ///   - representation of member function pointers adjusted as in ARM.
+    GenericMIPS,
+
     /// The Microsoft ABI is the ABI used by Microsoft Visual Studio (and
     /// compatible compilers).
     ///
@@ -114,6 +120,7 @@ public:
     case GenericARM:
     case iOS:
     case iOS64:
+    case GenericMIPS:
       return true;
 
     case Microsoft:
@@ -130,6 +137,7 @@ public:
     case GenericARM:
     case iOS:
     case iOS64:
+    case GenericMIPS:
       return false;
 
     case Microsoft:
@@ -212,6 +220,7 @@ public:
     case GenericItanium:
     case iOS:   // old iOS compilers did not follow this rule
     case Microsoft:
+    case GenericMIPS:
       return true;
     }
     llvm_unreachable("bad ABI kind");
@@ -257,6 +266,7 @@ public:
     case GenericAArch64:
     case GenericARM:
     case iOS:
+    case GenericMIPS:
       return UseTailPaddingUnlessPOD03;
 
     // iOS on ARM64 uses the C++11 POD rules.  It does not honor the

Modified: cfe/branches/release_36/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/AST/ASTContext.cpp?rev=235841&r1=235840&r2=235841&view=diff
==============================================================================
--- cfe/branches/release_36/lib/AST/ASTContext.cpp (original)
+++ cfe/branches/release_36/lib/AST/ASTContext.cpp Mon Apr 27 03:14:13 2015
@@ -682,6 +682,7 @@ CXXABI *ASTContext::createCXXABI(const T
   case TargetCXXABI::iOS:
   case TargetCXXABI::iOS64:
   case TargetCXXABI::GenericAArch64:
+  case TargetCXXABI::GenericMIPS:
   case TargetCXXABI::GenericItanium:
     return CreateItaniumCXXABI(*this);
   case TargetCXXABI::Microsoft:
@@ -8064,6 +8065,7 @@ MangleContext *ASTContext::createMangleC
   case TargetCXXABI::GenericAArch64:
   case TargetCXXABI::GenericItanium:
   case TargetCXXABI::GenericARM:
+  case TargetCXXABI::GenericMIPS:
   case TargetCXXABI::iOS:
   case TargetCXXABI::iOS64:
     return ItaniumMangleContext::create(*this, getDiagnostics());

Modified: cfe/branches/release_36/lib/Basic/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/Basic/TargetInfo.cpp?rev=235841&r1=235840&r2=235841&view=diff
==============================================================================
--- cfe/branches/release_36/lib/Basic/TargetInfo.cpp (original)
+++ cfe/branches/release_36/lib/Basic/TargetInfo.cpp Mon Apr 27 03:14:13 2015
@@ -655,6 +655,7 @@ bool TargetCXXABI::tryParse(llvm::String
     .Case("ios", iOS)
     .Case("itanium", GenericItanium)
     .Case("microsoft", Microsoft)
+    .Case("arm", GenericMIPS)
     .Default(unknown);
   if (kind == unknown) return false;
 

Modified: cfe/branches/release_36/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/Basic/Targets.cpp?rev=235841&r1=235840&r2=235841&view=diff
==============================================================================
--- cfe/branches/release_36/lib/Basic/Targets.cpp (original)
+++ cfe/branches/release_36/lib/Basic/Targets.cpp Mon Apr 27 03:14:13 2015
@@ -5640,7 +5640,9 @@ public:
                      const std::string &CPUStr)
       : TargetInfo(Triple), CPU(CPUStr), IsMips16(false), IsMicromips(false),
         IsNan2008(false), IsSingleFloat(false), FloatABI(HardFloat),
-        DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {}
+        DspRev(NoDSP), HasMSA(false), HasFP64(false), ABI(ABIStr) {
+    TheCXXABI.set(TargetCXXABI::GenericMIPS);
+  }
 
   bool isNaN2008Default() const {
     return CPU == "mips32r6" || CPU == "mips64r6";

Modified: cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp?rev=235841&r1=235840&r2=235841&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp Mon Apr 27 03:14:13 2015
@@ -64,6 +64,7 @@ static CGCXXABI *createCXXABI(CodeGenMod
   case TargetCXXABI::GenericARM:
   case TargetCXXABI::iOS:
   case TargetCXXABI::iOS64:
+  case TargetCXXABI::GenericMIPS:
   case TargetCXXABI::GenericItanium:
     return CreateItaniumCXXABI(CGM);
   case TargetCXXABI::Microsoft:

Modified: cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp?rev=235841&r1=235840&r2=235841&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/branches/release_36/lib/CodeGen/ItaniumCXXABI.cpp Mon Apr 27 03:14:13 2015
@@ -339,6 +339,9 @@ CodeGen::CGCXXABI *CodeGen::CreateItaniu
     return new ItaniumCXXABI(CGM, /* UseARMMethodPtrABI = */ true,
                              /* UseARMGuardVarABI = */ true);
 
+  case TargetCXXABI::GenericMIPS:
+    return new ItaniumCXXABI(CGM, /* UseARMMethodPtrABI = */ true);
+
   case TargetCXXABI::GenericItanium:
     if (CGM.getContext().getTargetInfo().getTriple().getArch()
         == llvm::Triple::le32) {

Modified: cfe/branches/release_36/test/CodeGenCXX/member-function-pointers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/member-function-pointers.cpp?rev=235841&r1=235840&r2=235841&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/member-function-pointers.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/member-function-pointers.cpp Mon Apr 27 03:14:13 2015
@@ -6,6 +6,8 @@
 
 // PNaCl uses the same representation of method pointers as ARM.
 // RUN: %clang_cc1 %s -emit-llvm -o - -triple=le32-unknown-nacl | FileCheck -check-prefix GLOBAL-ARM %s
+// MIPS uses the same representation of method pointers as ARM.
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple=mips-unknown-linux-gnu | FileCheck -check-prefix GLOBAL-ARM %s
 
 struct A { int a; void f(); virtual void vf1(); virtual void vf2(); };
 struct B { int b; virtual void g(); };





More information about the llvm-branch-commits mailing list