Make llvm::Error generated from replacement interfaces more specific.
authorEric Liu <ioeric@google.com>
Tue, 22 Nov 2016 13:46:42 +0000 (13:46 +0000)
committerEric Liu <ioeric@google.com>
Tue, 22 Nov 2016 13:46:42 +0000 (13:46 +0000)
commite86a5f4c65634d200c5654b7bc0e6277d1e86577
tree1a692d375626ae8daa69de09735bdf4a95c87291
parentd70c03ad684314b8b2046705fd9118555523b258
Make llvm::Error generated from replacement interfaces more specific.

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).

Reviewers: klimek, bkramer

Subscribers: djasper, cfe-commits

Differential Revision: https://reviews.llvm.org/D26853

llvm-svn: 287639
clang/include/clang/Tooling/Core/Replacement.h
clang/lib/Tooling/Core/Replacement.cpp
clang/unittests/Tooling/RefactoringTest.cpp