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 | 5936e33bf74dd6bf126ceee0f6169a2593d03a69 (patch) | |
tree | 3164dc30585d3d19d444998cfaed95b1530357c3 /lib/CodeGen/CodeGenModule.cpp | |
parent | 718b01d077748989f860bd21ee3402852ed0ed86 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 2a057a1866..5a45df24fe 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -90,7 +90,17 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO, DebugInfo = CodeGenOpts.DebugInfo ? new CGDebugInfo(*this) : 0; Block.GlobalUniqueCount = 0; - Int8PtrTy = llvm::Type::getInt8PtrTy(M.getContext()); + + // Initialize the type cache. + llvm::LLVMContext &LLVMContext = M.getContext(); + Int8Ty = llvm::Type::getInt8Ty(LLVMContext); + Int32Ty = llvm::Type::getInt32Ty(LLVMContext); + Int64Ty = llvm::Type::getInt64Ty(LLVMContext); + PointerWidthInBits = C.Target.getPointerWidth(0); + IntTy = llvm::IntegerType::get(LLVMContext, C.Target.getIntWidth()); + IntPtrTy = llvm::IntegerType::get(LLVMContext, PointerWidthInBits); + Int8PtrTy = Int8Ty->getPointerTo(0); + Int8PtrPtrTy = Int8PtrTy->getPointerTo(0); } CodeGenModule::~CodeGenModule() { |