54 Stmt *body_stmt = F->getBody();
55 CompoundStmt *body_compound_stmt = dyn_cast<CompoundStmt>(body_stmt);
57 if (!body_compound_stmt)
60 RecordDecl *struct_decl =
nullptr;
64 for (CompoundStmt::const_body_iterator bi = body_compound_stmt->body_begin(),
65 be = body_compound_stmt->body_end();
67 Stmt *curr_stmt = *bi;
68 DeclStmt *curr_decl_stmt = dyn_cast<DeclStmt>(curr_stmt);
71 DeclGroupRef decl_group = curr_decl_stmt->getDeclGroup();
72 for (Decl *candidate_decl : decl_group) {
73 RecordDecl *candidate_record_decl = dyn_cast<RecordDecl>(candidate_decl);
74 if (!candidate_record_decl)
76 if (candidate_record_decl->getName() == desired_name) {
77 struct_decl = candidate_record_decl;
88 const ASTRecordLayout *struct_layout(
95 struct_layout->getSize()
98 struct_layout->getFieldOffset(struct_layout->getFieldCount() - 1) / 8;
100 struct_layout->getDataSize().getQuantity() -
m_function.m_return_offset;
102 for (
unsigned field_index = 0, num_fields = struct_layout->getFieldCount();
103 field_index < num_fields; ++field_index) {
105 struct_layout->getFieldOffset(field_index) / 8);
112 LinkageSpecDecl *linkage_spec_decl = dyn_cast<LinkageSpecDecl>(D);
114 if (linkage_spec_decl) {
115 RecordDecl::decl_iterator decl_iterator;
117 for (decl_iterator = linkage_spec_decl->decls_begin();
118 decl_iterator != linkage_spec_decl->decls_end(); ++decl_iterator) {
123 FunctionDecl *function_decl = dyn_cast<FunctionDecl>(D);
126 m_function.m_wrapper_function_name == function_decl->getNameAsString()) {