This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Replace unordered_set with an array
ClosedPublic

Authored by krasimir on Jan 17 2018, 10:47 AM.

Diff Detail

Event Timeline

krasimir created this revision.Jan 17 2018, 10:47 AM
bkramer added inline comments.Jan 17 2018, 10:52 AM
lib/Format/Format.cpp
1424

The ArrayRef doesn't own its contents, so this is a use-after-scope.

I'd prefer static constexpr llvm::StringLiteral FoundationIdentifiers[] = {

krasimir updated this revision to Diff 130223.Jan 17 2018, 11:12 AM
  • Address review comment
benhamilton accepted this revision.Jan 17 2018, 11:19 AM

Thanks, this is smarter.

This revision is now accepted and ready to land.Jan 17 2018, 11:19 AM
benhamilton added inline comments.Jan 17 2018, 11:21 AM
lib/Format/Format.cpp
1424

Should we add a comment that this array must be sorted if someone adds a new entry?

krasimir updated this revision to Diff 130232.Jan 17 2018, 11:31 AM
  • Add comment
krasimir marked 2 inline comments as done.Jan 17 2018, 11:31 AM
This revision was automatically updated to reflect the committed changes.