• Home
  • Raw
  • Download

Lines Matching refs:clang

51 static bool GetMangledName(clang::MangleContext* ctx,  in GetMangledName()
52 const clang::NamedDecl* decl, in GetMangledName()
54 if (!llvm::isa<clang::CXXConstructorDecl>(decl) && in GetMangledName()
55 !llvm::isa<clang::CXXDestructorDecl>(decl)) { in GetMangledName()
67 static bool InV8Namespace(const clang::NamedDecl* decl) { in InV8Namespace()
75 static bool IsExternalVMState(const clang::ValueDecl* var) { in IsExternalVMState()
76 const clang::EnumConstantDecl* enum_constant = in IsExternalVMState()
77 llvm::dyn_cast<clang::EnumConstantDecl>(var); in IsExternalVMState()
79 clang::QualType type = enum_constant->getType(); in IsExternalVMState()
88 explicit Resolver(clang::ASTContext& ctx) in Resolver()
92 Resolver(clang::ASTContext& ctx, clang::DeclContext* decl_ctx) in Resolver()
96 clang::DeclarationName ResolveName(const char* n) { in ResolveName()
97 clang::IdentifierInfo* ident = &ctx_.Idents.get(n); in ResolveName()
102 return Resolver(ctx_, Resolve<clang::NamespaceDecl>(n)); in ResolveNamespace()
109 clang::DeclContext::lookup_result result = in Resolve()
112 clang::DeclContext::lookup_iterator end = result.end(); in Resolve()
113 for (clang::DeclContext::lookup_iterator i = result.begin(); i != end; in Resolve()
122 clang::ASTContext& ctx_;
123 clang::DeclContext* decl_ctx_;
127 class CalleesPrinter : public clang::RecursiveASTVisitor<CalleesPrinter> {
129 explicit CalleesPrinter(clang::MangleContext* ctx) : ctx_(ctx) { in CalleesPrinter()
132 virtual bool VisitCallExpr(clang::CallExpr* expr) { in VisitCallExpr()
133 const clang::FunctionDecl* callee = expr->getDirectCallee(); in VisitCallExpr()
138 virtual bool VisitDeclRefExpr(clang::DeclRefExpr* expr) { in VisitDeclRefExpr()
145 void AnalyzeFunction(const clang::FunctionDecl* f) { in AnalyzeFunction()
150 const clang::FunctionDecl* body = NULL; in AnalyzeFunction()
199 clang::MangleContext* ctx_;
207 : public clang::ASTConsumer,
208 public clang::RecursiveASTVisitor<FunctionDeclarationFinder> {
210 explicit FunctionDeclarationFinder(clang::DiagnosticsEngine& d, in FunctionDeclarationFinder()
211 clang::SourceManager& sm, in FunctionDeclarationFinder()
215 virtual void HandleTranslationUnit(clang::ASTContext &ctx) { in HandleTranslationUnit()
216 mangle_context_ = clang::ItaniumMangleContext::create(ctx, d_); in HandleTranslationUnit()
224 virtual bool VisitFunctionDecl(clang::FunctionDecl* decl) { in VisitFunctionDecl()
230 clang::DiagnosticsEngine& d_;
231 clang::SourceManager& sm_;
232 clang::MangleContext* mangle_context_;
254 static bool KnownToCauseGC(clang::MangleContext* ctx, in KnownToCauseGC()
255 const clang::FunctionDecl* decl) { in KnownToCauseGC()
507 FunctionAnalyzer(clang::MangleContext* ctx, in FunctionAnalyzer()
508 clang::DeclarationName handle_decl_name, in FunctionAnalyzer()
509 clang::CXXRecordDecl* object_decl, in FunctionAnalyzer()
510 clang::CXXRecordDecl* smi_decl, clang::DiagnosticsEngine& d, in FunctionAnalyzer()
511 clang::SourceManager& sm, bool dead_vars_analysis) in FunctionAnalyzer()
526 ExprEffect VisitExpr(clang::Expr* expr, const Environment& env) { in VisitExpr()
529 clang::type* concrete_expr = llvm::dyn_cast_or_null<clang::type>(expr); \ in VisitExpr()
594 ExprEffect Visit##type (clang::type* expr, const Environment& env)
597 ExprEffect Visit##type (clang::type* expr, const Environment& env) { \
646 clang::Expr* exprs[2] = {expr->getBase(), expr->getIdx()}; in DECL_VISIT_EXPR()
650 bool IsRawPointerVar(clang::Expr* expr, std::string* var_name) { in IsRawPointerVar()
651 if (llvm::isa<clang::DeclRefExpr>(expr)) { in IsRawPointerVar()
653 llvm::cast<clang::DeclRefExpr>(expr)->getDecl()->getNameAsString(); in IsRawPointerVar()
660 clang::Expr* lhs = expr->getLHS(); in DECL_VISIT_EXPR()
661 clang::Expr* rhs = expr->getRHS(); in DECL_VISIT_EXPR()
662 clang::Expr* exprs[2] = {lhs, rhs}; in DECL_VISIT_EXPR()
665 case clang::BO_Comma: in DECL_VISIT_EXPR()
668 case clang::BO_LAnd: in DECL_VISIT_EXPR()
669 case clang::BO_LOr: in DECL_VISIT_EXPR()
672 case clang::BO_Assign: { in DECL_VISIT_EXPR()
738 if (expr->getOpcode() == clang::UO_AddrOf) { in DECL_VISIT_EXPR()
755 ExprEffect Par(clang::Expr* parent, in Par()
757 clang::Expr** exprs, in Par()
770 ExprEffect Seq(clang::Stmt* parent, in Seq()
772 clang::Expr** exprs, in Seq()
783 ExprEffect Use(const clang::Expr* parent, in Use()
784 const clang::QualType& var_type, in Use()
796 ExprEffect Use(const clang::Expr* parent, in Use()
797 const clang::ValueDecl* var, in Use()
824 ExprEffect VisitCallExpr(clang::CallExpr* call, in VisitCallExpr()
828 clang::CXXMemberCallExpr* memcall = in VisitCallExpr()
829 llvm::dyn_cast_or_null<clang::CXXMemberCallExpr>(call); in VisitCallExpr()
831 clang::Expr* receiver = memcall->getImplicitObjectArgument(); in VisitCallExpr()
842 clang::FunctionDecl* callee = call->getDirectCallee(); in VisitCallExpr()
854 Environment VisitStmt(clang::Stmt* stmt, const Environment& env) { in VisitStmt()
857 clang::type* concrete_stmt = llvm::dyn_cast_or_null<clang::type>(stmt); \ in VisitStmt()
863 if (clang::Expr* expr = llvm::dyn_cast_or_null<clang::Expr>(stmt)) { in VisitStmt()
892 Environment Visit##type (clang::type* stmt, const Environment& env)
895 Environment Visit##type (clang::type* stmt, const Environment& env) { \
952 void Seq(clang::Stmt* a, clang::Stmt* b, clang::Stmt* c) { in Seq()
959 void Seq(clang::Stmt* a, clang::Stmt* b) { in Seq()
965 void Loop(clang::Stmt* a, clang::Stmt* b, clang::Stmt* c) { in Loop()
970 void Loop(clang::Stmt* a, clang::Stmt* b) { in Loop()
997 clang::CompoundStmt::body_iterator end = stmt->body_end(); in DECL_VISIT_STMT()
998 for (clang::CompoundStmt::body_iterator s = stmt->body_begin(); in DECL_VISIT_STMT()
1061 const clang::TagType* ToTagType(const clang::Type* t) { in ToTagType()
1064 } else if (llvm::isa<clang::TagType>(t)) { in ToTagType()
1065 return llvm::cast<clang::TagType>(t); in ToTagType()
1066 } else if (llvm::isa<clang::SubstTemplateTypeParmType>(t)) { in ToTagType()
1067 return ToTagType(llvm::cast<clang::SubstTemplateTypeParmType>(t) in ToTagType()
1075 bool IsDerivedFrom(clang::CXXRecordDecl* record, in IsDerivedFrom()
1076 clang::CXXRecordDecl* base) { in IsDerivedFrom()
1080 bool IsRawPointerType(clang::QualType qtype) { in IsRawPointerType()
1081 const clang::PointerType* type = in IsRawPointerType()
1082 llvm::dyn_cast_or_null<clang::PointerType>(qtype.getTypePtrOrNull()); in IsRawPointerType()
1085 const clang::TagType* pointee = in IsRawPointerType()
1089 clang::CXXRecordDecl* record = in IsRawPointerType()
1090 llvm::dyn_cast_or_null<clang::CXXRecordDecl>(pointee->getDecl()); in IsRawPointerType()
1103 Environment VisitDecl(clang::Decl* decl, const Environment& env) { in VisitDecl()
1104 if (clang::VarDecl* var = llvm::dyn_cast<clang::VarDecl>(decl)) { in VisitDecl()
1119 clang::DeclStmt::decl_iterator end = stmt->decl_end(); in DECL_VISIT_STMT()
1120 for (clang::DeclStmt::decl_iterator decl = stmt->decl_begin(); in DECL_VISIT_STMT()
1129 void DefineParameters(const clang::FunctionDecl* f, in DefineParameters()
1132 clang::FunctionDecl::param_const_iterator end = f->param_end(); in DefineParameters()
1133 for (clang::FunctionDecl::param_const_iterator p = f->param_begin(); in DefineParameters()
1141 void AnalyzeFunction(const clang::FunctionDecl* f) { in AnalyzeFunction()
1142 const clang::FunctionDecl* body = NULL; in AnalyzeFunction()
1162 void ReportUnsafe(const clang::Expr* expr, const std::string& msg) { in ReportUnsafe()
1163 d_.Report(clang::FullSourceLoc(expr->getExprLoc(), sm_), in ReportUnsafe()
1164 d_.getCustomDiagID(clang::DiagnosticsEngine::Warning, "%0")) in ReportUnsafe()
1169 clang::MangleContext* ctx_;
1170 clang::DeclarationName handle_decl_name_;
1171 clang::CXXRecordDecl* object_decl_;
1172 clang::CXXRecordDecl* smi_decl_;
1174 clang::DiagnosticsEngine& d_;
1175 clang::SourceManager& sm_;
1182 class ProblemsFinder : public clang::ASTConsumer,
1183 public clang::RecursiveASTVisitor<ProblemsFinder> {
1185 ProblemsFinder(clang::DiagnosticsEngine& d, clang::SourceManager& sm, in ProblemsFinder()
1195 virtual void HandleTranslationUnit(clang::ASTContext &ctx) { in HandleTranslationUnit()
1198 clang::CXXRecordDecl* object_decl = in HandleTranslationUnit()
1200 Resolve<clang::CXXRecordDecl>("Object"); in HandleTranslationUnit()
1202 clang::CXXRecordDecl* smi_decl = in HandleTranslationUnit()
1204 Resolve<clang::CXXRecordDecl>("Smi"); in HandleTranslationUnit()
1212 clang::ItaniumMangleContext::create(ctx, d_), r.ResolveName("Handle"), in HandleTranslationUnit()
1225 virtual bool VisitFunctionDecl(clang::FunctionDecl* decl) { in VisitFunctionDecl()
1231 clang::DiagnosticsEngine& d_;
1232 clang::SourceManager& sm_;
1240 class Action : public clang::PluginASTAction {
1242 clang::ASTConsumer *CreateASTConsumer(clang::CompilerInstance &CI, in CreateASTConsumer()
1247 bool ParseArgs(const clang::CompilerInstance &CI, in ParseArgs()
1262 static clang::FrontendPluginRegistry::Add<Action<ProblemsFinder> >
1265 static clang::FrontendPluginRegistry::Add<