[cfe-commits] r153539 - in /cfe/trunk: include/clang-c/Index.h tools/libclang/Indexing.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Mar 27 14:38:03 PDT 2012


Author: akirtzidis
Date: Tue Mar 27 16:38:03 2012
New Revision: 153539

URL: http://llvm.org/viewvc/llvm-project?rev=153539&view=rev
Log:
[libclang] Introduce indexing option CXIndexOpt_SuppressWarnings, which
disables all compiler warnings.

rdar://11059556

Modified:
    cfe/trunk/include/clang-c/Index.h
    cfe/trunk/tools/libclang/Indexing.cpp

Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=153539&r1=153538&r2=153539&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Tue Mar 27 16:38:03 2012
@@ -4494,7 +4494,12 @@
    * \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;
 
 /**

Modified: cfe/trunk/tools/libclang/Indexing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/Indexing.cpp?rev=153539&r1=153538&r2=153539&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/Indexing.cpp (original)
+++ cfe/trunk/tools/libclang/Indexing.cpp Tue Mar 27 16:38:03 2012
@@ -346,6 +346,9 @@
   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)));





More information about the cfe-commits mailing list