This patch is based on the RFC that I've sent out earlier (http://lists.llvm.org/pipermail/cfe-dev/2017-April/053394.html).
It teaches Clang's Lexer to recognize the editor placeholders that are produced by some editors like Xcode when expanding code-completion results that include placeholders. When the Lexer sees a placeholder, it emits an error 'editor placeholder in source file', suppresses all diagnostics in the placeholder range and lexes the tokens in the placeholder.
This patch also includes a new compiler option called '-fsuppress-editor-placeholder-error' that surpasses the 'editor placeholder in source file' error. This option is useful for an IDE like Xcode as we don't want to display those errors as live diagnostics in the editor.
There are still certain things that can be improved. For example, in the future we may want to add support for different kinds of placeholders (e.g. typed, it would produce special typed expressions) that would actually produce a special token instead of lexing the contents of the placeholder in order to improve the parser's recovery. But they will require changes to the code-completion code as well, so I left them for later to keep this patch small.