20 llvm::DenseMap<unsigned, ParamDescriptor> &&Params,
22 bool HasThisPointer,
bool HasRVO)
23 :
P(
P),
Kind(FunctionKind::
Normal), Source(Source), ArgSize(ArgSize),
24 ParamTypes(
std::move(ParamTypes)), Params(
std::move(Params)),
25 ParamOffsets(
std::move(ParamOffsets)), HasThisPointer(HasThisPointer),
27 if (
const auto *F = dyn_cast<const FunctionDecl *>(Source)) {
28 Variadic = F->isVariadic();
29 BuiltinID = F->getBuiltinID();
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 (MD->isLambdaStaticInvoker())
39 Kind = FunctionKind::LambdaStaticInvoker;
41 Kind = FunctionKind::LambdaCallOperator;
47 auto It = Params.find(Offset);
48 assert(It != Params.end() &&
"Invalid parameter offset");
53 assert(PC >= getCodeBegin() &&
"PC does not belong to this function");
54 assert(PC <= getCodeEnd() &&
"PC Does not belong to this function");
55 assert(hasBody() &&
"Function has no body");
56 unsigned Offset = PC - getCodeBegin();
57 using Elem = std::pair<unsigned, SourceInfo>;
58 auto It = llvm::lower_bound(SrcMap, Elem{Offset, {}}, llvm::less_first());
59 if (It == SrcMap.end())
60 return SrcMap.back().second;
70 return BuiltinID == Builtin::BI__builtin_classify_type ||
71 BuiltinID == Builtin::BI__builtin_os_log_format_buffer_size ||
72 BuiltinID == Builtin::BI__builtin_constant_p ||
73 BuiltinID == Builtin::BI__noop;
76bool Function::isUnevaluatedBuiltin()
const {
77 return ::isUnevaluatedBuiltin(BuiltinID);
Defines enum values for all the target-independent builtin functions.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
static bool isUnevaluatedBuiltin(unsigned BuiltinID)
Unevaluated builtins don't get their arguments put on the stack automatically.
Pointer into the code segment.
std::pair< PrimType, Descriptor * > ParamDescriptor
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)