20 llvm::DenseMap<unsigned, ParamDescriptor> &&Params,
22 bool HasThisPointer,
bool HasRVO,
unsigned BuiltinID)
23 :
P(
P), Source(Source), ArgSize(ArgSize), ParamTypes(
std::move(ParamTypes)),
24 Params(
std::move(Params)), ParamOffsets(
std::move(ParamOffsets)),
25 HasThisPointer(HasThisPointer), HasRVO(HasRVO), BuiltinID(BuiltinID) {
26 if (
const auto *F = Source.dyn_cast<
const FunctionDecl *>())
27 Variadic = F->isVariadic();
31 auto It = Params.find(Offset);
32 assert(It != Params.end() &&
"Invalid parameter offset");
37 assert(PC >= getCodeBegin() &&
"PC does not belong to this function");
38 assert(PC <= getCodeEnd() &&
"PC Does not belong to this function");
39 assert(hasBody() &&
"Function has no body");
40 unsigned Offset = PC - getCodeBegin();
41 using Elem = std::pair<unsigned, SourceInfo>;
42 auto It = llvm::lower_bound(SrcMap, Elem{Offset, {}}, llvm::less_first());
43 if (It == SrcMap.end())
44 return SrcMap.back().second;
48bool Function::isVirtual()
const {
49 if (
const auto *M = dyn_cast_if_present<CXXMethodDecl>(
51 return M->isVirtual();
61 return BuiltinID == Builtin::BI__builtin_classify_type ||
62 BuiltinID == Builtin::BI__builtin_os_log_format_buffer_size ||
63 BuiltinID == Builtin::BI__builtin_constant_p ||
64 BuiltinID == Builtin::BI__noop;
67bool Function::isUnevaluatedBuiltin()
const {
68 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.
Represents a function declaration or definition.
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.