This change adds a "multiversion" annotation to textual AST output.
For example:
FunctionDecl 0xb6628b0 <t.c:1:1, col:13> col:5 multiversion foo 'int (void)'
Differential D121961
[clang] Produce a "multiversion" annotation in textual AST output. tahonermann on Mar 17 2022, 2:31 PM. Authored by
Details This change adds a "multiversion" annotation to textual AST output. FunctionDecl 0xb6628b0 <t.c:1:1, col:13> col:5 multiversion foo 'int (void)'
Diff Detail
Event TimelineComment Actions Is there a need for this functionality? The text node dumper already dumps attributes associated with the function: https://godbolt.org/z/EbW8E74TT If the change is necessary, it needs some test coverage (I'd recommend adding the test to the clang/test/AST directory). Comment Actions I would have found this helpful while working with MV functions in the past, particularly 'target' ones. So there is perhaps some value and minimal harm to this. That said, we definitely need a test. Comment Actions
Not a strong need, but I found it helpful in two scenarios:
Some examples: void f(); __attribute__((target("default"))) void f(); // Causes multiversioning for the prior declaration. __attribute__((target("mmx"))) void g(); // Not a multiversion function declaration. __attribute__((target("mmx"))) void h(); __attribute__((target("sse"))) void h(); // Causes multiversioning for the prior declaration. I'll add a test; thank you for the hint for where to add it. Comment Actions
Ha! I didn't even think about that. I had copied the RUN lines from another test and only adjusted what was necessary. The bots must have Cygwin, MSYS[2], GnuWin32, or similar installed. |