[PATCH] D158591: Add support of Windows Trace Logging macros
Corentin Jabot via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 23 04:46:12 PDT 2023
cor3ntin added inline comments.
================
Comment at: clang/lib/Sema/Sema.cpp:1495-1499
+ DeclContext *DC = CurContext;
+ while (DC && !isa<BlockDecl>(DC) && !isa<CapturedDecl>(DC) &&
+ !isa<FunctionDecl>(DC) && !isa<ObjCMethodDecl>(DC))
+ DC = DC->getParent();
+ return dyn_cast_or_null<Decl>(DC);
----------------
I think this is reimplementing `getCurFunctionOrMethodDecl`
maybe we want to do
```
if(Decl* DC = getCurFunctionOrMethodDecl())
return DC;
return dyn_cast_or_null<Decl>(CurrentContext);
```
Or something like that
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158591/new/
https://reviews.llvm.org/D158591
More information about the cfe-commits
mailing list