Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 May 2017 19:47:09 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r318370 - in vendor/clang/dist: . cmake/caches docs include/clang-c include/clang/AST include/clang/Basic include/clang/Driver include/clang/Format include/clang/Frontend include/clang/...
Message-ID:  <201705161947.v4GJl98T096916@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Tue May 16 19:47:09 2017
New Revision: 318370
URL: https://svnweb.freebsd.org/changeset/base/318370

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

Added:
  vendor/clang/dist/test/Analysis/builtin-assume.c   (contents, props changed)
  vendor/clang/dist/test/CXX/drs/dr20xx.cpp   (contents, props changed)
  vendor/clang/dist/test/CodeGen/asan-no-globals-no-comdat.cpp   (contents, props changed)
  vendor/clang/dist/test/CodeGen/mips-aggregate-arg.c   (contents, props changed)
  vendor/clang/dist/test/CodeGen/sparcv8-inline-asm.c   (contents, props changed)
  vendor/clang/dist/test/CodeGen/x86_64-mno-sse.c   (contents, props changed)
  vendor/clang/dist/test/CodeGen/xray-customevent.cpp   (contents, props changed)
  vendor/clang/dist/test/CodeGenCXX/array-default-argument.cpp   (contents, props changed)
  vendor/clang/dist/test/Import/conflicting-struct/
  vendor/clang/dist/test/Import/conflicting-struct/Inputs/
  vendor/clang/dist/test/Import/conflicting-struct/Inputs/S1.cpp   (contents, props changed)
  vendor/clang/dist/test/Import/conflicting-struct/Inputs/S2.cpp   (contents, props changed)
  vendor/clang/dist/test/Import/conflicting-struct/test.cpp   (contents, props changed)
  vendor/clang/dist/test/Index/Core/index-dependent-source.cpp   (contents, props changed)
  vendor/clang/dist/test/Index/Core/index-instantiated-source.cpp   (contents, props changed)
  vendor/clang/dist/test/Index/complete-available.m
  vendor/clang/dist/test/Modules/DebugInfoNamespace.cpp   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/DebugInfoNamespace/
  vendor/clang/dist/test/Modules/Inputs/DebugInfoNamespace/A.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/DebugInfoNamespace/B.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/DebugInfoNamespace/module.modulemap
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Frameworks/
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Frameworks/Sub.framework/
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Frameworks/Sub.framework/Headers/
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Frameworks/Sub.framework/Headers/B.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Frameworks/Sub.framework/Headers/Sub.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Frameworks/Sub.framework/PrivateHeaders/
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Frameworks/Sub.framework/PrivateHeaders/BPriv.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Frameworks/Sub.framework/PrivateHeaders/SubPriv.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Headers/
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Headers/A.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Headers/Main.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Modules/
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Modules/module.modulemap
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/Modules/module.private.modulemap
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/PrivateHeaders/
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/PrivateHeaders/APriv.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/MainA.framework/PrivateHeaders/MainPriv.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/SameHeader/
  vendor/clang/dist/test/Modules/Inputs/SameHeader/A.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/SameHeader/B.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/SameHeader/C.h   (contents, props changed)
  vendor/clang/dist/test/Modules/Inputs/SameHeader/module.modulemap
  vendor/clang/dist/test/Modules/redefinition-same-header.m
  vendor/clang/dist/test/OpenMP/report_default_DSA.cpp   (contents, props changed)
  vendor/clang/dist/test/Sema/redefinition-same-header.c   (contents, props changed)
  vendor/clang/dist/test/Sema/vector-gcc-compat.c   (contents, props changed)
  vendor/clang/dist/test/Sema/vector-gcc-compat.cpp   (contents, props changed)
  vendor/clang/dist/test/SemaObjCXX/interface-return-type.mm
  vendor/clang/dist/test/SemaObjCXX/is-base-of.mm
  vendor/clang/dist/test/SemaOpenCL/array-init.cl
  vendor/clang/dist/test/SemaTemplate/typo-template-name.cpp   (contents, props changed)
Modified:
  vendor/clang/dist/CMakeLists.txt
  vendor/clang/dist/cmake/caches/Apple-stage2.cmake
  vendor/clang/dist/cmake/caches/DistributionExample.cmake
  vendor/clang/dist/docs/CMakeLists.txt
  vendor/clang/dist/docs/ClangFormatStyleOptions.rst
  vendor/clang/dist/docs/ThreadSafetyAnalysis.rst
  vendor/clang/dist/include/clang-c/Index.h
  vendor/clang/dist/include/clang/AST/CXXInheritance.h
  vendor/clang/dist/include/clang/AST/Decl.h
  vendor/clang/dist/include/clang/AST/DeclCXX.h
  vendor/clang/dist/include/clang/AST/ExternalASTMerger.h
  vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h
  vendor/clang/dist/include/clang/Basic/Attr.td
  vendor/clang/dist/include/clang/Basic/Builtins.def
  vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td
  vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
  vendor/clang/dist/include/clang/Basic/TargetOptions.h
  vendor/clang/dist/include/clang/Driver/Options.td
  vendor/clang/dist/include/clang/Driver/SanitizerArgs.h
  vendor/clang/dist/include/clang/Format/Format.h
  vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def
  vendor/clang/dist/include/clang/Lex/MacroInfo.h
  vendor/clang/dist/include/clang/Lex/Preprocessor.h
  vendor/clang/dist/include/clang/Parse/Parser.h
  vendor/clang/dist/include/clang/Sema/Sema.h
  vendor/clang/dist/include/clang/Tooling/RefactoringCallbacks.h
  vendor/clang/dist/lib/AST/ASTImporter.cpp
  vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp
  vendor/clang/dist/lib/AST/CXXInheritance.cpp
  vendor/clang/dist/lib/AST/DeclCXX.cpp
  vendor/clang/dist/lib/AST/ExternalASTMerger.cpp
  vendor/clang/dist/lib/AST/ODRHash.cpp
  vendor/clang/dist/lib/AST/Stmt.cpp
  vendor/clang/dist/lib/AST/Type.cpp
  vendor/clang/dist/lib/Basic/Targets.cpp
  vendor/clang/dist/lib/CodeGen/BackendUtil.cpp
  vendor/clang/dist/lib/CodeGen/CGBlocks.cpp
  vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp
  vendor/clang/dist/lib/CodeGen/CGCUDANV.cpp
  vendor/clang/dist/lib/CodeGen/CGCleanup.cpp
  vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp
  vendor/clang/dist/lib/CodeGen/CGDebugInfo.h
  vendor/clang/dist/lib/CodeGen/CGDecl.cpp
  vendor/clang/dist/lib/CodeGen/CGException.cpp
  vendor/clang/dist/lib/CodeGen/CGExpr.cpp
  vendor/clang/dist/lib/CodeGen/CGExprAgg.cpp
  vendor/clang/dist/lib/CodeGen/CGExprConstant.cpp
  vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp
  vendor/clang/dist/lib/CodeGen/CGObjCGNU.cpp
  vendor/clang/dist/lib/CodeGen/CGObjCMac.cpp
  vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenAction.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenTypes.cpp
  vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp
  vendor/clang/dist/lib/CodeGen/TargetInfo.cpp
  vendor/clang/dist/lib/Driver/SanitizerArgs.cpp
  vendor/clang/dist/lib/Driver/ToolChains/Arch/Mips.cpp
  vendor/clang/dist/lib/Driver/ToolChains/Myriad.cpp
  vendor/clang/dist/lib/Driver/ToolChains/WebAssembly.cpp
  vendor/clang/dist/lib/Format/ContinuationIndenter.cpp
  vendor/clang/dist/lib/Format/Format.cpp
  vendor/clang/dist/lib/Format/TokenAnnotator.cpp
  vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp
  vendor/clang/dist/lib/Format/WhitespaceManager.cpp
  vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp
  vendor/clang/dist/lib/Headers/avxintrin.h
  vendor/clang/dist/lib/Headers/emmintrin.h
  vendor/clang/dist/lib/Headers/intrin.h
  vendor/clang/dist/lib/Headers/mmintrin.h
  vendor/clang/dist/lib/Headers/opencl-c.h
  vendor/clang/dist/lib/Headers/pmmintrin.h
  vendor/clang/dist/lib/Headers/prfchwintrin.h
  vendor/clang/dist/lib/Headers/smmintrin.h
  vendor/clang/dist/lib/Headers/tmmintrin.h
  vendor/clang/dist/lib/Headers/x86intrin.h
  vendor/clang/dist/lib/Headers/xmmintrin.h
  vendor/clang/dist/lib/Index/IndexBody.cpp
  vendor/clang/dist/lib/Index/IndexDecl.cpp
  vendor/clang/dist/lib/Index/IndexTypeSourceInfo.cpp
  vendor/clang/dist/lib/Index/IndexingContext.cpp
  vendor/clang/dist/lib/Lex/MacroInfo.cpp
  vendor/clang/dist/lib/Lex/ModuleMap.cpp
  vendor/clang/dist/lib/Lex/PPDirectives.cpp
  vendor/clang/dist/lib/Lex/Preprocessor.cpp
  vendor/clang/dist/lib/Parse/ParseDecl.cpp
  vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp
  vendor/clang/dist/lib/Parse/ParseExpr.cpp
  vendor/clang/dist/lib/Parse/ParseExprCXX.cpp
  vendor/clang/dist/lib/Parse/ParseTemplate.cpp
  vendor/clang/dist/lib/Sema/CMakeLists.txt
  vendor/clang/dist/lib/Sema/Sema.cpp
  vendor/clang/dist/lib/Sema/SemaCast.cpp
  vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp
  vendor/clang/dist/lib/Sema/SemaDecl.cpp
  vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp
  vendor/clang/dist/lib/Sema/SemaExpr.cpp
  vendor/clang/dist/lib/Sema/SemaExprCXX.cpp
  vendor/clang/dist/lib/Sema/SemaExprObjC.cpp
  vendor/clang/dist/lib/Sema/SemaInit.cpp
  vendor/clang/dist/lib/Sema/SemaLookup.cpp
  vendor/clang/dist/lib/Sema/SemaOverload.cpp
  vendor/clang/dist/lib/Sema/SemaStmt.cpp
  vendor/clang/dist/lib/Sema/SemaTemplate.cpp
  vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp
  vendor/clang/dist/lib/Sema/SemaType.cpp
  vendor/clang/dist/lib/Serialization/ASTReader.cpp
  vendor/clang/dist/lib/Serialization/ASTWriter.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/SelectorExtras.h
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
  vendor/clang/dist/lib/Tooling/RefactoringCallbacks.cpp
  vendor/clang/dist/test/CXX/drs/dr4xx.cpp
  vendor/clang/dist/test/CodeCompletion/member-access.cpp
  vendor/clang/dist/test/CodeGen/asan-globals-gc.cpp
  vendor/clang/dist/test/CodeGen/sanitize-recover.c
  vendor/clang/dist/test/CodeGen/thinlto_backend.ll
  vendor/clang/dist/test/CodeGenCXX/linetable-virtual-variadic.cpp
  vendor/clang/dist/test/CodeGenCXX/vla.cpp
  vendor/clang/dist/test/CodeGenObjC/arc-blocks.m
  vendor/clang/dist/test/CodeGenObjC/arc-foreach.m
  vendor/clang/dist/test/CodeGenOpenCL/amdgpu-debug-info-pointer-address-space.cl
  vendor/clang/dist/test/CodeGenOpenCL/amdgpu-debug-info-variable-expression.cl
  vendor/clang/dist/test/CodeGenOpenCL/constant-addr-space-globals.cl
  vendor/clang/dist/test/Driver/fsanitize.c
  vendor/clang/dist/test/Driver/myriad-toolchain.c
  vendor/clang/dist/test/Driver/wasm-toolchain.c
  vendor/clang/dist/test/FixIt/fixit-availability.c
  vendor/clang/dist/test/FixIt/fixit-availability.mm
  vendor/clang/dist/test/Index/Core/index-source.cpp
  vendor/clang/dist/test/Index/get-cursor.m
  vendor/clang/dist/test/Misc/warning-flags.c
  vendor/clang/dist/test/Modules/DebugInfoSubmoduleImport.c
  vendor/clang/dist/test/Modules/find-privateheaders.m
  vendor/clang/dist/test/Modules/odr_hash.cpp
  vendor/clang/dist/test/Modules/preprocess-module.cpp
  vendor/clang/dist/test/PCH/cxx-templates.cpp
  vendor/clang/dist/test/PCH/cxx-templates.h
  vendor/clang/dist/test/Parser/objc-available.m
  vendor/clang/dist/test/Preprocessor/predefined-arch-macros.c
  vendor/clang/dist/test/Preprocessor/x86_target_features.c
  vendor/clang/dist/test/Sema/overloadable.c
  vendor/clang/dist/test/Sema/typo-correction.c
  vendor/clang/dist/test/Sema/vector-cast.c
  vendor/clang/dist/test/Sema/vector-ops.c
  vendor/clang/dist/test/Sema/zvector.c
  vendor/clang/dist/test/SemaCXX/constructor-initializer.cpp
  vendor/clang/dist/test/SemaCXX/cxx1y-generic-lambdas.cpp
  vendor/clang/dist/test/SemaCXX/cxx1y-variable-templates_top_level.cpp
  vendor/clang/dist/test/SemaCXX/enable_if.cpp
  vendor/clang/dist/test/SemaCXX/for-range-examples.cpp
  vendor/clang/dist/test/SemaCXX/invalid-member-expr.cpp
  vendor/clang/dist/test/SemaCXX/modules-ts.cppm
  vendor/clang/dist/test/SemaCXX/type-traits.cpp
  vendor/clang/dist/test/SemaCXX/typo-correction.cpp
  vendor/clang/dist/test/SemaCXX/vector-no-lax.cpp
  vendor/clang/dist/test/SemaCXX/warn-unused-filescoped.cpp
  vendor/clang/dist/test/SemaObjC/method-bad-param.m
  vendor/clang/dist/test/SemaObjC/unguarded-availability.m
  vendor/clang/dist/test/SemaOpenCL/storageclass.cl
  vendor/clang/dist/test/SemaTemplate/deduction-crash.cpp
  vendor/clang/dist/test/SemaTemplate/default-arguments.cpp
  vendor/clang/dist/test/SemaTemplate/explicit-instantiation.cpp
  vendor/clang/dist/test/SemaTemplate/explicit-specialization-member.cpp
  vendor/clang/dist/test/SemaTemplate/ms-lookup-template-base-classes.cpp
  vendor/clang/dist/tools/c-index-test/c-index-test.c
  vendor/clang/dist/tools/clang-import-test/clang-import-test.cpp
  vendor/clang/dist/tools/libclang/CIndex.cpp
  vendor/clang/dist/tools/libclang/libclang.exports
  vendor/clang/dist/unittests/Format/FormatTest.cpp
  vendor/clang/dist/unittests/Format/FormatTestJS.cpp
  vendor/clang/dist/unittests/Format/FormatTestSelective.cpp
  vendor/clang/dist/unittests/Tooling/RecursiveASTVisitorTest.cpp
  vendor/clang/dist/unittests/Tooling/RefactoringCallbacksTest.cpp
  vendor/clang/dist/www/cxx_dr_status.html

Modified: vendor/clang/dist/CMakeLists.txt
==============================================================================
--- vendor/clang/dist/CMakeLists.txt	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/CMakeLists.txt	Tue May 16 19:47:09 2017	(r318370)
@@ -579,10 +579,17 @@ if (CLANG_ENABLE_BOOTSTRAP)
     add_dependencies(clang-bootstrap-deps compiler-rt)
   endif()
 
+  set(C_COMPILER "clang")
+  set(CXX_COMPILER "clang++")
+  if(WIN32)
+    set(C_COMPILER "clang-cl.exe")
+    set(CXX_COMPILER "clang-cl.exe")
+  endif()
+
   set(COMPILER_OPTIONS
-    -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++
-    -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
-    -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
+    -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${CXX_COMPILER}
+    -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER}
+    -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/${C_COMPILER})
 
   if(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED)
     add_dependencies(clang-bootstrap-deps llvm-profdata)

Modified: vendor/clang/dist/cmake/caches/Apple-stage2.cmake
==============================================================================
--- vendor/clang/dist/cmake/caches/Apple-stage2.cmake	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/cmake/caches/Apple-stage2.cmake	Tue May 16 19:47:09 2017	(r318370)
@@ -13,6 +13,7 @@ set(CLANG_LINKS_TO_CREATE clang++ cc c++
 set(CMAKE_MACOSX_RPATH ON CACHE BOOL "")
 set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")
 set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
+set(LLVM_ENABLE_MODULES ON CACHE BOOL "")
 set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "")
 set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
 set(BUG_REPORT_URL "http://developer.apple.com/bugreporter/" CACHE STRING "")
@@ -28,8 +29,10 @@ set(LLVM_BUILD_TESTS ON CACHE BOOL "")
 set(LLVM_ENABLE_LTO ON CACHE BOOL "")
 set(CMAKE_C_FLAGS "-fno-stack-protector -fno-common -Wno-profile-instr-unprofiled" CACHE STRING "")
 set(CMAKE_CXX_FLAGS "-fno-stack-protector -fno-common -Wno-profile-instr-unprofiled" CACHE STRING "")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "")
+if(LLVM_ENABLE_LTO AND NOT LLVM_ENABLE_LTO STREQUAL "THIN")
+  set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "")
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "")
+endif()
 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")
 
 set(LIBCXX_INSTALL_LIBRARY OFF CACHE BOOL "")

Modified: vendor/clang/dist/cmake/caches/DistributionExample.cmake
==============================================================================
--- vendor/clang/dist/cmake/caches/DistributionExample.cmake	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/cmake/caches/DistributionExample.cmake	Tue May 16 19:47:09 2017	(r318370)
@@ -29,6 +29,13 @@ set(CLANG_BOOTSTRAP_TARGETS
 
 # Setup the bootstrap build.
 set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
-set(CLANG_BOOTSTRAP_CMAKE_ARGS
-  -C ${CMAKE_CURRENT_LIST_DIR}/DistributionExample-stage2.cmake
-  CACHE STRING "")
+
+if(STAGE2_CACHE_FILE)
+  set(CLANG_BOOTSTRAP_CMAKE_ARGS
+    -C ${STAGE2_CACHE_FILE}
+    CACHE STRING "")
+else()
+  set(CLANG_BOOTSTRAP_CMAKE_ARGS
+    -C ${CMAKE_CURRENT_LIST_DIR}/DistributionExample-stage2.cmake
+    CACHE STRING "")
+endif()

Modified: vendor/clang/dist/docs/CMakeLists.txt
==============================================================================
--- vendor/clang/dist/docs/CMakeLists.txt	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/docs/CMakeLists.txt	Tue May 16 19:47:09 2017	(r318370)
@@ -91,8 +91,8 @@ endif()
 endif()
 
 if (LLVM_ENABLE_SPHINX)
+  include(AddSphinxTarget)
   if (SPHINX_FOUND)
-    include(AddSphinxTarget)
     if (${SPHINX_OUTPUT_HTML})
       add_sphinx_target(html clang)
       add_custom_command(TARGET docs-clang-html POST_BUILD

Modified: vendor/clang/dist/docs/ClangFormatStyleOptions.rst
==============================================================================
--- vendor/clang/dist/docs/ClangFormatStyleOptions.rst	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/docs/ClangFormatStyleOptions.rst	Tue May 16 19:47:09 2017	(r318370)
@@ -209,23 +209,45 @@ the configuration (without a prefix: ``A
     float       b = 23;
     std::string ccc = 23;
 
-**AlignEscapedNewlinesLeft** (``bool``)
-  If ``true``, aligns escaped newlines as far left as possible.
-  Otherwise puts them into the right-most column.
+**AlignEscapedNewlines** (``EscapedNewlineAlignmentStyle``)
+  Options for aligning backslashes in escaped newlines.
 
-  .. code-block:: c++
+  Possible values:
+
+  * ``ENAS_DontAlign`` (in configuration: ``DontAlign``)
+    Don't align escaped newlines.
+
+    .. code-block:: c++
+
+      #define A \
+        int aaaa; \
+        int b; \
+        int dddddddddd;
+
+  * ``ENAS_Left`` (in configuration: ``Left``)
+    Align escaped newlines as far left as possible.
+
+    .. code-block:: c++
+
+      true:
+      #define A   \
+        int aaaa; \
+        int b;    \
+        int dddddddddd;
+
+      false:
+
+  * ``ENAS_Right`` (in configuration: ``Right``)
+    Align escaped newlines in the right-most column.
+
+    .. code-block:: c++
+
+      #define A                                                                      \
+        int aaaa;                                                                    \
+        int b;                                                                       \
+        int dddddddddd;
 
-    true:
-    #define A   \
-      int aaaa; \
-      int b;    \
-      int dddddddddd;
 
-    false:
-    #define A                                                                      \
-      int aaaa;                                                                    \
-      int b;                                                                       \
-      int dddddddddd;
 
 **AlignOperands** (``bool``)
   If ``true``, horizontally align operands of binary and ternary
@@ -1525,7 +1547,7 @@ the configuration (without a prefix: ``A
     Use C++03-compatible syntax.
 
   * ``LS_Cpp11`` (in configuration: ``Cpp11``)
-    Use features of C++11, C++14 and C++1z (e.g. ``A<A<int>>`` instead of 
+    Use features of C++11, C++14 and C++1z (e.g. ``A<A<int>>`` instead of
     ``A<A<int> >``).
 
   * ``LS_Auto`` (in configuration: ``Auto``)

Modified: vendor/clang/dist/docs/ThreadSafetyAnalysis.rst
==============================================================================
--- vendor/clang/dist/docs/ThreadSafetyAnalysis.rst	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/docs/ThreadSafetyAnalysis.rst	Tue May 16 19:47:09 2017	(r318370)
@@ -884,11 +884,11 @@ implementation.
 
   // Deprecated.
   #define PT_GUARDED_VAR \
-    THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded)
+    THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_var)
 
   // Deprecated.
   #define GUARDED_VAR \
-    THREAD_ANNOTATION_ATTRIBUTE__(guarded)
+    THREAD_ANNOTATION_ATTRIBUTE__(guarded_var)
 
   // Replaced by REQUIRES
   #define EXCLUSIVE_LOCKS_REQUIRED(...) \

Modified: vendor/clang/dist/include/clang-c/Index.h
==============================================================================
--- vendor/clang/dist/include/clang-c/Index.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang-c/Index.h	Tue May 16 19:47:09 2017	(r318370)
@@ -32,7 +32,7 @@
  * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
  */
 #define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 38
+#define CINDEX_VERSION_MINOR 39
 
 #define CINDEX_VERSION_ENCODE(major, minor) ( \
       ((major) * 10000)                       \
@@ -4081,6 +4081,23 @@ CINDEX_LINKAGE unsigned clang_Cursor_isO
 CINDEX_LINKAGE unsigned clang_Cursor_isVariadic(CXCursor C);
 
 /**
+ * \brief Returns non-zero if the given cursor points to a symbol marked with
+ * external_source_symbol attribute.
+ *
+ * \param language If non-NULL, and the attribute is present, will be set to
+ * the 'language' string from the attribute.
+ *
+ * \param definedIn If non-NULL, and the attribute is present, will be set to
+ * the 'definedIn' string from the attribute.
+ *
+ * \param isGenerated If non-NULL, and the attribute is present, will be set to
+ * non-zero if the 'generated_declaration' is set in the attribute.
+ */
+CINDEX_LINKAGE unsigned clang_Cursor_isExternalSymbol(CXCursor C,
+                                       CXString *language, CXString *definedIn,
+                                       unsigned *isGenerated);
+
+/**
  * \brief Given a cursor that represents a declaration, return the associated
  * comment's source range.  The range may include multiple consecutive comments
  * with whitespace in between.

Modified: vendor/clang/dist/include/clang/AST/CXXInheritance.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/CXXInheritance.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/AST/CXXInheritance.h	Tue May 16 19:47:09 2017	(r318370)
@@ -161,7 +161,8 @@ class CXXBasePaths {
   void ComputeDeclsFound();
 
   bool lookupInBases(ASTContext &Context, const CXXRecordDecl *Record,
-                     CXXRecordDecl::BaseMatchesCallback BaseMatches);
+                     CXXRecordDecl::BaseMatchesCallback BaseMatches,
+                     bool LookupInDependent = false);
 
 public:
   typedef std::list<CXXBasePath>::iterator paths_iterator;

Modified: vendor/clang/dist/include/clang/AST/Decl.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/Decl.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/AST/Decl.h	Tue May 16 19:47:09 2017	(r318370)
@@ -966,9 +966,16 @@ public:
   /// hasLocalStorage - Returns true if a variable with function scope
   ///  is a non-static local variable.
   bool hasLocalStorage() const {
-    if (getStorageClass() == SC_None)
+    if (getStorageClass() == SC_None) {
+      // OpenCL v1.2 s6.5.3: The __constant or constant address space name is
+      // used to describe variables allocated in global memory and which are
+      // accessed inside a kernel(s) as read-only variables. As such, variables
+      // in constant address space cannot have local storage.
+      if (getType().getAddressSpace() == LangAS::opencl_constant)
+        return false;
       // Second check is for C++11 [dcl.stc]p4.
       return !isFileVarDecl() && getTSCSpec() == TSCS_unspecified;
+    }
 
     // Global Named Register (GNU extension)
     if (getStorageClass() == SC_Register && !isLocalVarDeclOrParm())
@@ -2478,7 +2485,7 @@ public:
   void setCapturedVLAType(const VariableArrayType *VLAType);
 
   /// getParent - Returns the parent of this field declaration, which
-  /// is the struct in which this method is defined.
+  /// is the struct in which this field is defined.
   const RecordDecl *getParent() const {
     return cast<RecordDecl>(getDeclContext());
   }

Modified: vendor/clang/dist/include/clang/AST/DeclCXX.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/DeclCXX.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/AST/DeclCXX.h	Tue May 16 19:47:09 2017	(r318370)
@@ -1563,10 +1563,13 @@ public:
   /// \param Paths used to record the paths from this class to its base class
   /// subobjects that match the search criteria.
   ///
+  /// \param LookupInDependent can be set to true to extend the search to
+  /// dependent base classes.
+  ///
   /// \returns true if there exists any path from this class to a base class
   /// subobject that matches the search criteria.
-  bool lookupInBases(BaseMatchesCallback BaseMatches,
-                     CXXBasePaths &Paths) const;
+  bool lookupInBases(BaseMatchesCallback BaseMatches, CXXBasePaths &Paths,
+                     bool LookupInDependent = false) const;
 
   /// \brief Base-class lookup callback that determines whether the given
   /// base class specifier refers to a specific class declaration.
@@ -1608,6 +1611,16 @@ public:
                                  CXXBasePath &Path, DeclarationName Name);
 
   /// \brief Base-class lookup callback that determines whether there exists
+  /// a member with the given name.
+  ///
+  /// This callback can be used with \c lookupInBases() to find members
+  /// of the given name within a C++ class hierarchy, including dependent
+  /// classes.
+  static bool
+  FindOrdinaryMemberInDependentClasses(const CXXBaseSpecifier *Specifier,
+                                       CXXBasePath &Path, DeclarationName Name);
+
+  /// \brief Base-class lookup callback that determines whether there exists
   /// an OpenMP declare reduction member with the given name.
   ///
   /// This callback can be used with \c lookupInBases() to find members
@@ -1633,6 +1646,14 @@ public:
   /// \brief Get the indirect primary bases for this class.
   void getIndirectPrimaryBases(CXXIndirectPrimaryBaseSet& Bases) const;
 
+  /// Performs an imprecise lookup of a dependent name in this class.
+  ///
+  /// This function does not follow strict semantic rules and should be used
+  /// only when lookup rules can be relaxed, e.g. indexing.
+  std::vector<const NamedDecl *>
+  lookupDependentName(const DeclarationName &Name,
+                      llvm::function_ref<bool(const NamedDecl *ND)> Filter);
+
   /// Renders and displays an inheritance diagram
   /// for this C++ class and all of its base classes (transitively) using
   /// GraphViz.

Modified: vendor/clang/dist/include/clang/AST/ExternalASTMerger.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/ExternalASTMerger.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/AST/ExternalASTMerger.h	Tue May 16 19:47:09 2017	(r318370)
@@ -44,6 +44,8 @@ public:
   FindExternalLexicalDecls(const DeclContext *DC,
                            llvm::function_ref<bool(Decl::Kind)> IsKindWeWant,
                            SmallVectorImpl<Decl *> &Result) override;
+
+   void CompleteType(TagDecl *Tag) override;
 };
 
 } // end namespace clang

Modified: vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h	Tue May 16 19:47:09 2017	(r318370)
@@ -2326,7 +2326,7 @@ DEF_TRAVERSE_STMT(LambdaExpr, {
   }
 
   TypeLoc TL = S->getCallOperator()->getTypeSourceInfo()->getTypeLoc();
-  FunctionProtoTypeLoc Proto = TL.castAs<FunctionProtoTypeLoc>();
+  FunctionProtoTypeLoc Proto = TL.getAsAdjusted<FunctionProtoTypeLoc>();
 
   if (S->hasExplicitParameters() && S->hasExplicitResultType()) {
     // Visit the whole type.

Modified: vendor/clang/dist/include/clang/Basic/Attr.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/Attr.td	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Basic/Attr.td	Tue May 16 19:47:09 2017	(r318370)
@@ -652,6 +652,30 @@ def Availability : InheritableAttr {
              .Case("tvos_app_extension", "tvOS (App Extension)")
              .Case("watchos_app_extension", "watchOS (App Extension)")
              .Default(llvm::StringRef());
+}
+static llvm::StringRef getPlatformNameSourceSpelling(llvm::StringRef Platform) {
+    return llvm::StringSwitch<llvm::StringRef>(Platform)
+             .Case("ios", "iOS")
+             .Case("macos", "macOS")
+             .Case("tvos", "tvOS")
+             .Case("watchos", "watchOS")
+             .Case("ios_app_extension", "iOSApplicationExtension")
+             .Case("macos_app_extension", "macOSApplicationExtension")
+             .Case("tvos_app_extension", "tvOSApplicationExtension")
+             .Case("watchos_app_extension", "watchOSApplicationExtension")
+             .Default(Platform);
+}
+static llvm::StringRef canonicalizePlatformName(llvm::StringRef Platform) {
+    return llvm::StringSwitch<llvm::StringRef>(Platform)
+             .Case("iOS", "ios")
+             .Case("macOS", "macos")
+             .Case("tvOS", "tvos")
+             .Case("watchOS", "watchos")
+             .Case("iOSApplicationExtension", "ios_app_extension")
+             .Case("macOSApplicationExtension", "macos_app_extension")
+             .Case("tvOSApplicationExtension", "tvos_app_extension")
+             .Case("watchOSApplicationExtension", "watchos_app_extension")
+             .Default(Platform);
 } }];
   let HasCustomParsing = 1;
   let DuplicatesAllowedWhileMerging = 1;

Modified: vendor/clang/dist/include/clang/Basic/Builtins.def
==============================================================================
--- vendor/clang/dist/include/clang/Basic/Builtins.def	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Basic/Builtins.def	Tue May 16 19:47:09 2017	(r318370)
@@ -1409,6 +1409,9 @@ LANGBUILTIN(to_private, "v*v*", "tn", OC
 BUILTIN(__builtin_os_log_format_buffer_size, "zcC*.", "p:0:nut")
 BUILTIN(__builtin_os_log_format, "v*v*cC*.", "p:0:nt")
 
+// Builtins for XRay
+BUILTIN(__xray_customevent, "vcC*z", "")
+
 #undef BUILTIN
 #undef LIBBUILTIN
 #undef LANGBUILTIN

Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td	Tue May 16 19:47:09 2017	(r318370)
@@ -486,6 +486,7 @@ def UnneededInternalDecl : DiagGroup<"un
 def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
 def UnusedPrivateField : DiagGroup<"unused-private-field">;
 def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
+def UnusedTemplate : DiagGroup<"unused-template", [UnneededInternalDecl]>;
 def UnusedMemberFunction : DiagGroup<"unused-member-function",
                                      [UnneededMemberFunction]>;
 def UnusedLabel : DiagGroup<"unused-label">;
@@ -627,6 +628,7 @@ def Conversion : DiagGroup<"conversion",
 def Unused : DiagGroup<"unused",
                        [UnusedArgument, UnusedFunction, UnusedLabel,
                         // UnusedParameter, (matches GCC's behavior)
+                        // UnusedTemplate, (clean-up libc++ before enabling)
                         // UnusedMemberFunction, (clean-up llvm before enabling)
                         UnusedPrivateField, UnusedLambdaCapture,
                         UnusedLocalTypedef, UnusedValue, UnusedVariable,

Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td	Tue May 16 19:47:09 2017	(r318370)
@@ -303,6 +303,8 @@ def note_empty_parens_zero_initialize : 
   "replace parentheses with an initializer to declare a variable">;
 def warn_unused_function : Warning<"unused function %0">,
   InGroup<UnusedFunction>, DefaultIgnore;
+def warn_unused_template : Warning<"unused %select{function|variable}0 template %1">,
+  InGroup<UnusedTemplate>, DefaultIgnore;
 def warn_unused_member_function : Warning<"unused member function %0">,
   InGroup<UnusedMemberFunction>, DefaultIgnore;
 def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">,
@@ -2463,6 +2465,9 @@ def err_attribute_invalid_size : Error<
   "vector size not an integral multiple of component size">;
 def err_attribute_zero_size : Error<"zero vector size">;
 def err_attribute_size_too_large : Error<"vector size too large">;
+def err_typecheck_vector_not_convertable_implict_truncation : Error<
+   "cannot convert between %select{scalar|vector}0 type %1 and vector type"
+   " %2 as implicit conversion would cause truncation">;
 def err_typecheck_vector_not_convertable : Error<
   "cannot convert between vector values of different size (%0 and %1)">;
 def err_typecheck_vector_not_convertable_non_scalar : Error<
@@ -4607,6 +4612,8 @@ def err_abi_tag_on_redeclaration : Error
   "cannot add 'abi_tag' attribute in a redeclaration">;
 def err_new_abi_tag_on_redeclaration : Error<
   "'abi_tag' %0 missing in original declaration">;
+def note_use_ifdef_guards : Note<
+  "unguarded header; consider using #ifdef guards or #pragma once">;
 
 def note_deleted_dtor_no_operator_delete : Note<
   "virtual destructor requires an unambiguous, accessible 'operator delete'">;
@@ -5775,6 +5782,9 @@ def err_objc_object_assignment : Error<
   "cannot assign to class object (%0 invalid)">;
 def err_typecheck_invalid_operands : Error<
   "invalid operands to binary expression (%0 and %1)">;
+def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error<
+  "logical expression with vector %select{type %1 and non-vector type %2|types"
+  " %1 and %2}0 is only supported in C++">;
 def err_typecheck_sub_ptr_compatible : Error<
   "%diff{$ and $ are not pointers to compatible types|"
   "pointers to incompatible types}0,1">;
@@ -8186,9 +8196,20 @@ def err_undeclared_use_suggest : Error<
   "use of undeclared %0; did you mean %1?">;
 def err_undeclared_var_use_suggest : Error<
   "use of undeclared identifier %0; did you mean %1?">;
+def err_no_template : Error<"no template named %0">;
 def err_no_template_suggest : Error<"no template named %0; did you mean %1?">;
+def err_no_member_template : Error<"no template named %0 in %1">;
 def err_no_member_template_suggest : Error<
   "no template named %0 in %1; did you mean %select{|simply }2%3?">;
+def err_non_template_in_template_id : Error<
+  "%0 does not name a template but is followed by template arguments">;
+def err_non_template_in_template_id_suggest : Error<
+  "%0 does not name a template but is followed by template arguments; "
+  "did you mean %1?">;
+def err_non_template_in_member_template_id_suggest : Error<
+  "member %0 of %1 is not a template; did you mean %select{|simply }2%3?">;
+def note_non_template_in_template_id_found : Note<
+  "non-template declaration found by name lookup">;
 def err_mem_init_not_member_or_class_suggest : Error<
   "initializer %0 does not name a non-static data member or base "
   "class; did you mean the %select{base class|member}1 %2?">;
@@ -8875,6 +8896,13 @@ def ext_equivalent_internal_linkage_decl
   InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>;
 def note_equivalent_internal_linkage_decl : Note<
   "declared here%select{ in module '%1'|}0">;
+
+def note_redefinition_modules_same_file : Note<
+	"'%0' included multiple times, additional include site in header from module '%1'">;
+def note_redefinition_modules_same_file_modulemap : Note<
+	"consider adding '%0' as part of '%1' definition">;
+def note_redefinition_include_same_file : Note<
+	"'%0' included multiple times, additional include site here">;
 }
 
 let CategoryName = "Coroutines Issue" in {

Modified: vendor/clang/dist/include/clang/Basic/TargetOptions.h
==============================================================================
--- vendor/clang/dist/include/clang/Basic/TargetOptions.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Basic/TargetOptions.h	Tue May 16 19:47:09 2017	(r318370)
@@ -24,8 +24,7 @@ namespace clang {
 /// \brief Options for controlling the target.
 class TargetOptions {
 public:
-  /// If given, the name of the target triple to compile for. If not given the
-  /// target will be selected to match the host.
+  /// The name of the target triple to compile for.
   std::string Triple;
 
   /// When compiling for the device side, contains the triple used to compile

Modified: vendor/clang/dist/include/clang/Driver/Options.td
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Options.td	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Driver/Options.td	Tue May 16 19:47:09 2017	(r318370)
@@ -827,6 +827,9 @@ def fno_sanitize_address_use_after_scope
                                            Group<f_clang_Group>,
                                            Flags<[CoreOption, DriverOption]>,
                                            HelpText<"Disable use-after-scope detection in AddressSanitizer">;
+def fsanitize_address_globals_dead_stripping : Flag<["-"], "fsanitize-address-globals-dead-stripping">,
+                                        Group<f_clang_Group>,
+                                        HelpText<"Enable linker dead stripping of globals in AddressSanitizer">;
 def fsanitize_recover : Flag<["-"], "fsanitize-recover">, Group<f_clang_Group>;
 def fno_sanitize_recover : Flag<["-"], "fno-sanitize-recover">,
                            Flags<[CoreOption, DriverOption]>,

Modified: vendor/clang/dist/include/clang/Driver/SanitizerArgs.h
==============================================================================
--- vendor/clang/dist/include/clang/Driver/SanitizerArgs.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Driver/SanitizerArgs.h	Tue May 16 19:47:09 2017	(r318370)
@@ -35,6 +35,7 @@ class SanitizerArgs {
   int AsanFieldPadding = 0;
   bool AsanSharedRuntime = false;
   bool AsanUseAfterScope = true;
+  bool AsanGlobalsDeadStripping = false;
   bool LinkCXXRuntimes = false;
   bool NeedPIE = false;
   bool Stats = false;

Modified: vendor/clang/dist/include/clang/Format/Format.h
==============================================================================
--- vendor/clang/dist/include/clang/Format/Format.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Format/Format.h	Tue May 16 19:47:09 2017	(r318370)
@@ -98,22 +98,39 @@ struct FormatStyle {
   /// \endcode
   bool AlignConsecutiveDeclarations;
 
-  /// \brief If ``true``, aligns escaped newlines as far left as possible.
-  /// Otherwise puts them into the right-most column.
-  /// \code
-  ///   true:
-  ///   #define A   \
-  ///     int aaaa; \
-  ///     int b;    \
-  ///     int dddddddddd;
-  ///
-  ///   false:
-  ///   #define A                                                                      \
-  ///     int aaaa;                                                                    \
-  ///     int b;                                                                       \
-  ///     int dddddddddd;
-  /// \endcode
-  bool AlignEscapedNewlinesLeft;
+  /// \brief Different styles for aligning escaped newlines.
+  enum EscapedNewlineAlignmentStyle {
+    /// \brief Don't align escaped newlines.
+    /// \code
+    ///   #define A \
+    ///     int aaaa; \
+    ///     int b; \
+    ///     int dddddddddd;
+    /// \endcode
+    ENAS_DontAlign,
+    /// \brief Align escaped newlines as far left as possible.
+    /// \code
+    ///   true:
+    ///   #define A   \
+    ///     int aaaa; \
+    ///     int b;    \
+    ///     int dddddddddd;
+    ///
+    ///   false:
+    /// \endcode
+    ENAS_Left,
+    /// \brief Align escaped newlines in the right-most column.
+    /// \code
+    ///   #define A                                                                      \
+    ///     int aaaa;                                                                    \
+    ///     int b;                                                                       \
+    ///     int dddddddddd;
+    /// \endcode
+    ENAS_Right,
+  };
+
+  /// \brief Options for aligning backslashes in escaped newlines.
+  EscapedNewlineAlignmentStyle AlignEscapedNewlines;
 
   /// \brief If ``true``, horizontally align operands of binary and ternary
   /// expressions.
@@ -1347,7 +1364,7 @@ struct FormatStyle {
            AlignAfterOpenBracket == R.AlignAfterOpenBracket &&
            AlignConsecutiveAssignments == R.AlignConsecutiveAssignments &&
            AlignConsecutiveDeclarations == R.AlignConsecutiveDeclarations &&
-           AlignEscapedNewlinesLeft == R.AlignEscapedNewlinesLeft &&
+           AlignEscapedNewlines == R.AlignEscapedNewlines &&
            AlignOperands == R.AlignOperands &&
            AlignTrailingComments == R.AlignTrailingComments &&
            AllowAllParametersOfDeclarationOnNextLine ==

Modified: vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def	Tue May 16 19:47:09 2017	(r318370)
@@ -137,6 +137,8 @@ CODEGENOPT(StructPathTBAA    , 1, 0) ///
 CODEGENOPT(SaveTempLabels    , 1, 0) ///< Save temporary labels.
 CODEGENOPT(SanitizeAddressUseAfterScope , 1, 0) ///< Enable use-after-scope detection
                                                 ///< in AddressSanitizer
+CODEGENOPT(SanitizeAddressGlobalsDeadStripping, 1, 0) ///< Enable linker dead stripping
+                                                      ///< of globals in AddressSanitizer
 CODEGENOPT(SanitizeMemoryTrackOrigins, 2, 0) ///< Enable tracking origins in
                                              ///< MemorySanitizer
 CODEGENOPT(SanitizeMemoryUseAfterDtor, 1, 0) ///< Enable use-after-delete detection

Modified: vendor/clang/dist/include/clang/Lex/MacroInfo.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/MacroInfo.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Lex/MacroInfo.h	Tue May 16 19:47:09 2017	(r318370)
@@ -105,9 +105,6 @@ class MacroInfo {
   /// \brief Must warn if the macro is unused at the end of translation unit.
   bool IsWarnIfUnused : 1;
 
-  /// \brief Whether this macro info was loaded from an AST file.
-  bool FromASTFile : 1;
-
   /// \brief Whether this macro was used as header guard.
   bool UsedForHeaderGuard : 1;
 
@@ -264,34 +261,16 @@ public:
     IsDisabled = true;
   }
 
-  /// \brief Determine whether this macro info came from an AST file (such as
-  /// a precompiled header or module) rather than having been parsed.
-  bool isFromASTFile() const { return FromASTFile; }
-
   /// \brief Determine whether this macro was used for a header guard.
   bool isUsedForHeaderGuard() const { return UsedForHeaderGuard; }
 
   void setUsedForHeaderGuard(bool Val) { UsedForHeaderGuard = Val; }
 
-  /// \brief Retrieve the global ID of the module that owns this particular
-  /// macro info.
-  unsigned getOwningModuleID() const {
-    if (isFromASTFile())
-      return *(const unsigned *)(this + 1);
-
-    return 0;
-  }
-
   void dump() const;
 
 private:
   unsigned getDefinitionLengthSlow(const SourceManager &SM) const;
 
-  void setOwningModuleID(unsigned ID) {
-    assert(isFromASTFile());
-    *(unsigned *)(this + 1) = ID;
-  }
-
   friend class Preprocessor;
 };
 

Modified: vendor/clang/dist/include/clang/Lex/Preprocessor.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/Preprocessor.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Lex/Preprocessor.h	Tue May 16 19:47:09 2017	(r318370)
@@ -644,14 +644,6 @@ class Preprocessor {
   /// of that list.
   MacroInfoChain *MIChainHead;
 
-  struct DeserializedMacroInfoChain {
-    MacroInfo MI;
-    unsigned OwningModuleID; // MUST be immediately after the MacroInfo object
-                     // so it can be accessed by MacroInfo::getOwningModuleID().
-    DeserializedMacroInfoChain *Next;
-  };
-  DeserializedMacroInfoChain *DeserialMIChainHead;
-
   void updateOutOfDateIdentifier(IdentifierInfo &II) const;
 
 public:
@@ -1669,10 +1661,6 @@ public:
   /// \brief Allocate a new MacroInfo object with the provided SourceLocation.
   MacroInfo *AllocateMacroInfo(SourceLocation L);
 
-  /// \brief Allocate a new MacroInfo object loaded from an AST file.
-  MacroInfo *AllocateDeserializedMacroInfo(SourceLocation L,
-                                           unsigned SubModuleID);
-
   /// \brief Turn the specified lexer token into a fully checked and spelled
   /// filename, e.g. as an operand of \#include. 
   ///
@@ -1764,9 +1752,6 @@ private:
   /// macro name.
   void updateModuleMacroInfo(const IdentifierInfo *II, ModuleMacroInfo &Info);
 
-  /// \brief Allocate a new MacroInfo object.
-  MacroInfo *AllocateMacroInfo();
-
   DefMacroDirective *AllocateDefMacroDirective(MacroInfo *MI,
                                                SourceLocation Loc);
   UndefMacroDirective *AllocateUndefMacroDirective(SourceLocation UndefLoc);

Modified: vendor/clang/dist/include/clang/Parse/Parser.h
==============================================================================
--- vendor/clang/dist/include/clang/Parse/Parser.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Parse/Parser.h	Tue May 16 19:47:09 2017	(r318370)
@@ -1488,6 +1488,8 @@ private:
             K == tok::plusplus || K == tok::minusminus);
   }
 
+  bool diagnoseUnknownTemplateId(ExprResult TemplateName, SourceLocation Less);
+
   ExprResult ParsePostfixExpressionSuffix(ExprResult LHS);
   ExprResult ParseUnaryExprOrTypeTraitExpression();
   ExprResult ParseBuiltinPrimaryExpression();
@@ -2723,10 +2725,7 @@ private:
   bool ParseGreaterThanInTemplateList(SourceLocation &RAngleLoc,
                                       bool ConsumeLastToken,
                                       bool ObjCGenericList);
-  bool ParseTemplateIdAfterTemplateName(TemplateTy Template,
-                                        SourceLocation TemplateNameLoc,
-                                        const CXXScopeSpec &SS,
-                                        bool ConsumeLastToken,
+  bool ParseTemplateIdAfterTemplateName(bool ConsumeLastToken,
                                         SourceLocation &LAngleLoc,
                                         TemplateArgList &TemplateArgs,
                                         SourceLocation &RAngleLoc);

Modified: vendor/clang/dist/include/clang/Sema/Sema.h
==============================================================================
--- vendor/clang/dist/include/clang/Sema/Sema.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Sema/Sema.h	Tue May 16 19:47:09 2017	(r318370)
@@ -1074,6 +1074,10 @@ public:
   /// correctly named definition after the renamed definition.
   llvm::SmallPtrSet<const NamedDecl *, 4> TypoCorrectedFunctionDefinitions;
 
+  /// Stack of types that correspond to the parameter entities that are
+  /// currently being copy-initialized. Can be empty.
+  llvm::SmallVector<QualType, 4> CurrentParameterCopyTypes;
+
   void ReadMethodPool(Selector Sel);
   void updateOutOfDateSelector(Selector Sel);
 
@@ -1456,6 +1460,11 @@ private:
   /// The modules we're currently parsing.
   llvm::SmallVector<ModuleScope, 16> ModuleScopes;
 
+  /// Get the module whose scope we are currently within.
+  Module *getCurrentModule() const {
+    return ModuleScopes.empty() ? nullptr : ModuleScopes.back().Module;
+  }
+
   VisibleModuleSet VisibleModules;
 
   Module *CachedFakeTopLevelModule;
@@ -1466,7 +1475,7 @@ public:
 
   /// \brief Make a merged definition of an existing hidden definition \p ND
   /// visible at the specified location.
-  void makeMergedDefinitionVisible(NamedDecl *ND, SourceLocation Loc);
+  void makeMergedDefinitionVisible(NamedDecl *ND);
 
   bool isModuleVisible(Module *M) { return VisibleModules.isVisible(M); }
 
@@ -1593,7 +1602,7 @@ public:
                                Scope *S,
                                CXXScopeSpec *SS,
                                ParsedType &SuggestedType,
-                               bool AllowClassTemplates = false);
+                               bool IsTemplateName = false);
 
   /// Attempt to behave like MSVC in situations where lookup of an unqualified
   /// type name has failed in a dependent context. In these situations, we
@@ -1738,6 +1747,23 @@ public:
   TemplateNameKindForDiagnostics
   getTemplateNameKindForDiagnostics(TemplateName Name);
 
+  /// Determine whether it's plausible that E was intended to be a
+  /// template-name.
+  bool mightBeIntendedToBeTemplateName(ExprResult E) {
+    if (!getLangOpts().CPlusPlus || E.isInvalid())
+      return false;
+    if (auto *DRE = dyn_cast<DeclRefExpr>(E.get()))
+      return !DRE->hasExplicitTemplateArgs();
+    if (auto *ME = dyn_cast<MemberExpr>(E.get()))
+      return !ME->hasExplicitTemplateArgs();
+    // Any additional cases recognized here should also be handled by
+    // diagnoseExprIntendedAsTemplateName.
+    return false;
+  }
+  void diagnoseExprIntendedAsTemplateName(Scope *S, ExprResult TemplateName,
+                                          SourceLocation Less,
+                                          SourceLocation Greater);
+
   Decl *ActOnDeclarator(Scope *S, Declarator &D);
 
   NamedDecl *HandleDeclarator(Scope *S, Declarator &D,
@@ -2336,6 +2362,7 @@ public:
   void MergeVarDeclTypes(VarDecl *New, VarDecl *Old, bool MergeTypeWithOld);
   void MergeVarDeclExceptionSpecs(VarDecl *New, VarDecl *Old);
   bool checkVarDeclRedefinition(VarDecl *OldDefn, VarDecl *NewDefn);
+  void notePreviousDefinition(SourceLocation Old, SourceLocation New);
   bool MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old, Scope *S);
 
   // AssignmentAction - This is used by all the assignment diagnostic functions
@@ -2726,7 +2753,8 @@ public:
   resolveAddressOfOnlyViableOverloadCandidate(Expr *E,
                                               DeclAccessPair &FoundResult);
 
-  bool resolveAndFixAddressOfOnlyViableOverloadCandidate(ExprResult &SrcExpr);
+  bool resolveAndFixAddressOfOnlyViableOverloadCandidate(
+      ExprResult &SrcExpr, bool DoFunctionPointerConversion = false);
 
   FunctionDecl *
   ResolveSingleFunctionTemplateSpecialization(OverloadExpr *ovl,
@@ -3049,7 +3077,8 @@ public:
                           bool IncludeGlobalScope = true);
   void LookupVisibleDecls(DeclContext *Ctx, LookupNameKind Kind,
                           VisibleDeclConsumer &Consumer,
-                          bool IncludeGlobalScope = true);
+                          bool IncludeGlobalScope = true,
+                          bool IncludeDependentBases = false);
 
   enum CorrectTypoKind {
     CTK_NonError,     // CorrectTypo used in a non error recovery situation.
@@ -6084,6 +6113,7 @@ public:
                          TemplateArgumentListInfo *ExplicitTemplateArgs,
                                            LookupResult &Previous);
   bool CheckMemberSpecialization(NamedDecl *Member, LookupResult &Previous);
+  void CompleteMemberSpecialization(NamedDecl *Member, LookupResult &Previous);
 
   DeclResult
   ActOnExplicitInstantiation(Scope *S,
@@ -9259,6 +9289,8 @@ public:
   /// type checking binary operators (subroutines of CreateBuiltinBinOp).
   QualType InvalidOperands(SourceLocation Loc, ExprResult &LHS,
                            ExprResult &RHS);
+  QualType InvalidLogicalVectorOperands(SourceLocation Loc, ExprResult &LHS,
+                                 ExprResult &RHS);
   QualType CheckPointerToMemberOperands( // C++ 5.5
     ExprResult &LHS, ExprResult &RHS, ExprValueKind &VK,
     SourceLocation OpLoc, bool isIndirect);
@@ -10008,6 +10040,7 @@ public:
                                              MacroInfo *MacroInfo,
                                              unsigned Argument);
   void CodeCompleteNaturalLanguage();
+  void CodeCompleteAvailabilityPlatformName();
   void GatherGlobalCodeCompletions(CodeCompletionAllocator &Allocator,
                                    CodeCompletionTUInfo &CCTUInfo,
                   SmallVectorImpl<CodeCompletionResult> &Results);

Modified: vendor/clang/dist/include/clang/Tooling/RefactoringCallbacks.h
==============================================================================
--- vendor/clang/dist/include/clang/Tooling/RefactoringCallbacks.h	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/include/clang/Tooling/RefactoringCallbacks.h	Tue May 16 19:47:09 2017	(r318370)
@@ -47,6 +47,33 @@ protected:
   Replacements Replace;
 };
 
+/// \brief Adaptor between \c ast_matchers::MatchFinder and \c
+/// tooling::RefactoringTool.
+///
+/// Runs AST matchers and stores the \c tooling::Replacements in a map.
+class ASTMatchRefactorer {
+public:
+  explicit ASTMatchRefactorer(
+    std::map<std::string, Replacements> &FileToReplaces);
+
+  template <typename T>
+  void addMatcher(const T &Matcher, RefactoringCallback *Callback) {
+    MatchFinder.addMatcher(Matcher, Callback);
+    Callbacks.push_back(Callback);
+  }
+
+  void addDynamicMatcher(const ast_matchers::internal::DynTypedMatcher &Matcher,
+                         RefactoringCallback *Callback);
+
+  std::unique_ptr<ASTConsumer> newASTConsumer();
+
+private:
+  friend class RefactoringASTConsumer;
+  std::vector<RefactoringCallback *> Callbacks;
+  ast_matchers::MatchFinder MatchFinder;
+  std::map<std::string, Replacements> &FileToReplaces;
+};
+
 /// \brief Replace the text of the statement bound to \c FromId with the text in
 /// \c ToText.
 class ReplaceStmtWithText : public RefactoringCallback {
@@ -59,6 +86,29 @@ private:
   std::string ToText;
 };
 
+/// \brief Replace the text of an AST node bound to \c FromId with the result of
+/// evaluating the template in \c ToTemplate.
+///
+/// Expressions of the form ${NodeName} in \c ToTemplate will be
+/// replaced by the text of the node bound to ${NodeName}. The string
+/// "$$" will be replaced by "$".
+class ReplaceNodeWithTemplate : public RefactoringCallback {
+public:
+  static llvm::Expected<std::unique_ptr<ReplaceNodeWithTemplate>>
+  create(StringRef FromId, StringRef ToTemplate);
+  void run(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+  struct TemplateElement {
+    enum { Literal, Identifier } Type;
+    std::string Value;
+  };
+  ReplaceNodeWithTemplate(llvm::StringRef FromId,
+                          std::vector<TemplateElement> Template);
+  std::string FromId;
+  std::vector<TemplateElement> Template;
+};
+
 /// \brief Replace the text of the statement bound to \c FromId with the text of
 /// the statement bound to \c ToId.
 class ReplaceStmtWithStmt : public RefactoringCallback {

Modified: vendor/clang/dist/lib/AST/ASTImporter.cpp
==============================================================================
--- vendor/clang/dist/lib/AST/ASTImporter.cpp	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/lib/AST/ASTImporter.cpp	Tue May 16 19:47:09 2017	(r318370)
@@ -1622,10 +1622,18 @@ Decl *ASTNodeImporter::VisitRecordDecl(R
 
   // We may already have a record of the same name; try to find and match it.
   RecordDecl *AdoptDecl = nullptr;
+  RecordDecl *PrevDecl = nullptr;
   if (!DC->isFunctionOrMethod()) {
     SmallVector<NamedDecl *, 4> ConflictingDecls;
     SmallVector<NamedDecl *, 2> FoundDecls;
     DC->getRedeclContext()->localUncachedLookup(SearchName, FoundDecls);
+
+    if (!FoundDecls.empty()) {
+      // We're going to have to compare D against potentially conflicting Decls, so complete it.
+      if (D->hasExternalLexicalStorage() && !D->isCompleteDefinition())
+        D->getASTContext().getExternalSource()->CompleteType(D);
+    }
+
     for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
       if (!FoundDecls[I]->isInIdentifierNamespace(IDNS))
         continue;
@@ -1652,6 +1660,8 @@ Decl *ASTNodeImporter::VisitRecordDecl(R
           }
         }
 
+        PrevDecl = FoundRecord;
+
         if (RecordDecl *FoundDef = FoundRecord->getDefinition()) {
           if ((SearchName && !D->isCompleteDefinition())
               || (D->isCompleteDefinition() &&
@@ -1744,6 +1754,10 @@ Decl *ASTNodeImporter::VisitRecordDecl(R
     LexicalDC->addDeclInternal(D2);
     if (D->isAnonymousStructOrUnion())
       D2->setAnonymousStructOrUnion(true);
+    if (PrevDecl) {
+      // FIXME: do this for all Redeclarables, not just RecordDecls.
+      D2->setPreviousDecl(PrevDecl);
+    }
   }
   
   Importer.Imported(D, D2);

Modified: vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp
==============================================================================
--- vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp	Tue May 16 19:47:09 2017	(r318370)
@@ -855,6 +855,11 @@ static bool IsStructurallyEquivalent(Str
 
   if (CXXRecordDecl *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {
     if (CXXRecordDecl *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {
+      if (D1CXX->hasExternalLexicalStorage() &&
+          !D1CXX->isCompleteDefinition()) {
+        D1CXX->getASTContext().getExternalSource()->CompleteType(D1CXX);
+      }
+
       if (D1CXX->getNumBases() != D2CXX->getNumBases()) {
         if (Context.Complain) {
           Context.Diag2(D2->getLocation(), diag::warn_odr_tag_type_inconsistent)

Modified: vendor/clang/dist/lib/AST/CXXInheritance.cpp
==============================================================================
--- vendor/clang/dist/lib/AST/CXXInheritance.cpp	Tue May 16 19:47:00 2017	(r318369)
+++ vendor/clang/dist/lib/AST/CXXInheritance.cpp	Tue May 16 19:47:09 2017	(r318370)
@@ -13,6 +13,7 @@
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/DeclCXX.h"
+#include "clang/AST/DeclTemplate.h"
 #include "clang/AST/RecordLayout.h"
 #include "llvm/ADT/SetVector.h"
 #include <algorithm>
@@ -174,9 +175,10 @@ bool CXXRecordDecl::forallBases(ForallBa
   return AllMatches;
 }
 
-bool CXXBasePaths::lookupInBases(
-    ASTContext &Context, const CXXRecordDecl *Record,
-    CXXRecordDecl::BaseMatchesCallback BaseMatches) {
+bool CXXBasePaths::lookupInBases(ASTContext &Context,
+                                 const CXXRecordDecl *Record,
+                                 CXXRecordDecl::BaseMatchesCallback BaseMatches,
+                                 bool LookupInDependent) {
   bool FoundPath = false;
 
   // The access of the path down to this record.
@@ -194,7 +196,7 @@ bool CXXBasePaths::lookupInBases(
     //   the base class scope is not examined during unqualified name lookup 
     //   either at the point of definition of the class template or member or 
     //   during an instantiation of the class tem- plate or member.
-    if (BaseType->isDependentType())
+    if (!LookupInDependent && BaseType->isDependentType())
       continue;
     
     // Determine whether we need to visit this base class at all,
@@ -262,10 +264,28 @@ bool CXXBasePaths::lookupInBases(
         return FoundPath;
       }
     } else if (VisitBase) {
-      CXXRecordDecl *BaseRecord
-        = cast<CXXRecordDecl>(BaseSpec.getType()->castAs<RecordType>()
-                                ->getDecl());
-      if (lookupInBases(Context, BaseRecord, BaseMatches)) {
+      CXXRecordDecl *BaseRecord;
+      if (LookupInDependent) {
+        BaseRecord = nullptr;
+        const TemplateSpecializationType *TST =
+            BaseSpec.getType()->getAs<TemplateSpecializationType>();
+        if (!TST) {
+          if (auto *RT = BaseSpec.getType()->getAs<RecordType>())
+            BaseRecord = cast<CXXRecordDecl>(RT->getDecl());
+        } else {
+          TemplateName TN = TST->getTemplateName();
+          if (auto *TD =
+                  dyn_cast_or_null<ClassTemplateDecl>(TN.getAsTemplateDecl()))
+            BaseRecord = TD->getTemplatedDecl();
+        }
+        if (BaseRecord && !BaseRecord->hasDefinition())
+          BaseRecord = nullptr;
+      } else {
+        BaseRecord = cast<CXXRecordDecl>(
+            BaseSpec.getType()->castAs<RecordType>()->getDecl());
+      }
+      if (BaseRecord &&
+          lookupInBases(Context, BaseRecord, BaseMatches, LookupInDependent)) {
         // C++ [class.member.lookup]p2:
         //   A member name f in one sub-object B hides a member name f in
         //   a sub-object A if A is a base class sub-object of B. Any
@@ -299,9 +319,11 @@ bool CXXBasePaths::lookupInBases(
 }
 
 bool CXXRecordDecl::lookupInBases(BaseMatchesCallback BaseMatches,
-                                  CXXBasePaths &Paths) const {
+                                  CXXBasePaths &Paths,
+                                  bool LookupInDependent) const {
   // If we didn't find anything, report that.
-  if (!Paths.lookupInBases(getASTContext(), this, BaseMatches))
+  if (!Paths.lookupInBases(getASTContext(), this, BaseMatches,
+                           LookupInDependent))
     return false;
 
   // If we're not recording paths or we won't ever find ambiguities,
@@ -387,23 +409,49 @@ bool CXXRecordDecl::FindTagMember(const 
   return false;
 }
 
-bool CXXRecordDecl::FindOrdinaryMember(const CXXBaseSpecifier *Specifier, 
-                                       CXXBasePath &Path,
-                                       DeclarationName Name) {
-  RecordDecl *BaseRecord =
-    Specifier->getType()->castAs<RecordType>()->getDecl();

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705161947.v4GJl98T096916>