aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-08-05 23:31:02 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-08-05 23:31:02 +0000
commit3c827a79cb7d04c255db8080e682ee2c6912373d (patch)
treefd060f3c7825d061c686097a8350195989cca939 /lib/CodeGen/CodeGenModule.h
parent608b17f792691c9e3dcdd2dfbe95b593aece0b40 (diff)
Change CodeGen of global decls to key off of the name (instead of
having multiple bindings from all the possible decls which conceptually map to the same global). - This eliminates CodeGen depending on the LLVM module for name lookup. - This also eliminates the need for ReplaceMapValuesWith (hurrah). - This handles lookups for FunctionDecls correctly in the presence of aliases, this was previously broken. - WIP: Can still clean up & unify variable and function emission. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r--lib/CodeGen/CodeGenModule.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h
index c243590955..d90ebb4b36 100644
--- a/lib/CodeGen/CodeGenModule.h
+++ b/lib/CodeGen/CodeGenModule.h
@@ -69,11 +69,13 @@ class CodeGenModule {
llvm::Function *MemMoveFn;
llvm::Function *MemSetFn;
- /// GlobalDeclMap - Mapping of decls to global variables we have
+ /// GlobalDeclMap - Mapping of decl names global variables we have
/// already emitted. Note that the entries in this map are the
- /// actual global and therefore may not be of the same type as the
- /// decl, they should be bitcasted on retrieval.
- llvm::DenseMap<const Decl*, llvm::GlobalValue*> GlobalDeclMap;
+ /// actual globals and therefore may not be of the same type as the
+ /// decl, they should be bitcasted on retrieval. Also note that the
+ /// globals are keyed on their source name, not the global name
+ /// (which may change with attributes such as asm-labels).
+ llvm::StringMap<llvm::GlobalValue*> GlobalDeclMap;
/// List of static global for which code generation is delayed. When
/// the translation unit has been fully processed we will lazily
@@ -172,11 +174,6 @@ public:
VisibilityAttr::VisibilityTypes);
private:
- /// ReplaceMapValuesWith - This is a really slow and bad function that
- /// searches for any entries in GlobalDeclMap that point to OldVal, changing
- /// them to point to NewVal. This is badbadbad, FIXME!
- void ReplaceMapValuesWith(llvm::GlobalValue *OldVal, llvm::GlobalValue *NewVal);
-
void SetFunctionAttributes(const FunctionDecl *FD,
llvm::Function *F,
const llvm::FunctionType *FTy);