1 //===-- CodeInjector.h ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief Defines the clang::CodeInjector interface which is responsible for
12 /// injecting AST of function definitions that may not be available in the
15 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_CLANG_ANALYSIS_CODEINJECTOR_H
18 #define LLVM_CLANG_ANALYSIS_CODEINJECTOR_H
26 /// \brief CodeInjector is an interface which is responsible for injecting AST
27 /// of function definitions that may not be available in the original source.
29 /// The getBody function will be called each time the static analyzer examines a
30 /// function call that has no definition available in the current translation
31 /// unit. If the returned statement is not a null pointer, it is assumed to be
32 /// the body of a function which will be used for the analysis. The source of
33 /// the body can be arbitrary, but it is advised to use memoization to avoid
34 /// unnecessary reparsing of the external source that provides the body of the
39 virtual ~CodeInjector();
41 virtual Stmt *getBody(const FunctionDecl *D) = 0;
42 virtual Stmt *getBody(const ObjCMethodDecl *D) = 0;