diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-22 21:03:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-22 21:03:39 +0000 |
commit | 74391b48b4791cded373683a3baf67314f358d50 (patch) | |
tree | 97306981d77b22dded950a0e4659936e67a7193c /lib/CodeGen/CodeGenModule.h | |
parent | 3023ca870d545685881116f2c6e2bd5d1736e33c (diff) |
pull "runtime globals" into the same framework as other functions/global variables.
No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 91030e7aa3..bea2d15c40 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -82,12 +82,6 @@ class CodeGenModule : public BlockModule { llvm::Function *MemMoveFn; llvm::Function *MemSetFn; - /// RuntimeGlobal - List of runtime globals whose names must be - /// protected from introducing conflicts. These globals should be - /// created unnamed, we will name them and patch up conflicts when - /// we release the module. - std::vector<std::pair<llvm::GlobalValue*, std::string> > RuntimeGlobals; - /// GlobalDeclMap - Mapping of decl names (represented as unique /// character pointers from either the identifier table or the set /// of mangled names) to global variables we have already @@ -254,14 +248,14 @@ public: void AddAnnotation(llvm::Constant *C) { Annotations.push_back(C); } - /// CreateRuntimeFunction - Create a new runtime function whose name must be - /// protected from collisions. - llvm::Function *CreateRuntimeFunction(const llvm::FunctionType *Ty, - const std::string &Name); - /// CreateRuntimeVariable - Create a new runtime global variable - /// whose name must be protected from collisions. - llvm::GlobalVariable *CreateRuntimeVariable(const llvm::Type *Ty, - const std::string &Name); + /// CreateRuntimeFunction - Create a new runtime function with the specified + /// type and name. + llvm::Constant *CreateRuntimeFunction(const llvm::FunctionType *Ty, + const char *Name); + /// CreateRuntimeVariable - Create a new runtime global variable with the + /// specified type and name. + llvm::Constant *CreateRuntimeVariable(const llvm::Type *Ty, + const char *Name); void UpdateCompletedType(const TagDecl *D); @@ -306,6 +300,13 @@ public: private: + llvm::Constant *GetOrCreateLLVMFunction(const char *MangledName, + const llvm::Type *Ty, + const FunctionDecl *D); + llvm::Constant *GetOrCreateLLVMGlobal(const char *MangledName, + const llvm::PointerType *PTy, + const VarDecl *D); + /// SetGlobalValueAttributes - Set attributes for a global decl. void SetGlobalValueAttributes(const Decl *D, bool IsInternal, @@ -352,8 +353,6 @@ private: /// references to global which may otherwise be optimized out. void EmitLLVMUsed(void); - void BindRuntimeGlobals(); - /// MayDeferGeneration - Determine if the given decl can be emitted /// lazily; this is only relevant for definitions. The given decl /// must be either a function or var decl. |