aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-11 00:07:24 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-11 00:07:24 +0000
commit0ff8bafde95f6fa51ccea70738c1b99db870bddc (patch)
treeb290b7d3e83628560c4f13023792a630f679e424 /lib/CodeGen/CodeGenModule.h
parent555b4bb2749aea2ec8e2adc351a71ec1cb9bdc33 (diff)
Pass GlobalDecls to GenerateCode and StartFunction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r--lib/CodeGen/CodeGenModule.h13
1 files changed, 7 insertions, 6 deletions
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<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)