diff options
author | John McCall <rjmccall@apple.com> | 2010-04-21 10:05:39 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-21 10:05:39 +0000 |
commit | 3d3ec1c099ec8bfac3aa1fb0126fe515b7c7fa05 (patch) | |
tree | fc71638619df042442fe2a23c68c4264a007481c /lib/CodeGen/CodeGenFunction.h | |
parent | d8383d45e41ba2316610e5d638d2872e37b67cfb (diff) |
Miscellaneous codegen cleanups. Mostly, don't create new basic blocks
just to save the current insertion state! This change significantly
simplifies the IR CFG in exceptions code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101996 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index c43e0006e6..7072301b4b 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -148,19 +148,17 @@ public: /// block. class EHCleanupBlock { CodeGenFunction& CGF; - llvm::BasicBlock *Cont; + llvm::BasicBlock *PreviousInsertionBlock; llvm::BasicBlock *CleanupHandler; - llvm::BasicBlock *CleanupEntryBB; llvm::BasicBlock *PreviousInvokeDest; public: EHCleanupBlock(CodeGenFunction &cgf) - : CGF(cgf), Cont(CGF.createBasicBlock("cont")), - CleanupHandler(CGF.createBasicBlock("ehcleanup")), - CleanupEntryBB(CGF.createBasicBlock("ehcleanup.rest")), + : CGF(cgf), + PreviousInsertionBlock(CGF.Builder.GetInsertBlock()), + CleanupHandler(CGF.createBasicBlock("ehcleanup", CGF.CurFn)), PreviousInvokeDest(CGF.getInvokeDest()) { - CGF.EmitBranch(Cont); llvm::BasicBlock *TerminateHandler = CGF.getTerminateHandler(); - CGF.Builder.SetInsertPoint(CleanupEntryBB); + CGF.Builder.SetInsertPoint(CleanupHandler); CGF.setInvokeDest(TerminateHandler); } ~EHCleanupBlock(); @@ -706,6 +704,12 @@ public: RValue EmitAnyExprToTemp(const Expr *E, bool IsAggLocVolatile = false, bool IsInitializer = false); + /// EmitsAnyExprToMem - Emits the code necessary to evaluate an + /// arbitrary expression into the given memory location. + void EmitAnyExprToMem(const Expr *E, llvm::Value *Location, + bool IsLocationVolatile = false, + bool IsInitializer = false); + /// EmitAggregateCopy - Emit an aggrate copy. /// /// \param isVolatile - True iff either the source or the destination is |