clang  16.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 CGFunctionInfo;
38 class CodeGenFunction;
39 }
40 
41  class FieldDecl;
42  class ObjCAtTryStmt;
43  class ObjCAtThrowStmt;
44  class ObjCAtSynchronizedStmt;
45  class ObjCContainerDecl;
46  class ObjCCategoryImplDecl;
47  class ObjCImplementationDecl;
48  class ObjCInterfaceDecl;
49  class ObjCMessageExpr;
50  class ObjCMethodDecl;
51  class ObjCProtocolDecl;
52  class Selector;
53  class ObjCIvarDecl;
54  class ObjCStringLiteral;
55  class BlockDeclRefExpr;
56 
57 namespace CodeGen {
58  class CodeGenModule;
59  class CGBlockInfo;
60 
61 // FIXME: Several methods should be pure virtual but aren't to avoid the
62 // partially-implemented subclass breaking.
63 
64 /// Implements runtime-specific code generation functions.
66 protected:
69 
70  // Utility functions for unified ivar access. These need to
71  // eventually be folded into other places (the structure layout
72  // code).
73 
74  /// Compute an offset to the given ivar, suitable for passing to
75  /// EmitValueForIvarAtOffset. Note that the correct handling of
76  /// bit-fields is carefully coordinated by these two, use caution!
77  ///
78  /// The latter overload is suitable for computing the offset of a
79  /// sythesized ivar.
81  const ObjCInterfaceDecl *OID,
82  const ObjCIvarDecl *Ivar);
84  const ObjCImplementationDecl *OID,
85  const ObjCIvarDecl *Ivar);
86 
88  const ObjCInterfaceDecl *OID,
89  llvm::Value *BaseValue,
90  const ObjCIvarDecl *Ivar,
91  unsigned CVRQualifiers,
92  llvm::Value *Offset);
93  /// Emits a try / catch statement. This function is intended to be called by
94  /// subclasses, and provides a generic mechanism for generating these, which
95  /// should be usable by all runtimes. The caller must provide the functions
96  /// to call when entering and exiting a \@catch() block, and the function
97  /// used to rethrow exceptions. If the begin and end catch functions are
98  /// NULL, then the function assumes that the EH personality function provides
99  /// the thrown object directly.
100  void EmitTryCatchStmt(CodeGenFunction &CGF, const ObjCAtTryStmt &S,
101  llvm::FunctionCallee beginCatchFn,
102  llvm::FunctionCallee endCatchFn,
103  llvm::FunctionCallee exceptionRethrowFn);
104 
105  void EmitInitOfCatchParam(CodeGenFunction &CGF, llvm::Value *exn,
106  const VarDecl *paramDecl);
107 
108  /// Emits an \@synchronize() statement, using the \p syncEnterFn and
109  /// \p syncExitFn arguments as the functions called to lock and unlock
110  /// the object. This function can be called by subclasses that use
111  /// zero-cost exception handling.
113  const ObjCAtSynchronizedStmt &S,
114  llvm::FunctionCallee syncEnterFn,
115  llvm::FunctionCallee syncExitFn);
116 
117 public:
118  virtual ~CGObjCRuntime();
119 
121  bool includeCategoryName = true);
122 
123  /// Generate the function required to register all Objective-C components in
124  /// this compilation unit with the runtime library.
125  virtual llvm::Function *ModuleInitFunction() = 0;
126 
127  /// Get a selector for the specified name and type values.
128  /// The result should have the LLVM type for ASTContext::getObjCSelType().
129  virtual llvm::Value *GetSelector(CodeGenFunction &CGF, Selector Sel) = 0;
130 
131  /// Get the address of a selector for the specified name and type values.
132  /// This is a rarely-used language extension, but sadly it exists.
133  ///
134  /// The result should have the LLVM type for a pointer to
135  /// ASTContext::getObjCSelType().
136  virtual Address GetAddrOfSelector(CodeGenFunction &CGF, Selector Sel) = 0;
137 
138  /// Get a typed selector.
139  virtual llvm::Value *GetSelector(CodeGenFunction &CGF,
140  const ObjCMethodDecl *Method) = 0;
141 
142  /// Get the type constant to catch for the given ObjC pointer type.
143  /// This is used externally to implement catching ObjC types in C++.
144  /// Runtimes which don't support this should add the appropriate
145  /// error to Sema.
146  virtual llvm::Constant *GetEHType(QualType T) = 0;
147 
148  virtual CatchTypeInfo getCatchAllTypeInfo() { return { nullptr, 0 }; }
149 
150  /// Generate a constant string object.
152 
153  /// Generate a category. A category contains a list of methods (and
154  /// accompanying metadata) and a list of protocols.
155  virtual void GenerateCategory(const ObjCCategoryImplDecl *OCD) = 0;
156 
157  /// Generate a class structure for this class.
158  virtual void GenerateClass(const ObjCImplementationDecl *OID) = 0;
159 
160  /// Register an class alias.
161  virtual void RegisterAlias(const ObjCCompatibleAliasDecl *OAD) = 0;
162 
163  /// Generate an Objective-C message send operation.
164  ///
165  /// \param Method - The method being called, this may be null if synthesizing
166  /// a property setter or getter.
167  virtual CodeGen::RValue
169  ReturnValueSlot ReturnSlot,
170  QualType ResultType,
171  Selector Sel,
172  llvm::Value *Receiver,
173  const CallArgList &CallArgs,
174  const ObjCInterfaceDecl *Class = nullptr,
175  const ObjCMethodDecl *Method = nullptr) = 0;
176 
177  /// Generate an Objective-C message send operation.
178  ///
179  /// This variant allows for the call to be substituted with an optimized
180  /// variant.
183  ReturnValueSlot Return,
184  QualType ResultType,
185  Selector Sel,
186  llvm::Value *Receiver,
187  const CallArgList& Args,
188  const ObjCInterfaceDecl *OID,
189  const ObjCMethodDecl *Method,
190  bool isClassMessage);
191 
192  /// Generate an Objective-C message send operation to the super
193  /// class initiated in a method for Class and with the given Self
194  /// object.
195  ///
196  /// \param Method - The method being called, this may be null if synthesizing
197  /// a property setter or getter.
198  virtual CodeGen::RValue
200  ReturnValueSlot ReturnSlot,
201  QualType ResultType,
202  Selector Sel,
203  const ObjCInterfaceDecl *Class,
204  bool isCategoryImpl,
205  llvm::Value *Self,
206  bool IsClassMessage,
207  const CallArgList &CallArgs,
208  const ObjCMethodDecl *Method = nullptr) = 0;
209 
210  /// Walk the list of protocol references from a class, category or
211  /// protocol to traverse the DAG formed from it's inheritance hierarchy. Find
212  /// the list of protocols that ends each walk at either a runtime
213  /// protocol or a non-runtime protocol with no parents. For the common case of
214  /// just a list of standard runtime protocols this just returns the same list
215  /// that was passed in.
216  std::vector<const ObjCProtocolDecl *>
219 
220  /// Emit the code to return the named protocol as an object, as in a
221  /// \@protocol expression.
222  virtual llvm::Value *GenerateProtocolRef(CodeGenFunction &CGF,
223  const ObjCProtocolDecl *OPD) = 0;
224 
225  /// Generate the named protocol. Protocols contain method metadata but no
226  /// implementations.
227  virtual void GenerateProtocol(const ObjCProtocolDecl *OPD) = 0;
228 
229  /// GetOrEmitProtocol - Get the protocol object for the given
230  /// declaration, emitting it if necessary. The return value has type
231  /// ProtocolPtrTy.
232  virtual llvm::Constant *GetOrEmitProtocol(const ObjCProtocolDecl *PD) = 0;
233 
234  /// Generate a function preamble for a method with the specified
235  /// types.
236 
237  // FIXME: Current this just generates the Function definition, but really this
238  // should also be generating the loads of the parameters, as the runtime
239  // should have full control over how parameters are passed.
240  virtual llvm::Function *GenerateMethod(const ObjCMethodDecl *OMD,
241  const ObjCContainerDecl *CD) = 0;
242 
243  /// Generates prologue for direct Objective-C Methods.
245  llvm::Function *Fn,
246  const ObjCMethodDecl *OMD,
247  const ObjCContainerDecl *CD) = 0;
248 
249  /// Return the runtime function for getting properties.
250  virtual llvm::FunctionCallee GetPropertyGetFunction() = 0;
251 
252  /// Return the runtime function for setting properties.
253  virtual llvm::FunctionCallee GetPropertySetFunction() = 0;
254 
255  /// Return the runtime function for optimized setting properties.
256  virtual llvm::FunctionCallee GetOptimizedPropertySetFunction(bool atomic,
257  bool copy) = 0;
258 
259  // API for atomic copying of qualified aggregates in getter.
260  virtual llvm::FunctionCallee GetGetStructFunction() = 0;
261  // API for atomic copying of qualified aggregates in setter.
262  virtual llvm::FunctionCallee GetSetStructFunction() = 0;
263  /// API for atomic copying of qualified aggregates with non-trivial copy
264  /// assignment (c++) in setter.
265  virtual llvm::FunctionCallee GetCppAtomicObjectSetFunction() = 0;
266  /// API for atomic copying of qualified aggregates with non-trivial copy
267  /// assignment (c++) in getter.
268  virtual llvm::FunctionCallee GetCppAtomicObjectGetFunction() = 0;
269 
270  /// GetClass - Return a reference to the class for the given
271  /// interface decl.
272  virtual llvm::Value *GetClass(CodeGenFunction &CGF,
273  const ObjCInterfaceDecl *OID) = 0;
274 
275 
276  virtual llvm::Value *EmitNSAutoreleasePoolClassRef(CodeGenFunction &CGF) {
277  llvm_unreachable("autoreleasepool unsupported in this ABI");
278  }
279 
280  /// EnumerationMutationFunction - Return the function that's called by the
281  /// compiler when a mutation is detected during foreach iteration.
282  virtual llvm::FunctionCallee EnumerationMutationFunction() = 0;
283 
285  const ObjCAtSynchronizedStmt &S) = 0;
286  virtual void EmitTryStmt(CodeGen::CodeGenFunction &CGF,
287  const ObjCAtTryStmt &S) = 0;
288  virtual void EmitThrowStmt(CodeGen::CodeGenFunction &CGF,
289  const ObjCAtThrowStmt &S,
290  bool ClearInsertionPoint=true) = 0;
291  virtual llvm::Value *EmitObjCWeakRead(CodeGen::CodeGenFunction &CGF,
292  Address AddrWeakObj) = 0;
294  llvm::Value *src, Address dest) = 0;
296  llvm::Value *src, Address dest,
297  bool threadlocal=false) = 0;
299  llvm::Value *src, Address dest,
300  llvm::Value *ivarOffset) = 0;
302  llvm::Value *src, Address dest) = 0;
303 
305  QualType ObjectTy,
306  llvm::Value *BaseValue,
307  const ObjCIvarDecl *Ivar,
308  unsigned CVRQualifiers) = 0;
309  virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
310  const ObjCInterfaceDecl *Interface,
311  const ObjCIvarDecl *Ivar) = 0;
313  Address DestPtr,
314  Address SrcPtr,
315  llvm::Value *Size) = 0;
316  virtual llvm::Constant *BuildGCBlockLayout(CodeGen::CodeGenModule &CGM,
317  const CodeGen::CGBlockInfo &blockInfo) = 0;
318  virtual llvm::Constant *BuildRCBlockLayout(CodeGen::CodeGenModule &CGM,
319  const CodeGen::CGBlockInfo &blockInfo) = 0;
321  const CGBlockInfo &blockInfo) {
322  return {};
323  }
324 
325  /// Returns an i8* which points to the byref layout information.
326  virtual llvm::Constant *BuildByrefLayout(CodeGen::CodeGenModule &CGM,
327  QualType T) = 0;
328 
331  llvm::PointerType *MessengerType;
332 
334  llvm::PointerType *messengerType)
335  : CallInfo(callInfo), MessengerType(messengerType) {}
336  };
337 
338  MessageSendInfo getMessageSendInfo(const ObjCMethodDecl *method,
339  QualType resultType,
342  const ObjCMethodDecl *method,
343  bool isSuper,
344  const ObjCInterfaceDecl *classReceiver,
345  llvm::Value *receiver);
346  static bool isWeakLinkedClass(const ObjCInterfaceDecl *cls);
347 
348  /// Destroy the callee-destroyed arguments of the given method,
349  /// if it has any. Used for nil-receiver paths in message sends.
350  /// Never does anything if the method does not satisfy
351  /// hasParamDestroyedInCallee().
352  ///
353  /// \param callArgs - just the formal arguments, not including implicit
354  /// arguments such as self and cmd
356  const ObjCMethodDecl *method,
357  const CallArgList &callArgs);
358 
359  // FIXME: This probably shouldn't be here, but the code to compute
360  // it is here.
362  const ObjCInterfaceDecl *ID,
363  const ObjCIvarDecl *Ivar);
364 };
365 
366 /// Creates an instance of an Objective-C runtime class.
367 //TODO: This should include some way of selecting which runtime to target.
368 CGObjCRuntime *CreateGNUObjCRuntime(CodeGenModule &CGM);
369 CGObjCRuntime *CreateMacObjCRuntime(CodeGenModule &CGM);
370 }
371 }
372 #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:1148
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:2740
llvm
YAML serialization mapping.
Definition: Dominators.h:30
clang::CodeGen::ConstantAddress
A specialization of Address that requires the address to be an LLVM Constant.
Definition: Address.h:140
clang::CodeGen::CGObjCRuntime::CGM
CodeGen::CodeGenModule & CGM
Definition: CGObjCRuntime.h:67
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:2565
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:326
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:54
clang::CodeGen::CGObjCRuntime::CGObjCRuntime
CGObjCRuntime(CodeGen::CodeGenModule &CGM)
Definition: CGObjCRuntime.h:68
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:467
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:737
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:156
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:362
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:434
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:2717
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:329
clang::CodeGen::ReturnValueSlot
ReturnValueSlot - Contains the address where the return value of a function can be stored,...
Definition: CGCall.h:357
clang::CodeGen::CGObjCRuntime::getRCBlockLayoutStr
virtual std::string getRCBlockLayoutStr(CodeGen::CodeGenModule &CGM, const CGBlockInfo &blockInfo)
Definition: CGObjCRuntime.h:320
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:276
hlsl::uint64_t
unsigned long uint64_t
Definition: hlsl_basic_types.h:25
clang::ObjCAtThrowStmt
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:357
clang::CodeGen::CGObjCRuntime::getSymbolNameForMethod
std::string getSymbolNameForMethod(const ObjCMethodDecl *method, bool includeCategoryName=true)
Definition: CGObjCRuntime.cpp:474
clang::index::SymbolKind::Module
@ Module
CGCleanup.h
clang::ObjCAtSynchronizedStmt
Represents Objective-C's @synchronized statement.
Definition: StmtObjC.h:302
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:906
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:333
clang::StringLiteral
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1776
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:2512
clang::CodeGen::Address
An aligned address.
Definition: Address.h:74
clang::CodeGen::CGObjCRuntime::EmitInitOfCatchParam
void EmitInitOfCatchParam(CodeGenFunction &CGF, llvm::Value *exn, const VarDecl *paramDecl)
Definition: CGObjCRuntime.cpp:289
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:4204
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:439
clang::CodeGen::LValue
LValue - This represents an lvalue references.
Definition: CGValue.h:171
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:231
clang::CodeGen::CGObjCRuntime::~CGObjCRuntime
virtual ~CGObjCRuntime()
Definition: CGObjC.cpp:4105
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:279
Value
Value
Definition: UninitializedValues.cpp:103
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:46
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:391
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:52
clang::CodeGen::CGObjCRuntime::getCatchAllTypeInfo
virtual CatchTypeInfo getCatchAllTypeInfo()
Definition: CGObjCRuntime.h:148
clang
Definition: CalledOnceCheck.h:17
clang::Selector
Smart pointer class that efficiently represents Objective-C method names.
Definition: IdentifierTable.h:759
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:36
clang::ObjCIvarDecl
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1920
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:425
clang::CodeGen::CGObjCRuntime::MessageSendInfo::CallInfo
const CGFunctionInfo & CallInfo
Definition: CGObjCRuntime.h:330
clang::ObjCProtocolDecl
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2049
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:943
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:31
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:144
clang::ObjCProtocolDecl::protocol_iterator
ObjCProtocolList::iterator protocol_iterator
Definition: DeclObjC.h:2122
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:259
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:65
clang::CodeGen::CGObjCRuntime::MessageSendInfo::MessengerType
llvm::PointerType * MessengerType
Definition: CGObjCRuntime.h:331
Type
MatchType Type
Definition: ASTMatchFinder.cpp:71