[PATCH] D153369: [OpenMP] Always apply target declarations to canonical definitions

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 27 05:21:05 PDT 2023


ABataev added a comment.

In D153369#4452008 <https://reviews.llvm.org/D153369#4452008>, @jhuber6 wrote:

> In D153369#4451993 <https://reviews.llvm.org/D153369#4451993>, @ABataev wrote:
>
>> Did you try instead fix the OMPDeclareTargetDeclAttr::getActiveAttr() function to make it look through all the declarations and return the attribute from the first found instead of adding a new attribute?
>
> I originally tried that but found that once we've found a canonical declaration, nothing will really bind to the new non-canonical definition. So the only way to do it would be to scan the entire file with the source manager as far as I could tell. I could be wrong though, I'm not as familiar with Clang here.

Hmm, it should not be so. Did you try to get redecls()?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153369



More information about the cfe-commits mailing list