diff options
author | John McCall <rjmccall@apple.com> | 2011-02-22 22:25:56 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-22 22:25:56 +0000 |
commit | 201e519ad9cc2863bc94cf799e407a81ed29181f (patch) | |
tree | c589ba772f9bb6b2f2b9464e64f710198e71666f | |
parent | aab9e315184d344bbd733f13b68915d02db7b32b (diff) |
Give ImplicitParamDecl a public constructor so that it can be allocated on
the stack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126254 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/Decl.h | 14 | ||||
-rw-r--r-- | lib/AST/Decl.cpp | 6 |
2 files changed, 12 insertions, 8 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 80b1ca07b8..1d5d0fe68b 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -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()); } diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 56db8c7e33..18c680b1fe 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -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, |