summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-08 08:22:06 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-08 08:22:06 +0000
commitad7c5c1657f2504537bb62298f9372873c63d508 (patch)
tree2a6f5a80a514910228be09928ec2b813f131681c /clang/lib/CodeGen/CodeGenFunction.cpp
parentf9399453c38f8c7ea5d2784847119937c440e40e (diff)
downloadbcm5719-llvm-ad7c5c1657f2504537bb62298f9372873c63d508.tar.gz
bcm5719-llvm-ad7c5c1657f2504537bb62298f9372873c63d508.zip
Reorganize CodeGen{Function,Module} to eliminate the unfortunate
Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index d8879438719..66114c87a45 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -29,9 +29,9 @@ using namespace clang;
using namespace CodeGen;
CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
- : BlockFunction(cgm, *this, Builder), CGM(cgm),
- Target(CGM.getContext().Target),
+ : 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),
SwitchInsn(0), CaseRangeBlock(0),
@@ -46,6 +46,7 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
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;
@@ -192,12 +193,11 @@ void CodeGenFunction::EmitFunctionInstrumentation(const char *Fn) {
std::vector<const llvm::Type*> ProfileFuncArgs;
// void __cyg_profile_func_{enter,exit} (void *this_fn, void *call_site);
- PointerTy = llvm::Type::getInt8PtrTy(VMContext);
+ PointerTy = Int8PtrTy;
ProfileFuncArgs.push_back(PointerTy);
ProfileFuncArgs.push_back(PointerTy);
- FunctionTy = llvm::FunctionType::get(
- llvm::Type::getVoidTy(VMContext),
- ProfileFuncArgs, false);
+ FunctionTy = llvm::FunctionType::get(llvm::Type::getVoidTy(getLLVMContext()),
+ ProfileFuncArgs, false);
llvm::Constant *F = CGM.CreateRuntimeFunction(FunctionTy, Fn);
llvm::CallInst *CallSite = Builder.CreateCall(
@@ -671,8 +671,6 @@ llvm::BasicBlock *CodeGenFunction::GetIndirectGotoBlock() {
CGBuilderTy TmpBuilder(createBasicBlock("indirectgoto"));
- const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(VMContext);
-
// Create the PHI node that indirect gotos will add entries to.
llvm::Value *DestVal = TmpBuilder.CreatePHI(Int8PtrTy, "indirect.goto.dest");
OpenPOWER on IntegriCloud