diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-02 07:09:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-02 07:09:19 +0000 |
commit | 9cd4fe4af6d3e8b6dcfce9c2cdefcaafca7eed7c (patch) | |
tree | 951b238ba836eba03ff31ab6a77b8de7e0f9de57 /CodeGen/CodeGenModule.h | |
parent | 5a2fa14860813a8b93f68a84063dd20c690f045a (diff) |
Handle global variable definitions which change the type of a definition, such as:
extern int x[];
void foo() { x[0] = 1; }
int x[10];
void bar() { x[0] = 1; }
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenModule.h')
-rw-r--r-- | CodeGen/CodeGenModule.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/CodeGen/CodeGenModule.h b/CodeGen/CodeGenModule.h index dd4c006a12..027c8303aa 100644 --- a/CodeGen/CodeGenModule.h +++ b/CodeGen/CodeGenModule.h @@ -66,16 +66,11 @@ public: CodeGenTypes &getTypes() { return Types; } Diagnostic &getDiags() const { return Diags; } - llvm::Constant *GetAddrOfGlobalDecl(const ValueDecl *D); + llvm::Constant *GetAddrOfFunctionDecl(const FunctionDecl *D, + bool isDefinition); + llvm::Constant *GetAddrOfFileVarDecl(const FileVarDecl *D, + bool isDefinition); - void ChangeGlobalDeclMap(const Decl *Decl, llvm::Constant *NewVal) { - GlobalDeclMap[Decl] = NewVal; - } - - /// 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::Constant *OldVal, llvm::Constant *NewVal); /// getBuiltinLibFunction - Given a builtin id for a function like /// "__builtin_fabsf", return a Function* for "fabsf". @@ -92,6 +87,13 @@ public: llvm::Constant *EmitGlobalInit(const Expr *Expression); void PrintStats() {} + +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::Constant *OldVal, llvm::Constant *NewVal); + }; } // end namespace CodeGen } // end namespace clang |