Home | History | Annotate | Download | only in slang

Lines Matching full:clang

21 #include "clang/AST/DeclGroup.h"
22 #include "clang/AST/Expr.h"
23 #include "clang/AST/NestedNameSpecifier.h"
24 #include "clang/AST/OperationKinds.h"
25 #include "clang/AST/Stmt.h"
26 #include "clang/AST/StmtVisitor.h"
35 clang::FunctionDecl *RSObjectRefCount::
38 clang::FunctionDecl *RSObjectRefCount::
42 void RSObjectRefCount::GetRSRefCountingFunctions(clang::ASTContext &C) {
44 i < (sizeof(RSClearObjectFD) / sizeof(clang::FunctionDecl*));
50 clang::TranslationUnitDecl *TUDecl = C.getTranslationUnitDecl();
52 for (clang::DeclContext::decl_iterator I = TUDecl->decls_begin(),
54 if ((I->getKind() >= clang::Decl::firstFunction) &&
55 (I->getKind() <= clang::Decl::lastFunction)) {
56 clang::FunctionDecl *FD = static_cast<clang::FunctionDecl*>(*I);
59 clang::FunctionDecl **RSObjectFD;
73 const clang::ParmVarDecl *PVD = FD->getParamDecl(0);
74 clang::QualType PVT = PVD->getOriginalType();
80 clang::QualType RST = PVT->getPointeeType();
94 static clang::CompoundStmt* BuildCompoundStmt(clang::ASTContext &C,
95 std::list<clang::Stmt*> &StmtList, clang::SourceLocation Loc) {
99 clang::Stmt **CompoundStmtList;
100 CompoundStmtList = new clang::Stmt*[NewStmtCount];
102 std::list<clang::Stmt*>::const_iterator I = StmtList.begin();
103 std::list<clang::Stmt*>::const_iterator E = StmtList.end();
109 clang::CompoundStmt *CS = new(C) clang::CompoundStmt(C,
120 static void AppendAfterStmt(clang::ASTContext &C,
121 clang::CompoundStmt *CS,
122 clang::Stmt *S,
123 std::list<clang::Stmt*> &StmtList) {
125 clang::CompoundStmt::body_iterator bI = CS->body_begin();
126 clang::CompoundStmt::body_iterator bE = CS->body_end();
127 clang::Stmt **UpdatedStmtList =
128 new clang::Stmt*[CS->size() + StmtList.size()];
133 if (!S && ((*bI)->getStmtClass() == clang::Stmt::ReturnStmtClass)) {
146 std::list<clang::Stmt*>::const_iterator I = StmtList.begin();
147 std::list<clang::Stmt*>::const_iterator E = StmtList.end();
158 std::list<clang::Stmt*>::const_iterator I = StmtList.begin();
159 std::list<clang::Stmt*>::const_iterator E = StmtList.end();
184 class DestructorVisitor : public clang::StmtVisitor<DestructorVisitor> {
186 clang::ASTContext &mCtx;
199 clang::Stmt *mOuterStmt;
202 clang::Stmt* mDtorStmt;
206 std::stack<clang::Stmt*> mReplaceStmtStack;
212 clang::SourceLocation mVarLoc;
215 DestructorVisitor(clang::ASTContext &C,
216 clang::Stmt* OuterStmt,
217 clang::Stmt* DtorStmt,
218 clang::SourceLocation VarLoc);
224 clang::Stmt *S = NULL;
225 clang::SourceManager &SM = mCtx.getSourceManager();
226 std::list<clang::Stmt *> StmtList;
240 clang::CompoundStmt *CS =
247 clang::CompoundStmt *CS =
248 llvm::dyn_cast<clang::CompoundStmt>(mOuterStmt);
253 void VisitStmt(clang::Stmt *S);
254 void VisitCompoundStmt(clang::CompoundStmt *CS);
256 void VisitBreakStmt(clang::BreakStmt *BS);
257 void VisitCaseStmt(clang::CaseStmt *CS);
258 void VisitContinueStmt(clang::ContinueStmt *CS);
259 void VisitDefaultStmt(clang::DefaultStmt *DS);
260 void VisitDoStmt(clang::DoStmt *DS);
261 void VisitForStmt(clang::ForStmt *FS);
262 void VisitIfStmt(clang::IfStmt *IS);
263 void VisitReturnStmt(clang::ReturnStmt *RS);
264 void VisitSwitchCase(clang::SwitchCase *SC);
265 void VisitSwitchStmt(clang::SwitchStmt *SS);
266 void VisitWhileStmt(clang::WhileStmt *WS);
269 DestructorVisitor::DestructorVisitor(clang::ASTContext &C,
270 clang::Stmt *OuterStmt,
271 clang::Stmt *DtorStmt,
272 clang::SourceLocation VarLoc)
282 void DestructorVisitor::VisitStmt(clang::Stmt *S) {
283 for (clang::Stmt::child_iterator I = S->child_begin(), E = S->child_end();
286 if (clang::Stmt *Child = *I) {
293 void DestructorVisitor::VisitCompoundStmt(clang::CompoundStmt *CS) {
298 void DestructorVisitor::VisitBreakStmt(clang::BreakStmt *BS) {
306 void DestructorVisitor::VisitCaseStmt(clang::CaseStmt *CS) {
311 void DestructorVisitor::VisitContinueStmt(clang::ContinueStmt *CS) {
320 void DestructorVisitor::VisitDefaultStmt(clang::DefaultStmt *DS) {
325 void DestructorVisitor::VisitDoStmt(clang::DoStmt *DS) {
332 void DestructorVisitor::VisitForStmt(clang::ForStmt *FS) {
339 void DestructorVisitor::VisitIfStmt(clang::IfStmt *IS) {
344 void DestructorVisitor::VisitReturnStmt(clang::ReturnStmt *RS) {
349 void DestructorVisitor::VisitSwitchCase(clang::SwitchCase *SC) {
355 void DestructorVisitor::VisitSwitchStmt(clang::SwitchStmt *SS) {
362 void DestructorVisitor::VisitWhileStmt(clang::WhileStmt *WS) {
369 clang::Expr *ClearSingleRSObject(clang::ASTContext &C,
370 clang::Expr *RefRSVar,
371 clang::SourceLocation Loc) {
373 const clang::Type *T = RefRSVar->getType().getTypePtr();
377 clang::FunctionDecl *ClearObjectFD = RSObjectRefCount::GetRSClearObjectFD(T);
381 clang::QualType ClearObjectFDType = ClearObjectFD->getType();
382 clang::QualType ClearObjectFDArgType =
394 clang::Expr *AddrRefRSVar =
395 new(C) clang::UnaryOperator(RefRSVar,
396 clang::UO_AddrOf,
398 clang::VK_RValue,
399 clang::OK_Ordinary,
402 clang::Expr *RefRSClearObjectFD =
403 clang::DeclRefExpr::Create(C,
404 clang::NestedNameSpecifierLoc(),
408 clang::VK_RValue,
411 clang::Expr *RSClearObjectFP =
412 clang::ImplicitCastExpr::Create(C,
414 clang::CK_FunctionToPointerDecay,
417 clang::VK_RValue);
419 clang::CallExpr *RSClearObjectCall =
420 new(C) clang::CallExpr(C,
425 clang::VK_RValue,
431 static int ArrayDim(const clang::Type *T) {
436 const clang::ConstantArrayType *CAT =
437 static_cast<const clang::ConstantArrayType *>(T);
441 static clang::Stmt *ClearStructRSObject(
442 clang::ASTContext &C,
443 clang::DeclContext *DC,
444 clang::Expr *RefRSStruct,
445 clang::SourceLocation StartLoc,
446 clang::SourceLocation Loc);
448 static clang::Stmt *ClearArrayRSObject(
449 clang::ASTContext &C,
450 clang::DeclContext *DC,
451 clang::Expr *RefRSArr,
452 clang::SourceLocation StartLoc,
453 clang::SourceLocation Loc) {
454 const clang::Type *BaseType = RefRSArr->getType().getTypePtr();
461 clang::Stmt *StmtArray[2] = {NULL};
492 clang::IdentifierInfo& II = C.Idents.get("rsIntIter");
493 clang::VarDecl *IIVD =
494 clang::VarDecl::Create(C,
501 clang::SC_None,
502 clang::SC_None);
503 clang::Decl *IID = (clang::Decl *)IIVD;
505 clang::DeclGroupRef DGR = clang::DeclGroupRef::Create(C, &IID, 1);
506 StmtArray[StmtCtr++] = new(C) clang::DeclStmt(DGR, Loc, Loc);
513 clang::DeclRefExpr *RefrsIntIter =
514 clang::DeclRefExpr::Create(C,
515 clang::NestedNameSpecifierLoc(),
519 clang::VK_RValue,
522 clang::Expr *Int0 = clang::IntegerLiteral::Create(C,
525 clang::BinaryOperator *Init =
526 new(C) clang::BinaryOperator(RefrsIntIter,
528 clang::BO_Assign,
530 clang::VK_RValue,
531 clang::OK_Ordinary,
535 clang::Expr *NumArrayElementsExpr = clang::IntegerLiteral::Create(C,
538 clang::BinaryOperator *Cond =
539 new(C) clang::BinaryOperator(RefrsIntIter,
541 clang::BO_LT,
543 clang::VK_RValue,
544 clang::OK_Ordinary,
548 clang::UnaryOperator *Inc =
549 new(C) clang::UnaryOperator(RefrsIntIter,
550 clang::UO_PostInc,
552 clang::VK_RValue,
553 clang::OK_Ordinary,
559 clang::Expr *RefRSArrPtr =
560 clang::ImplicitCastExpr::Create(C,
562 clang::CK_ArrayToPointerDecay,
565 clang::VK_RValue);
567 clang::Expr *RefRSArrPtrSubscript =
568 new(C) clang::ArraySubscriptExpr(RefRSArrPtr,
571 clang::VK_RValue,
572 clang::OK_Ordinary,
578 clang::Stmt *RSClearObjectCall = NULL;
589 clang::ForStmt *DestructorLoop =
590 new(C) clang::ForStmt(C,
603 clang::CompoundStmt *CS =
604 new(C) clang::CompoundStmt(C, StmtArray, StmtCtr, Loc, Loc);
609 static unsigned CountRSObjectTypes(clang::ASTContext &C,
610 const clang::Type *T,
611 clang::SourceLocation Loc) {
626 clang::RecordDecl *RD = T->getAsUnionType()->getDecl();
628 for (clang::RecordDecl::field_iterator FI = RD->field_begin(),
632 const clang::FieldDecl *FD = *FI;
633 const clang::Type *FT = RSExportType::GetTypeOfDecl(FD);
645 clang::RecordDecl *RD = T->getAsStructureType()->getDecl();
647 for (clang::RecordDecl::field_iterator FI = RD->field_begin(),
651 const clang::FieldDecl *FD = *FI;
652 const clang::Type *FT = RSExportType::GetTypeOfDecl(FD);
662 static clang::Stmt *ClearStructRSObject(
663 clang::ASTContext &C,
664 clang::DeclContext *DC,
665 clang::Expr *RefRSStruct,
666 clang::SourceLocation StartLoc,
667 clang::SourceLocation Loc) {
668 const clang::Type *BaseType = RefRSStruct->getType().getTypePtr();
679 clang::Stmt **StmtArray = new clang::Stmt*[FieldsToDestroy];
685 clang::RecordDecl *RD = BaseType->getAsStructureType()->getDecl();
687 for (clang::RecordDecl::field_iterator FI = RD->field_begin(),
694 clang::FieldDecl *FD = *FI;
695 const clang::Type *FT = RSExportType::GetTypeOfDecl(FD);
696 const clang::Type *OrigType = FT;
703 clang::DeclAccessPair FoundDecl =
704 clang::DeclAccessPair::make(FD, clang::AS_none);
705 clang::MemberExpr *RSObjectMember =
706 clang::MemberExpr::Create(C,
709 clang::NestedNameSpecifierLoc(),
712 clang::DeclarationNameInfo(),
715 clang::VK_RValue,
716 clang::OK_Ordinary);
735 clang::DeclAccessPair FoundDecl =
736 clang::DeclAccessPair::make(FD, clang::AS_none);
737 clang::MemberExpr *RSObjectMember =
738 clang::MemberExpr::Create(C,
741 clang::NestedNameSpecifierLoc(),
744 clang::DeclarationNameInfo(),
747 clang::VK_RValue,
748 clang::OK_Ordinary);
767 clang::CompoundStmt *CS =
768 new(C) clang::CompoundStmt(C, StmtArray, StmtCount, Loc, Loc);
775 static clang::Stmt *CreateSingleRSSetObject(clang::ASTContext &C,
776 clang::Expr *DstExpr,
777 clang::Expr *SrcExpr,
778 clang::SourceLocation StartLoc,
779 clang::SourceLocation Loc) {
780 const clang::Type *T = DstExpr->getType().getTypePtr();
781 clang::FunctionDecl *SetObjectFD = RSObjectRefCount::GetRSSetObjectFD(T);
785 clang::QualType SetObjectFDType = SetObjectFD->getType();
786 clang::QualType SetObjectFDArgType[2];
790 clang::Expr *RefRSSetObjectFD =
791 clang::DeclRefExpr::Create(C,
792 clang::NestedNameSpecifierLoc(),
796 clang::VK_RValue,
799 clang::Expr *RSSetObjectFP =
800 clang::ImplicitCastExpr::Create(C,
802 clang::CK_FunctionToPointerDecay,
805 clang::VK_RValue);
807 clang::Expr *ArgList[2];
808 ArgList[0] = new(C) clang::UnaryOperator(DstExpr,
809 clang::UO_AddrOf,
811 clang::VK_RValue,
812 clang::OK_Ordinary,
816 clang::CallExpr *RSSetObjectCall =
817 new(C) clang::CallExpr(C,
822 clang::VK_RValue,
828 static clang::Stmt *CreateStructRSSetObject(clang::ASTContext &C,
829 clang::Expr *LHS,
830 clang::Expr *RHS,
831 clang::SourceLocation StartLoc,
832 clang::SourceLocation Loc);
834 static clang::Stmt *CreateArrayRSSetObject(clang::ASTContext &C,
835 clang::Expr *DstArr,
836 clang::Expr *SrcArr,
837 clang::SourceLocation StartLoc,
838 clang::SourceLocation Loc) {
839 clang::DeclContext *DC = NULL;
840 const clang::Type *BaseType = DstArr->getType().getTypePtr();
847 clang::Stmt *StmtArray[2] = {NULL};
855 clang::IdentifierInfo& II = C.Idents.get("rsIntIter");
856 clang::VarDecl *IIVD =
857 clang::VarDecl::Create(C,
864 clang::SC_None,
865 clang::SC_None);
866 clang::Decl *IID = (clang::Decl *)IIVD;
868 clang::DeclGroupRef DGR = clang::DeclGroupRef::Create(C, &IID, 1);
869 StmtArray[StmtCtr++] = new(C) clang::DeclStmt(DGR, Loc, Loc);
876 clang::DeclRefExpr *RefrsIntIter =
877 clang::DeclRefExpr::Create(C,
878 clang::NestedNameSpecifierLoc(),
882 clang::VK_RValue,
885 clang::Expr *Int0 = clang::IntegerLiteral::Create(C,
888 clang::BinaryOperator *Init =
889 new(C) clang::BinaryOperator(RefrsIntIter,
891 clang::BO_Assign,
893 clang::VK_RValue,
894 clang::OK_Ordinary,
898 clang::Expr *NumArrayElementsExpr = clang::IntegerLiteral::Create(C,
901 clang::BinaryOperator *Cond =
902 new(C) clang::BinaryOperator(RefrsIntIter,
904 clang::BO_LT,
906 clang::VK_RValue,
907 clang::OK_Ordinary,
911 clang::UnaryOperator *Inc =
912 new(C) clang::UnaryOperator(RefrsIntIter,
913 clang::UO_PostInc,
915 clang::VK_RValue,
916 clang::OK_Ordinary,
922 clang::Expr *DstArrPtr =
923 clang::ImplicitCastExpr::Create(C,
925 clang::CK_ArrayToPointerDecay,
928 clang::VK_RValue);
930 clang::Expr *DstArrPtrSubscript =
931 new(C) clang::ArraySubscriptExpr(DstArrPtr,
934 clang::VK_RValue,
935 clang::OK_Ordinary,
938 clang::Expr *SrcArrPtr =
939 clang::ImplicitCastExpr::Create(C,
941 clang::CK_ArrayToPointerDecay,
944 clang::VK_RValue);
946 clang::Expr *SrcArrPtrSubscript =
947 new(C) clang::ArraySubscriptExpr(SrcArrPtr,
950 clang::VK_RValue,
951 clang::OK_Ordinary,
957 clang::Stmt *RSSetObjectCall = NULL;
972 clang::ForStmt *DestructorLoop =
973 new(C) clang::ForStmt(C,
986 clang::CompoundStmt *CS =
987 new(C) clang::CompoundStmt(C, StmtArray, StmtCtr, Loc, Loc);
992 static clang::Stmt *CreateStructRSSetObject(clang::ASTContext &C,
993 clang::Expr *LHS,
994 clang::Expr *RHS,
995 clang::SourceLocation StartLoc,
996 clang::SourceLocation Loc) {
997 clang::QualType QT = LHS->getType();
998 const clang::Type *T = QT.getTypePtr();
1006 clang::Stmt **StmtArray = new clang::Stmt*[FieldsToSet];
1011 clang::RecordDecl *RD = T->getAsStructureType()->getDecl();
1013 for (clang::RecordDecl::field_iterator FI = RD->field_begin(),
1018 clang::FieldDecl *FD = *FI;
1019 const clang::Type *FT = RSExportType::GetTypeOfDecl(FD);
1020 const clang::Type *OrigType = FT;
1027 clang::DeclAccessPair FoundDecl =
1028 clang::DeclAccessPair::make(FD, clang::AS_none);
1029 clang::MemberExpr *DstMember =
1030 clang::MemberExpr::Create(C,
1033 clang::NestedNameSpecifierLoc(),
1036 clang::DeclarationNameInfo(),
1039 clang::VK_RValue,
1040 clang::OK_Ordinary);
1042 clang::MemberExpr *SrcMember =
1043 clang::MemberExpr::Create(C,
1046 clang::NestedNameSpecifierLoc(),
1049 clang::DeclarationNameInfo(),
1052 clang::VK_RValue,
1053 clang::OK_Ordinary);
1064 clang::DiagnosticsEngine &DiagEngine = C.getDiagnostics();
1066 clang::FullSourceLoc(Loc, C.getSourceManager()),
1068 clang::DiagnosticsEngine::Error,
1089 clang::BinaryOperator *CopyStruct =
1090 new(C) clang::BinaryOperator(LHS, RHS, clang::BO_Assign, QT,
1091 clang::VK_RValue, clang::OK_Ordinary, Loc);
1094 clang::CompoundStmt *CS =
1095 new(C) clang::CompoundStmt(C, StmtArray, StmtCount, Loc, Loc);
1105 clang::BinaryOperator *AS) {
1107 clang::QualType QT = AS->getType();
1109 clang::ASTContext &C = RSObjectRefCount::GetRSSetObjectFD(
1112 clang::SourceLocation Loc = AS->getExprLoc();
1113 clang::SourceLocation StartLoc = AS->getExprLoc();
1114 clang::Stmt *UpdatedStmt = NULL;
1131 clang::VarDecl *VD,
1132 clang::DeclStmt *DS,
1134 clang::Expr *InitExpr) {
1141 clang::ASTContext &C = RSObjectRefCount::GetRSSetObjectFD(
1143 clang::SourceLocation Loc = RSObjectRefCount::GetRSSetObjectFD(
1145 clang::SourceLocation StartLoc = RSObjectRefCount::GetRSSetObjectFD(
1149 const clang::Type *T = RSExportType::GetTypeOfDecl(VD);
1150 clang::DeclRefExpr *RefRSVar =
1151 clang::DeclRefExpr::Create(C,
1152 clang::NestedNameSpecifierLoc(),
1156 clang::VK_RValue,
1159 clang::Stmt *RSSetObjectOps =
1162 std::list<clang::Stmt*> StmtList;
1168 clang::FunctionDecl *SetObjectFD = RSObjectRefCount::GetRSSetObjectFD(DT);
1172 clang::QualType SetObjectFDType = SetObjectFD->getType();
1173 clang::QualType SetObjectFDArgType[2];
1177 clang::Expr *RefRSSetObjectFD =
1178 clang::DeclRefExpr::Create(C,
1179 clang::NestedNameSpecifierLoc(),
1183 clang::VK_RValue,
1186 clang::Expr *RSSetObjectFP =
1187 clang::ImplicitCastExpr::Create(C,
1189 clang::CK_FunctionToPointerDecay,
1192 clang::VK_RValue);
1194 const clang::Type *T = RSExportType::GetTypeOfDecl(VD);
1195 clang::DeclRefExpr *RefRSVar =
1196 clang::DeclRefExpr::Create(C,
1197 clang::NestedNameSpecifierLoc(),
1201 clang::VK_RValue,
1204 clang::Expr *ArgList[2];
1205 ArgList[0] = new(C) clang::UnaryOperator(RefRSVar,
1206 clang::UO_AddrOf,
1208 clang::VK_RValue,
1209 clang::OK_Ordinary,
1213 clang::CallExpr *RSSetObjectCall =
1214 new(C) clang::CallExpr(C,
1219 clang::VK_RValue,
1222 std::list<clang::Stmt*> StmtList;
1230 for (std::list<clang::VarDecl*>::const_iterator I = mRSO.begin(),
1234 clang::VarDecl *VD = *I;
1235 clang::Stmt *RSClearObjectCall = ClearRSObject(VD, VD->getDeclContext());
1248 clang::Stmt *RSObjectRefCount::Scope::ClearRSObject(
1249 clang::VarDecl *VD,
1250 clang::DeclContext *DC) {
1252 clang::ASTContext &C = VD->getASTContext();
1253 clang::SourceLocation Loc = VD->getLocation();
1254 clang::SourceLocation StartLoc = VD->getInnerLocStart();
1255 const clang::Type *T = RSExportType::GetTypeOfDecl(VD);
1258 clang::DeclRefExpr *RefRSVar =
1259 clang::DeclRefExpr::Create(C,
1260 clang::NestedNameSpecifierLoc(),
1264 clang::VK_RValue,
1285 bool RSObjectRefCount::InitializeRSObject(clang::VarDecl *VD,
1287 clang::Expr **InitExpr) {
1289 const clang::Type *T = RSExportType::GetTypeOfDecl(VD);
1321 clang::Expr *ZeroInitializer =
1334 clang::Expr *RSObjectRefCount::CreateZeroInitializerForRSSpecificType(
1336 clang::ASTContext &C,
1337 const clang::SourceLocation &Loc) {
1338 clang::Expr *Res = NULL;
1355 clang::Expr *Int0 = clang::IntegerLiteral::Create(C, Zero, C.IntTy, Loc);
1356 clang::Expr *CastToNull =
1357 clang::ImplicitCastExpr::Create(C,
1359 clang::CK_IntegralToPointer,
1362 clang::VK_RValue);
1364 Res = new(C) clang::InitListExpr(C, Loc, &CastToNull, 1, Loc);
1377 clang::QualType FloatTy = C.FloatTy;
1380 clang::FloatingLiteral *Float0Val =
1381 clang::FloatingLiteral::Create(C,
1396 clang::Expr *InitVals[16];
1399 clang::Expr *InitExpr =
1400 new(C) clang::InitListExpr(C, Loc, InitVals, N * N, Loc);
1403 clang::ArrayType::Normal,
1406 Res = new(C) clang::InitListExpr(C, Loc, &InitExpr, 1, Loc);
1434 void RSObjectRefCount::VisitDeclStmt(clang::DeclStmt *DS) {
1435 for (clang::DeclStmt::decl_iterator I = DS->decl_begin(), E = DS->decl_end();
1438 clang::Decl *D = *I;
1439 if (D->getKind() == clang::Decl::Var) {
1440 clang::VarDecl *VD = static_cast<clang::VarDecl*>(D);
1443 clang::Expr *InitExpr = NULL;
1453 void RSObjectRefCount::VisitCompoundStmt(clang::CompoundStmt *CS) {
1470 void RSObjectRefCount::VisitBinAssign(clang::BinaryOperator *AS) {
1471 clang::QualType QT = AS->getType();
1480 void RSObjectRefCount::VisitStmt(clang::Stmt *S) {
1481 for (clang::Stmt::child_iterator I = S->child_begin(), E = S->child_end();
1484 if (clang::Stmt *Child = *I) {
1494 clang::FunctionDecl *RSObjectRefCount::CreateStaticGlobalDtor() {
1497 clang::DeclContext *DC = mCtx.getTranslationUnitDecl();
1498 clang::SourceLocation loc;
1501 clang::IdentifierInfo &II = mCtx.Idents.get(SR);
1502 clang::DeclarationName N(&II);
1503 clang::FunctionProtoType::ExtProtoInfo EPI;
1504 clang::QualType T = mCtx.getFunctionType(mCtx.VoidTy, NULL, 0, EPI);
1505 clang::FunctionDecl *FD = NULL;
1509 std::list<clang::Stmt *> StmtList;
1510 for (clang::DeclContext::decl_iterator I = DC->decls_begin(),
1512 clang::VarDecl *VD = llvm::dyn_cast<clang::VarDecl>(*I);
1517 FD = clang::FunctionDecl::Create(mCtx, DC, loc, loc, N, T, NULL);
1521 clang::Stmt *RSClearObjectCall = Scope::ClearRSObject(VD, FD);
1532 clang::CompoundStmt *CS = BuildCompoundStmt(mCtx, StmtList, loc);