This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Get rid of unnecssary source transformations in locateMacroAt
ClosedPublic

Authored by kadircet on Feb 27 2020, 7:54 AM.

Details

Summary

All callers are already passing spelling locations to locateMacroAt.
Also there's no point at looking at macro expansion for figuring out undefs as
it is forbidden to have PP directives inside macro bodies.
Also fixes a bug when the previous sourcelocation is unavailable.

Diff Detail

Event Timeline

kadircet created this revision.Feb 27 2020, 7:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2020, 7:54 AM
hokein accepted this revision.Feb 28 2020, 5:40 AM
hokein added inline comments.
clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
440

nit: the trailing ; seems not needed.

This revision is now accepted and ready to land.Feb 28 2020, 5:40 AM
kadircet updated this revision to Diff 247438.Feb 29 2020, 4:46 AM
kadircet marked an inline comment as done.
  • Drop semicolon
This revision was automatically updated to reflect the committed changes.