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 | d4808924450e86391475b7c6e6c119cd642ae971 (patch) | |
tree | 6fa1597da14c0600a825823161b452148fbf8cca /clang/lib/CodeGen/CodeGenModule.h | |
parent | d6a7b72944cefcc7c780f1a635706756755d98b7 (diff) | |
download | bcm5719-llvm-d4808924450e86391475b7c6e6c119cd642ae971.tar.gz bcm5719-llvm-d4808924450e86391475b7c6e6c119cd642ae971.zip |
pull "runtime globals" into the same framework as other functions/global variables.
No intended functionality change.
llvm-svn: 67478
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 91030e7aa35..bea2d15c404 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/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. |