diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-04-22 10:28:39 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-04-22 10:28:39 +0000 |
commit | 412f59b23fc502b199b9ca96c72ef5d5ad21d62b (patch) | |
tree | 0a359e672859bbb876eb4c96af40d1b8f61b6e8a /lib/CodeGen/CodeGenTypes.h | |
parent | 84ad77a8f83121713ea69d8002d1fd19565f87ab (diff) |
Don't convert interface types (to structs) as part of CodeGenTypes.
- This has pros and cons, but for now the pros seem to significantly
outway the con.
The con is that we will always need to cast in the runtime
implementation to a struct type, if we wish to access an interface
directly.
The pros are:
- Avoid the cost of generating types which are used. Most
manipulation of Objective-C objects is done through messages, and
only the implementation of a class will directly access
memory. Previously, we would convert the type even if it only
appear as a function parameter, for example.
- We don't need to worry about incomplete types, and
UpdateCompletedType for interfaces is gone.
- It becomes easier to narrow the interface to the shadow struct for
Objective-C interfaces (so it can be eliminated).
Currently the runtimes still use the CodeGenTypes machinery to
generate the LLVM structure they need via ConvertTagDecl, but this can
eventually be replaced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenTypes.h')
-rw-r--r-- | lib/CodeGen/CodeGenTypes.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenTypes.h b/lib/CodeGen/CodeGenTypes.h index a23b8f651a..b72d8e9201 100644 --- a/lib/CodeGen/CodeGenTypes.h +++ b/lib/CodeGen/CodeGenTypes.h @@ -92,6 +92,12 @@ class CodeGenTypes { llvm::DenseMap<const Type*, llvm::PATypeHolder> FunctionTypes; + /// The opaque type map for Objective-C interfaces. All direct + /// manipulation is done by the runtime interfaces, which are + /// responsible for coercing to the appropriate type; these opaque + /// types are never refined. + llvm::DenseMap<const ObjCInterfaceType*, const llvm::Type *> InterfaceTypes; + /// CGRecordLayouts - This maps llvm struct type with corresponding /// record layout info. /// FIXME : If CGRecordLayout is less than 16 bytes then use @@ -162,8 +168,6 @@ public: /// UpdateCompletedType - When we find the full definition for a TagDecl, /// replace the 'opaque' type we previously made for it if applicable. void UpdateCompletedType(const TagDecl *TD); - /// Likewise for an ObjC Interface. - void UpdateCompletedType(const ObjCInterfaceDecl *OID); /// getFunctionInfo - Get the CGFunctionInfo for this function signature. const CGFunctionInfo &getFunctionInfo(QualType RetTy, |