This is an archive of the discontinued LLVM Phabricator instance.

Make llvm::Error generated from replacement interfaces more specific.
ClosedPublic

Authored by ioeric on Nov 18 2016, 6:59 AM.

Details

Summary

The new error information contains the type of error (e.g. overlap or bad file path)
and the replacement(s) that is causing the error. This enables us to resolve some errors.
For example, for insertion at the same location conflict, we need to know the
existing replacement which conflicts with the new replacement in order to calculate
the new position to be insert before/after the existing replacement (for merging).

Event Timeline

ioeric updated this revision to Diff 78519.Nov 18 2016, 6:59 AM
ioeric retitled this revision from to Make llvm::Error generated from replacement interfaces more specific..
ioeric updated this object.
ioeric added reviewers: klimek, djasper, bkramer.
ioeric added a subscriber: cfe-commits.
ioeric removed a reviewer: djasper.Nov 21 2016, 6:55 AM
ioeric added a subscriber: djasper.
bkramer added inline comments.Nov 21 2016, 8:58 AM
include/clang/Tooling/Core/Replacement.h
157

Can you use pass by value and std::move here?

162

Here too.

174

This on the other hand should return a const ref.

178

This too.

lib/Tooling/Core/Replacement.cpp
157

Drop the 's here.

ioeric updated this revision to Diff 78733.Nov 21 2016, 9:13 AM
ioeric marked 5 inline comments as done.
  • Addressed review comments.

Thanks for the review!

bkramer accepted this revision.Nov 21 2016, 9:50 AM
bkramer edited edge metadata.
This revision is now accepted and ready to land.Nov 21 2016, 9:50 AM
This revision was automatically updated to reflect the committed changes.