Skip to content

TableGen: Avoid emitting trailing whitespace in StringToOffsetTable #148840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/TableGen/StringToOffsetTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void StringToOffsetTable::EmitStringTableDef(raw_ostream &OS,
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverlength-strings"
#endif
{} constexpr char {}{}Storage[] = )",
{} constexpr char {}{}Storage[] =)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'd want to add a whitespace before "{\n" a few lines below then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, it looks right as is. Every entry ends up on its own line, though under-indented

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm referring to the >64k case, which now would print ={ instead of = { I think. But it doesn't particularly matter...

ClassPrefix.empty() ? "static" : "", ClassPrefix, Name);

// MSVC silently miscompiles string literals longer than 64k in some
Expand Down
Loading