From b681b8ffab2aa016b3897916d5110927c34a584b Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 6 Mar 2009 22:13:30 +0000 Subject: (LLVM svn up) Generalize RuntimeFunctions to RuntimeGlobals and add CodeGenModule::CreateRuntimeVariable. - No real functionality change; although we now assert on silly things like: -- int objc_exception_throw; void f0() { @throw(@"A"); } -- instead of accepting it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66292 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.h') diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index a2b45a0b74..76ab0f8937 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -82,10 +82,11 @@ class CodeGenModule : public BlockModule { llvm::Function *MemMoveFn; llvm::Function *MemSetFn; - /// RuntimeFunctions - List of runtime functions whose names must be protected - /// from introducing conflicts. These functions should be created unnamed, we - /// will name them and patch up conflicts when we release the module. - std::vector< std::pair > RuntimeFunctions; + /// 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 > RuntimeGlobals; /// GlobalDeclMap - Mapping of decl names (represented as unique /// character pointers from either the identifier table or the set @@ -241,6 +242,10 @@ public: /// 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); void UpdateCompletedType(const TagDecl *D); @@ -340,7 +345,7 @@ private: /// references to global which may otherwise be optimized out. void EmitLLVMUsed(void); - void BindRuntimeFunctions(); + void BindRuntimeGlobals(); /// MayDeferGeneration - Determine if the given decl can be emitted /// lazily; this is only relevant for definitions. The given decl -- cgit v1.2.3-18-g5258