summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-15 09:22:45 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-15 09:22:45 +0000
commite3dc1707b530dd264417390f1510c99c166eb103 (patch)
tree930defae9890f4e57bda489693591a534d17341e /clang/lib/CodeGen/CodeGenModule.cpp
parentcd3858b103195a2fa1ff2a5221e34d0680584c73 (diff)
downloadbcm5719-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.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 2a057a1866b..5a45df24fe8 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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() {
OpenPOWER on IntegriCloud