diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-26 20:35:05 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-26 20:35:05 +0000 |
commit | a7b98a772cb63cd2eb5f1af194c2d5910adeea2a (patch) | |
tree | 6eedb2b10ca06fe8e509d699d9e39825660a7158 /clang/lib/CodeGen | |
parent | 5bf1a6e98636a113adf6b8078b3e4d6f1181b406 (diff) | |
download | bcm5719-llvm-a7b98a772cb63cd2eb5f1af194c2d5910adeea2a.tar.gz bcm5719-llvm-a7b98a772cb63cd2eb5f1af194c2d5910adeea2a.zip |
Implement function-try-blocks. However, there's a very subtle bug that I can't track down.
llvm-svn: 70155
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index df49c70ec64..de89f0d961a 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -129,7 +129,7 @@ void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) { DebugInfo = CGM.getDebugInfo(); StartObjCMethod(OMD, OMD->getClassInterface()); EmitStmt(OMD->getBody(getContext())); - FinishFunction(cast<CompoundStmt>(OMD->getBody(getContext()))->getRBracLoc()); + FinishFunction(OMD->getBodyRBrace(getContext())); } // FIXME: I wasn't sure about the synthesis approach. If we end up diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index c05ead5233b..c74f8344cc8 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -225,12 +225,13 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD, FProto->getArgType(i))); } - const CompoundStmt *S = FD->getBody(getContext()); + // FIXME: Support CXXTryStmt here, too. + if (const CompoundStmt *S = FD->getCompoundBody(getContext())) { + StartFunction(FD, FD->getResultType(), Fn, Args, S->getLBracLoc()); + EmitStmt(S); + FinishFunction(S->getRBracLoc()); + } - StartFunction(FD, FD->getResultType(), Fn, Args, S->getLBracLoc()); - EmitStmt(S); - FinishFunction(S->getRBracLoc()); - // Destroy the 'this' declaration. if (CXXThisDecl) CXXThisDecl->Destroy(getContext()); |