diff options
author | John McCall <rjmccall@apple.com> | 2011-02-22 06:44:22 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-22 06:44:22 +0000 |
commit | c533cb7008cfc03f94da72029445bc429e39210d (patch) | |
tree | 40dfb309f9dd8a8eeab2db6963ce9d0ec8f2d543 /clang/lib/CodeGen/CGException.cpp | |
parent | fb1a79af7aff4cec44a4a0d2a83bb081cf702151 (diff) | |
download | bcm5719-llvm-c533cb7008cfc03f94da72029445bc429e39210d.tar.gz bcm5719-llvm-c533cb7008cfc03f94da72029445bc429e39210d.zip |
Reorganize the emission of local variables.
llvm-svn: 126189
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 6181965748c..4bce081e48d 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -1086,14 +1086,14 @@ static void BeginCatch(CodeGenFunction &CGF, const CXXCatchStmt *S) { // 3. Enter __cxa_end_catch cleanup // 4. Enter dtor cleanup // - // We do this by initializing the exception variable with a - // "special initializer", InitCatchParam. Delegation sequence: + // We do this by using a slightly abnormal initialization process. + // Delegation sequence: // - ExitCXXTryStmt opens a RunCleanupsScope - // - EmitLocalBlockVarDecl creates the variable and debug info + // - EmitAutoVarAlloca creates the variable and debug info // - InitCatchParam initializes the variable from the exception - // - CallBeginCatch calls __cxa_begin_catch - // - CallBeginCatch enters the __cxa_end_catch cleanup - // - EmitLocalBlockVarDecl enters the variable destructor cleanup + // - CallBeginCatch calls __cxa_begin_catch + // - CallBeginCatch enters the __cxa_end_catch cleanup + // - EmitAutoVarCleanups enters the variable destructor cleanup // - EmitCXXTryStmt emits the code for the catch body // - EmitCXXTryStmt close the RunCleanupsScope @@ -1105,7 +1105,9 @@ static void BeginCatch(CodeGenFunction &CGF, const CXXCatchStmt *S) { } // Emit the local. - CGF.EmitAutoVarDecl(*CatchParam, &InitCatchParam); + CodeGenFunction::AutoVarEmission var = CGF.EmitAutoVarAlloca(*CatchParam); + InitCatchParam(CGF, *CatchParam, var.getObjectAddress(CGF)); + CGF.EmitAutoVarCleanups(var); } namespace { |