llvm-project/clang/lib
Alex Lorenz 1be800c511 Add support for editor placeholders to Clang
This commit teaches Clang to recognize editor placeholders that are produced
when an IDE like Xcode inserts a code-completion result that includes a
placeholder. Now when the lexer sees a placeholder token, it emits an
'editor placeholder in source file' error and creates an identifier token
that represents the placeholder. The parser/sema can now recognize the
placeholders and can suppress the diagnostics related to the placeholders. This
ensures that live issues in an IDE like Xcode won't get spurious diagnostics
related to placeholders.

This commit also adds a new compiler option named '-fallow-editor-placeholders'
that silences the 'editor placeholder in source file' error. This is useful
for an IDE like Xcode as we don't want to display those errors in live issues.

rdar://31581400

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

llvm-svn: 300667
2017-04-19 08:58:56 +00:00
..
ARCMigrate Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and CodeCompleteConsumer" 2017-01-06 19:49:01 +00:00
AST Revert r300653 and r300650. The underlying commit fixes one issue with 2017-04-19 05:25:13 +00:00
ASTMatchers [clang] Register isConstexpr matcher 2017-04-16 19:05:17 +00:00
Analysis Fix PR13910: Don't warn that __builtin_unreachable() is unreachable 2017-04-11 15:36:06 +00:00
Basic Add #pragma clang attribute 2017-04-18 14:33:39 +00:00
CodeGen [CodeGen] Use APInt::lshrInPlace instead of APInt::lshr. NFC 2017-04-19 05:17:33 +00:00
Driver Add support for editor placeholders to Clang 2017-04-19 08:58:56 +00:00
Edit Fix problems in "[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand." 2016-12-23 14:55:49 +00:00
Format clang-format: Properly match parens of macro parameter lists. 2017-04-19 06:06:38 +00:00
Frontend Add support for editor placeholders to Clang 2017-04-19 08:58:56 +00:00
FrontendTool unique_ptrify createDriverOptTable 2017-01-13 17:34:15 +00:00
Headers [DOXYGEN] Minor improvements in doxygen comments. 2017-04-18 19:44:07 +00:00
Index Fix MSVC 'not all control paths return a value' warning. 2017-03-24 16:59:14 +00:00
Lex Add support for editor placeholders to Clang 2017-04-19 08:58:56 +00:00
Parse Add support for editor placeholders to Clang 2017-04-19 08:58:56 +00:00
Rewrite [analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last) 2016-10-07 19:25:10 +00:00
Sema Add support for editor placeholders to Clang 2017-04-19 08:58:56 +00:00
Serialization Modules: Do not serialize #pragma pack state 2017-04-15 00:07:57 +00:00
StaticAnalyzer [analyzer] Enforce super-region classes for various memory regions. 2017-04-13 09:56:07 +00:00
Tooling Add `replace` interface with range in AtomicChange. 2017-03-30 13:07:38 +00:00
CMakeLists.txt