clang  14.0.0git
CGObjCRuntime.h
Go to the documentation of this file.
1 //===----- CGObjCRuntime.h - Interface to ObjC Runtimes ---------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This provides an abstract class for Objective-C code generation. Concrete
10 // subclasses of this implement code generation for specific Objective-C
11 // runtime libraries.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_LIB_CODEGEN_CGOBJCRUNTIME_H
16 #define LLVM_CLANG_LIB_CODEGEN_CGOBJCRUNTIME_H
17 #include "CGBuilder.h"
18 #include "CGCall.h"
19 #include "CGCleanup.h"
20 #include "CGValue.h"
21 #include "clang/AST/DeclObjC.h"
22 #include "clang/Basic/IdentifierTable.h" // Selector
23 #include "llvm/ADT/UniqueVector.h"
24 
25 namespace llvm {
26  class Constant;
27  class Function;
28  class Module;
29  class StructLayout;
30  class StructType;
31  class Type;
32  class Value;
33 }
34 
35 namespace clang {
36 namespace CodeGen {
37  class CodeGenFunction;
38 }
39 
40  class FieldDecl;
41  class ObjCAtTryStmt;
42  class ObjCAtThrowStmt;
43  class ObjCAtSynchronizedStmt;
44  class ObjCContainerDecl;
45  class ObjCCategoryImplDecl;
46  class ObjCImplementationDecl;
47  class ObjCInterfaceDecl;
48  class ObjCMessageExpr;
49  class ObjCMethodDecl;
50  class ObjCProtocolDecl;
51  class Selector;
52  class ObjCIvarDecl;
53  class ObjCStringLiteral;
54  class BlockDeclRefExpr;
55 
56 namespace CodeGen {
57  class CodeGenModule;
58  class CGBlockInfo;
59 
60 // FIXME: Several methods should be pure virtual but aren't to avoid the
61 // partially-implemented subclass breaking.
62 
63 /// Implements runtime-specific code generation functions.
65 protected:
68 
69  // Utility functions for unified ivar access. These need to
70  // eventually be folded into other places (the structure layout
71  // code).
72 
73  /// Compute an offset to the given ivar, suitable for passing to
74  /// EmitValueForIvarAtOffset. Note that the correct handling of
75  /// bit-fields is carefully coordinated by these two, use caution!
76  ///
77  /// The latter overload is suitable for computing the offset of a
78  /// sythesized ivar.
80  const ObjCInterfaceDecl *OID,
81  const ObjCIvarDecl *Ivar);
83  const ObjCImplementationDecl *OID,
84  const ObjCIvarDecl *Ivar);
85 
87  const ObjCInterfaceDecl *OID,
88  llvm::Value *BaseValue,
89  const ObjCIvarDecl *Ivar,
90  unsigned CVRQualifiers,
92  /// Emits a try / catch statement. This function is intended to be called by
93  /// subclasses, and provides a generic mechanism for generating these, which
94  /// should be usable by all runtimes. The caller must provide the functions
95  /// to call when entering and exiting a \@catch() block, and the function
96  /// used to rethrow exceptions. If the begin and end catch functions are
97  /// NULL, then the function assumes that the EH personality function provides
98  /// the thrown object directly.
100  llvm::FunctionCallee beginCatchFn,
101  llvm::FunctionCallee endCatchFn,
102  llvm::FunctionCallee exceptionRethrowFn);
103 
105  const VarDecl *paramDecl);
106 
107  /// Emits an \@synchronize() statement, using the \p syncEnterFn and
108  /// \p syncExitFn arguments as the functions called to lock and unlock
109  /// the object. This function can be called by subclasses that use
110  /// zero-cost exception handling.
112  const ObjCAtSynchronizedStmt &S,
113  llvm::FunctionCallee syncEnterFn,
114  llvm::FunctionCallee syncExitFn);
115 
116 public:
117  virtual ~CGObjCRuntime();
118 
120  bool includeCategoryName = true);
121 
122  /// Generate the function required to register all Objective-C components in
123  /// this compilation unit with the runtime library.
124  virtual llvm::Function *ModuleInitFunction() = 0;
125 
126  /// Get a selector for the specified name and type values.
127  /// The result should have the LLVM type for ASTContext::getObjCSelType().
128  virtual llvm::Value *GetSelector(CodeGenFunction &CGF, Selector Sel) = 0;
129 
130  /// Get the address of a selector for the specified name and type values.
131  /// This is a rarely-used language extension, but sadly it exists.
132  ///
133  /// The result should have the LLVM type for a pointer to
134  /// ASTContext::getObjCSelType().
135  virtual Address GetAddrOfSelector(CodeGenFunction &CGF, Selector Sel) = 0;
136 
137  /// Get a typed selector.
139  const ObjCMethodDecl *Method) = 0;
140 
141  /// Get the type constant to catch for the given ObjC pointer type.
142  /// This is used externally to implement catching ObjC types in C++.
143  /// Runtimes which don't support this should add the appropriate
144  /// error to Sema.
145  virtual llvm::Constant *GetEHType(QualType T) = 0;
146 
147  virtual CatchTypeInfo getCatchAllTypeInfo() { return { nullptr, 0 }; }
148 
149  /// Generate a constant string object.
151 
152  /// Generate a category. A category contains a list of methods (and
153  /// accompanying metadata) and a list of protocols.
154  virtual void GenerateCategory(const ObjCCategoryImplDecl *OCD) = 0;
155 
156  /// Generate a class structure for this class.
157  virtual void GenerateClass(const ObjCImplementationDecl *OID) = 0;
158 
159  /// Register an class alias.
160  virtual void RegisterAlias(const ObjCCompatibleAliasDecl *OAD) = 0;
161 
162  /// Generate an Objective-C message send operation.
163  ///
164  /// \param Method - The method being called, this may be null if synthesizing
165  /// a property setter or getter.
166  virtual CodeGen::RValue
168  ReturnValueSlot ReturnSlot,
169  QualType ResultType,
170  Selector Sel,
171  llvm::Value *Receiver,
172  const CallArgList &CallArgs,
173  const ObjCInterfaceDecl *Class = nullptr,
174  const ObjCMethodDecl *Method = nullptr) = 0;
175 
176  /// Generate an Objective-C message send operation.
177  ///
178  /// This variant allows for the call to be substituted with an optimized
179  /// variant.
182  ReturnValueSlot Return,
183  QualType ResultType,
184  Selector Sel,
185  llvm::Value *Receiver,
186  const CallArgList& Args,
187  const ObjCInterfaceDecl *OID,
188  const ObjCMethodDecl *Method,
189  bool isClassMessage);
190 
191  /// Generate an Objective-C message send operation to the super
192  /// class initiated in a method for Class and with the given Self
193  /// object.
194  ///
195  /// \param Method - The method being called, this may be null if synthesizing
196  /// a property setter or getter.
197  virtual CodeGen::RValue
199  ReturnValueSlot ReturnSlot,
200  QualType ResultType,
201  Selector Sel,
202  const ObjCInterfaceDecl *Class,
203  bool isCategoryImpl,
204  llvm::Value *Self,
205  bool IsClassMessage,
206  const CallArgList &CallArgs,
207  const ObjCMethodDecl *Method = nullptr) = 0;
208 
209  /// Walk the list of protocol references from a class, category or
210  /// protocol to traverse the DAG formed from it's inheritance hierarchy. Find
211  /// the list of protocols that ends each walk at either a runtime
212  /// protocol or a non-runtime protocol with no parents. For the common case of
213  /// just a list of standard runtime protocols this just returns the same list
214  /// that was passed in.
215  std::vector<const ObjCProtocolDecl *>
218 
219  /// Emit the code to return the named protocol as an object, as in a
220  /// \@protocol expression.
222  const ObjCProtocolDecl *OPD) = 0;
223 
224  /// Generate the named protocol. Protocols contain method metadata but no
225  /// implementations.
226  virtual void GenerateProtocol(const ObjCProtocolDecl *OPD) = 0;
227 
228  /// GetOrEmitProtocol - Get the protocol object for the given
229  /// declaration, emitting it if necessary. The return value has type
230  /// ProtocolPtrTy.
231  virtual llvm::Constant *GetOrEmitProtocol(const ObjCProtocolDecl *PD) = 0;
232 
233  /// Generate a function preamble for a method with the specified
234  /// types.
235 
236  // FIXME: Current this just generates the Function definition, but really this
237  // should also be generating the loads of the parameters, as the runtime
238  // should have full control over how parameters are passed.
239  virtual llvm::Function *GenerateMethod(const ObjCMethodDecl *OMD,
240  const ObjCContainerDecl *CD) = 0;
241 
242  /// Generates prologue for direct Objective-C Methods.
244  llvm::Function *Fn,
245  const ObjCMethodDecl *OMD,
246  const ObjCContainerDecl *CD) = 0;
247 
248  /// Return the runtime function for getting properties.
249  virtual llvm::FunctionCallee GetPropertyGetFunction() = 0;
250 
251  /// Return the runtime function for setting properties.
252  virtual llvm::FunctionCallee GetPropertySetFunction() = 0;
253 
254  /// Return the runtime function for optimized setting properties.
255  virtual llvm::FunctionCallee GetOptimizedPropertySetFunction(bool atomic,
256  bool copy) = 0;
257 
258  // API for atomic copying of qualified aggregates in getter.
259  virtual llvm::FunctionCallee GetGetStructFunction() = 0;
260  // API for atomic copying of qualified aggregates in setter.
261  virtual llvm::FunctionCallee GetSetStructFunction() = 0;
262  /// API for atomic copying of qualified aggregates with non-trivial copy
263  /// assignment (c++) in setter.
264  virtual llvm::FunctionCallee GetCppAtomicObjectSetFunction() = 0;
265  /// API for atomic copying of qualified aggregates with non-trivial copy
266  /// assignment (c++) in getter.
267  virtual llvm::FunctionCallee GetCppAtomicObjectGetFunction() = 0;
268 
269  /// GetClass - Return a reference to the class for the given
270  /// interface decl.
271  virtual llvm::Value *GetClass(CodeGenFunction &CGF,
272  const ObjCInterfaceDecl *OID) = 0;
273 
274 
276  llvm_unreachable("autoreleasepool unsupported in this ABI");
277  }
278 
279  /// EnumerationMutationFunction - Return the function that's called by the
280  /// compiler when a mutation is detected during foreach iteration.
281  virtual llvm::FunctionCallee EnumerationMutationFunction() = 0;
282 
284  const ObjCAtSynchronizedStmt &S) = 0;
285  virtual void EmitTryStmt(CodeGen::CodeGenFunction &CGF,
286  const ObjCAtTryStmt &S) = 0;
287  virtual void EmitThrowStmt(CodeGen::CodeGenFunction &CGF,
288  const ObjCAtThrowStmt &S,
289  bool ClearInsertionPoint=true) = 0;
291  Address AddrWeakObj) = 0;
293  llvm::Value *src, Address dest) = 0;
295  llvm::Value *src, Address dest,
296  bool threadlocal=false) = 0;
298  llvm::Value *src, Address dest,
299  llvm::Value *ivarOffset) = 0;
301  llvm::Value *src, Address dest) = 0;
302 
304  QualType ObjectTy,
305  llvm::Value *BaseValue,
306  const ObjCIvarDecl *Ivar,
307  unsigned CVRQualifiers) = 0;
309  const ObjCInterfaceDecl *Interface,
310  const ObjCIvarDecl *Ivar) = 0;
312  Address DestPtr,
313  Address SrcPtr,
314  llvm::Value *Size) = 0;
315  virtual llvm::Constant *BuildGCBlockLayout(CodeGen::CodeGenModule &CGM,
316  const CodeGen::CGBlockInfo &blockInfo) = 0;
317  virtual llvm::Constant *BuildRCBlockLayout(CodeGen::CodeGenModule &CGM,
318  const CodeGen::CGBlockInfo &blockInfo) = 0;
320  const CGBlockInfo &blockInfo) {
321  return {};
322  }
323 
324  /// Returns an i8* which points to the byref layout information.
325  virtual llvm::Constant *BuildByrefLayout(CodeGen::CodeGenModule &CGM,
326  QualType T) = 0;
327 
330  llvm::PointerType *MessengerType;
331 
333  llvm::PointerType *messengerType)
334  : CallInfo(callInfo), MessengerType(messengerType) {}
335  };
336 
337  MessageSendInfo getMessageSendInfo(const ObjCMethodDecl *method,
338  QualType resultType,
341  const ObjCMethodDecl *method,
342  bool isSuper,
343  const ObjCInterfaceDecl *classReceiver,
344  llvm::Value *receiver);
345  static bool isWeakLinkedClass(const ObjCInterfaceDecl *cls);
346 
347  /// Destroy the callee-destroyed arguments of the given method,
348  /// if it has any. Used for nil-receiver paths in message sends.
349  /// Never does anything if the method does not satisfy
350  /// hasParamDestroyedInCallee().
351  ///
352  /// \param callArgs - just the formal arguments, not including implicit
353  /// arguments such as self and cmd
355  const ObjCMethodDecl *method,
356  const CallArgList &callArgs);
357 
358  // FIXME: This probably shouldn't be here, but the code to compute
359  // it is here.
361  const ObjCInterfaceDecl *ID,
362  const ObjCIvarDecl *Ivar);
363 };
364 
365 /// Creates an instance of an Objective-C runtime class.
366 //TODO: This should include some way of selecting which runtime to target.
367 CGObjCRuntime *CreateGNUObjCRuntime(CodeGenModule &CGM);
368 CGObjCRuntime *CreateMacObjCRuntime(CodeGenModule &CGM);
369 }
370 }
371 #endif
clang::CodeGen::CGObjCRuntime::BuildByrefLayout
virtual llvm::Constant * BuildByrefLayout(CodeGen::CodeGenModule &CGM, QualType T)=0
Returns an i8* which points to the byref layout information.
clang::ObjCInterfaceDecl
Represents an ObjC class declaration.
Definition: DeclObjC.h:1151
clang::CodeGen::CGObjCRuntime::GetClass
virtual llvm::Value * GetClass(CodeGenFunction &CGF, const ObjCInterfaceDecl *OID)=0
GetClass - Return a reference to the class for the given interface decl.
clang::ObjCCompatibleAliasDecl
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2721
llvm
Definition: Dominators.h:30
clang::CodeGen::ConstantAddress
A specialization of Address that requires the address to be an LLVM Constant.
Definition: Address.h:74
clang::CodeGen::CGObjCRuntime::CGM
CodeGen::CodeGenModule & CGM
Definition: CGObjCRuntime.h:66
clang::CodeGen::RValue
RValue - This trivial value class is used to represent the result of an expression that is evaluated.
Definition: CGValue.h:39
clang::CodeGen::CGObjCRuntime::GetPropertyGetFunction
virtual llvm::FunctionCallee GetPropertyGetFunction()=0
Return the runtime function for getting properties.
clang::CodeGen::CGObjCRuntime::GenerateMessageSend
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
Generate an Objective-C message send operation.
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::CodeGen::CGObjCRuntime::EmitGCMemmoveCollectable
virtual void EmitGCMemmoveCollectable(CodeGen::CodeGenFunction &CGF, Address DestPtr, Address SrcPtr, llvm::Value *Size)=0
clang::ObjCImplementationDecl
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2546
clang::CodeGen::CGObjCRuntime::GetOptimizedPropertySetFunction
virtual llvm::FunctionCallee GetOptimizedPropertySetFunction(bool atomic, bool copy)=0
Return the runtime function for optimized setting properties.
clang::CodeGen::CGObjCRuntime::EmitAtSynchronizedStmt
void EmitAtSynchronizedStmt(CodeGenFunction &CGF, const ObjCAtSynchronizedStmt &S, llvm::FunctionCallee syncEnterFn, llvm::FunctionCallee syncExitFn)
Emits an @synchronize() statement, using the syncEnterFn and syncExitFn arguments as the functions ca...
Definition: CGObjCRuntime.cpp:325
clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset
LValue EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF, const ObjCInterfaceDecl *OID, llvm::Value *BaseValue, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers, llvm::Value *Offset)
Definition: CGObjCRuntime.cpp:53
clang::CodeGen::CGObjCRuntime::CGObjCRuntime
CGObjCRuntime(CodeGen::CodeGenModule &CGM)
Definition: CGObjCRuntime.h:67
clang::CodeGen::CGObjCRuntime::GetRuntimeProtocolList
std::vector< const ObjCProtocolDecl * > GetRuntimeProtocolList(ObjCProtocolDecl::protocol_iterator begin, ObjCProtocolDecl::protocol_iterator end)
Walk the list of protocol references from a class, category or protocol to traverse the DAG formed fr...
Definition: CGObjC.cpp:464
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:673
clang::CodeGen::CGObjCRuntime::EmitObjCValueForIvar
virtual LValue EmitObjCValueForIvar(CodeGen::CodeGenFunction &CGF, QualType ObjectTy, llvm::Value *BaseValue, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers)=0
clang::CodeGen::CGBlockInfo
CGBlockInfo - Information to generate a block literal.
Definition: CGBlocks.h:152
clang::ObjCAtTryStmt
Represents Objective-C's @try ... @catch ... @finally statement.
Definition: StmtObjC.h:165
clang::CodeGen::CGObjCRuntime::getMessageSendInfo
MessageSendInfo getMessageSendInfo(const ObjCMethodDecl *method, QualType resultType, CallArgList &callArgs)
Compute the pointer-to-function type to which a message send should be casted in order to correctly c...
Definition: CGObjCRuntime.cpp:361
clang::CodeGen::CGObjCRuntime::destroyCalleeDestroyedArguments
static void destroyCalleeDestroyedArguments(CodeGenFunction &CGF, const ObjCMethodDecl *method, const CallArgList &callArgs)
Destroy the callee-destroyed arguments of the given method, if it has any.
Definition: CGObjCRuntime.cpp:431
clang::CodeGen::CGObjCRuntime::ModuleInitFunction
virtual llvm::Function * ModuleInitFunction()=0
Generate the function required to register all Objective-C components in this compilation unit with t...
clang::CodeGen::CGObjCRuntime::EmitObjCIvarAssign
virtual void EmitObjCIvarAssign(CodeGen::CodeGenFunction &CGF, llvm::Value *src, Address dest, llvm::Value *ivarOffset)=0
DeclObjC.h
Offset
unsigned Offset
Definition: Format.cpp:2335
clang::CodeGen::CGObjCRuntime::GetCppAtomicObjectGetFunction
virtual llvm::FunctionCallee GetCppAtomicObjectGetFunction()=0
API for atomic copying of qualified aggregates with non-trivial copy assignment (c++) in getter.
clang::CodeGen::CGObjCRuntime::MessageSendInfo
Definition: CGObjCRuntime.h:328
clang::CodeGen::ReturnValueSlot
ReturnValueSlot - Contains the address where the return value of a function can be stored,...
Definition: CGCall.h:362
clang::CodeGen::CGObjCRuntime::getRCBlockLayoutStr
virtual std::string getRCBlockLayoutStr(CodeGen::CodeGenModule &CGM, const CGBlockInfo &blockInfo)
Definition: CGObjCRuntime.h:319
CGCall.h
clang::CodeGen::CGObjCRuntime::EmitThrowStmt
virtual void EmitThrowStmt(CodeGen::CodeGenFunction &CGF, const ObjCAtThrowStmt &S, bool ClearInsertionPoint=true)=0
clang::CodeGen::CGObjCRuntime::GetSelector
virtual llvm::Value * GetSelector(CodeGenFunction &CGF, Selector Sel)=0
Get a selector for the specified name and type values.
clang::CodeGen::CGObjCRuntime::GenerateProtocol
virtual void GenerateProtocol(const ObjCProtocolDecl *OPD)=0
Generate the named protocol.
clang::CodeGen::CGObjCRuntime::BuildRCBlockLayout
virtual llvm::Constant * BuildRCBlockLayout(CodeGen::CodeGenModule &CGM, const CodeGen::CGBlockInfo &blockInfo)=0
CGValue.h
clang::CodeGen::CGObjCRuntime::EmitNSAutoreleasePoolClassRef
virtual llvm::Value * EmitNSAutoreleasePoolClassRef(CodeGenFunction &CGF)
Definition: CGObjCRuntime.h:275
clang::ObjCAtThrowStmt
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:332
clang::CodeGen::CGObjCRuntime::getSymbolNameForMethod
std::string getSymbolNameForMethod(const ObjCMethodDecl *method, bool includeCategoryName=true)
Definition: CGObjCRuntime.cpp:471
clang::index::SymbolKind::Module
@ Module
CGCleanup.h
clang::ObjCAtSynchronizedStmt
Represents Objective-C's @synchronized statement.
Definition: StmtObjC.h:277
clang::CodeGen::CGObjCRuntime::EmitTryStmt
virtual void EmitTryStmt(CodeGen::CodeGenFunction &CGF, const ObjCAtTryStmt &S)=0
IdentifierTable.h
clang::CodeGen::CGObjCRuntime::EmitObjCWeakRead
virtual llvm::Value * EmitObjCWeakRead(CodeGen::CodeGenFunction &CGF, Address AddrWeakObj)=0
clang::CodeGen::CGObjCRuntime::EnumerationMutationFunction
virtual llvm::FunctionCallee EnumerationMutationFunction()=0
EnumerationMutationFunction - Return the function that's called by the compiler when a mutation is de...
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:876
clang::CodeGen::CGObjCRuntime::GetGetStructFunction
virtual llvm::FunctionCallee GetGetStructFunction()=0
clang::CodeGen::CGObjCRuntime::GenerateCategory
virtual void GenerateCategory(const ObjCCategoryImplDecl *OCD)=0
Generate a category.
clang::CodeGen::CGObjCRuntime::MessageSendInfo::MessageSendInfo
MessageSendInfo(const CGFunctionInfo &callInfo, llvm::PointerType *messengerType)
Definition: CGObjCRuntime.h:332
clang::StringLiteral
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1761
clang::CodeGen::CGObjCRuntime::GenerateProtocolRef
virtual llvm::Value * GenerateProtocolRef(CodeGenFunction &CGF, const ObjCProtocolDecl *OPD)=0
Emit the code to return the named protocol as an object, as in a @protocol expression.
clang::ObjCCategoryImplDecl
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2493
clang::CodeGen::Address
An aligned address.
Definition: Address.h:24
clang::CodeGen::CGObjCRuntime::EmitInitOfCatchParam
void EmitInitOfCatchParam(CodeGenFunction &CGF, llvm::Value *exn, const VarDecl *paramDecl)
Definition: CGObjCRuntime.cpp:288
clang::CodeGen::CGObjCRuntime::GetPropertySetFunction
virtual llvm::FunctionCallee GetPropertySetFunction()=0
Return the runtime function for setting properties.
clang::CodeGen::CGObjCRuntime::GenerateMessageSendSuper
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
Generate an Objective-C message send operation to the super class initiated in a method for Class and...
clang::CodeGen::CGObjCRuntime::EmitIvarOffset
virtual llvm::Value * EmitIvarOffset(CodeGen::CodeGenFunction &CGF, const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar)=0
clang::CodeGen::CGObjCRuntime::EmitSynchronizedStmt
virtual void EmitSynchronizedStmt(CodeGen::CodeGenFunction &CGF, const ObjCAtSynchronizedStmt &S)=0
clang::CodeGen::CreateMacObjCRuntime
CGObjCRuntime * CreateMacObjCRuntime(CodeGenModule &CGM)
clang::CodeGen::CreateGNUObjCRuntime
CGObjCRuntime * CreateGNUObjCRuntime(CodeGenModule &CGM)
Creates an instance of an Objective-C runtime class.
Definition: CGObjCGNU.cpp:4195
clang::CodeGen::CGObjCRuntime::GeneratePossiblySpecializedMessageSend
CodeGen::RValue GeneratePossiblySpecializedMessageSend(CodeGenFunction &CGF, ReturnValueSlot Return, QualType ResultType, Selector Sel, llvm::Value *Receiver, const CallArgList &Args, const ObjCInterfaceDecl *OID, const ObjCMethodDecl *Method, bool isClassMessage)
Generate an Objective-C message send operation.
Definition: CGObjC.cpp:436
clang::CodeGen::LValue
LValue - This represents an lvalue references.
Definition: CGValue.h:167
clang::CodeGen::CGObjCRuntime::GenerateMethod
virtual llvm::Function * GenerateMethod(const ObjCMethodDecl *OMD, const ObjCContainerDecl *CD)=0
Generate a function preamble for a method with the specified types.
clang::CodeGen::CodeGenFunction
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
Definition: CodeGenFunction.h:235
clang::CodeGen::CGObjCRuntime::~CGObjCRuntime
virtual ~CGObjCRuntime()
Definition: CGObjC.cpp:4027
clang::CodeGen::CGObjCRuntime::GenerateDirectMethodPrologue
virtual void GenerateDirectMethodPrologue(CodeGenFunction &CGF, llvm::Function *Fn, const ObjCMethodDecl *OMD, const ObjCContainerDecl *CD)=0
Generates prologue for direct Objective-C Methods.
clang::CodeGen::CGObjCRuntime::EmitObjCWeakAssign
virtual void EmitObjCWeakAssign(CodeGen::CodeGenFunction &CGF, llvm::Value *src, Address dest)=0
clang::CodeGen::CodeGenModule
This class organizes the cross-function state that is used while generating LLVM code.
Definition: CodeGenModule.h:284
Value
Value
Definition: UninitializedValues.cpp:102
CGBuilder.h
clang::CodeGen::CGObjCRuntime::RegisterAlias
virtual void RegisterAlias(const ObjCCompatibleAliasDecl *OAD)=0
Register an class alias.
clang::CodeGen::CGObjCRuntime::GenerateConstantString
virtual ConstantAddress GenerateConstantString(const StringLiteral *)=0
Generate a constant string object.
clang::CodeGen::CGObjCRuntime::ComputeBitfieldBitOffset
unsigned ComputeBitfieldBitOffset(CodeGen::CodeGenModule &CGM, const ObjCInterfaceDecl *ID, const ObjCIvarDecl *Ivar)
Definition: CGObjCRuntime.cpp:45
clang::CodeGen::CGObjCRuntime::GetCppAtomicObjectSetFunction
virtual llvm::FunctionCallee GetCppAtomicObjectSetFunction()=0
API for atomic copying of qualified aggregates with non-trivial copy assignment (c++) in setter.
clang::CodeGen::CGObjCRuntime::GenerateClass
virtual void GenerateClass(const ObjCImplementationDecl *OID)=0
Generate a class structure for this class.
clang::CodeGen::CGObjCRuntime::canMessageReceiverBeNull
bool canMessageReceiverBeNull(CodeGenFunction &CGF, const ObjCMethodDecl *method, bool isSuper, const ObjCInterfaceDecl *classReceiver, llvm::Value *receiver)
Definition: CGObjCRuntime.cpp:388
clang::CodeGen::CGObjCRuntime::GetSetStructFunction
virtual llvm::FunctionCallee GetSetStructFunction()=0
clang::CodeGen::CGFunctionInfo
CGFunctionInfo - Class to encapsulate the information about a function definition.
Definition: CGFunctionInfo.h:546
clang::ObjCMethodDecl
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
clang::Builtin::ID
ID
Definition: Builtins.h:48
clang::CodeGen::CGObjCRuntime::getCatchAllTypeInfo
virtual CatchTypeInfo getCatchAllTypeInfo()
Definition: CGObjCRuntime.h:147
clang
Definition: CalledOnceCheck.h:17
clang::Selector
Smart pointer class that efficiently represents Objective-C method names.
Definition: IdentifierTable.h:748
clang::CodeGen::CatchTypeInfo
The MS C++ ABI needs a pointer to RTTI data plus some flags to describe the type of a catch handler,...
Definition: CGCleanup.h:37
clang::ObjCIvarDecl
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1924
clang::CodeGen::CGObjCRuntime::GetOrEmitProtocol
virtual llvm::Constant * GetOrEmitProtocol(const ObjCProtocolDecl *PD)=0
GetOrEmitProtocol - Get the protocol object for the given declaration, emitting it if necessary.
clang::CodeGen::CGObjCRuntime::isWeakLinkedClass
static bool isWeakLinkedClass(const ObjCInterfaceDecl *cls)
Definition: CGObjCRuntime.cpp:422
clang::CodeGen::CGObjCRuntime::MessageSendInfo::CallInfo
const CGFunctionInfo & CallInfo
Definition: CGObjCRuntime.h:329
clang::ObjCProtocolDecl
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2050
clang::transformer::callArgs
RangeSelector callArgs(std::string ID)
Definition: RangeSelector.cpp:298
clang::CodeGen::CGObjCRuntime::BuildGCBlockLayout
virtual llvm::Constant * BuildGCBlockLayout(CodeGen::CodeGenModule &CGM, const CodeGen::CGBlockInfo &blockInfo)=0
clang::CodeGen::CGObjCRuntime::EmitObjCGlobalAssign
virtual void EmitObjCGlobalAssign(CodeGen::CodeGenFunction &CGF, llvm::Value *src, Address dest, bool threadlocal=false)=0
clang::CodeGen::CGObjCRuntime::EmitObjCStrongCastAssign
virtual void EmitObjCStrongCastAssign(CodeGen::CodeGenFunction &CGF, llvm::Value *src, Address dest)=0
clang::ObjCContainerDecl
ObjCContainerDecl - Represents a container for method declarations.
Definition: DeclObjC.h:948
clang::index::SymbolKind::Function
@ Function
clang::CodeGen::CGObjCRuntime::ComputeIvarBaseOffset
uint64_t ComputeIvarBaseOffset(CodeGen::CodeGenModule &CGM, const ObjCInterfaceDecl *OID, const ObjCIvarDecl *Ivar)
Compute an offset to the given ivar, suitable for passing to EmitValueForIvarAtOffset.
Definition: CGObjCRuntime.cpp:30
clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt
void EmitTryCatchStmt(CodeGenFunction &CGF, const ObjCAtTryStmt &S, llvm::FunctionCallee beginCatchFn, llvm::FunctionCallee endCatchFn, llvm::FunctionCallee exceptionRethrowFn)
Emits a try / catch statement.
Definition: CGObjCRuntime.cpp:143
clang::ObjCProtocolDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:2112
clang::CodeGen::CGObjCRuntime::GetAddrOfSelector
virtual Address GetAddrOfSelector(CodeGenFunction &CGF, Selector Sel)=0
Get the address of a selector for the specified name and type values.
clang::CodeGen::CallArgList
CallArgList - Type for representing both the value and type of arguments in a call.
Definition: CGCall.h:264
clang::CodeGen::CGObjCRuntime::GetEHType
virtual llvm::Constant * GetEHType(QualType T)=0
Get the type constant to catch for the given ObjC pointer type.
clang::CodeGen::CGObjCRuntime
Implements runtime-specific code generation functions.
Definition: CGObjCRuntime.h:64
clang::CodeGen::CGObjCRuntime::MessageSendInfo::MessengerType
llvm::PointerType * MessengerType
Definition: CGObjCRuntime.h:330
Type
MatchType Type
Definition: ASTMatchFinder.cpp:70