[PATCH] D112287: [clang] Implement CFG construction for @try and @catch

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 26 06:41:38 PDT 2021


thakis marked 4 inline comments as done.
thakis added a comment.

Thanks, all done.

Looks like there's no range access to a try's catch blocks, so no for-range loop for now. Maybe I'll add range accessors for those later.



================
Comment at: clang/lib/Analysis/CFG.cpp:3895
 CFGBlock *CFGBuilder::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
   // FIXME: This isn't complete.  We basically treat @throw like a return
   //  statement.
----------------
hans wrote:
> does the fixme still stand?
No, I think this is done now. Removed, thanks.


================
Comment at: clang/lib/Analysis/CFG.cpp:5790
+      OS << "@catch (";
+      if (CS->getCatchParamDecl())
+        CS->getCatchParamDecl()->print(OS, PrintingPolicy(Helper.getLangOpts()),
----------------
hans wrote:
> maybe
> 
> ```
> if (const VarDecl *PD = CS->getCatchParamDecl())
>   PD->print(...)
> ```
oh yes, that's much nicer. thanks, done.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112287/new/

https://reviews.llvm.org/D112287



More information about the cfe-commits mailing list