From 570585c91dee98d7ba8ccf1198c03208ba17966b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 21 Mar 2009 09:16:30 +0000 Subject: simplify and cleanup global variable creation stuff to all go through one code path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67445 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.h') diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 12da8c1e34..60031ab648 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -175,8 +175,11 @@ public: const llvm::TargetData &getTargetData() const { return TheTargetData; } /// GetAddrOfGlobalVar - Return the llvm::Constant for the address of the - /// given global variable. - llvm::Constant *GetAddrOfGlobalVar(const VarDecl *D); + /// given global variable. If Ty is non-null and if the global doesn't exist, + /// then it will be greated with the specified type instead of whatever the + /// normal requested type would be. + llvm::Constant *GetAddrOfGlobalVar(const VarDecl *D, + const llvm::Type *Ty = 0); /// GetAddrOfFunction - Return the address of the given function. If Ty is /// non-null, then this function will use the specified type if it has to -- cgit v1.2.3-70-g09d2