Lines Matching defs:clang

24 #include "clang/AST/StmtVisitor.h"
29 namespace clang {
37 bool HasRSObjectType(const clang::Type *T);
49 class RSObjectRefCount : public clang::StmtVisitor<RSObjectRefCount> {
53 clang::CompoundStmt *mCS; // Associated compound statement ({ ... })
54 clang::Stmt *mCurrent; // The statement currently being analyzed
55 std::list<clang::VarDecl*> mRSO; // Declared RS objects in this scope (but
59 explicit Scope(clang::CompoundStmt *CS) : mCS(CS) {
64 inline void addRSObject(clang::VarDecl* VD) {
68 void ReplaceRSObjectAssignment(clang::BinaryOperator *AS);
70 void AppendRSObjectInit(clang::VarDecl *VD,
71 clang::DeclStmt *DS,
73 clang::Expr *InitExpr);
89 void setCurrentStmt(clang::Stmt *S) { mCurrent = S; }
92 void InsertStmt(const clang::ASTContext &C, clang::Stmt *NewStmt);
95 void ReplaceStmt(const clang::ASTContext &C, clang::Stmt *NewStmt);
98 void ReplaceExpr(const clang::ASTContext& C, clang::Expr* OldExpr,
99 clang::Expr* NewExpr);
101 static clang::Stmt *ClearRSObject(clang::VarDecl *VD,
102 clang::DeclContext *DC);
105 clang::ASTContext &mCtx;
108 clang::DeclContext* mCurrentDC;
114 static clang::FunctionDecl *RSSetObjectFD[];
115 static clang::FunctionDecl *RSClearObjectFD[];
127 static void GetRSRefCountingFunctions(clang::ASTContext &C);
131 static bool InitializeRSObject(clang::VarDecl *VD,
133 clang::Expr **InitExpr);
141 static clang::Expr *CreateEmptyInitListExpr(
142 clang::ASTContext &C,
143 const clang::SourceLocation &Loc);
150 static clang::CompoundStmt* CreateRetStmtWithTempVar(
151 clang::ASTContext& C,
152 clang::DeclContext* DC,
153 clang::ReturnStmt* RS,
157 explicit RSObjectRefCount(clang::ASTContext &C)
171 void HandleParamsAndLocals(clang::FunctionDecl *FD);
173 static clang::FunctionDecl *GetRSSetObjectFD(DataType DT) {
183 static clang::FunctionDecl *GetRSSetObjectFD(const clang::Type *T) {
187 static clang::FunctionDecl *GetRSClearObjectFD(DataType DT) {
197 static clang::FunctionDecl *GetRSClearObjectFD(const clang::Type *T) {
210 // C: The clang AST Context.
220 static clang::DeclRefExpr *CreateGuard(clang::ASTContext &C,
221 clang::DeclContext *DC,
222 clang::Expr *E,
224 std::vector<clang::Stmt*> &NewStmts);
265 // C: The clang AST Context.
272 clang::ASTContext &C,
273 clang::DeclContext *DC,
274 clang::ParmVarDecl *PD,
275 std::vector<clang::Stmt*> &NewStmts);
277 void SetDeclContext(clang::DeclContext* DC) { mCurrentDC = DC; }
278 clang::DeclContext* GetDeclContext() const { return mCurrentDC; }
280 void VisitStmt(clang::Stmt *S);
281 void VisitCallExpr(clang::CallExpr *CE);
282 void VisitDeclStmt(clang::DeclStmt *DS);
283 void VisitCompoundStmt(clang::CompoundStmt *CS);
284 void VisitBinAssign(clang::BinaryOperator *AS);
285 void VisitReturnStmt(clang::ReturnStmt *RS);
290 clang::FunctionDecl *CreateStaticGlobalDtor();