16 #ifndef LLVM_CLANG_LIB_CODEGEN_CGOBJCRUNTIME_H
17 #define LLVM_CLANG_LIB_CODEGEN_CGOBJCRUNTIME_H
36 class CodeGenFunction;
41 class ObjCAtThrowStmt;
42 class ObjCAtSynchronizedStmt;
43 class ObjCContainerDecl;
44 class ObjCCategoryImplDecl;
45 class ObjCImplementationDecl;
46 class ObjCInterfaceDecl;
47 class ObjCMessageExpr;
49 class ObjCProtocolDecl;
52 class ObjCStringLiteral;
53 class BlockDeclRefExpr;
89 unsigned CVRQualifiers,
100 llvm::Constant *beginCatchFn,
101 llvm::Constant *endCatchFn,
102 llvm::Constant *exceptionRethrowFn);
109 llvm::Function *syncEnterFn,
110 llvm::Function *syncExitFn);
226 llvm_unreachable(
"autoreleasepool unsupported in this ABI");
239 bool ClearInsertionPoint=
true) = 0;
246 bool threadlocal=
false) = 0;
257 unsigned CVRQualifiers) = 0;
271 virtual llvm::GlobalVariable *
GetClassGlobal(
const std::string &Name,
272 bool Weak =
false) = 0;
279 llvm::PointerType *messengerType)
Smart pointer class that efficiently represents Objective-C method names.
virtual llvm::Function * GenerateMethod(const ObjCMethodDecl *OMD, const ObjCContainerDecl *CD)=0
virtual CodeGen::RValue GenerateMessageSend(CodeGen::CodeGenFunction &CGF, ReturnValueSlot ReturnSlot, QualType ResultType, Selector Sel, llvm::Value *Receiver, const CallArgList &CallArgs, const ObjCInterfaceDecl *Class=nullptr, const ObjCMethodDecl *Method=nullptr)=0
Implements runtime-specific code generation functions.
virtual llvm::GlobalVariable * GetClassGlobal(const std::string &Name, bool Weak=false)=0
Represents Objective-C's @throw statement.
llvm::PointerType * MessengerType
virtual void EmitObjCWeakAssign(CodeGen::CodeGenFunction &CGF, llvm::Value *src, llvm::Value *dest)=0
uint64_t ComputeIvarBaseOffset(CodeGen::CodeGenModule &CGM, const ObjCInterfaceDecl *OID, const ObjCIvarDecl *Ivar)
virtual llvm::Constant * BuildRCBlockLayout(CodeGen::CodeGenModule &CGM, const CodeGen::CGBlockInfo &blockInfo)=0
virtual llvm::Constant * GetOptimizedPropertySetFunction(bool atomic, bool copy)=0
Return the runtime function for optimized setting properties.
virtual llvm::Constant * GetPropertySetFunction()=0
Return the runtime function for setting properties.
virtual CodeGen::RValue GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF, ReturnValueSlot ReturnSlot, QualType ResultType, Selector Sel, const ObjCInterfaceDecl *Class, bool isCategoryImpl, llvm::Value *Self, bool IsClassMessage, const CallArgList &CallArgs, const ObjCMethodDecl *Method=nullptr)=0
virtual llvm::Value * EmitIvarOffset(CodeGen::CodeGenFunction &CGF, const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar)=0
MessageSendInfo getMessageSendInfo(const ObjCMethodDecl *method, QualType resultType, CallArgList &callArgs)
virtual void EmitObjCGlobalAssign(CodeGen::CodeGenFunction &CGF, llvm::Value *src, llvm::Value *dest, bool threadlocal=false)=0
CGObjCRuntime * CreateMacObjCRuntime(CodeGenModule &CGM)
CodeGen::CodeGenModule & CGM
virtual void EmitGCMemmoveCollectable(CodeGen::CodeGenFunction &CGF, llvm::Value *DestPtr, llvm::Value *SrcPtr, llvm::Value *Size)=0
Represents an Objective-C protocol declaration.
virtual llvm::Constant * GetGetStructFunction()=0
Represents an ObjC class declaration.
CGBlockInfo - Information to generate a block literal.
ID
Defines the set of possible language-specific address spaces.
virtual llvm::Constant * GetSetStructFunction()=0
CGObjCRuntime(CodeGen::CodeGenModule &CGM)
virtual void EmitThrowStmt(CodeGen::CodeGenFunction &CGF, const ObjCAtThrowStmt &S, bool ClearInsertionPoint=true)=0
virtual void RegisterAlias(const ObjCCompatibleAliasDecl *OAD)=0
Register an class alias.
Represents Objective-C's @synchronized statement.
virtual void EmitTryStmt(CodeGen::CodeGenFunction &CGF, const ObjCAtTryStmt &S)=0
void EmitAtSynchronizedStmt(CodeGenFunction &CGF, const ObjCAtSynchronizedStmt &S, llvm::Function *syncEnterFn, llvm::Function *syncExitFn)
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
virtual llvm::Constant * GetPropertyGetFunction()=0
Return the runtime function for getting properties.
unsigned ComputeBitfieldBitOffset(CodeGen::CodeGenModule &CGM, const ObjCInterfaceDecl *ID, const ObjCIvarDecl *Ivar)
virtual llvm::Constant * BuildByrefLayout(CodeGen::CodeGenModule &CGM, QualType T)=0
virtual void EmitSynchronizedStmt(CodeGen::CodeGenFunction &CGF, const ObjCAtSynchronizedStmt &S)=0
virtual LValue EmitObjCValueForIvar(CodeGen::CodeGenFunction &CGF, QualType ObjectTy, llvm::Value *BaseValue, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers)=0
virtual void GenerateProtocol(const ObjCProtocolDecl *OPD)=0
MessageSendInfo(const CGFunctionInfo &callInfo, llvm::PointerType *messengerType)
virtual llvm::Value * EmitNSAutoreleasePoolClassRef(CodeGenFunction &CGF)
virtual llvm::Value * GenerateProtocolRef(CodeGenFunction &CGF, const ObjCProtocolDecl *OPD)=0
virtual void EmitObjCIvarAssign(CodeGen::CodeGenFunction &CGF, llvm::Value *src, llvm::Value *dest, llvm::Value *ivarOffset)=0
virtual llvm::Constant * GetCppAtomicObjectGetFunction()=0
virtual void GenerateClass(const ObjCImplementationDecl *OID)=0
Generate a class structure for this class.
virtual llvm::Constant * BuildGCBlockLayout(CodeGen::CodeGenModule &CGM, const CodeGen::CGBlockInfo &blockInfo)=0
const CGFunctionInfo & CallInfo
virtual void EmitObjCStrongCastAssign(CodeGen::CodeGenFunction &CGF, llvm::Value *src, llvm::Value *dest)=0
virtual void GenerateCategory(const ObjCCategoryImplDecl *OCD)=0
virtual llvm::Function * ModuleInitFunction()=0
virtual llvm::Constant * EnumerationMutationFunction()=0
virtual llvm::Value * EmitObjCWeakRead(CodeGen::CodeGenFunction &CGF, llvm::Value *AddrWeakObj)=0
virtual llvm::Constant * GenerateConstantString(const StringLiteral *)=0
Generate a constant string object.
virtual llvm::Value * GetClass(CodeGenFunction &CGF, const ObjCInterfaceDecl *OID)=0
Represents Objective-C's @try ... @catch ... @finally statement.
virtual llvm::Value * GetSelector(CodeGenFunction &CGF, Selector Sel, bool lval=false)=0
virtual llvm::Constant * GetCppAtomicObjectSetFunction()=0
void EmitTryCatchStmt(CodeGenFunction &CGF, const ObjCAtTryStmt &S, llvm::Constant *beginCatchFn, llvm::Constant *endCatchFn, llvm::Constant *exceptionRethrowFn)
LValue EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF, const ObjCInterfaceDecl *OID, llvm::Value *BaseValue, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers, llvm::Value *Offset)
virtual llvm::Constant * GetEHType(QualType T)=0
CGObjCRuntime * CreateGNUObjCRuntime(CodeGenModule &CGM)
Creates an instance of an Objective-C runtime class.