From 0ff8bafde95f6fa51ccea70738c1b99db870bddc Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 11 Sep 2009 00:07:24 +0000 Subject: Pass GlobalDecls to GenerateCode and StartFunction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81485 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.h') diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index d5b0bfa6a8..c8ac249540 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -17,6 +17,7 @@ #include "clang/Basic/LangOptions.h" #include "clang/AST/Attr.h" #include "clang/AST/DeclCXX.h" +#include "clang/AST/DeclObjC.h" #include "CGBlocks.h" #include "CGCall.h" #include "CGCXX.h" @@ -74,11 +75,9 @@ namespace CodeGen { class GlobalDecl { llvm::PointerIntPair Value; - void init(const Decl *D) { + void Init(const Decl *D) { assert(!isa(D) && "Use other ctor with ctor decls!"); assert(!isa(D) && "Use other ctor with dtor decls!"); - assert(isa(D) || isa(D) - && "Invalid decl type passed to GlobalDecl ctor!"); Value.setPointer(D); } @@ -86,9 +85,11 @@ class GlobalDecl { public: GlobalDecl() {} - GlobalDecl(const VarDecl *D) { init(D);} - GlobalDecl(const FunctionDecl *D) { init(D); } - + GlobalDecl(const VarDecl *D) { Init(D);} + GlobalDecl(const FunctionDecl *D) { Init(D); } + GlobalDecl(const BlockDecl *D) { Init(D); } + GlobalDecl(const ObjCMethodDecl *D) { Init(D); } + GlobalDecl(const CXXConstructorDecl *D, CXXCtorType Type) : Value(D, Type) {} GlobalDecl(const CXXDestructorDecl *D, CXXDtorType Type) -- cgit v1.2.3-18-g5258