Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index bd5b05a..6ffca81 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -1356,11 +1356,12 @@
 
 /// hasObjCExceptionAttribute - Return true if this class or any super
 /// class has the __objc_exception__ attribute.
-static bool hasObjCExceptionAttribute(const ObjCInterfaceDecl *OID) {
-  if (OID->hasAttr<ObjCExceptionAttr>())
+static bool hasObjCExceptionAttribute(ASTContext &Context, 
+                                      const ObjCInterfaceDecl *OID) {
+  if (OID->hasAttr<ObjCExceptionAttr>(Context))
     return true;
   if (const ObjCInterfaceDecl *Super = OID->getSuperClass())
-    return hasObjCExceptionAttribute(Super);
+    return hasObjCExceptionAttribute(Context, Super);
   return false;
 }
 
@@ -4402,7 +4403,7 @@
   if (classIsHidden)
     flags |= OBJC2_CLS_HIDDEN;
 
-  if (hasObjCExceptionAttribute(ID->getClassInterface()))
+  if (hasObjCExceptionAttribute(CGM.getContext(), ID->getClassInterface()))
     flags |= CLS_EXCEPTION;
 
   if (!ID->getClassInterface()->getSuperClass()) {
@@ -5686,7 +5687,7 @@
 
     // If this type (or a super class) has the __objc_exception__
     // attribute, emit an external reference.
-    if (hasObjCExceptionAttribute(ID))
+    if (hasObjCExceptionAttribute(CGM.getContext(), ID))
       return Entry = 
         new llvm::GlobalVariable(ObjCTypes.EHTypeTy, false,
                                  llvm::GlobalValue::ExternalLinkage,