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 = CD->isCopyOrMoveConstructor() ? FunctionKind::CopyOrMoveCtor
34 }
else if (
const auto *CD = dyn_cast<CXXDestructorDecl>(F)) {
36 Kind = FunctionKind::Dtor;
37 }
else if (
const auto *MD = dyn_cast<CXXMethodDecl>(F)) {
39 if (IsLambdaStaticInvoker)
40 Kind = FunctionKind::LambdaStaticInvoker;
42 Kind = FunctionKind::LambdaCallOperator;
43 else if (MD->isCopyAssignmentOperator() || MD->isMoveAssignmentOperator())
44 Kind = FunctionKind::CopyOrMoveOperator;
57 assert(PC >=
getCodeBegin() &&
"PC does not belong to this function");
58 assert(PC <=
getCodeEnd() &&
"PC Does not belong to this function");
59 assert(
hasBody() &&
"Function has no body");
61 using Elem = std::pair<unsigned, SourceInfo>;
62 auto It = llvm::lower_bound(SrcMap, Elem{Offset, {}}, llvm::less_first());
63 if (It == SrcMap.end())
64 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)