summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-16 01:23:04 +0000
committerChris Lattner <sabre@nondot.org>2008-03-16 01:23:04 +0000
commitf87ca0a7d13e33c0e9e5bf0ac64d1392e3c2c0aa (patch)
tree78941244d417a869d7163360ab547aa82df49e6e /clang/lib
parent2a52083efc80a68f1318cb7a4178c9d32bcc333a (diff)
downloadbcm5719-llvm-f87ca0a7d13e33c0e9e5bf0ac64d1392e3c2c0aa.tar.gz
bcm5719-llvm-f87ca0a7d13e33c0e9e5bf0ac64d1392e3c2c0aa.zip
Give ObjCProtocolDecl a Create method.
llvm-svn: 48410
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/DeclObjC.cpp8
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp8
2 files changed, 12 insertions, 4 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 53ba8c12194..17b1d28cadb 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -47,6 +47,14 @@ ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, SourceLocation L,
return new (Mem) ObjCIvarDecl(L, Id, T);
}
+ObjCProtocolDecl *ObjCProtocolDecl::Create(ASTContext &C, SourceLocation L,
+ unsigned numRefProtos,
+ IdentifierInfo *Id,
+ bool ForwardDecl) {
+ void *Mem = C.getAllocator().Allocate<ObjCProtocolDecl>();
+ return new (Mem) ObjCProtocolDecl(L, numRefProtos, Id, ForwardDecl);
+}
+
//===----------------------------------------------------------------------===//
// Objective-C Decl Implementation
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index d5d658d4ff1..af57d09ce62 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -211,10 +211,10 @@ Sema::DeclTy *Sema::ActOnStartProtocolInterface(
}
}
else {
- PDecl = new ObjCProtocolDecl(AtProtoInterfaceLoc, NumProtoRefs,
- ProtocolName);
+ PDecl = ObjCProtocolDecl::Create(Context, AtProtoInterfaceLoc, NumProtoRefs,
+ ProtocolName);
ObjCProtocols[ProtocolName] = PDecl;
- }
+ }
if (NumProtoRefs) {
/// Check then save referenced protocols
@@ -260,7 +260,7 @@ Sema::ActOnForwardProtocolDeclaration(SourceLocation AtProtocolLoc,
ObjCProtocolDecl *PDecl = ObjCProtocols[P];
if (!PDecl) { // Not already seen?
// FIXME: Pass in the location of the identifier!
- PDecl = new ObjCProtocolDecl(AtProtocolLoc, 0, P, true);
+ PDecl = ObjCProtocolDecl::Create(Context, AtProtocolLoc, 0, P, true);
ObjCProtocols[P] = PDecl;
}
OpenPOWER on IntegriCloud