diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-07-29 23:18:29 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-07-29 23:18:29 +0000 |
commit | 9c426524f8c1e0cd3fb1b05ceefb903629a4cda8 (patch) | |
tree | ad75ea6eec15c8e9d0a6bee3b32c0c14ad7beea5 /clang/lib/CodeGen/ModuleBuilder.cpp | |
parent | 6b1cc46fee3cb5f5c3140f68036346eef0079100 (diff) | |
download | llvm-9c426524f8c1e0cd3fb1b05ceefb903629a4cda8.zip llvm-9c426524f8c1e0cd3fb1b05ceefb903629a4cda8.tar.gz llvm-9c426524f8c1e0cd3fb1b05ceefb903629a4cda8.tar.bz2 |
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.
llvm-svn: 54179
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
-rw-r--r-- | clang/lib/CodeGen/ModuleBuilder.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp index 3fa086f..201092f 100644 --- a/clang/lib/CodeGen/ModuleBuilder.cpp +++ b/clang/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)){ |