The script is silent for the following issue:
FileCheck %s -check-prefix=CHECK,POPCOUNT
FileCheck will catch it later, but I think we can warn here too.
Now it warns:
./update_llc_test_checks.py file.ll
Differential D64589
[UpdateTestChecks] Emit warning when invalid value for -check-prefix(es) option xbolva00 on Jul 11 2019, 1:41 PM. Authored by
Details The script is silent for the following issue: FileCheck will catch it later, but I think we can warn here too. Now it warns: WARNING: Supplied prefix 'CHECK,POPCOUNT' is invalid. Prefix must contain only alphanumeric characters, hyphens and underscores. Did you mean --check-prefixes=CHECK,POPCOUNT?
Diff Detail
Event TimelineComment Actions Thank you, i have stumbled into this a few times :) To be noted, the problem is: --check-prefix=A,B,C. Comment Actions -check-prefix=A,B -check-prefix=C ^ This won't be detected, not sure if worth to match. What do you think? Comment Actions I'm not confident that will do the right thing. (i expect this to have some false-negatives, iff it is allowed to specify -check-prefix= more than once)
Comment Actions is there anyway that we could move this to common.py so we can reuse it in the other update scripts? Comment Actions Thanks, I forgot about mir. Moved to common, now it warns for broken LLC/MIR prefixes. Comment Actions Please can you add this to update_analyze_test_checks.py and update_mca_test_checks.py as well? update_cc_test_checks.py maybe - not sure what state that is in though tbh.
Comment Actions @gbedwell Thanks for ideas! I decided to take the regex [0] which FileCheck uses to check prefixes and apply it here. Comment Actions FileCheck says but it does not enforce it in RE, should we enforce it here? Comment Actions I've tried the latest update and it seems to work well for me. The only suggestion I'd make at this stage is adding a message like (did you mean --check-prefixes?) to the end of the warning if a comma is spotted in the prefix string. --check-prefix=FOO,BAR gives a fairly generic warning message now: WARNING: Supplied prefix 'FOO,BAR' is invalid. Prefix must start with a letter and contain only alphanumeric characters, hyphens and underscores. which I can believe that if I was new to filecheck would probably cause me to spend more time debugging the issue than I'd like.
|