This is an archive of the discontinued LLVM Phabricator instance.

[pseudo] Use the pseudoCXX library in fuzzer.
Needs ReviewPublic

Authored by hokein on May 30 2022, 12:28 AM.

Details

Reviewers
sammccall
Summary

Get rid of the tedious grammar command-flag handling, and simply the
code.

Diff Detail

Event Timeline

hokein created this revision.May 30 2022, 12:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2022, 12:28 AM
Herald added a subscriber: mgorny. · View Herald Transcript
hokein requested review of this revision.May 30 2022, 12:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2022, 12:28 AM

As discussed offline:

  • this should really be a cross-cutting change for all tools
  • we're going to have multiple grammars or variants (e.g. c, c++, obj-c)
  • it would be nice to preserve the ability for tools to use a grammar from a file

This all points at having a library shared between {fuzzer, clang-pseudo, benchmark} that supports --grammar=cxx and --grammar=/some/path.

It needs to depend on CXX but isn't itself CXX, so I think it's a new library. Maybe clangPseudoCLI? I think for now the easiest thing is for the library to define the cl::opt flags and just expose functions to get the "current" grammar. (And maybe langopts should go there too)