From 5936e33bf74dd6bf126ceee0f6169a2593d03a69 Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 15 Feb 2011 09:22:45 +0000 Subject: 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 --- lib/CodeGen/CodeGenFunction.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'lib/CodeGen/CodeGenFunction.cpp') diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 39aff78c73..ee8b98cdd4 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -29,8 +29,8 @@ using namespace clang; using namespace CodeGen; CodeGenFunction::CodeGenFunction(CodeGenModule &cgm) - : CGM(cgm), Target(CGM.getContext().Target), - Builder(cgm.getModule().getContext()), + : CodeGenTypeCache(cgm), CGM(cgm), + Target(CGM.getContext().Target), Builder(cgm.getModule().getContext()), BlockInfo(0), BlockPointer(0), NormalCleanupDest(0), EHCleanupDest(0), NextCleanupDestIndex(1), ExceptionSlot(0), DebugInfo(0), IndirectBranch(0), @@ -40,14 +40,6 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm) OutermostConditional(0), TerminateLandingPad(0), TerminateHandler(0), TrapBB(0) { - // Get some frequently used types. - LLVMPointerWidth = Target.getPointerWidth(0); - llvm::LLVMContext &LLVMContext = CGM.getLLVMContext(); - IntPtrTy = llvm::IntegerType::get(LLVMContext, LLVMPointerWidth); - Int32Ty = llvm::Type::getInt32Ty(LLVMContext); - Int64Ty = llvm::Type::getInt64Ty(LLVMContext); - Int8PtrTy = cgm.Int8PtrTy; - Exceptions = getContext().getLangOptions().Exceptions; CatchUndefined = getContext().getLangOptions().CatchUndefined; CGM.getCXXABI().getMangleContext().startNewFunction(); -- cgit v1.2.3-18-g5258