https://github.com/ChuanqiXu9 commented:

Thanks.

(1) Hardcoding is generally not good. And even if we have to, e.g., (we don't 
have an automatic mechanism to check if we need to defer an attribute), let's 
avoid hardcoding in both reader side and writer side. We can make this by 
adding a new bit in the record of attribute to indicate if we need to delay it 
or not in the reader side generally.

(2) Then I think we can keep the signature of `readAttr` as is, where it will 
always skip the check for the delay bit and always try to read it. Then we can 
add a `readOrDeferFor(Decl *D)` method as you did. The `readOrDeferFor` will 
try to read the `deferring` bits directly and if it is true, it will record the 
length `skipCount` and `D` to `PendingDeferredAttributes` . Otherwise, it will 
call `readAttr`. I think it is more clear.

https://github.com/llvm/llvm-project/pull/122726
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to