[libclang] Pass in the -fallow-editor-placeholders option

This will suppress any live diagnostics caused by editor placeholders in Xcode.

rdar://31833579

llvm-svn: 301542
This commit is contained in:
Alex Lorenz 2017-04-27 13:47:03 +00:00
parent fbdaac4841
commit cb00640c05
3 changed files with 11 additions and 2 deletions

View File

@ -266,7 +266,8 @@ LANGOPT(SanitizeAddressFieldPadding, 2, 0, "controls how aggressive is ASan "
LANGOPT(XRayInstrument, 1, 0, "controls whether to do XRay instrumentation") LANGOPT(XRayInstrument, 1, 0, "controls whether to do XRay instrumentation")
LANGOPT(AllowEditorPlaceholders, 1, 0, "allow editor placeholders in source") BENIGN_LANGOPT(AllowEditorPlaceholders, 1, 0,
"allow editor placeholders in source")
#undef LANGOPT #undef LANGOPT
#undef COMPATIBLE_LANGOPT #undef COMPATIBLE_LANGOPT

View File

@ -0,0 +1,5 @@
// RUN: c-index-test -test-load-source all %s 2>&1 | FileCheck %s
<#placeholder#>;
// CHECK-NOT: error

View File

@ -3372,6 +3372,9 @@ clang_parseTranslationUnit_Impl(CXIndex CIdx, const char *source_filename,
Args->push_back("-detailed-preprocessing-record"); Args->push_back("-detailed-preprocessing-record");
} }
// Suppress any editor placeholder diagnostics.
Args->push_back("-fallow-editor-placeholders");
unsigned NumErrors = Diags->getClient()->getNumErrors(); unsigned NumErrors = Diags->getClient()->getNumErrors();
std::unique_ptr<ASTUnit> ErrUnit; std::unique_ptr<ASTUnit> ErrUnit;
// Unless the user specified that they want the preamble on the first parse // Unless the user specified that they want the preamble on the first parse