lib/Sema/DerivedConformanceCodingKey.cpp
/// Sets the body of the given function to `return nil`.
///
/// \param funcDecl The function whose body to set.
Sets the body of the given function to `return nil`.
\param funcDecl The function whose body to set.
Sets the body of the given function to ` return nil ` . \ param funcDecl The function whose body to set .
static void deriveNilReturn(AbstractFunctionDecl *funcDecl, void *) {
  auto *parentDC = funcDecl->getDeclContext();
  auto &C = parentDC->getASTContext();
  auto *nilExpr = new (C) NilLiteralExpr(SourceLoc(), true);
  auto *returnStmt = new (C) ReturnStmt(SourceLoc(), nilExpr);
  auto *body = BraceStmt::create(C, SourceLoc(), ASTNode(returnStmt),
                                 SourceLoc());
  funcDecl->setBody(body);
}
static void deriveNilReturn ( AbstractFunctionDecl * funcDecl , void * ) { auto * parentDC = funcDecl -> getDeclContext ( ) ; auto & C = parentDC -> getASTContext ( ) ; auto * nilExpr = new ( C ) NilLiteralExpr ( SourceLoc ( ) , true ) ; auto * returnStmt = new ( C ) ReturnStmt ( SourceLoc ( ) , nilExpr ) ; auto * body = BraceStmt :: create ( C , SourceLoc ( ) , ASTNode ( returnStmt ) , SourceLoc ( ) ) ; funcDecl -> setBody ( body ) ; }
Sets the body of the given function to `return nil`.
Sets the body of the given function to ` return nil ` .
/*Implicit=*/