clang
10.0.0git
include
clang
Analysis
BodyFarm.h
Go to the documentation of this file.
1
//== BodyFarm.h - Factory for conjuring up fake bodies -------------*- C++ -*-//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// BodyFarm is a factory for creating faux implementations for functions/methods
10
// for analysis purposes.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CLANG_LIB_ANALYSIS_BODYFARM_H
15
#define LLVM_CLANG_LIB_ANALYSIS_BODYFARM_H
16
17
#include "
clang/AST/DeclBase.h
"
18
#include "
clang/Basic/LLVM.h
"
19
#include "llvm/ADT/DenseMap.h"
20
#include "llvm/ADT/Optional.h"
21
22
namespace
clang
{
23
24
class
ASTContext;
25
class
FunctionDecl;
26
class
ObjCMethodDecl;
27
class
ObjCPropertyDecl;
28
class
Stmt;
29
class
CodeInjector;
30
31
class
BodyFarm
{
32
public
:
33
BodyFarm
(
ASTContext
&C,
CodeInjector
*injector) : C(C), Injector(injector) {}
34
35
/// Factory method for creating bodies for ordinary functions.
36
Stmt
*
getBody
(
const
FunctionDecl
*D);
37
38
/// Factory method for creating bodies for Objective-C properties.
39
Stmt
*
getBody
(
const
ObjCMethodDecl
*D);
40
41
/// Remove copy constructor to avoid accidental copying.
42
BodyFarm
(
const
BodyFarm
&other) =
delete
;
43
44
private
:
45
typedef
llvm::DenseMap<const Decl *, Optional<Stmt *>> BodyMap;
46
47
ASTContext
&C;
48
BodyMap Bodies;
49
CodeInjector
*Injector;
50
};
51
}
// namespace clang
52
53
#endif
clang::FunctionDecl
Represents a function declaration or definition.
Definition:
Decl.h:1783
clang::Stmt
Stmt - This represents one statement.
Definition:
Stmt.h:66
clang::BodyFarm
Definition:
BodyFarm.h:31
clang::ObjCMethodDecl
ObjCMethodDecl - Represents an instance or class method declaration.
Definition:
DeclObjC.h:138
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition:
ASTContext.h:168
LLVM.h
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
clang::BodyFarm::BodyFarm
BodyFarm(ASTContext &C, CodeInjector *injector)
Definition:
BodyFarm.h:33
DeclBase.h
clang
Dataflow Directional Tag Classes.
Definition:
CFGReachabilityAnalysis.h:21
clang::CodeInjector
CodeInjector is an interface which is responsible for injecting AST of function definitions that may ...
Definition:
CodeInjector.h:35
clang::BodyFarm::getBody
Stmt * getBody(const FunctionDecl *D)
Factory method for creating bodies for ordinary functions.
Definition:
BodyFarm.cpp:667
Generated on Thu Feb 13 2020 14:07:04 for clang by
1.8.13