lib/Sema/DerivedConformanceCodingKey.cpp
/// Sets the body of the given function to `return self.rawValue`.
///
/// \param funcDecl The function whose body to set.
Sets the body of the given function to `return self.rawValue`.
\param funcDecl The function whose body to set.
Sets the body of the given function to ` return self . rawValue ` . \ param funcDecl The function whose body to set .
static void deriveRawValueReturn(AbstractFunctionDecl *funcDecl, void *) {
  auto *parentDC = funcDecl->getDeclContext();
  auto &C = parentDC->getASTContext();
  auto *selfRef = DerivedConformance::createSelfDeclRef(funcDecl);
  auto *memberRef = new (C) UnresolvedDotExpr(selfRef, SourceLoc(),
                                              C.Id_rawValue, DeclNameLoc(),
                                              true);
  auto *returnStmt = new (C) ReturnStmt(SourceLoc(), memberRef);
  auto *body = BraceStmt::create(C, SourceLoc(), ASTNode(returnStmt),
                                 SourceLoc());
  funcDecl->setBody(body);
}
static void deriveRawValueReturn ( AbstractFunctionDecl * funcDecl , void * ) { auto * parentDC = funcDecl -> getDeclContext ( ) ; auto & C = parentDC -> getASTContext ( ) ; auto * selfRef = DerivedConformance :: createSelfDeclRef ( funcDecl ) ; auto * memberRef = new ( C ) UnresolvedDotExpr ( selfRef , SourceLoc ( ) , C . Id_rawValue , DeclNameLoc ( ) , true ) ; auto * returnStmt = new ( C ) ReturnStmt ( SourceLoc ( ) , memberRef ) ; auto * body = BraceStmt :: create ( C , SourceLoc ( ) , ASTNode ( returnStmt ) , SourceLoc ( ) ) ; funcDecl -> setBody ( body ) ; }
Sets the body of the given function to `return self.rawValue`.
Sets the body of the given function to ` return self . rawValue ` .
/*Implicit=*/