14#ifndef LLVM_CLANG_LIB_CODEGEN_CGCALL_H
15#define LLVM_CLANG_LIB_CODEGEN_CGCALL_H
24#include "llvm/ADT/STLForwardCompat.h"
25#include "llvm/IR/Value.h"
50 : CalleeProtoTy(calleeProtoTy), CalleeDecl(calleeDecl) {}
52 : CalleeProtoTy(calleeProtoTy) {}
54 : CalleeProtoTy(nullptr), CalleeDecl(calleeDecl) {}
73 struct OrdinaryInfoStorage {
77 struct BuiltinInfoStorage {
81 struct PseudoDestructorInfoStorage {
84 struct VirtualInfoStorage {
88 llvm::FunctionType *FTy;
91 SpecialKind KindOrFunctionPointer;
99 explicit CGCallee(SpecialKind kind) : KindOrFunctionPointer(kind) {}
102 : KindOrFunctionPointer(SpecialKind::Builtin) {
108 CGCallee() : KindOrFunctionPointer(SpecialKind::Invalid) {}
115 : KindOrFunctionPointer(
116 SpecialKind(reinterpret_cast<
uintptr_t>(functionPtr))) {
119 assert(functionPtr &&
"configuring callee without function pointer");
120 assert(functionPtr->getType()->isPointerTy());
125 CGCallee result(SpecialKind::Builtin);
132 CGCallee result(SpecialKind::PseudoDestructor);
139 return CGCallee(abstractInfo, functionPtr);
144 return CGCallee(abstractInfo, functionPtr.getCallee());
148 llvm::FunctionType *FTy) {
149 CGCallee result(SpecialKind::Virtual);
158 return KindOrFunctionPointer == SpecialKind::Builtin;
170 return KindOrFunctionPointer == SpecialKind::PseudoDestructor;
192 return reinterpret_cast<llvm::Value *
>(
uintptr_t(KindOrFunctionPointer));
196 KindOrFunctionPointer =
197 SpecialKind(
reinterpret_cast<uintptr_t>(functionPtr));