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/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 4856e7f..a2ceafa 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -166,7 +166,7 @@
   // handlers.
 
   // Printf checking.
-  if (const FormatAttr *Format = FDecl->getAttr<FormatAttr>()) {
+  if (const FormatAttr *Format = FDecl->getAttr<FormatAttr>(Context)) {
     if (Format->getType() == "printf") {
       bool HasVAListArg = Format->getFirstArg() == 0;
       if (!HasVAListArg) {
@@ -178,7 +178,8 @@
                            HasVAListArg ? 0 : Format->getFirstArg() - 1);
     }
   }
-  for (const Attr *attr = FDecl->getAttrs(); attr; attr = attr->getNext()) {
+  for (const Attr *attr = FDecl->getAttrs(Context); 
+       attr; attr = attr->getNext()) {
     if (const NonNullAttr *NonNull = dyn_cast<NonNullAttr>(attr))
       CheckNonNullArguments(NonNull, TheCall);
   }
@@ -191,7 +192,7 @@
 
   OwningExprResult TheCallResult(Owned(TheCall));
   // Printf checking.
-  const FormatAttr *Format = NDecl->getAttr<FormatAttr>();
+  const FormatAttr *Format = NDecl->getAttr<FormatAttr>(Context);
   if (!Format)
     return move(TheCallResult);
   const VarDecl *V = dyn_cast<VarDecl>(NDecl);