This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Don't squash Verilog escaped identifiers
ClosedPublic

Authored by sstwcw on Mar 19 2023, 7:54 PM.

Details

Summary

An escaped identifier always needs a space following it so the parser
can tell it apart from the next token.

The unit tests are changed to use FormatTestBase.h because we need the
2-argument version of verifyFormat. We also added the messUp
virtual function because Verilog needs a different version of it.

Diff Detail

Event Timeline

sstwcw created this revision.Mar 19 2023, 7:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2023, 7:54 PM
sstwcw requested review of this revision.Mar 19 2023, 7:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2023, 7:54 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
sstwcw added a project: Restricted Project.Mar 19 2023, 7:55 PM
MyDeveloperDay added inline comments.Mar 22 2023, 3:36 AM
clang/unittests/Format/FormatTestVerilog.cpp
949

is this correct? do you have an anonymous namespace?

sstwcw marked an inline comment as done.Mar 22 2023, 8:32 PM
sstwcw added inline comments.
clang/unittests/Format/FormatTestVerilog.cpp
949

It is correct. The class FormatTestVerilog is only used in this file. Other files have it too. I didn't notice it when I copied the first few lines from FormatTest.cpp this time, but I probably forgot to add it when creating the file.

sstwcw marked an inline comment as done.Mar 22 2023, 8:32 PM
HazardyKnusperkeks added inline comments.
clang/unittests/Format/FormatTestVerilog.cpp
19–20

Drop that virtual.

This revision is now accepted and ready to land.Mar 25 2023, 1:51 PM
This revision was landed with ongoing or failed builds.Mar 26 2023, 3:51 PM
This revision was automatically updated to reflect the committed changes.