diff options
author | John McCall <rjmccall@apple.com> | 2011-02-15 09:22:45 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-15 09:22:45 +0000 |
commit | e3dc1707b530dd264417390f1510c99c166eb103 (patch) | |
tree | 930defae9890f4e57bda489693591a534d17341e /clang/lib/CodeGen/CodeGenModule.h | |
parent | cd3858b103195a2fa1ff2a5221e34d0680584c73 (diff) | |
download | bcm5719-llvm-e3dc1707b530dd264417390f1510c99c166eb103.tar.gz bcm5719-llvm-e3dc1707b530dd264417390f1510c99c166eb103.zip |
Assorted cleanup:
- Have CGM precompute a number of commonly-used types
- Have CGF copy that during initialization instead of recomputing them
- Use TBAA info when initializing a parameter variable
- Refactor the scalar ++/-- code
llvm-svn: 125562
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 5d2e581ec35..b6bd37c1c0d 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -94,10 +94,39 @@ namespace CodeGen { return priority == RHS.priority && lex_order < RHS.lex_order; } }; + + struct CodeGenTypeCache { + /// i8, i32, and i64 + const llvm::IntegerType *Int8Ty, *Int32Ty, *Int64Ty; + + /// int + const llvm::IntegerType *IntTy; + + /// intptr_t and size_t, which we assume are the same + union { + const llvm::IntegerType *IntPtrTy; + const llvm::IntegerType *SizeTy; + }; + + /// void* in address space 0 + union { + const llvm::PointerType *VoidPtrTy; + const llvm::PointerType *Int8PtrTy; + }; + + /// void** in address space 0 + union { + const llvm::PointerType *VoidPtrPtrTy; + const llvm::PointerType *Int8PtrPtrTy; + }; + + /// The width of an address-zero pointer. + unsigned char PointerWidthInBits; + }; /// CodeGenModule - This class organizes the cross-function state that is used /// while generating LLVM code. -class CodeGenModule { +class CodeGenModule : public CodeGenTypeCache { CodeGenModule(const CodeGenModule&); // DO NOT IMPLEMENT void operator=(const CodeGenModule&); // DO NOT IMPLEMENT @@ -227,8 +256,6 @@ public: /// Release - Finalize LLVM code generation. void Release(); - const llvm::PointerType *Int8PtrTy; - /// getObjCRuntime() - Return a reference to the configured /// Objective-C runtime. CGObjCRuntime &getObjCRuntime() { |