diff options
author | Anders Carlsson <andersca@mac.com> | 2009-09-11 00:07:24 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-09-11 00:07:24 +0000 |
commit | 73fcc95f0fdebdae62dbef9174b8a775c01affe9 (patch) | |
tree | fc7eda0efedc7c2861adacafc154624e7e1f8711 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 11ff570292bc776efc2ee29e49c0620934275f34 (diff) | |
download | bcm5719-llvm-73fcc95f0fdebdae62dbef9174b8a775c01affe9.tar.gz bcm5719-llvm-73fcc95f0fdebdae62dbef9174b8a775c01affe9.zip |
Pass GlobalDecls to GenerateCode and StartFunction.
llvm-svn: 81485
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index d5b0bfa6a8d..c8ac249540e 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/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<const Decl*, 2> Value; - void init(const Decl *D) { + void Init(const Decl *D) { assert(!isa<CXXConstructorDecl>(D) && "Use other ctor with ctor decls!"); assert(!isa<CXXDestructorDecl>(D) && "Use other ctor with dtor decls!"); - assert(isa<VarDecl>(D) || isa<FunctionDecl>(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) |