> On Aug 21, 2024, at 18:08, Bill Wendling <isanb...@gmail.com> wrote: > >>> >>> to test. >> >> For the unary operator __counted_by(PTR), “PTR” must have a counted_by >> attribute, if not, there will be a compilation time error. >> >> Then the user could write the following code: >> >> If __builtin_has_attriubtes (PTR,counted_by) >> __counted_by(PTR) = COUNT; >> >> >> From the design point of view, I think this might be the cleanest solution. >> >> However, currently, CLANG doesn’t have __builtin_has_attributes. In order >> to provide a consistent interface, __builtin_get_counted_by(PTR) is fine. >> > This was the confusion I had during our meeting today. For the above > to be a compilation time error, we would have to diagnose it after > DCE, which is okay, but seems like we're opening ourselves up to > future issues when DCE misses. Maybe not the biggest concern, but...
Does the DCE above mean "dead code elimination”? If so, I am a little confused: CLANG has dead code elimination pass in the FE? Could you explain a little bit here in details to clarify the issues? A small example will be helpful. (In the current GCC’s implementation, I implement this feature completely in C parser). Thanks. Qing > > -bw