]> granicus.if.org Git - clang/commitdiff
[libclang] Introduce indexing option CXIndexOpt_SuppressWarnings, which
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 27 Mar 2012 21:38:03 +0000 (21:38 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 27 Mar 2012 21:38:03 +0000 (21:38 +0000)
disables all compiler warnings.

rdar://11059556

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153539 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang-c/Index.h
tools/libclang/Indexing.cpp

index d05510e281421b9d7f199aa612debb1815b17425..904585f1082a0ac1f619492c1727587473abe1f2 100644 (file)
@@ -4494,7 +4494,12 @@ typedef enum {
    * \brief Implicit function/class template instantiations should be indexed.
    * If this is not set, implicit instantiations will be ignored.
    */
-  CXIndexOpt_IndexImplicitTemplateInstantiations = 0x4
+  CXIndexOpt_IndexImplicitTemplateInstantiations = 0x4,
+
+  /**
+   * \brief Suppress all compiler warnings when parsing for indexing.
+   */
+  CXIndexOpt_SuppressWarnings = 0x8
 } CXIndexOptFlags;
 
 /**
index aad6e02fe98653a81230db8d1ca0cec62b58425b..85b638530f10d09b98bf72f032cef8824ad6b112 100644 (file)
@@ -346,6 +346,9 @@ static void clang_indexSourceFile_Impl(void *UserData) {
   if (!requestedToGetTU)
     CInvok->getPreprocessorOpts().DetailedRecord = false;
 
+  if (index_options & CXIndexOpt_SuppressWarnings)
+    CInvok->getDiagnosticOpts().IgnoreWarnings = true;
+
   ASTUnit *Unit = ASTUnit::create(CInvok.getPtr(), Diags,
                                   /*CaptureDiagnostics=*/true);
   OwningPtr<CXTUOwner> CXTU(new CXTUOwner(MakeCXTranslationUnit(Unit)));