aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/ModuleBuilder.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-07-29 23:18:29 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-07-29 23:18:29 +0000
commitbd012ff1fa088181646a784f385b28867372d434 (patch)
tree1ebb8c8ea9f37c4b01ecc872d7030c0d0504e106 /lib/CodeGen/ModuleBuilder.cpp
parent4f95b750534f2111f28434b282bcbd5656002816 (diff)
Rework codegen emission of globals
- No (intended) functionality change. - Primary purpose is to clearly separate (lazy) construction of globals that are a forward declaration or tentative definition from those that are the final definition. - Lazy construction is now encapsulated in GetAddrOf{Function,GlobalVar} while final definitions are constructed in EmitGlobal{Function,Var}Definition. - External interface for dealing with globals is now limited to EmitGlobal and GetAddrOf{Function,GlobalVar}. - Also updated helper functions dealing with statics, annotations, and ctors to be private. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54179 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ModuleBuilder.cpp')
-rw-r--r--lib/CodeGen/ModuleBuilder.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp
index 3fa086fc6a..201092f4d8 100644
--- a/lib/CodeGen/ModuleBuilder.cpp
+++ b/lib/CodeGen/ModuleBuilder.cpp
@@ -66,7 +66,9 @@ namespace {
return;
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
- Builder->EmitFunction(FD);
+ Builder->EmitGlobal(FD);
+ } else if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
+ Builder->EmitGlobal(VD);
} else if (isa<ObjCClassDecl>(D)){
//Forward declaration. Only used for type checking.
} else if (ObjCProtocolDecl *PD = dyn_cast<ObjCProtocolDecl>(D)){
@@ -85,8 +87,6 @@ namespace {
// Ignore - generated when the implementation decl is CodeGen'd
} else if (ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)){
Builder->EmitObjCMethod(OMD);
- } else if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
- Builder->EmitGlobalVar(VD);
} else if (isa<ObjCClassDecl>(D) || isa<ObjCCategoryDecl>(D)) {
// Forward declaration. Only used for type checking.
} else if (ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)){