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 | 2188696d98f1b45a2de613107c684b97df9e9487 (patch) | |
tree | 79f76903490ad46766bd3a67655e1f240268906f /clang/lib/CodeGen/CodeGenFunction.h | |
parent | a668b45ebd70c88b9df46c7d420a247977dbf0e9 (diff) | |
download | bcm5719-llvm-2188696d98f1b45a2de613107c684b97df9e9487.tar.gz bcm5719-llvm-2188696d98f1b45a2de613107c684b97df9e9487.zip |
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.
llvm-svn: 101996
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index c43e0006e69..7072301b4bc 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/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 |