diff options
Diffstat (limited to 'include/clang/Analysis/AnalysisContext.h')
-rw-r--r-- | include/clang/Analysis/AnalysisContext.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/clang/Analysis/AnalysisContext.h b/include/clang/Analysis/AnalysisContext.h index 08e335418a..0ebdf15f2c 100644 --- a/include/clang/Analysis/AnalysisContext.h +++ b/include/clang/Analysis/AnalysisContext.h @@ -17,6 +17,7 @@ #include "clang/AST/Decl.h" #include "clang/Analysis/CFG.h" +#include "clang/Analysis/CodeInjector.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/Support/Allocator.h" @@ -143,6 +144,14 @@ public: /// \sa getBody bool isBodyAutosynthesized() const; + /// \brief Checks if the body of the Decl is generated by the BodyFarm from a + /// model file. + /// + /// Note, the lookup is not free. We are going to call getBody behind + /// the scenes. + /// \sa getBody + bool isBodyAutosynthesizedFromModelFile() const; + CFG *getCFG(); CFGStmtMap *getCFGStmtMap(); @@ -398,6 +407,10 @@ class AnalysisDeclContextManager { ContextMap Contexts; LocationContextManager LocContexts; CFG::BuildOptions cfgBuildOptions; + + /// Pointer to an interface that can provide function bodies for + /// declarations from external source. + std::unique_ptr<CodeInjector> Injector; /// Flag to indicate whether or not bodies should be synthesized /// for well-known functions. @@ -410,7 +423,8 @@ public: bool addTemporaryDtors = false, bool synthesizeBodies = false, bool addStaticInitBranches = false, - bool addCXXNewAllocator = true); + bool addCXXNewAllocator = true, + CodeInjector* injector = nullptr); ~AnalysisDeclContextManager(); |