diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 2aa97de2b09..607f2a172c2 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -73,32 +73,32 @@ namespace CodeGen { // a regular VarDecl or a FunctionDecl. class GlobalDecl { llvm::PointerIntPair<const ValueDecl*, 2> Value; - + public: GlobalDecl() {} - + explicit GlobalDecl(const ValueDecl *VD) : Value(VD, 0) { assert(!isa<CXXConstructorDecl>(VD) && "Use other ctor with ctor decls!"); assert(!isa<CXXDestructorDecl>(VD) && "Use other ctor with dtor decls!"); } - GlobalDecl(const CXXConstructorDecl *D, CXXCtorType Type) + GlobalDecl(const CXXConstructorDecl *D, CXXCtorType Type) : Value(D, Type) {} GlobalDecl(const CXXDestructorDecl *D, CXXDtorType Type) : Value(D, Type) {} - + const ValueDecl *getDecl() const { return Value.getPointer(); } - + CXXCtorType getCtorType() const { assert(isa<CXXConstructorDecl>(getDecl()) && "Decl is not a ctor!"); return static_cast<CXXCtorType>(Value.getInt()); } - + CXXDtorType getDtorType() const { assert(isa<CXXDestructorDecl>(getDecl()) && "Decl is not a dtor!"); return static_cast<CXXDtorType>(Value.getInt()); } }; - + /// CodeGenModule - This class organizes the cross-function state that is used /// while generating LLVM code. class CodeGenModule : public BlockModule { @@ -176,11 +176,11 @@ class CodeGenModule : public BlockModule { /// CXXGlobalInits - Variables with global initializers that need to run /// before main. std::vector<const VarDecl*> CXXGlobalInits; - + /// CFConstantStringClassRef - Cached reference to the class for constant /// strings. This value has type int * but is actually an Obj-C class pointer. llvm::Constant *CFConstantStringClassRef; - + llvm::LLVMContext &VMContext; public: CodeGenModule(ASTContext &C, const CompileOptions &CompileOpts, @@ -255,7 +255,7 @@ public: /// GetAddrOfConstantStringFromObjCEncode - Return a pointer to a constant /// array for the given ObjCEncodeExpr node. llvm::Constant *GetAddrOfConstantStringFromObjCEncode(const ObjCEncodeExpr *); - + /// GetAddrOfConstantString - Returns a pointer to a character array /// containing the literal. This contents are exactly that of the given /// string, i.e. it will not be null terminated automatically; see @@ -280,14 +280,14 @@ public: /// GetAddrOfCXXConstructor - Return the address of the constructor of the /// given type. - llvm::Function *GetAddrOfCXXConstructor(const CXXConstructorDecl *D, + llvm::Function *GetAddrOfCXXConstructor(const CXXConstructorDecl *D, CXXCtorType Type); /// GetAddrOfCXXDestructor - Return the address of the constructor of the /// given type. - llvm::Function *GetAddrOfCXXDestructor(const CXXDestructorDecl *D, + llvm::Function *GetAddrOfCXXDestructor(const CXXDestructorDecl *D, CXXDtorType Type); - + /// getBuiltinLibFunction - Given a builtin id for a function like /// "__builtin_fabsf", return a Function* for "fabsf". llvm::Value *getBuiltinLibFunction(unsigned BuiltinID); @@ -378,9 +378,9 @@ public: const char *getMangledName(const GlobalDecl &D); const char *getMangledName(const NamedDecl *ND); - const char *getMangledCXXCtorName(const CXXConstructorDecl *D, + const char *getMangledCXXCtorName(const CXXConstructorDecl *D, CXXCtorType Type); - const char *getMangledCXXDtorName(const CXXDestructorDecl *D, + const char *getMangledCXXDtorName(const CXXDestructorDecl *D, CXXDtorType Type); void EmitTentativeDefinition(const VarDecl *D); @@ -392,12 +392,12 @@ public: GVA_StrongExternal, GVA_TemplateInstantiation }; - + private: /// UniqueMangledName - Unique a name by (if necessary) inserting it into the /// MangledNames string map. const char *UniqueMangledName(const char *NameStart, const char *NameEnd); - + llvm::Constant *GetOrCreateLLVMFunction(const char *MangledName, const llvm::Type *Ty, GlobalDecl D); @@ -407,7 +407,7 @@ private: void DeferredCopyConstructorToEmit(GlobalDecl D); void DeferredCopyAssignmentToEmit(GlobalDecl D); void DeferredDestructorToEmit(GlobalDecl D); - + /// SetCommonAttributes - Set attributes which are common to any /// form of a global definition (alias, Objective-C method, /// function, global variable). @@ -416,9 +416,9 @@ private: void SetCommonAttributes(const Decl *D, llvm::GlobalValue *GV); /// SetFunctionDefinitionAttributes - Set attributes for a global definition. - void SetFunctionDefinitionAttributes(const FunctionDecl *D, + void SetFunctionDefinitionAttributes(const FunctionDecl *D, llvm::GlobalValue *GV); - + /// SetFunctionAttributes - Set function attributes for a function /// declaration. void SetFunctionAttributes(const FunctionDecl *FD, @@ -437,29 +437,29 @@ private: void EmitObjCPropertyImplementations(const ObjCImplementationDecl *D); // C++ related functions. - + void EmitNamespace(const NamespaceDecl *D); void EmitLinkageSpec(const LinkageSpecDecl *D); /// EmitCXXConstructors - Emit constructors (base, complete) from a /// C++ constructor Decl. void EmitCXXConstructors(const CXXConstructorDecl *D); - + /// EmitCXXConstructor - Emit a single constructor with the given type from /// a C++ constructor Decl. void EmitCXXConstructor(const CXXConstructorDecl *D, CXXCtorType Type); - - /// EmitCXXDestructors - Emit destructors (base, complete) from a + + /// EmitCXXDestructors - Emit destructors (base, complete) from a /// C++ destructor Decl. void EmitCXXDestructors(const CXXDestructorDecl *D); - + /// EmitCXXDestructor - Emit a single destructor with the given type from /// a C++ destructor Decl. void EmitCXXDestructor(const CXXDestructorDecl *D, CXXDtorType Type); - + /// EmitCXXGlobalInitFunc - Emit a function that initializes C++ globals. void EmitCXXGlobalInitFunc(); - + // FIXME: Hardcoding priority here is gross. void AddGlobalCtor(llvm::Function *Ctor, int Priority=65535); void AddGlobalDtor(llvm::Function *Dtor, int Priority=65535); |