">

clang: lib/CodeGen/CGObjCMac.cpp File Reference (original) (raw)

#include "[CGBlocks.h](CGBlocks%5F8h%5Fsource.html)"
#include "[CGCleanup.h](CGCleanup%5F8h%5Fsource.html)"
#include "[CGObjCRuntime.h](CGObjCRuntime%5F8h%5Fsource.html)"
#include "[CGRecordLayout.h](CGRecordLayout%5F8h%5Fsource.html)"
#include "[CodeGenFunction.h](CodeGenFunction%5F8h%5Fsource.html)"
#include "[CodeGenModule.h](CodeGenModule%5F8h%5Fsource.html)"
#include "[clang/AST/ASTContext.h](ASTContext%5F8h%5Fsource.html)"
#include "[clang/AST/Attr.h](AST%5F2Attr%5F8h%5Fsource.html)"
#include "[clang/AST/Decl.h](Decl%5F8h%5Fsource.html)"
#include "[clang/AST/DeclObjC.h](DeclObjC%5F8h%5Fsource.html)"
#include "[clang/AST/Mangle.h](Mangle%5F8h%5Fsource.html)"
#include "[clang/AST/RecordLayout.h](RecordLayout%5F8h%5Fsource.html)"
#include "[clang/AST/StmtObjC.h](StmtObjC%5F8h%5Fsource.html)"
#include "[clang/Basic/CodeGenOptions.h](CodeGenOptions%5F8h%5Fsource.html)"
#include "[clang/Basic/LangOptions.h](LangOptions%5F8h%5Fsource.html)"
#include "[clang/CodeGen/ConstantInitBuilder.h](ConstantInitBuilder%5F8h%5Fsource.html)"
#include "llvm/ADT/CachedHashString.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdio>

Go to the source code of this file.

Enumerations
enum { kCFTaggedObjectID_Integer = (1 << 1) + 1 }
enum FragileClassFlags { FragileABI_Class_Factory = 0x00001 , FragileABI_Class_Meta = 0x00002 , FragileABI_Class_HasCXXStructors = 0x02000 , FragileABI_Class_Hidden = 0x20000 , FragileABI_Class_CompiledByARC = 0x04000000 , FragileABI_Class_HasMRCWeakIvars = 0x08000000 }
enum NonFragileClassFlags { NonFragileABI_Class_Meta = 0x00001 , NonFragileABI_Class_Root = 0x00002 , NonFragileABI_Class_HasCXXStructors = 0x00004 , NonFragileABI_Class_Hidden = 0x00010 , NonFragileABI_Class_Exception = 0x00020 , NonFragileABI_Class_HasIvarReleaser = 0x00040 , NonFragileABI_Class_CompiledByARC = 0x00080 , NonFragileABI_Class_HasCXXDestructorOnly = 0x00100 , NonFragileABI_Class_HasMRCWeakIvars = 0x00200 }
enum ImageInfoFlags { eImageInfo_FixAndContinue = (1 << 0) , eImageInfo_GarbageCollected = (1 << 1) , eImageInfo_GCOnly = (1 << 2) , eImageInfo_OptimizedByDyld = (1 << 3) , eImageInfo_CorrectedSynthesize = (1 << 4) , eImageInfo_ImageIsSimulated = (1 << 5) , eImageInfo_ClassProperties = (1 << 6) }
EmitImageInfo - Emit the image info marker used to encode some module level information. More...
Functions
static llvm::Constant * getConstantGEP (llvm::LLVMContext &VMContext, llvm::GlobalVariable *C, unsigned idx0, unsigned idx1)
getConstantGEP() - Help routine to construct simple GEPs.
static bool hasObjCExceptionAttribute (ASTContext &Context, const ObjCInterfaceDecl *OID)
hasObjCExceptionAttribute - Return true if this class or any super class has the objc_exception attribute.
static llvm::GlobalValue::LinkageTypes getLinkageTypeForObjCMetadata (CodeGenModule &CGM, StringRef Section)
static llvm::GlobalVariable * finishAndCreateGlobal (ConstantInitBuilder::StructBuilder &Builder, const llvm::Twine &Name, CodeGenModule &CGM)
A helper function to create an internal or private global variable.
static llvm::StringMapEntry< llvm::GlobalVariable * > & GetConstantStringEntry (llvm::StringMap< llvm::GlobalVariable * > &Map, const StringLiteral *Literal, unsigned &StringLength)
static Qualifiers::GC GetGCAttrTypeForType (ASTContext &Ctx, QualType FQT, bool pointee=false)
static std::string getBlockLayoutInfoString (const SmallVectorImpl< CGObjCCommonMac::RUN_SKIP > &RunSkipBlockVars, bool HasCopyDisposeHelpers)
static void PushProtocolProperties (llvm::SmallPtrSet< const IdentifierInfo *, 16 > &PropertySet, SmallVectorImpl< const ObjCPropertyDecl * > &Properties, const ObjCProtocolDecl *Proto, bool IsClassProperty)
static bool hasWeakMember (QualType type)
static bool hasMRCWeakIvars (CodeGenModule &CGM, const ObjCImplementationDecl *ID)
For compatibility, we only want to set the "HasMRCWeakIvars" flag (and actually fill in a layout string) if we really do have any __weak ivars.
static void addIfPresent (llvm::DenseSet< llvm::Value * > &S, Address V)
static llvm::GlobalValue::DLLStorageClassTypes getStorage (CodeGenModule &CGM, StringRef Name)

anonymous enum

FragileClassFlags

Enumerator
FragileABI_Class_Factory Apparently: is not a meta-class.
FragileABI_Class_Meta Is a meta-class.
FragileABI_Class_HasCXXStructors Has a non-trivial constructor or destructor.
FragileABI_Class_Hidden Has hidden visibility.
FragileABI_Class_CompiledByARC Class implementation was compiled under ARC.
FragileABI_Class_HasMRCWeakIvars Class implementation was compiled under MRC and has MRC weak ivars. Exclusive with CompiledByARC.

Definition at line 3398 of file CGObjCMac.cpp.

ImageInfoFlags

EmitImageInfo - Emit the image info marker used to encode some module level information.

See: rdr://4810609&4810587&4810587 struct IMAGE_INFO { unsigned version; unsigned flags; };

Enumerator
eImageInfo_FixAndContinue
eImageInfo_GarbageCollected
eImageInfo_GCOnly
eImageInfo_OptimizedByDyld
eImageInfo_CorrectedSynthesize
eImageInfo_ImageIsSimulated
eImageInfo_ClassProperties

Definition at line 5071 of file CGObjCMac.cpp.

NonFragileClassFlags

Enumerator
NonFragileABI_Class_Meta Is a meta-class.
NonFragileABI_Class_Root Is a root class.
NonFragileABI_Class_HasCXXStructors Has a non-trivial constructor or destructor.
NonFragileABI_Class_Hidden Has hidden visibility.
NonFragileABI_Class_Exception Has the exception attribute.
NonFragileABI_Class_HasIvarReleaser (Obsolete) ARC-specific: this class has a .release_ivars method
NonFragileABI_Class_CompiledByARC Class implementation was compiled under ARC.
NonFragileABI_Class_HasCXXDestructorOnly Class has non-trivial destructors, but zero-initialization is okay.
NonFragileABI_Class_HasMRCWeakIvars Class implementation was compiled under MRC and has MRC weak ivars. Exclusive with CompiledByARC.

Definition at line 3419 of file CGObjCMac.cpp.

addIfPresent()

finishAndCreateGlobal()

static llvm::GlobalVariable * finishAndCreateGlobal ( ConstantInitBuilder::StructBuilder & Builder, const llvm::Twine & Name, CodeGenModule & CGM ) static

getBlockLayoutInfoString()

static std::string getBlockLayoutInfoString ( const SmallVectorImpl< CGObjCCommonMac::RUN_SKIP > & RunSkipBlockVars, bool HasCopyDisposeHelpers ) static

getConstantGEP()

static llvm::Constant * getConstantGEP ( llvm::LLVMContext & VMContext, llvm::GlobalVariable * C, unsigned idx0, unsigned idx1 ) static

GetConstantStringEntry()

static llvm::StringMapEntry< llvm::GlobalVariable * > & GetConstantStringEntry ( llvm::StringMap< llvm::GlobalVariable * > & Map, const StringLiteral * Literal, unsigned & StringLength ) static

GetGCAttrTypeForType()

Definition at line 2230 of file CGObjCMac.cpp.

References clang::Qualifiers::GCNone, clang::Type::getAs(), GetGCAttrTypeForType(), clang::ASTContext::getLangOpts(), clang::QualType::getObjCLifetime(), clang::Type::isBlockPointerType(), clang::QualType::isObjCGCStrong(), clang::QualType::isObjCGCWeak(), clang::Type::isObjCObjectPointerType(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::Qualifiers::Strong, and clang::Qualifiers::Weak.

Referenced by GetGCAttrTypeForType().

getLinkageTypeForObjCMetadata()

static llvm::GlobalValue::LinkageTypes getLinkageTypeForObjCMetadata ( CodeGenModule & CGM, StringRef Section ) static

getStorage()

static llvm::GlobalValue::DLLStorageClassTypes getStorage ( CodeGenModule & CGM, StringRef Name ) static

hasMRCWeakIvars()

hasObjCExceptionAttribute()

hasWeakMember()

PushProtocolProperties()

ModuleVersion

const int ModuleVersion = 7 static