This patch implements a couple of functions that were described in my RFC from last week that’s available at http://lists.llvm.org/pipermail/cfe-dev/2017-July/054831.html. This patch adds the following pieces: apply function, requiredSelection function, and the selection::SourceSelectionRange constraint.
This code will be used as a base to start moving the functionality and tests for clang-rename over to clang-refactor.
Could you please split changes related to DiagnosticOr into a separate patch and have owners of clang/Basic/ directory review it? ;)