aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-19 09:25:03 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-19 09:25:03 +0000
commit9fc6a7774643a810c8501dae2323e863fefb623e (patch)
tree5e1022305d460e971bfeca65e95cbf15597c9808 /lib/CodeGen/CodeGenFunction.h
parent8c0b9646f54499ee88a3b3df308a2bfbaafac345 (diff)
More refactoring around constructor/destructor code generation.
Fix some bugs with function-try-blocks and simplify normal try-block code generation. This implementation excludes a deleting destructor's call to operator delete() from the function-try-block, which I believe is correct but which I can't find straightforward support for at a moment's glance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96670 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h29
1 files changed, 13 insertions, 16 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 29c75fdb8e..1c5cd67fa9 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -91,9 +91,6 @@ public:
/// CurGD - The GlobalDecl for the current function being compiled.
GlobalDecl CurGD;
- /// OuterTryBlock - This is the address of the outter most try block, 0
- /// otherwise.
- const Stmt *OuterTryBlock;
/// ReturnBlock - Unified return block.
llvm::BasicBlock *ReturnBlock;
@@ -494,7 +491,9 @@ public:
const FunctionArgList &Args,
SourceLocation StartLoc);
- void GenerateBody(GlobalDecl GD, llvm::Function *Fn, FunctionArgList &Args);
+ void EmitConstructorBody(FunctionArgList &Args);
+ void EmitDestructorBody(FunctionArgList &Args);
+ void EmitFunctionBody(FunctionArgList &Args);
/// EmitReturnBlock - Emit the unified return block, trying to avoid its
/// emission when possible.
@@ -529,18 +528,8 @@ public:
llvm::Value *ThisPtr,
uint64_t Offset);
- void SynthesizeCXXCopyConstructor(const CXXConstructorDecl *Ctor,
- CXXCtorType Type,
- llvm::Function *Fn,
- const FunctionArgList &Args);
-
- void SynthesizeCXXCopyAssignment(const CXXMethodDecl *CD,
- llvm::Function *Fn,
- const FunctionArgList &Args);
-
- void SynthesizeImplicitFunctionBody(GlobalDecl GD,
- llvm::Function *Fn,
- const FunctionArgList &Args);
+ void SynthesizeCXXCopyConstructor(const FunctionArgList &Args);
+ void SynthesizeCXXCopyAssignment(const FunctionArgList &Args);
/// EmitDtorEpilogue - Emit all code that comes at the end of class's
/// destructor. This is to call destructors on members and base classes in
@@ -927,6 +916,14 @@ public:
void EmitObjCAtThrowStmt(const ObjCAtThrowStmt &S);
void EmitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt &S);
+ struct CXXTryStmtInfo {
+ llvm::BasicBlock *SavedLandingPad;
+ llvm::BasicBlock *HandlerBlock;
+ llvm::BasicBlock *FinallyBlock;
+ };
+ CXXTryStmtInfo EnterCXXTryStmt(const CXXTryStmt &S);
+ void ExitCXXTryStmt(const CXXTryStmt &S, CXXTryStmtInfo Info);
+
void EmitCXXTryStmt(const CXXTryStmt &S);
//===--------------------------------------------------------------------===//