[PATCH] D111199: [Clang][LLVM][Attr] support btf_type_tag attribute
David Blaikie via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 4 09:57:02 PDT 2021
dblaikie accepted this revision.
dblaikie added a comment.
Seems unfortunate that attributes on types are only available through TypeLocs rather than through sugar (like if we used a typedef it'd be visible in the type sugar, but not if it's written on the type usage itself) - but that's above my domain knowledge here & I'll take it there are some good reasons for that to be the way it is.
================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:1426
+ TypeLoc RetTL;
+ if (!TL.isNull()) {
+ if (auto FTL = TL.getAs<FunctionTypeLoc>())
----------------
I'm /guessing/ this can be rewritten as:
```
if (TL)
```
? (similarly elsewhere in this patch)
================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:1440-1441
+ bool DoneWithTL = false;
+ if (!TL.isNull()) {
+ if (auto FTL = TL.getAs<FunctionTypeLoc>()) {
+ DoneWithTL = true;
----------------
Is this null check necessary, or does "getAs" return null if the underlying value is null already anyway? (oh, and this would apply above as well)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111199/new/
https://reviews.llvm.org/D111199
More information about the cfe-commits
mailing list