20 bool HasThisPointer,
bool HasRVO,
bool IsLambdaStaticInvoker)
21 : P(P), Kind(FunctionKind::
Normal), Source(Source), ArgSize(ArgSize),
22 ParamDescriptors(
std::move(ParamDescriptors)), IsValid(
false),
23 IsFullyCompiled(
false), HasThisPointer(HasThisPointer), HasRVO(HasRVO),
26 if (
const auto *F = dyn_cast<const FunctionDecl *>(Source)) {
27 Variadic = F->isVariadic();
30 if (
const auto *CD = dyn_cast<CXXConstructorDecl>(F)) {
32 Kind = FunctionKind::Ctor;
33 }
else if (
const auto *CD = dyn_cast<CXXDestructorDecl>(F)) {
35 Kind = FunctionKind::Dtor;
36 }
else if (
const auto *MD = dyn_cast<CXXMethodDecl>(F)) {
38 if (IsLambdaStaticInvoker)
39 Kind = FunctionKind::LambdaStaticInvoker;
41 Kind = FunctionKind::LambdaCallOperator;
42 else if (MD->isCopyAssignmentOperator() || MD->isMoveAssignmentOperator())
43 Kind = FunctionKind::CopyOrMoveOperator;
56 assert(PC >=
getCodeBegin() &&
"PC does not belong to this function");
57 assert(PC <=
getCodeEnd() &&
"PC Does not belong to this function");
58 assert(
hasBody() &&
"Function has no body");
60 using Elem = std::pair<unsigned, SourceInfo>;
61 auto It = llvm::lower_bound(SrcMap, Elem{Offset, {}}, llvm::less_first());
62 if (It == SrcMap.end())
63 return SrcMap.back().second;
This file provides some common utility functions for processing Lambda related AST Constructs.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Pointer into the code segment.
CodePtr getCodeBegin() const
Returns a pointer to the start of the code.
CodePtr getCodeEnd() const
Returns a pointer to the end of the code.
bool hasBody() const
Checks if the function already has a body attached.
SourceInfo getSource(CodePtr PC) const
Returns the source information at a given PC.
The program contains and links the bytecode for all functions.
Describes the statement/declaration an opcode was generated from.
llvm::PointerUnion< const FunctionDecl *, const BlockExpr * > FunctionDeclTy
The JSON file list parser is used to communicate input to InstallAPI.
bool isLambdaCallOperator(const CXXMethodDecl *MD)