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 | 5bcdf24a50a587af807decdfb060a4f35a373a18 (patch) | |
| tree | 13c934844e8289bf5c88c4e0804a4e16261692dc /clang/CodeGen/CodeGenModule.h | |
| parent | c48023bd5b648252b1d504452cb2cd09818c7813 (diff) | |
| download | bcm5719-llvm-5bcdf24a50a587af807decdfb060a4f35a373a18.tar.gz bcm5719-llvm-5bcdf24a50a587af807decdfb060a4f35a373a18.zip | |
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; }
llvm-svn: 44509
Diffstat (limited to 'clang/CodeGen/CodeGenModule.h')
| -rw-r--r-- | clang/CodeGen/CodeGenModule.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/clang/CodeGen/CodeGenModule.h b/clang/CodeGen/CodeGenModule.h index dd4c006a125..027c8303aa2 100644 --- a/clang/CodeGen/CodeGenModule.h +++ b/clang/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 |

