]> granicus.if.org Git - clang/commitdiff
ObjectiveC objc_bridge. Minor refactoring.
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 19 Nov 2013 01:38:23 +0000 (01:38 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 19 Nov 2013 01:38:23 +0000 (01:38 +0000)
// rdar://15454846

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195070 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprObjC.cpp

index a2399b7ec42ca7f216d614e730a5457ab4d5d887..cc8eacee61038d0f88bdb18ccd2c0b337c1cecce 100644 (file)
@@ -3170,8 +3170,8 @@ static inline ObjCBridgeAttr *getObjCBridgeAttr(const TypedefType *TD) {
   QualType QT = TDNDecl->getUnderlyingType();
   if (QT->isPointerType()) {
     QT = QT->getPointeeType();
-    if (QT->isStructureType() || QT->isUnionType() || QT->isClassType())
-      if (RecordDecl *RD = QT->getAs<RecordType>()->getDecl())
+    if (const RecordType *RT = QT->getAs<RecordType>())
+      if (RecordDecl *RD = RT->getDecl())
         if (RD->hasAttr<ObjCBridgeAttr>())
           return RD->getAttr<ObjCBridgeAttr>();
   }