]> granicus.if.org Git - clang/commitdiff
Give ImplicitParamDecl a public constructor so that it can be allocated on
authorJohn McCall <rjmccall@apple.com>
Tue, 22 Feb 2011 22:25:56 +0000 (22:25 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 22 Feb 2011 22:25:56 +0000 (22:25 +0000)
the stack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126254 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
lib/AST/Decl.cpp

index 80b1ca07b85efd9654f83babd1d416ae85e82fc2..1d5d0fe68ba068a1deaa79987d22eb13670bdd01 100644 (file)
@@ -1034,16 +1034,18 @@ public:
 };
 
 class ImplicitParamDecl : public VarDecl {
-protected:
-  ImplicitParamDecl(Kind DK, DeclContext *DC, SourceLocation L,
-                    IdentifierInfo *Id, QualType Tw)
-    : VarDecl(DK, DC, L, Id, Tw, /*TInfo=*/0, SC_None, SC_None) {
-    setImplicit();
-  }
 public:
   static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC,
                                    SourceLocation L, IdentifierInfo *Id,
                                    QualType T);
+
+  ImplicitParamDecl(DeclContext *DC, SourceLocation loc,
+                    IdentifierInfo *name, QualType type)
+    : VarDecl(ImplicitParam, DC, loc, name, type,
+              /*tinfo*/ 0, SC_None, SC_None) {
+    setImplicit();
+  }
+
   // Implement isa/cast/dyncast/etc.
   static bool classof(const ImplicitParamDecl *D) { return true; }
   static bool classof(const Decl *D) { return classofKind(D->getKind()); }
index 56db8c7e330b27abe1ac3bb000651e632f733e7a..18c680b1fe77d9061cbc492ad465544e4dfb3aee 100644 (file)
@@ -2211,8 +2211,10 @@ NamespaceDecl *NamespaceDecl::getNextNamespace() {
 }
 
 ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC,
-    SourceLocation L, IdentifierInfo *Id, QualType T) {
-  return new (C) ImplicitParamDecl(ImplicitParam, DC, L, Id, T);
+                                             SourceLocation loc,
+                                             IdentifierInfo *name,
+                                             QualType type) {
+  return new (C) ImplicitParamDecl(DC, loc, name, type);
 }
 
 FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *DC,