summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-04-27 13:47:03 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-04-27 13:47:03 +0000
commitcb00640c05a7e99214ed05f92ec6e378f0773e14 (patch)
tree74c440de7e3a7ba498b725d8c5f13e3135df956b
parentfbdaac4841c278dfd220d60a01ca0ceaa1f5fa5b (diff)
downloadbcm5719-llvm-cb00640c05a7e99214ed05f92ec6e378f0773e14.tar.gz
bcm5719-llvm-cb00640c05a7e99214ed05f92ec6e378f0773e14.zip
[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
-rw-r--r--clang/include/clang/Basic/LangOptions.def3
-rw-r--r--clang/test/Index/allow-editor-placeholders.cpp5
-rw-r--r--clang/tools/libclang/CIndex.cpp5
3 files changed, 11 insertions, 2 deletions
diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def
index 6ae34a89fe2..60c8a68cd2e 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -266,7 +266,8 @@ LANGOPT(SanitizeAddressFieldPadding, 2, 0, "controls how aggressive is ASan "
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 COMPATIBLE_LANGOPT
diff --git a/clang/test/Index/allow-editor-placeholders.cpp b/clang/test/Index/allow-editor-placeholders.cpp
new file mode 100644
index 00000000000..5a7207d3f07
--- /dev/null
+++ b/clang/test/Index/allow-editor-placeholders.cpp
@@ -0,0 +1,5 @@
+// RUN: c-index-test -test-load-source all %s 2>&1 | FileCheck %s
+
+<#placeholder#>;
+
+// CHECK-NOT: error
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 216322b9f93..c7fdb5ad1aa 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -3371,7 +3371,10 @@ clang_parseTranslationUnit_Impl(CXIndex CIdx, const char *source_filename,
Args->push_back("-Xclang");
Args->push_back("-detailed-preprocessing-record");
}
-
+
+ // Suppress any editor placeholder diagnostics.
+ Args->push_back("-fallow-editor-placeholders");
+
unsigned NumErrors = Diags->getClient()->getNumErrors();
std::unique_ptr<ASTUnit> ErrUnit;
// Unless the user specified that they want the preamble on the first parse
OpenPOWER on IntegriCloud