dblaikie added a comment.

In D106615#2950964 <https://reviews.llvm.org/D106615#2950964>, @yonghong-song 
wrote:

> The attributes should be revolved during semantic analysis stage. So looks 
> like replace-style attribute setting is not really needed. I will change to 
> add attribute parameter during creation time. Thanks for suggestion.

I think semantic analysis runs alongside code generation - eg, if you have one 
attribute applied to a declaration, then a function definition using that type, 
then another declaration of the same type, but with a different attribute, then 
another function definition using the type - if you build the type only once, 
on the first use, you might not capture all the attributes?

Anyway, yeah, if all this works out without the replacement style API, I 
/think/ that's probably the better call. Might be worth including a test like 
that to show how it's expected to be handled.

(do these attributes need to work on declared-but-not-defined types? (eg: a 
type declared, and then a function that takes pointer-to that type, but the 
type is never defined in this translation unit) If so, could you include 
testing. for that situation?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106615

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to