[cfe-commits] r126254 - in /cfe/trunk: include/clang/AST/Decl.h lib/AST/Decl.cpp

John McCall rjmccall at apple.com
Tue Feb 22 14:25:56 PST 2011


Author: rjmccall
Date: Tue Feb 22 16:25:56 2011
New Revision: 126254

URL: http://llvm.org/viewvc/llvm-project?rev=126254&view=rev
Log:
Give ImplicitParamDecl a public constructor so that it can be allocated on
the stack.


Modified:
    cfe/trunk/include/clang/AST/Decl.h
    cfe/trunk/lib/AST/Decl.cpp

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=126254&r1=126253&r2=126254&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Tue Feb 22 16:25:56 2011
@@ -1034,16 +1034,18 @@
 };
 
 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()); }

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=126254&r1=126253&r2=126254&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Tue Feb 22 16:25:56 2011
@@ -2211,8 +2211,10 @@
 }
 
 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,





More information about the cfe-commits mailing list