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 | 7d4e1c5e4ade927d37a387920455f3eb770601c0 (patch) | |
tree | 9fcb70dc6c32ff024830af5570e1d84afe8a7714 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 7b4dfc8b78defcc6ae1f5964ccd17137a1ae7c90 (diff) | |
download | bcm5719-llvm-7d4e1c5e4ade927d37a387920455f3eb770601c0.tar.gz bcm5719-llvm-7d4e1c5e4ade927d37a387920455f3eb770601c0.zip |
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.
llvm-svn: 69797
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index ba0b28ac975..0247b693faf 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1369,11 +1369,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { case Decl::ObjCClass: case Decl::ObjCForwardProtocol: case Decl::ObjCCategory: - break; case Decl::ObjCInterface: - // If we already laid out this interface due to an @class, and if we - // codegen'd a reference it, update the 'opaque' type to be a real type now. - Types.UpdateCompletedType(cast<ObjCInterfaceDecl>(D)); break; case Decl::ObjCProtocol: |