[llvm-branch-commits] [cfe-branch] r168609 - in /cfe/branches/release_32: ./ lib/CodeGen/CGObjCGNU.cpp test/Driver/pic.c

Pawel Wodnicki pawel at 32bitmicro.com
Mon Nov 26 13:17:11 PST 2012


Author: pawel
Date: Mon Nov 26 15:17:11 2012
New Revision: 168609

URL: http://llvm.org/viewvc/llvm-project?rev=168609&view=rev
Log:
Merging r167925: into the 3.2 release branch.

Move some GNUStep-specific code out of CGObjCGNU.

Patch by Jonathan Schleifer.

Modified:
    cfe/branches/release_32/   (props changed)
    cfe/branches/release_32/lib/CodeGen/CGObjCGNU.cpp
    cfe/branches/release_32/test/Driver/pic.c   (props changed)

Propchange: cfe/branches/release_32/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 26 15:17:11 2012
@@ -1,3 +1,3 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:167749,167762,167780,167788,167790,167813-167814,167868,167884,167920,168024,168063,168124,168297,168355,168379
+/cfe/trunk:167749,167762,167780,167788,167790,167813-167814,167868,167884,167920,167925,168024,168063,168124,168297,168355,168379
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_32/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_32/lib/CodeGen/CGObjCGNU.cpp?rev=168609&r1=168608&r2=168609&view=diff
==============================================================================
--- cfe/branches/release_32/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/branches/release_32/lib/CodeGen/CGObjCGNU.cpp Mon Nov 26 15:17:11 2012
@@ -600,6 +600,8 @@
     /// Type of an slot structure pointer.  This is returned by the various
     /// lookup functions.
     llvm::Type *SlotTy;
+  public:
+    virtual llvm::Constant *GetEHType(QualType T);
   protected:
     virtual llvm::Value *LookupIMP(CodeGenFunction &CGF,
                                    llvm::Value *&Receiver,
@@ -966,29 +968,30 @@
 }
 
 llvm::Constant *CGObjCGNU::GetEHType(QualType T) {
-  if (!CGM.getLangOpts().CPlusPlus) {
-      if (T->isObjCIdType()
-          || T->isObjCQualifiedIdType()) {
-        // With the old ABI, there was only one kind of catchall, which broke
-        // foreign exceptions.  With the new ABI, we use __objc_id_typeinfo as
-        // a pointer indicating object catchalls, and NULL to indicate real
-        // catchalls
-        if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
-          return MakeConstantString("@id");
-        } else {
-          return 0;
-        }
-      }
-
-      // All other types should be Objective-C interface pointer types.
-      const ObjCObjectPointerType *OPT =
-        T->getAs<ObjCObjectPointerType>();
-      assert(OPT && "Invalid @catch type.");
-      const ObjCInterfaceDecl *IDecl =
-        OPT->getObjectType()->getInterface();
-      assert(IDecl && "Invalid @catch type.");
-      return MakeConstantString(IDecl->getIdentifier()->getName());
+  if (T->isObjCIdType() || T->isObjCQualifiedIdType()) {
+    // With the old ABI, there was only one kind of catchall, which broke
+    // foreign exceptions.  With the new ABI, we use __objc_id_typeinfo as
+    // a pointer indicating object catchalls, and NULL to indicate real
+    // catchalls
+    if (CGM.getLangOpts().ObjCRuntime.isNonFragile()) {
+      return MakeConstantString("@id");
+    } else {
+      return 0;
+    }
   }
+
+  // All other types should be Objective-C interface pointer types.
+  const ObjCObjectPointerType *OPT = T->getAs<ObjCObjectPointerType>();
+  assert(OPT && "Invalid @catch type.");
+  const ObjCInterfaceDecl *IDecl = OPT->getObjectType()->getInterface();
+  assert(IDecl && "Invalid @catch type.");
+  return MakeConstantString(IDecl->getIdentifier()->getName());
+}
+
+llvm::Constant *CGObjCGNUstep::GetEHType(QualType T) {
+  if (!CGM.getLangOpts().CPlusPlus)
+    return CGObjCGNU::GetEHType(T);
+
   // For Objective-C++, we want to provide the ability to catch both C++ and
   // Objective-C objects in the same function.
 

Propchange: cfe/branches/release_32/test/Driver/pic.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 26 15:17:11 2012
@@ -1,3 +1,4 @@
+/cfe/branches/release_32/test/Driver/pic.c:168526-168537
 /cfe/branches/type-system-rewrite/test/Driver/pic.c:134693-134817
 /cfe/trunk/test/Driver/pic.c:167749,167762,167780,167788,167790,167813-167814,167846,167868,167884,167920,168024,168124,168297
 /cfe/trunk/test/SemaTemplate/test/Driver/pic.c:126920





More information about the llvm-branch-commits mailing list