Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:26

0001 //===-- CodeInjector.h ------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 ///
0009 /// \file
0010 /// Defines the clang::CodeInjector interface which is responsible for
0011 /// injecting AST of function definitions that may not be available in the
0012 /// original source.
0013 ///
0014 //===----------------------------------------------------------------------===//
0015 
0016 #ifndef LLVM_CLANG_ANALYSIS_CODEINJECTOR_H
0017 #define LLVM_CLANG_ANALYSIS_CODEINJECTOR_H
0018 
0019 namespace clang {
0020 
0021 class Stmt;
0022 class FunctionDecl;
0023 class ObjCMethodDecl;
0024 
0025 /// CodeInjector is an interface which is responsible for injecting AST
0026 /// of function definitions that may not be available in the original source.
0027 ///
0028 /// The getBody function will be called each time the static analyzer examines a
0029 /// function call that has no definition available in the current translation
0030 /// unit. If the returned statement is not a null pointer, it is assumed to be
0031 /// the body of a function which will be used for the analysis. The source of
0032 /// the body can be arbitrary, but it is advised to use memoization to avoid
0033 /// unnecessary reparsing of the external source that provides the body of the
0034 /// functions.
0035 class CodeInjector {
0036 public:
0037   CodeInjector();
0038   virtual ~CodeInjector();
0039 
0040   virtual Stmt *getBody(const FunctionDecl *D) = 0;
0041   virtual Stmt *getBody(const ObjCMethodDecl *D) = 0;
0042 };
0043 }
0044 
0045 #endif