diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-09-08 23:44:31 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-09-08 23:44:31 +0000 |
commit | 219df6644e2338ff067471ab0d85f27b88544ac2 (patch) | |
tree | 8cea5994fd433549fa8a11054dbe62da56e7840a /lib/CodeGen/CodeGenModule.h | |
parent | 0dbe227feccf6a8dbadfff8ca3f80416b7bf2f28 (diff) |
Fix a number of issues w.r.t. emission of global for functions and
aliases.
- Attributes specific to a definition are only set when the
definition is seen.
- Alias generation is delayed until the end of the module; necessary
since the alias may reference forward.
- Fixes: PR2743, <rdr://6140807&6094512>
- Improves: <rdr://6095112> (added XFAIL)
Also, print module on verification failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55966 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 41985fbac6..bcb464b66a 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -79,11 +79,16 @@ class CodeGenModule { /// (which may change with attributes such as asm-labels). llvm::DenseMap<IdentifierInfo*, llvm::GlobalValue*> GlobalDeclMap; - /// List of static global for which code generation is delayed. When - /// the translation unit has been fully processed we will lazily - /// emit definitions for only the decls that were actually used. - /// This should contain only Function and Var decls, and only those - /// which actually define something. + /// Aliases - List of aliases in module. These cannot be emitted + /// until all the code has been seen, as they reference things by + /// name instead of directly and may reference forward. + std::vector<const FunctionDecl*> Aliases; + + /// StaticDecls - List of static global for which code generation is + /// delayed. When the translation unit has been fully processed we + /// will lazily emit definitions for only the decls that were + /// actually used. This should contain only Function and Var decls, + /// and only those which actually define something. std::vector<const ValueDecl*> StaticDecls; /// GlobalCtors - Store the list of global constructors and their @@ -213,7 +218,9 @@ public: private: /// SetFunctionAttributesForDefinition - Set function attributes /// specific to a function definition. - void SetFunctionAttributesForDefinition(llvm::Function *F); + /// \param D - The ObjCMethodDecl or FunctionDecl defining \arg F. + void SetFunctionAttributesForDefinition(const Decl *D, + llvm::Function *F); void SetFunctionAttributes(const FunctionDecl *FD, llvm::Function *F); @@ -238,9 +245,9 @@ private: /// or destructor array. void EmitCtorList(const CtorList &Fns, const char *GlobalName); + void EmitAliases(void); void EmitAnnotations(void); void EmitStatics(void); - }; } // end namespace CodeGen } // end namespace clang |