File indexing completed on 2026-05-10 08:36:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_CLANG_ANALYSIS_BODYFARM_H
0015 #define LLVM_CLANG_ANALYSIS_BODYFARM_H
0016
0017 #include "clang/AST/DeclBase.h"
0018 #include "clang/Basic/LLVM.h"
0019 #include "llvm/ADT/DenseMap.h"
0020 #include <optional>
0021
0022 namespace clang {
0023
0024 class ASTContext;
0025 class FunctionDecl;
0026 class ObjCMethodDecl;
0027 class Stmt;
0028 class CodeInjector;
0029
0030 class BodyFarm {
0031 public:
0032 BodyFarm(ASTContext &C, CodeInjector *injector) : C(C), Injector(injector) {}
0033
0034
0035 Stmt *getBody(const FunctionDecl *D);
0036
0037
0038 Stmt *getBody(const ObjCMethodDecl *D);
0039
0040
0041 BodyFarm(const BodyFarm &other) = delete;
0042
0043
0044 BodyFarm &operator=(const BodyFarm &other) = delete;
0045
0046 private:
0047 typedef llvm::DenseMap<const Decl *, std::optional<Stmt *>> BodyMap;
0048
0049 ASTContext &C;
0050 BodyMap Bodies;
0051 CodeInjector *Injector;
0052 };
0053 }
0054
0055 #endif