aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-07-23 18:04:17 +0000
committerTed Kremenek <kremenek@apple.com>2008-07-23 18:04:17 +0000
commitb8db21d4df5fbb6ce1ace6411b82d3d623d789de (patch)
tree0fafa7b5945e75bb7ff9eeb6d5ea41b1085cf588 /lib/AST/DeclObjC.cpp
parentf079570fcad0d0053e75ebae29c883ec4276e020 (diff)
When constructing an ObjCIvarDecl object in Sema, provide its visibility up front instead of setting it afterwards.
This change also fixes a subtle bug where the access control of an ivar would be initialized to garbage if we didn't have an explicit visibility specifier (e.g., @private). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r--lib/AST/DeclObjC.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 4b798474f6..9ba6e86cf0 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -87,9 +87,10 @@ void ObjCInterfaceDecl::Destroy(ASTContext& C) {
ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, SourceLocation L,
- IdentifierInfo *Id, QualType T, Expr *BW) {
+ IdentifierInfo *Id, QualType T,
+ AccessControl ac, Expr *BW) {
void *Mem = C.getAllocator().Allocate<ObjCIvarDecl>();
- return new (Mem) ObjCIvarDecl(L, Id, T, BW);
+ return new (Mem) ObjCIvarDecl(L, Id, T, ac, BW);
}
ObjCProtocolDecl *ObjCProtocolDecl::Create(ASTContext &C,