This is an archive of the discontinued LLVM Phabricator instance.

[Index] Return SourceLocation to consumers, not FileID/Offset pair.
ClosedPublic

Authored by sammccall on Mar 28 2018, 8:03 PM.

Details

Summary

The FileID/Offset conversion is lossy. The code takes the fileLoc, which loses
e.g. the spelling location in some macro cases.
Instead, pass the original SourceLocation which preserves all information, and
update consumers to match current behavior.

This allows us to fix two bugs in clangd that need the spelling location.

Diff Detail

Repository
rC Clang

Event Timeline

sammccall created this revision.Mar 28 2018, 8:03 PM

Ping...

@akyrtzi @arphaman I'm confident there's no functional change in this patch so I'm happy to land it with just a review from clangd folks, but would be great to know if you're happy with the interface change.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 9 2018, 7:15 AM
This revision was automatically updated to reflect the committed changes.

Oops, I got my reviews crossed and thought @ilya-biryukov had already approved it (we chatted about this today)

LGTM, but let's watch out for @akyrtzi's and @arphaman's comments, just in case they're not happy with the change. In that case we'll have to revert it.

sammccall reopened this revision.Apr 9 2018, 7:23 AM
ilya-biryukov accepted this revision.Apr 9 2018, 7:23 AM
This revision is now accepted and ready to land.Apr 9 2018, 7:23 AM

The matching clangd patch is r329571, I got distracted and it took me a few
minutes to land it. Apologies!

ilya-biryukov closed this revision.Apr 10 2018, 4:42 AM