FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 808add7..147155e 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -131,8 +131,8 @@
   if (CGM.getDebugInfo() && !OMD->hasAttr<NodebugAttr>())
     DebugInfo = CGM.getDebugInfo();
   StartObjCMethod(OMD, OMD->getClassInterface());
-  EmitStmt(OMD->getBody());
-  FinishFunction(cast<CompoundStmt>(OMD->getBody())->getRBracLoc());
+  EmitStmt(OMD->getBody(getContext()));
+  FinishFunction(cast<CompoundStmt>(OMD->getBody(getContext()))->getRBracLoc());
 }
 
 // FIXME: I wasn't sure about the synthesis approach. If we end up
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 4bdebfe..45c7d0a 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -225,7 +225,7 @@
                                     FProto->getArgType(i)));
   }
 
-  const CompoundStmt *S = FD->getBody();
+  const CompoundStmt *S = FD->getBody(getContext());
 
   StartFunction(FD, FD->getResultType(), Fn, Args, S->getLBracLoc());
   EmitStmt(S);
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 4cb1b43..df62f0e 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -971,7 +971,7 @@
   if (D->hasAttr<DLLExportAttr>()) {
     if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
       // The dllexport attribute is ignored for undefined symbols.
-      if (FD->getBody())
+      if (FD->getBody(getContext()))
         GA->setLinkage(llvm::Function::DLLExportLinkage);
     } else {
       GA->setLinkage(llvm::Function::DLLExportLinkage);
@@ -1403,7 +1403,7 @@
   case Decl::ObjCMethod: {
     ObjCMethodDecl *OMD = cast<ObjCMethodDecl>(D);
     // If this is not a prototype, emit the body.
-    if (OMD->getBody())
+    if (OMD->getBody(getContext()))
       CodeGenFunction(*this).GenerateObjCMethod(OMD);
     break;
   }