summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-14 17:12:03 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-14 17:12:03 +0000
commit40d009ff0cf336565a6fc86de120366133e1850d (patch)
treea47d972fb57e25fd8a237d47c45a67e51412352c /clang/lib/AST/DeclObjC.cpp
parent4a814568b2aaaa2cf83ca01ed404890d65f4c1a6 (diff)
downloadbcm5719-llvm-40d009ff0cf336565a6fc86de120366133e1850d.tar.gz
bcm5719-llvm-40d009ff0cf336565a6fc86de120366133e1850d.zip
Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline its
members into ObjCClassDecl, saving ourselves one pointer per forward declaration. llvm-svn: 146564
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 2157762e7fd..38efadf3b58 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -942,31 +942,21 @@ void ObjCProtocolDecl::completedForwardDecl() {
//===----------------------------------------------------------------------===//
ObjCClassDecl::ObjCClassDecl(DeclContext *DC, SourceLocation L,
- ObjCInterfaceDecl *const Elt,
- const SourceLocation Loc,
- ASTContext &C)
- : Decl(ObjCClass, DC, L) {
- setClass(C, Elt, Loc);
+ ObjCInterfaceDecl *Interface,
+ SourceLocation InterfaceLoc)
+ : Decl(ObjCClass, DC, L), Interface(Interface), InterfaceLoc(InterfaceLoc)
+{
}
ObjCClassDecl *ObjCClassDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L,
- ObjCInterfaceDecl *const Elt,
- const SourceLocation Loc) {
- return new (C) ObjCClassDecl(DC, L, Elt, Loc, C);
+ ObjCInterfaceDecl *Interface,
+ SourceLocation InterfaceLoc) {
+ return new (C) ObjCClassDecl(DC, L, Interface, InterfaceLoc);
}
-void ObjCClassDecl::setClass(ASTContext &C, ObjCInterfaceDecl*const Cls,
- const SourceLocation Loc) {
-
- ForwardDecl = (ObjCClassRef*) C.Allocate(sizeof(ObjCClassRef),
- llvm::alignOf<ObjCClassRef>());
- new (ForwardDecl) ObjCClassRef(Cls, Loc);
-}
-
SourceRange ObjCClassDecl::getSourceRange() const {
- // FIXME: We should include the semicolon
- return SourceRange(getLocation(), ForwardDecl->getLocation());
+ return SourceRange(getLocation(), InterfaceLoc);
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud