This is an archive of the discontinued LLVM Phabricator instance.

[flang][directive] Get rid of flangClassValue in TableGen
ClosedPublic

Authored by clementval on Jan 15 2021, 1:01 PM.

Details

Summary

The TableGen emitter for directives has two slots for flangClass information and this was mainly
to be able to keep up with the legacy openmp parser at the time. Now that all clauses are encapsulated in
AccClause or OmpClause, these two strings are not necessary anymore and were the the source of couple
of problem while working with the generic structure checker for OpenMP.
This patch remove the flangClassValue string from DirectiveBase.td and use the string flangClass as the
placeholder for the encapsulated class.

Diff Detail

Event Timeline

clementval created this revision.Jan 15 2021, 1:01 PM
clementval requested review of this revision.Jan 15 2021, 1:01 PM
Herald added a project: Restricted Project. · View Herald Transcript
clementval added a project: Restricted Project.Jan 15 2021, 1:02 PM

This was a much needed change. Thank you for the refactoring.
One of the typical and most common problems was FindClause did not work as expected given that CheckAllowed was correctly defined for the clauses.

I see tests failing defined with the target mentioned inline.

llvm/test/TableGen/directive2.td
17

Did you check with the target check-llvm-tablegen ?

clementval added inline comments.Jan 18 2021, 11:55 AM
llvm/test/TableGen/directive2.td
17

I did it but will double-check.

clementval added inline comments.Jan 18 2021, 5:31 PM
llvm/test/TableGen/directive2.td
17

All tests are passing on my side. What kind of error are you seeing?

sameeranjoshi added inline comments.Jan 18 2021, 8:26 PM
llvm/test/TableGen/directive2.td
17
Command Output (stderr):
--
directive2.td:17:1: error: Record `TDLC_ClauseA' does not have a field named `flangClassValue'!

def TDLC_ClauseA : Clause<"clausea"> {
^
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/amd/f18_git/final_test/driver_build/bin/FileCheck -match-full-lines /home/amd/f18_git/final_test/llvm-project/llvm/test/TableGen/directive2.td -check-prefix=GEN

and for directive1.td.

Command Output (stderr):
--
/home/amd/f18_git/final_test/llvm-project/llvm/test/TableGen/directive1.td:97:16: error: CHECK-NEXT: expected string not found in input
// CHECK-NEXT: llvm::StringRef getTdlAKindName(AKind);

I even rebased on main .
I have gcc version 9.2.1. Maybe that's the source of problem.

sameeranjoshi accepted this revision.Jan 18 2021, 9:34 PM

Ok a clang version 8.0.1 based build passes.
It's seems compiler version related issue.
BTW, is there a way to mitigate or conform such compiler version/build related issues?
LGTM.

This revision is now accepted and ready to land.Jan 18 2021, 9:34 PM

Ok a clang version 8.0.1 based build passes.
It's seems compiler version related issue.
BTW, is there a way to mitigate or conform such compiler version/build related issues?
LGTM.

Do you see a build failure or a test failure?

This revision was landed with ongoing or failed builds.Jan 19 2021, 7:29 AM
This revision was automatically updated to reflect the committed changes.