svn commit: r320376 - in vendor/clang/dist: docs docs/tools include/clang-c include/clang/AST include/clang/Analysis include/clang/Basic include/clang/Driver include/clang/Edit include/clang/Format...

Dimitry Andric dim at FreeBSD.org
Mon Jun 26 20:33:16 UTC 2017


Author: dim
Date: Mon Jun 26 20:33:12 2017
New Revision: 320376
URL: https://svnweb.freebsd.org/changeset/base/320376

Log:
  Vendor import of clang trunk r306325:
  https://llvm.org/svn/llvm-project/cfe/trunk@306325

Added:
  vendor/clang/dist/include/clang/Frontend/PrecompiledPreamble.h   (contents, props changed)
  vendor/clang/dist/lib/Driver/ToolChains/Ananas.cpp   (contents, props changed)
  vendor/clang/dist/lib/Driver/ToolChains/Ananas.h   (contents, props changed)
  vendor/clang/dist/lib/Format/UsingDeclarationsSorter.cpp   (contents, props changed)
  vendor/clang/dist/lib/Format/UsingDeclarationsSorter.h   (contents, props changed)
  vendor/clang/dist/lib/Frontend/PrecompiledPreamble.cpp   (contents, props changed)
  vendor/clang/dist/test/Analysis/copypaste/autogenerated_automoc.cpp   (contents, props changed)
  vendor/clang/dist/test/Analysis/copypaste/dbus_autogenerated.cpp   (contents, props changed)
  vendor/clang/dist/test/Analysis/copypaste/moc_autogenerated.cpp   (contents, props changed)
  vendor/clang/dist/test/Analysis/copypaste/not-autogenerated.cpp   (contents, props changed)
  vendor/clang/dist/test/Analysis/copypaste/ui_autogenerated.cpp   (contents, props changed)
  vendor/clang/dist/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c   (contents, props changed)
  vendor/clang/dist/test/CodeGen/ms-intrinsics-other.c   (contents, props changed)
  vendor/clang/dist/test/CodeGen/no-devirt.cpp   (contents, props changed)
  vendor/clang/dist/test/CodeGenObjC/objc_copyStruct.m
  vendor/clang/dist/test/Driver/ananas.c   (contents, props changed)
  vendor/clang/dist/test/Driver/compress-noias.c   (contents, props changed)
  vendor/clang/dist/test/Driver/fsanitize-object-size.c   (contents, props changed)
  vendor/clang/dist/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
  vendor/clang/dist/test/Frontend/pp-only-no-editor-placeholders.c   (contents, props changed)
  vendor/clang/dist/test/Import/indirect-struct-member-access/
  vendor/clang/dist/test/Import/indirect-struct-member-access/Inputs/
  vendor/clang/dist/test/Import/indirect-struct-member-access/Inputs/S.c   (contents, props changed)
  vendor/clang/dist/test/Import/indirect-struct-member-access/test.c   (contents, props changed)
  vendor/clang/dist/test/Index/single-file-parse.m
  vendor/clang/dist/test/Misc/Inputs/module.modulemap
  vendor/clang/dist/test/Misc/cc1as-compress.s   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/preprocess/other.h   (contents, props changed)
  vendor/clang/dist/test/Modules/const-var-init-update.cpp   (contents, props changed)
  vendor/clang/dist/test/Modules/interface-visibility.m
  vendor/clang/dist/test/Parser/objc-at-implementation-eof-crash.m
  vendor/clang/dist/test/Parser/objc-at-interface-eof-crash.m
  vendor/clang/dist/test/SemaCXX/invalid-template-params.cpp   (contents, props changed)
  vendor/clang/dist/test/SemaCXX/warn-throw-out-noexcept-func.cpp   (contents, props changed)
  vendor/clang/dist/test/SemaObjC/unguarded-availability-new.m
  vendor/clang/dist/unittests/Format/UsingDeclarationsSorterTest.cpp   (contents, props changed)
Deleted:
  vendor/clang/dist/test/Analysis/builtin-assume.c
  vendor/clang/dist/test/CodeGen/pr27892.c
  vendor/clang/dist/test/Index/singe-file-parse.m
Modified:
  vendor/clang/dist/docs/Block-ABI-Apple.rst
  vendor/clang/dist/docs/ClangFormat.rst
  vendor/clang/dist/docs/ClangFormatStyleOptions.rst
  vendor/clang/dist/docs/LibFormat.rst
  vendor/clang/dist/docs/MemorySanitizer.rst
  vendor/clang/dist/docs/SourceBasedCodeCoverage.rst
  vendor/clang/dist/docs/ThinLTO.rst
  vendor/clang/dist/docs/tools/dump_format_style.py
  vendor/clang/dist/include/clang-c/CXCompilationDatabase.h
  vendor/clang/dist/include/clang-c/Index.h
  vendor/clang/dist/include/clang/AST/Decl.h
  vendor/clang/dist/include/clang/AST/DeclBase.h
  vendor/clang/dist/include/clang/Analysis/CloneDetection.h
  vendor/clang/dist/include/clang/Basic/Builtins.def
  vendor/clang/dist/include/clang/Basic/BuiltinsARM.def
  vendor/clang/dist/include/clang/Basic/BuiltinsX86.def
  vendor/clang/dist/include/clang/Basic/BuiltinsX86_64.def
  vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td
  vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td
  vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
  vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td
  vendor/clang/dist/include/clang/Basic/Module.h
  vendor/clang/dist/include/clang/Basic/arm_neon.td
  vendor/clang/dist/include/clang/Driver/CC1Options.td
  vendor/clang/dist/include/clang/Driver/Options.h
  vendor/clang/dist/include/clang/Driver/Options.td
  vendor/clang/dist/include/clang/Edit/EditedSource.h
  vendor/clang/dist/include/clang/Format/Format.h
  vendor/clang/dist/include/clang/Frontend/ASTUnit.h
  vendor/clang/dist/include/clang/Lex/Preprocessor.h
  vendor/clang/dist/include/clang/Lex/PreprocessorOptions.h
  vendor/clang/dist/include/clang/Parse/Parser.h
  vendor/clang/dist/include/clang/Sema/Sema.h
  vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
  vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
  vendor/clang/dist/lib/AST/ASTContext.cpp
  vendor/clang/dist/lib/AST/ASTDumper.cpp
  vendor/clang/dist/lib/AST/ASTImporter.cpp
  vendor/clang/dist/lib/AST/DeclBase.cpp
  vendor/clang/dist/lib/AST/ExternalASTMerger.cpp
  vendor/clang/dist/lib/Analysis/CloneDetection.cpp
  vendor/clang/dist/lib/Basic/Module.cpp
  vendor/clang/dist/lib/Basic/SourceManager.cpp
  vendor/clang/dist/lib/Basic/TargetInfo.cpp
  vendor/clang/dist/lib/Basic/Targets.cpp
  vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp
  vendor/clang/dist/lib/CodeGen/CGCall.cpp
  vendor/clang/dist/lib/CodeGen/CGClass.cpp
  vendor/clang/dist/lib/CodeGen/CGDecl.cpp
  vendor/clang/dist/lib/CodeGen/CGExpr.cpp
  vendor/clang/dist/lib/CodeGen/CGObjCMac.cpp
  vendor/clang/dist/lib/CodeGen/CGStmt.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenFunction.h
  vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenModule.h
  vendor/clang/dist/lib/CodeGen/CodeGenTypeCache.h
  vendor/clang/dist/lib/CodeGen/SwiftCallingConv.cpp
  vendor/clang/dist/lib/CodeGen/TargetInfo.cpp
  vendor/clang/dist/lib/Driver/CMakeLists.txt
  vendor/clang/dist/lib/Driver/Driver.cpp
  vendor/clang/dist/lib/Driver/DriverOptions.cpp
  vendor/clang/dist/lib/Driver/SanitizerArgs.cpp
  vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp
  vendor/clang/dist/lib/Driver/ToolChains/Gnu.cpp
  vendor/clang/dist/lib/Driver/ToolChains/WebAssembly.cpp
  vendor/clang/dist/lib/Edit/EditedSource.cpp
  vendor/clang/dist/lib/Format/CMakeLists.txt
  vendor/clang/dist/lib/Format/ContinuationIndenter.cpp
  vendor/clang/dist/lib/Format/Format.cpp
  vendor/clang/dist/lib/Format/FormatToken.h
  vendor/clang/dist/lib/Format/TokenAnnotator.cpp
  vendor/clang/dist/lib/Format/UnwrappedLineFormatter.cpp
  vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp
  vendor/clang/dist/lib/Frontend/ASTUnit.cpp
  vendor/clang/dist/lib/Frontend/CMakeLists.txt
  vendor/clang/dist/lib/Frontend/CompilerInstance.cpp
  vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp
  vendor/clang/dist/lib/Frontend/FrontendAction.cpp
  vendor/clang/dist/lib/Frontend/FrontendActions.cpp
  vendor/clang/dist/lib/Frontend/PrintPreprocessedOutput.cpp
  vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp
  vendor/clang/dist/lib/Frontend/Rewrite/InclusionRewriter.cpp
  vendor/clang/dist/lib/Index/IndexDecl.cpp
  vendor/clang/dist/lib/Lex/Lexer.cpp
  vendor/clang/dist/lib/Lex/PPDirectives.cpp
  vendor/clang/dist/lib/Lex/PPExpressions.cpp
  vendor/clang/dist/lib/Lex/Pragma.cpp
  vendor/clang/dist/lib/Parse/ParseDecl.cpp
  vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp
  vendor/clang/dist/lib/Parse/ParseObjc.cpp
  vendor/clang/dist/lib/Parse/ParseTemplate.cpp
  vendor/clang/dist/lib/Sema/AnalysisBasedWarnings.cpp
  vendor/clang/dist/lib/Sema/Sema.cpp
  vendor/clang/dist/lib/Sema/SemaCUDA.cpp
  vendor/clang/dist/lib/Sema/SemaDecl.cpp
  vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp
  vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp
  vendor/clang/dist/lib/Sema/SemaExpr.cpp
  vendor/clang/dist/lib/Sema/SemaExprCXX.cpp
  vendor/clang/dist/lib/Sema/SemaLookup.cpp
  vendor/clang/dist/lib/Sema/SemaTemplate.cpp
  vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp
  vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp
  vendor/clang/dist/lib/Serialization/ASTReader.cpp
  vendor/clang/dist/lib/Serialization/ASTReaderDecl.cpp
  vendor/clang/dist/lib/Serialization/ASTWriter.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngineC.cpp
  vendor/clang/dist/test/Analysis/analyzer-config.c
  vendor/clang/dist/test/Analysis/analyzer-config.cpp
  vendor/clang/dist/test/Analysis/builtin-functions.cpp
  vendor/clang/dist/test/Analysis/null-deref-ps-region.c
  vendor/clang/dist/test/CXX/except/except.spec/p11.cpp
  vendor/clang/dist/test/CodeGen/64bit-swiftcall.c
  vendor/clang/dist/test/CodeGen/aarch64-neon-intrinsics.c
  vendor/clang/dist/test/CodeGen/aarch64-neon-ldst-one.c
  vendor/clang/dist/test/CodeGen/address-space.c
  vendor/clang/dist/test/CodeGen/arm_neon_intrinsics.c
  vendor/clang/dist/test/CodeGen/default-address-space.c
  vendor/clang/dist/test/CodeGen/mcount.c
  vendor/clang/dist/test/CodeGen/ms-inline-asm.c
  vendor/clang/dist/test/CodeGen/ms-intrinsics-rotations.c
  vendor/clang/dist/test/CodeGen/target-data.c
  vendor/clang/dist/test/CodeGen/vectorcall.c
  vendor/clang/dist/test/CodeGen/x86_64-arguments.c
  vendor/clang/dist/test/CodeGenCXX/amdgcn-automatic-variable.cpp
  vendor/clang/dist/test/CodeGenObjC/ubsan-nonnull-and-nullability.m
  vendor/clang/dist/test/CodeGenObjC/ubsan-nullability.m
  vendor/clang/dist/test/CodeGenOpenCL/spir_version.cl
  vendor/clang/dist/test/Driver/autocomplete.c
  vendor/clang/dist/test/Driver/compress.c
  vendor/clang/dist/test/Driver/fsanitize.c
  vendor/clang/dist/test/Driver/nozlibcompress.c
  vendor/clang/dist/test/Driver/wasm-toolchain.c
  vendor/clang/dist/test/FixIt/fixit-format-darwin.m
  vendor/clang/dist/test/Frontend/optimization-remark-with-hotness.c
  vendor/clang/dist/test/Index/Core/index-source.cpp
  vendor/clang/dist/test/Misc/ast-dump-decl.c
  vendor/clang/dist/test/Misc/ast-dump-decl.cpp
  vendor/clang/dist/test/Modules/Inputs/preprocess/file.h
  vendor/clang/dist/test/Modules/Inputs/preprocess/fwd.h
  vendor/clang/dist/test/Modules/Inputs/preprocess/module.modulemap
  vendor/clang/dist/test/Modules/preprocess-module.cpp
  vendor/clang/dist/test/Modules/string_names.cpp
  vendor/clang/dist/test/Sema/asm.c
  vendor/clang/dist/test/Sema/overloadable.c
  vendor/clang/dist/test/SemaCXX/PR16677.cpp
  vendor/clang/dist/test/SemaCXX/cxx1y-deduced-return-type.cpp
  vendor/clang/dist/test/SemaCXX/cxx1z-noexcept-function-type.cpp
  vendor/clang/dist/test/SemaCXX/friend2.cpp
  vendor/clang/dist/test/SemaOpenCL/storageclass.cl
  vendor/clang/dist/tools/clang-format/clang-format.py
  vendor/clang/dist/tools/clang-import-test/clang-import-test.cpp
  vendor/clang/dist/tools/driver/cc1as_main.cpp
  vendor/clang/dist/tools/driver/driver.cpp
  vendor/clang/dist/unittests/Format/CMakeLists.txt
  vendor/clang/dist/unittests/Format/FormatTest.cpp
  vendor/clang/dist/utils/TableGen/NeonEmitter.cpp
  vendor/clang/dist/utils/bash-autocomplete.sh

Modified: vendor/clang/dist/docs/Block-ABI-Apple.rst
==============================================================================
--- vendor/clang/dist/docs/Block-ABI-Apple.rst	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/docs/Block-ABI-Apple.rst	Mon Jun 26 20:33:12 2017	(r320376)
@@ -856,15 +856,15 @@ mentioned above, call:
 
 .. code-block:: c
 
-     _Block_object_assign(&dst->target, src->target, BLOCK_FIELD_<appropo>);
+     _Block_object_assign(&dst->target, src->target, BLOCK_FIELD_<apropos>);
 
 in the copy helper and:
 
 .. code-block:: c
 
-    _Block_object_dispose(->target, BLOCK_FIELD_<appropo>);
+    _Block_object_dispose(->target, BLOCK_FIELD_<apropos>);
 
-in the dispose helper where ``<appropo>`` is:
+in the dispose helper where ``<apropos>`` is:
 
 .. code-block:: c
 
@@ -888,7 +888,7 @@ and functions are generated in the same manner.
 Under ObjC we allow ``__weak`` as an attribute on ``__block`` variables, and
 this causes the addition of ``BLOCK_FIELD_IS_WEAK`` orred onto the
 ``BLOCK_FIELD_IS_BYREF`` flag when copying the ``block_byref`` structure in the
-``Block`` copy helper, and onto the ``BLOCK_FIELD_<appropo>`` field within the
+``Block`` copy helper, and onto the ``BLOCK_FIELD_<apropos>`` field within the
 ``block_byref`` copy/dispose helper calls.
 
 The prototypes, and summary, of the helper functions are:

Modified: vendor/clang/dist/docs/ClangFormat.rst
==============================================================================
--- vendor/clang/dist/docs/ClangFormat.rst	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/docs/ClangFormat.rst	Mon Jun 26 20:33:12 2017	(r320376)
@@ -120,6 +120,18 @@ entity.
 It operates on the current, potentially unsaved buffer and does not create
 or save any files. To revert a formatting, just undo.
 
+An alternative option is to format changes when saving a file and thus to
+have a zero-effort integration into the coding workflow. To do this, add this to
+your `.vimrc`:
+
+.. code-block:: vim
+
+  function! Formatonsave()
+    let l:formatdiff = 1
+    pyf ~/llvm/tools/clang/tools/clang-format/clang-format.py
+  endfunction
+  autocmd BufWritePre *.h,*.cc,*.cpp call Formatonsave()
+
 
 Emacs Integration
 =================

Modified: vendor/clang/dist/docs/ClangFormatStyleOptions.rst
==============================================================================
--- vendor/clang/dist/docs/ClangFormatStyleOptions.rst	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/docs/ClangFormatStyleOptions.rst	Mon Jun 26 20:33:12 2017	(r320376)
@@ -309,12 +309,28 @@ the configuration (without a prefix: ``Auto``).
   * ``SFS_None`` (in configuration: ``None``)
     Never merge functions into a single line.
 
+  * ``SFS_InlineOnly`` (in configuration: ``InlineOnly``)
+    Only merge functions defined inside a class. Same as "inline",
+    except it does not implies "empty": i.e. top level empty functions
+    are not merged either.
+
+    .. code-block:: c++
+
+      class Foo {
+        void f() { foo(); }
+      };
+      void f() {
+        foo();
+      }
+      void f() {
+      }
+
   * ``SFS_Empty`` (in configuration: ``Empty``)
     Only merge empty functions.
 
     .. code-block:: c++
 
-      void f() { bar(); }
+      void f() {}
       void f2() {
         bar2();
       }
@@ -327,6 +343,10 @@ the configuration (without a prefix: ``Auto``).
       class Foo {
         void f() { foo(); }
       };
+      void f() {
+        foo();
+      }
+      void f() {}
 
   * ``SFS_All`` (in configuration: ``All``)
     Merge all functions fitting on a single line.
@@ -518,148 +538,160 @@ the configuration (without a prefix: ``Auto``).
 
   * ``bool AfterClass`` Wrap class definitions.
 
-  .. code-block:: c++
+    .. code-block:: c++
 
-    true:
-    class foo
-    {};
+      true:
+      class foo {};
 
-    false:
-    class foo {};
+      false:
+      class foo
+      {};
 
   * ``bool AfterControlStatement`` Wrap control statements (``if``/``for``/``while``/``switch``/..).
 
-  .. code-block:: c++
+    .. code-block:: c++
 
-    true:
-    if (foo())
-    {
-    } else
-    {}
-    for (int i = 0; i < 10; ++i)
-    {}
+      true:
+      if (foo())
+      {
+      } else
+      {}
+      for (int i = 0; i < 10; ++i)
+      {}
 
-    false:
-    if (foo()) {
-    } else {
-    }
-    for (int i = 0; i < 10; ++i) {
-    }
+      false:
+      if (foo()) {
+      } else {
+      }
+      for (int i = 0; i < 10; ++i) {
+      }
 
   * ``bool AfterEnum`` Wrap enum definitions.
 
-  .. code-block:: c++
+    .. code-block:: c++
 
-    true:
-    enum X : int
-    {
-      B
-    };
+      true:
+      enum X : int
+      {
+        B
+      };
 
-    false:
-    enum X : int { B };
+      false:
+      enum X : int { B };
 
   * ``bool AfterFunction`` Wrap function definitions.
 
-  .. code-block:: c++
+    .. code-block:: c++
 
-    true:
-    void foo()
-    {
-      bar();
-      bar2();
-    }
+      true:
+      void foo()
+      {
+        bar();
+        bar2();
+      }
 
-    false:
-    void foo() {
-      bar();
-      bar2();
-    }
+      false:
+      void foo() {
+        bar();
+        bar2();
+      }
 
   * ``bool AfterNamespace`` Wrap namespace definitions.
 
-  .. code-block:: c++
+    .. code-block:: c++
 
-    true:
-    namespace
-    {
-    int foo();
-    int bar();
-    }
+      true:
+      namespace
+      {
+      int foo();
+      int bar();
+      }
 
-    false:
-    namespace {
-    int foo();
-    int bar();
-    }
+      false:
+      namespace {
+      int foo();
+      int bar();
+      }
 
   * ``bool AfterObjCDeclaration`` Wrap ObjC definitions (``@autoreleasepool``, interfaces, ..).
 
   * ``bool AfterStruct`` Wrap struct definitions.
 
-  .. code-block:: c++
+    .. code-block:: c++
 
-    true:
-    struct foo
-    {
-      int x;
-    };
+      true:
+      struct foo
+      {
+        int x;
+      };
 
-    false:
-    struct foo {
-      int x;
-    };
+      false:
+      struct foo {
+        int x;
+      };
 
   * ``bool AfterUnion`` Wrap union definitions.
 
-  .. code-block:: c++
+    .. code-block:: c++
 
-    true:
-    union foo
-    {
-      int x;
-    }
+      true:
+      union foo
+      {
+        int x;
+      }
 
-    false:
-    union foo {
-      int x;
-    }
+      false:
+      union foo {
+        int x;
+      }
 
   * ``bool BeforeCatch`` Wrap before ``catch``.
 
-  .. code-block:: c++
+    .. code-block:: c++
 
-    true:
-    try {
-      foo();
-    }
-    catch () {
-    }
+      true:
+      try {
+        foo();
+      }
+      catch () {
+      }
 
-    false:
-    try {
-      foo();
-    } catch () {
-    }
+      false:
+      try {
+        foo();
+      } catch () {
+      }
 
   * ``bool BeforeElse`` Wrap before ``else``.
 
-  .. code-block:: c++
+    .. code-block:: c++
 
-    true:
-    if (foo()) {
-    }
-    else {
-    }
+      true:
+      if (foo()) {
+      }
+      else {
+      }
 
-    false:
-    if (foo()) {
-    } else {
-    }
+      false:
+      if (foo()) {
+      } else {
+      }
 
   * ``bool IndentBraces`` Indent the wrapped braces themselves.
 
+  * ``bool SplitEmptyFunctionBody`` If ``false``, empty function body can be put on a single line.
+    This option is used only if the opening brace of the function has
+    already been wrapped, i.e. the `AfterFunction` brace wrapping mode is
+    set, and the function could/should not be put on a single line (as per
+    `AllowShortFunctionsOnASingleLine` and constructor formatting options).
 
+    .. code-block:: c++
+
+      int f()   vs.   inf f()
+      {}              {
+                      }
+
+
 **BreakAfterJavaFieldAnnotations** (``bool``)
   Break after each annotation on a field in Java files.
 
@@ -899,18 +931,41 @@ the configuration (without a prefix: ``Auto``).
          firstValue :
          SecondValueVeryVeryVeryVeryLong;
 
-**BreakConstructorInitializersBeforeComma** (``bool``)
-  Always break constructor initializers before commas and align
-  the commas with the colon.
+**BreakConstructorInitializers** (``BreakConstructorInitializersStyle``)
+  The constructor initializers style to use.
 
-  .. code-block:: c++
+  Possible values:
 
-     true:                                  false:
-     SomeClass::Constructor()       vs.     SomeClass::Constructor() : a(a),
-         : a(a)                                                   b(b),
-         , b(b)                                                   c(c) {}
-         , c(c) {}
+  * ``BCIS_BeforeColon`` (in configuration: ``BeforeColon``)
+    Break constructor initializers before the colon and after the commas.
 
+    .. code-block:: c++
+
+    Constructor()
+        : initializer1(),
+          initializer2()
+
+  * ``BCIS_BeforeComma`` (in configuration: ``BeforeComma``)
+    Break constructor initializers before the colon and commas, and align
+    the commas with the colon.
+
+    .. code-block:: c++
+
+    Constructor()
+        : initializer1()
+        , initializer2()
+
+  * ``BCIS_AfterColon`` (in configuration: ``AfterColon``)
+    Break constructor initializers after the colon and commas.
+
+    .. code-block:: c++
+
+    Constructor() :
+        initializer1(),
+        initializer2()
+
+
+
 **BreakStringLiterals** (``bool``)
   Allow breaking string literals when formatting.
 
@@ -931,6 +986,31 @@ the configuration (without a prefix: ``Auto``).
      // Will leave the following line unaffected
      #include <vector> // FOOBAR pragma: keep
 
+**CompactNamespaces** (``bool``)
+  If ``true``, consecutive namespace declarations will be on the same
+  line. If ``false``, each namespace is declared on a new line.
+
+  .. code-block:: c++
+
+    true:
+    namespace Foo { namespace Bar {
+    }}
+
+    false:
+    namespace Foo {
+    namespace Bar {
+    }
+    }
+
+  If it does not fit on a single line, the overflowing namespaces get
+  wrapped:
+
+  .. code-block:: c++
+
+    namespace Foo { namespace Bar {
+    namespace Extra {
+    }}}
+
 **ConstructorInitializerAllOnOneLineOrOnePerLine** (``bool``)
   If the constructor initializers don't fit on a line, put each
   initializer on its own line.
@@ -1321,6 +1401,9 @@ the configuration (without a prefix: ``Auto``).
   Add a space in front of an Objective-C protocol list, i.e. use
   ``Foo <Protocol>`` instead of ``Foo<Protocol>``.
 
+**PenaltyBreakAssignment** (``unsigned``)
+  The penalty for breaking around an assignment operator.
+
 **PenaltyBreakBeforeFirstCallParameter** (``unsigned``)
   The penalty for breaking a function call after ``call(``.
 
@@ -1391,6 +1474,15 @@ the configuration (without a prefix: ``Auto``).
      false:                                 true:
      #include "b.h"                 vs.     #include "a.h"
      #include "a.h"                         #include "b.h"
+
+**SortUsingDeclarations** (``bool``)
+  If ``true``, clang-format will sort using declarations.
+
+  .. code-block:: c++
+
+     false:                                 true:
+     using std::cout;               vs.     using std::cin;
+     using std::cin;                        using std::cout;
 
 **SpaceAfterCStyleCast** (``bool``)
   If ``true``, a space is inserted after C style casts.

Modified: vendor/clang/dist/docs/LibFormat.rst
==============================================================================
--- vendor/clang/dist/docs/LibFormat.rst	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/docs/LibFormat.rst	Mon Jun 26 20:33:12 2017	(r320376)
@@ -28,7 +28,9 @@ The core routine of LibFormat is ``reformat()``:
 
 This reads a token stream out of the lexer ``Lex`` and reformats all the code
 ranges in ``Ranges``. The ``FormatStyle`` controls basic decisions made during
-formatting. A list of options can be found under :ref:`style-options`. 
+formatting. A list of options can be found under :ref:`style-options`.
+
+The style options are described in :doc:`ClangFormatStyleOptions`.
 
 
 .. _style-options:

Modified: vendor/clang/dist/docs/MemorySanitizer.rst
==============================================================================
--- vendor/clang/dist/docs/MemorySanitizer.rst	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/docs/MemorySanitizer.rst	Mon Jun 26 20:33:12 2017	(r320376)
@@ -27,7 +27,7 @@ executable, so make sure to use ``clang`` (not ``ld``)
 link step. When linking shared libraries, the MemorySanitizer run-time
 is not linked, so ``-Wl,-z,defs`` may cause link errors (don't use it
 with MemorySanitizer). To get a reasonable performance add ``-O1`` or
-higher. To get meaninful stack traces in error messages add
+higher. To get meaningful stack traces in error messages add
 ``-fno-omit-frame-pointer``. To get perfect stack traces you may need
 to disable inlining (just use ``-O1``) and tail call elimination
 (``-fno-optimize-sibling-calls``).

Modified: vendor/clang/dist/docs/SourceBasedCodeCoverage.rst
==============================================================================
--- vendor/clang/dist/docs/SourceBasedCodeCoverage.rst	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/docs/SourceBasedCodeCoverage.rst	Mon Jun 26 20:33:12 2017	(r320376)
@@ -274,6 +274,11 @@ To specify an alternate directory for raw profiles, us
 Drawbacks and limitations
 =========================
 
+* Prior to version 2.26, the GNU binutils BFD linker is not able link programs
+  compiled with ``-fcoverage-mapping`` in its ``--gc-sections`` mode.  Possible
+  workarounds include disabling ``--gc-sections``, upgrading to a newer version
+  of BFD, or using the Gold linker.
+
 * Code coverage does not handle unpredictable changes in control flow or stack
   unwinding in the presence of exceptions precisely. Consider the following
   function:

Modified: vendor/clang/dist/docs/ThinLTO.rst
==============================================================================
--- vendor/clang/dist/docs/ThinLTO.rst	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/docs/ThinLTO.rst	Mon Jun 26 20:33:12 2017	(r320376)
@@ -126,6 +126,50 @@ which currently must be enabled through a linker optio
 - lld (as of LLVM r296702):
   ``-Wl,--thinlto-cache-dir=/path/to/cache``
 
+Cache Pruning
+-------------
+
+To help keep the size of the cache under control, ThinLTO supports cache
+pruning. Cache pruning is supported with ld64 and ELF lld, but currently only
+ELF lld allows you to control the policy with a policy string.  The cache
+policy must be specified with a linker option.
+
+- ELF lld (as of LLVM r298036):
+  ``-Wl,--thinlto-cache-policy,POLICY``
+
+A policy string is a series of key-value pairs separated by ``:`` characters.
+Possible key-value pairs are:
+
+- ``cache_size=X%``: The maximum size for the cache directory is ``X`` percent
+  of the available space on the the disk. Set to 100 to indicate no limit,
+  50 to indicate that the cache size will not be left over half the available
+  disk space. A value over 100 is invalid. A value of 0 disables the percentage
+  size-based pruning. The default is 75%.
+
+- ``cache_size_bytes=X``, ``cache_size_bytes=Xk``, ``cache_size_bytes=Xm``,
+  ``cache_size_bytes=Xg``:
+  Sets the maximum size for the cache directory to ``X`` bytes (or KB, MB,
+  GB respectively). A value over the amount of available space on the disk
+  will be reduced to the amount of available space. A value of 0 disables
+  the byte size-based pruning. The default is no byte size-based pruning.
+
+  Note that ThinLTO will apply both size-based pruning policies simultaneously,
+  and changing one does not affect the other. For example, a policy of
+  ``cache_size_bytes=1g`` on its own will cause both the 1GB and default 75%
+  policies to be applied unless the default ``cache_size`` is overridden.
+
+- ``prune_after=Xs``, ``prune_after=Xm``, ``prune_after=Xh``: Sets the
+  expiration time for cache files to ``X`` seconds (or minutes, hours
+  respectively).  When a file hasn't been accessed for ``prune_after`` seconds,
+  it is removed from the cache. A value of 0 disables the expiration-based
+  pruning. The default is 1 week.
+
+- ``prune_interval=Xs``, ``prune_interval=Xm``, ``prune_interval=Xh``:
+  Sets the pruning interval to ``X`` seconds (or minutes, hours
+  respectively). This is intended to be used to avoid scanning the directory
+  too often. It does not impact the decision of which files to prune. A
+  value of 0 forces the scan to occur. The default is every 20 minutes.
+
 Clang Bootstrap
 ---------------
 

Modified: vendor/clang/dist/docs/tools/dump_format_style.py
==============================================================================
--- vendor/clang/dist/docs/tools/dump_format_style.py	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/docs/tools/dump_format_style.py	Mon Jun 26 20:33:12 2017	(r320376)
@@ -24,10 +24,10 @@ def doxygen2rst(text):
   text = re.sub(r'\\\w+ ', '', text)
   return text
 
-def indent(text, columns):
+def indent(text, columns, indent_first_line=True):
   indent = ' ' * columns
   s = re.sub(r'\n([^\n])', '\n' + indent + '\\1', text, flags=re.S)
-  if s.startswith('\n'):
+  if not indent_first_line or s.startswith('\n'):
     return s
   return indent + s
 
@@ -64,7 +64,9 @@ class NestedField:
     self.comment = comment.strip()
 
   def __str__(self):
-    return '\n* ``%s`` %s' % (self.name, doxygen2rst(self.comment))
+    return '\n* ``%s`` %s' % (
+        self.name,
+        doxygen2rst(indent(self.comment, 2, indent_first_line=False)))
 
 class Enum:
   def __init__(self, name, comment):
@@ -179,7 +181,7 @@ def read_options(header):
       if enums.has_key(option.type):
         option.enum = enums[option.type]
       elif nested_structs.has_key(option.type):
-        option.nested_struct = nested_structs[option.type];
+        option.nested_struct = nested_structs[option.type]
       else:
         raise Exception('Unknown type: %s' % option.type)
   return options
@@ -195,4 +197,3 @@ contents = substitute(contents, 'FORMAT_STYLE_OPTIONS'
 
 with open(DOC_FILE, 'wb') as output:
   output.write(contents)
-

Modified: vendor/clang/dist/include/clang-c/CXCompilationDatabase.h
==============================================================================
--- vendor/clang/dist/include/clang-c/CXCompilationDatabase.h	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/include/clang-c/CXCompilationDatabase.h	Mon Jun 26 20:33:12 2017	(r320376)
@@ -7,7 +7,7 @@
 |*                                                                            *|
 |*===----------------------------------------------------------------------===*|
 |*                                                                            *|
-|* This header provides a public inferface to use CompilationDatabase without *|
+|* This header provides a public interface to use CompilationDatabase without *|
 |* the full Clang C++ API.                                                    *|
 |*                                                                            *|
 \*===----------------------------------------------------------------------===*/

Modified: vendor/clang/dist/include/clang-c/Index.h
==============================================================================
--- vendor/clang/dist/include/clang-c/Index.h	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/include/clang-c/Index.h	Mon Jun 26 20:33:12 2017	(r320376)
@@ -7,7 +7,7 @@
 |*                                                                            *|
 |*===----------------------------------------------------------------------===*|
 |*                                                                            *|
-|* This header provides a public inferface to a Clang library for extracting  *|
+|* This header provides a public interface to a Clang library for extracting  *|
 |* high-level symbol information from source files without exposing the full  *|
 |* Clang C++ API.                                                             *|
 |*                                                                            *|

Modified: vendor/clang/dist/include/clang/AST/Decl.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/Decl.h	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/include/clang/AST/Decl.h	Mon Jun 26 20:33:12 2017	(r320376)
@@ -1656,6 +1656,7 @@ class FunctionDecl : public DeclaratorDecl, public Dec
   unsigned HasImplicitReturnZero : 1;
   unsigned IsLateTemplateParsed : 1;
   unsigned IsConstexpr : 1;
+  unsigned InstantiationIsPending:1;
 
   /// \brief Indicates if the function uses __try.
   unsigned UsesSEHTry : 1;
@@ -1751,6 +1752,7 @@ class FunctionDecl : public DeclaratorDecl, public Dec
         IsDeleted(false), IsTrivial(false), IsDefaulted(false),
         IsExplicitlyDefaulted(false), HasImplicitReturnZero(false),
         IsLateTemplateParsed(false), IsConstexpr(isConstexprSpecified),
+        InstantiationIsPending(false),
         UsesSEHTry(false), HasSkippedBody(false), WillHaveBody(false),
         EndRangeLoc(NameInfo.getEndLoc()), TemplateOrSpecialization(),
         DNLoc(NameInfo.getInfo()) {}
@@ -1872,7 +1874,7 @@ class FunctionDecl : public DeclaratorDecl, public Dec
   ///
   bool isThisDeclarationADefinition() const {
     return IsDeleted || IsDefaulted || Body || IsLateTemplateParsed ||
-      hasDefiningAttr();
+      WillHaveBody || hasDefiningAttr();
   }
 
   /// doesThisDeclarationHaveABody - Returns whether this specific
@@ -1942,6 +1944,15 @@ class FunctionDecl : public DeclaratorDecl, public Dec
   /// Whether this is a (C++11) constexpr function or constexpr constructor.
   bool isConstexpr() const { return IsConstexpr; }
   void setConstexpr(bool IC) { IsConstexpr = IC; }
+
+  /// \brief Whether the instantiation of this function is pending.
+  /// This bit is set when the decision to instantiate this function is made
+  /// and unset if and when the function body is created. That leaves out
+  /// cases where instantiation did not happen because the template definition
+  /// was not seen in this TU. This bit remains set in those cases, under the
+  /// assumption that the instantiation will happen in some other TU.
+  bool instantiationIsPending() const { return InstantiationIsPending; }
+  void setInstantiationIsPending(bool IC) { InstantiationIsPending = IC; }
 
   /// \brief Indicates the function uses __try.
   bool usesSEHTry() const { return UsesSEHTry; }

Modified: vendor/clang/dist/include/clang/AST/DeclBase.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/DeclBase.h	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/include/clang/AST/DeclBase.h	Mon Jun 26 20:33:12 2017	(r320376)
@@ -202,26 +202,33 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu
     OBJC_TQ_CSNullability = 0x40
   };
 
-protected:
-  // Enumeration values used in the bits stored in NextInContextAndBits.
-  enum {
-    /// \brief Whether this declaration is a top-level declaration (function,
-    /// global variable, etc.) that is lexically inside an objc container
-    /// definition.
-    TopLevelDeclInObjCContainerFlag = 0x01,
-    
-    /// \brief Whether this declaration is private to the module in which it was
-    /// defined.
-    ModulePrivateFlag = 0x02
+  /// The kind of ownership a declaration has, for visibility purposes.
+  /// This enumeration is designed such that higher values represent higher
+  /// levels of name hiding.
+  enum class ModuleOwnershipKind : unsigned {
+    /// This declaration is not owned by a module.
+    Unowned,
+    /// This declaration has an owning module, but is globally visible
+    /// (typically because its owning module is visible and we know that
+    /// modules cannot later become hidden in this compilation).
+    /// After serialization and deserialization, this will be converted
+    /// to VisibleWhenImported.
+    Visible,
+    /// This declaration has an owning module, and is visible when that
+    /// module is imported.
+    VisibleWhenImported,
+    /// This declaration has an owning module, but is only visible to
+    /// lookups that occur within that module.
+    ModulePrivate
   };
-  
+
+protected:
   /// \brief The next declaration within the same lexical
   /// DeclContext. These pointers form the linked list that is
   /// traversed via DeclContext's decls_begin()/decls_end().
   ///
-  /// The extra two bits are used for the TopLevelDeclInObjCContainer and
-  /// ModulePrivate bits.
-  llvm::PointerIntPair<Decl *, 2, unsigned> NextInContextAndBits;
+  /// The extra two bits are used for the ModuleOwnershipKind.
+  llvm::PointerIntPair<Decl *, 2, ModuleOwnershipKind> NextInContextAndBits;
 
 private:
   friend class DeclContext;
@@ -282,6 +289,11 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu
   /// are regarded as "referenced" but not "used".
   unsigned Referenced : 1;
 
+  /// \brief Whether this declaration is a top-level declaration (function,
+  /// global variable, etc.) that is lexically inside an objc container
+  /// definition.
+  unsigned TopLevelDeclInObjCContainer : 1;
+  
   /// \brief Whether statistic collection is enabled.
   static bool StatisticsEnabled;
 
@@ -294,11 +306,6 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu
   /// \brief Whether this declaration was loaded from an AST file.
   unsigned FromASTFile : 1;
 
-  /// \brief Whether this declaration is hidden from normal name lookup, e.g.,
-  /// because it is was loaded from an AST file is either module-private or
-  /// because its submodule has not been made visible.
-  unsigned Hidden : 1;
-  
   /// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
   unsigned IdentifierNamespace : 13;
 
@@ -332,26 +339,38 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu
 private:
   bool AccessDeclContextSanity() const;
 
+  /// Get the module ownership kind to use for a local lexical child of \p DC,
+  /// which may be either a local or (rarely) an imported declaration.
+  static ModuleOwnershipKind getModuleOwnershipKindForChildOf(DeclContext *DC) {
+    if (DC) {
+      auto *D = cast<Decl>(DC);
+      auto MOK = D->getModuleOwnershipKind();
+      if (MOK != ModuleOwnershipKind::Unowned &&
+          (!D->isFromASTFile() || D->hasLocalOwningModuleStorage()))
+        return MOK;
+      // If D is not local and we have no local module storage, then we don't
+      // need to track module ownership at all.
+    }
+    return ModuleOwnershipKind::Unowned;
+  }
+
 protected:
   Decl(Kind DK, DeclContext *DC, SourceLocation L)
-      : NextInContextAndBits(), DeclCtx(DC), Loc(L), DeclKind(DK),
-        InvalidDecl(0), HasAttrs(false), Implicit(false), Used(false),
-        Referenced(false), Access(AS_none), FromASTFile(0),
-        Hidden(DC && cast<Decl>(DC)->Hidden &&
-               (!cast<Decl>(DC)->isFromASTFile() ||
-                hasLocalOwningModuleStorage())),
+      : NextInContextAndBits(nullptr, getModuleOwnershipKindForChildOf(DC)),
+        DeclCtx(DC), Loc(L), DeclKind(DK), InvalidDecl(0), HasAttrs(false),
+        Implicit(false), Used(false), Referenced(false),
+        TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0),
         IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
         CacheValidAndLinkage(0) {
     if (StatisticsEnabled) add(DK);
   }
 
   Decl(Kind DK, EmptyShell Empty)
-    : NextInContextAndBits(), DeclKind(DK), InvalidDecl(0),
-      HasAttrs(false), Implicit(false), Used(false), Referenced(false),
-      Access(AS_none), FromASTFile(0), Hidden(0),
-      IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
-      CacheValidAndLinkage(0)
-  {
+      : NextInContextAndBits(), DeclKind(DK), InvalidDecl(0), HasAttrs(false),
+        Implicit(false), Used(false), Referenced(false),
+        TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0),
+        IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
+        CacheValidAndLinkage(0) {
     if (StatisticsEnabled) add(DK);
   }
 
@@ -551,16 +570,11 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu
   /// global variable, etc.) that is lexically inside an objc container
   /// definition.
   bool isTopLevelDeclInObjCContainer() const {
-    return NextInContextAndBits.getInt() & TopLevelDeclInObjCContainerFlag;
+    return TopLevelDeclInObjCContainer;
   }
 
   void setTopLevelDeclInObjCContainer(bool V = true) {
-    unsigned Bits = NextInContextAndBits.getInt();
-    if (V)
-      Bits |= TopLevelDeclInObjCContainerFlag;
-    else
-      Bits &= ~TopLevelDeclInObjCContainerFlag;
-    NextInContextAndBits.setInt(Bits);
+    TopLevelDeclInObjCContainer = V;
   }
 
   /// \brief Looks on this and related declarations for an applicable
@@ -570,7 +584,7 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu
   /// \brief Whether this declaration was marked as being private to the
   /// module in which it was defined.
   bool isModulePrivate() const {
-    return NextInContextAndBits.getInt() & ModulePrivateFlag;
+    return getModuleOwnershipKind() == ModuleOwnershipKind::ModulePrivate;
   }
 
   /// \brief Whether this declaration is exported (by virtue of being lexically
@@ -585,15 +599,14 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu
   const Attr *getDefiningAttr() const;
 
 protected:
-  /// \brief Specify whether this declaration was marked as being private
+  /// \brief Specify that this declaration was marked as being private
   /// to the module in which it was defined.
-  void setModulePrivate(bool MP = true) {
-    unsigned Bits = NextInContextAndBits.getInt();
-    if (MP)
-      Bits |= ModulePrivateFlag;
-    else
-      Bits &= ~ModulePrivateFlag;
-    NextInContextAndBits.setInt(Bits);
+  void setModulePrivate() {
+    // The module-private specifier has no effect on unowned declarations.
+    // FIXME: We should track this in some way for source fidelity.
+    if (getModuleOwnershipKind() == ModuleOwnershipKind::Unowned)
+      return;
+    setModuleOwnershipKind(ModuleOwnershipKind::ModulePrivate);
   }
 
   /// \brief Set the owning module ID.
@@ -692,7 +705,7 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu
   /// \brief Get the imported owning module, if this decl is from an imported
   /// (non-local) module.
   Module *getImportedOwningModule() const {
-    if (!isFromASTFile())
+    if (!isFromASTFile() || !hasOwningModule())
       return nullptr;
 
     return getOwningModuleSlow();
@@ -701,31 +714,57 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu
   /// \brief Get the local owning module, if known. Returns nullptr if owner is
   /// not yet known or declaration is not from a module.
   Module *getLocalOwningModule() const {
-    if (isFromASTFile() || !Hidden)
+    if (isFromASTFile() || !hasOwningModule())
       return nullptr;
 
     assert(hasLocalOwningModuleStorage() &&
-           "hidden local decl but no local module storage");
+           "owned local decl but no local module storage");
     return reinterpret_cast<Module *const *>(this)[-1];
   }
   void setLocalOwningModule(Module *M) {
-    assert(!isFromASTFile() && Hidden && hasLocalOwningModuleStorage() &&
+    assert(!isFromASTFile() && hasOwningModule() &&
+           hasLocalOwningModuleStorage() &&
            "should not have a cached owning module");
     reinterpret_cast<Module **>(this)[-1] = M;
   }
 
+  /// Is this declaration owned by some module?
+  bool hasOwningModule() const {
+    return getModuleOwnershipKind() != ModuleOwnershipKind::Unowned;
+  }
+
+  /// Get the module that owns this declaration.
   Module *getOwningModule() const {
     return isFromASTFile() ? getImportedOwningModule() : getLocalOwningModule();
   }
 
-  /// \brief Determine whether this declaration is hidden from name lookup.
-  bool isHidden() const { return Hidden; }
+  /// \brief Determine whether this declaration might be hidden from name
+  /// lookup. Note that the declaration might be visible even if this returns
+  /// \c false, if the owning module is visible within the query context.
+  // FIXME: Rename this to make it clearer what it does.
+  bool isHidden() const {
+    return (int)getModuleOwnershipKind() > (int)ModuleOwnershipKind::Visible;
+  }
 
+  /// Set that this declaration is globally visible, even if it came from a
+  /// module that is not visible.
+  void setVisibleDespiteOwningModule() {
+    if (hasOwningModule())
+      setModuleOwnershipKind(ModuleOwnershipKind::Visible);
+  }
+
+  /// \brief Get the kind of module ownership for this declaration.
+  ModuleOwnershipKind getModuleOwnershipKind() const {
+    return NextInContextAndBits.getInt();
+  }
+
   /// \brief Set whether this declaration is hidden from name lookup.
-  void setHidden(bool Hide) {
-    assert((!Hide || isFromASTFile() || hasLocalOwningModuleStorage()) &&
-           "declaration with no owning module can't be hidden");
-    Hidden = Hide;
+  void setModuleOwnershipKind(ModuleOwnershipKind MOK) {
+    assert(!(getModuleOwnershipKind() == ModuleOwnershipKind::Unowned &&
+             MOK != ModuleOwnershipKind::Unowned && !isFromASTFile() &&
+             !hasLocalOwningModuleStorage()) &&
+           "no storage available for owning module for this declaration");
+    NextInContextAndBits.setInt(MOK);
   }
 
   unsigned getIdentifierNamespace() const {

Modified: vendor/clang/dist/include/clang/Analysis/CloneDetection.h
==============================================================================
--- vendor/clang/dist/include/clang/Analysis/CloneDetection.h	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/include/clang/Analysis/CloneDetection.h	Mon Jun 26 20:33:12 2017	(r320376)
@@ -17,6 +17,8 @@
 
 #include "clang/Basic/SourceLocation.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Regex.h"
 #include <vector>
 
 namespace clang {
@@ -317,6 +319,26 @@ class MinGroupSizeConstraint { (public)
 /// Ensures that no clone group fully contains another clone group.
 struct OnlyLargestCloneConstraint {
   void constrain(std::vector<CloneDetector::CloneGroup> &Result);
+};
+
+struct FilenamePatternConstraint {
+  StringRef IgnoredFilesPattern;
+  std::shared_ptr<llvm::Regex> IgnoredFilesRegex;
+
+  FilenamePatternConstraint(StringRef IgnoredFilesPattern) 
+      : IgnoredFilesPattern(IgnoredFilesPattern) {
+    IgnoredFilesRegex = std::make_shared<llvm::Regex>("^(" +
+        IgnoredFilesPattern.str() + "$)");
+  }
+
+  bool isAutoGenerated(const CloneDetector::CloneGroup &Group);
+
+  void constrain(std::vector<CloneDetector::CloneGroup> &CloneGroups) {
+    CloneConstraint::filterGroups(
+        CloneGroups, [this](const CloneDetector::CloneGroup &Group) {
+          return isAutoGenerated(Group);
+        });
+  }
 };
 
 /// Analyzes the pattern of the referenced variables in a statement.

Modified: vendor/clang/dist/include/clang/Basic/Builtins.def
==============================================================================
--- vendor/clang/dist/include/clang/Basic/Builtins.def	Mon Jun 26 20:33:01 2017	(r320375)
+++ vendor/clang/dist/include/clang/Basic/Builtins.def	Mon Jun 26 20:33:12 2017	(r320376)
@@ -52,6 +52,7 @@
 //  LL  -> long long
 //  LLL -> __int128_t (e.g. LLLi)
 //  W   -> int64_t
+//  N   -> 'int' size if target is LP64, 'L' otherwise.
 //  S   -> signed
 //  U   -> unsigned
 //  I   -> Required to constant fold to an integer constant expression.
@@ -718,11 +719,11 @@ BUILTIN(__builtin_rindex, "c*cC*i", "Fn")
 LANGBUILTIN(_alloca,          "v*z", "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(__assume,         "vb",  "n", ALL_MS_LANGUAGES)
 LIBBUILTIN(_byteswap_ushort, "UsUs",     "fnc", "stdlib.h", ALL_MS_LANGUAGES)
-LIBBUILTIN(_byteswap_ulong,  "ULiULi",   "fnc", "stdlib.h", ALL_MS_LANGUAGES)
+LIBBUILTIN(_byteswap_ulong,  "UNiUNi",   "fnc", "stdlib.h", ALL_MS_LANGUAGES)
 LIBBUILTIN(_byteswap_uint64, "ULLiULLi", "fnc", "stdlib.h", ALL_MS_LANGUAGES)
 LANGBUILTIN(__debugbreak,     "v",   "n", ALL_MS_LANGUAGES)
-LANGBUILTIN(__exception_code, "ULi", "n", ALL_MS_LANGUAGES)
-LANGBUILTIN(_exception_code,  "ULi", "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(__exception_code, "UNi", "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_exception_code,  "UNi", "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(__exception_info, "v*",  "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_exception_info,  "v*",  "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(__abnormal_termination, "i", "n", ALL_MS_LANGUAGES)
@@ -730,33 +731,33 @@ LANGBUILTIN(_abnormal_termination,  "i", "n", ALL_MS_L
 LANGBUILTIN(__GetExceptionInfo, "v*.", "ntu", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedAnd8,   "ccD*c",        "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedAnd16,  "ssD*s",        "n", ALL_MS_LANGUAGES)
-LANGBUILTIN(_InterlockedAnd,    "LiLiD*Li",     "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedAnd,    "NiNiD*Ni",     "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedCompareExchange8,   "ccD*cc",         "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedCompareExchange16,  "ssD*ss",         "n", ALL_MS_LANGUAGES)
-LANGBUILTIN(_InterlockedCompareExchange,    "LiLiD*LiLi",     "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedCompareExchange,    "NiNiD*NiNi",     "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedCompareExchange64,  "LLiLLiD*LLiLLi", "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedCompareExchangePointer, "v*v*D*v*v*", "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedDecrement16,        "ssD*",     "n", ALL_MS_LANGUAGES)
-LANGBUILTIN(_InterlockedDecrement,          "LiLiD*",   "n", ALL_MS_LANGUAGES)
-LANGBUILTIN(_InterlockedExchange,           "LiLiD*Li",     "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedDecrement,          "NiNiD*",   "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedExchange,           "NiNiD*Ni",     "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedExchange8,          "ccD*c",        "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedExchange16,         "ssD*s",        "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedExchangeAdd8,       "ccD*c",          "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedExchangeAdd16,      "ssD*s",          "n", ALL_MS_LANGUAGES)
-LANGBUILTIN(_InterlockedExchangeAdd,        "LiLiD*Li",       "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedExchangeAdd,        "NiNiD*Ni",       "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedExchangePointer,    "v*v*D*v*",   "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedExchangeSub8,   "ccD*c",        "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedExchangeSub16,  "ssD*s",        "n", ALL_MS_LANGUAGES)
-LANGBUILTIN(_InterlockedExchangeSub,    "LiLiD*Li",     "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedExchangeSub,    "NiNiD*Ni",     "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(_InterlockedIncrement16,        "ssD*",     "n", ALL_MS_LANGUAGES)
-LANGBUILTIN(_InterlockedIncrement,          "LiLiD*",   "n", ALL_MS_LANGUAGES)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-vendor mailing list