From owner-svn-src-all@freebsd.org Thu Jul 13 19:25:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B36ACDAC1DD; Thu, 13 Jul 2017 19:25:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D8FD676; Thu, 13 Jul 2017 19:25:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6DJPfNL036483; Thu, 13 Jul 2017 19:25:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6DJPdUg036459; Thu, 13 Jul 2017 19:25:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707131925.v6DJPdUg036459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 13 Jul 2017 19:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r320959 - in vendor/clang/dist: bindings/python/clang bindings/python/tests/cindex docs include/clang-c include/clang/AST include/clang/ASTMatchers include/clang/Analysis include/clang/... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist: bindings/python/clang bindings/python/tests/cindex docs include/clang-c include/clang/AST include/clang/ASTMatchers include/clang/Analysis include/clang/Basic include/clang/CodeG... X-SVN-Commit-Revision: 320959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:25:42 -0000 Author: dim Date: Thu Jul 13 19:25:38 2017 New Revision: 320959 URL: https://svnweb.freebsd.org/changeset/base/320959 Log: Vendor import of clang trunk r307894: https://llvm.org/svn/llvm-project/cfe/trunk@307894 Added: vendor/clang/dist/test/Analysis/lifetime-cfg-output.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/ vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/p4/ vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/p4/module.cppm vendor/clang/dist/test/CXX/modules-ts/basic/basic.def.odr/p4/user.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/basic/basic.link/p2/ vendor/clang/dist/test/CXX/modules-ts/basic/basic.link/p2/module.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/basic/basic.link/p2/module.cppm vendor/clang/dist/test/CXX/modules-ts/basic/basic.link/p2/other.cpp (contents, props changed) vendor/clang/dist/test/CXX/modules-ts/dcl.dcl/dcl.module/p5.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/dllimport-memptr-global.cpp (contents, props changed) vendor/clang/dist/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl vendor/clang/dist/test/Driver/crash-report-spaces.c (contents, props changed) vendor/clang/dist/test/Driver/darwin-sdk-vs-os-version.c (contents, props changed) vendor/clang/dist/test/FixIt/fixit-add-synthesize-to-property.m vendor/clang/dist/test/Import/direct/ vendor/clang/dist/test/Import/direct/Inputs/ vendor/clang/dist/test/Import/direct/Inputs/S.c (contents, props changed) vendor/clang/dist/test/Import/direct/test.c (contents, props changed) vendor/clang/dist/test/Import/enum/ vendor/clang/dist/test/Import/enum/Inputs/ vendor/clang/dist/test/Import/enum/Inputs/S.cpp (contents, props changed) vendor/clang/dist/test/Import/enum/test.cpp (contents, props changed) vendor/clang/dist/test/Import/import-overrides/ vendor/clang/dist/test/Import/import-overrides/Inputs/ vendor/clang/dist/test/Import/import-overrides/Inputs/Hierarchy.cpp (contents, props changed) vendor/clang/dist/test/Import/import-overrides/test.cpp (contents, props changed) vendor/clang/dist/test/Index/Core/index-source-invalid-name.cpp (contents, props changed) vendor/clang/dist/test/Index/Inputs/empty.dia vendor/clang/dist/test/Index/read-empty-diags.test vendor/clang/dist/test/Misc/find-diagnostic-id.c (contents, props changed) vendor/clang/dist/test/Modules/missing-flag.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/taskloop_reduction_messages.cpp (contents, props changed) vendor/clang/dist/test/OpenMP/taskloop_simd_reduction_messages.cpp (contents, props changed) vendor/clang/dist/test/Rewriter/objc-modern-metadata-visibility2.mm vendor/clang/dist/test/SemaCXX/amdgpu-sizeof-alignof.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/dllimport-memptr.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/warn-cast-qual.cpp (contents, props changed) vendor/clang/dist/tools/diagtool/FindDiagnosticID.cpp (contents, props changed) vendor/clang/dist/unittests/Format/FormatTestTextProto.cpp (contents, props changed) Deleted: vendor/clang/dist/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c vendor/clang/dist/test/Driver/crash report spaces.c Modified: vendor/clang/dist/bindings/python/clang/cindex.py vendor/clang/dist/bindings/python/tests/cindex/test_cursor.py vendor/clang/dist/docs/ControlFlowIntegrityDesign.rst vendor/clang/dist/docs/LibASTMatchersReference.html vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/docs/UsersManual.rst vendor/clang/dist/include/clang-c/Index.h vendor/clang/dist/include/clang/AST/DeclBase.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/ASTMatchers/ASTMatchers.h vendor/clang/dist/include/clang/Analysis/AnalysisContext.h vendor/clang/dist/include/clang/Analysis/CFG.h vendor/clang/dist/include/clang/Analysis/CloneDetection.h vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td vendor/clang/dist/include/clang/Basic/Linkage.h vendor/clang/dist/include/clang/Basic/PartialDiagnostic.h vendor/clang/dist/include/clang/Basic/TargetInfo.h vendor/clang/dist/include/clang/Basic/arm_neon.td vendor/clang/dist/include/clang/CodeGen/CodeGenABITypes.h vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Driver/ToolChain.h vendor/clang/dist/include/clang/Format/Format.h vendor/clang/dist/include/clang/Frontend/FrontendActions.h vendor/clang/dist/include/clang/Lex/Preprocessor.h vendor/clang/dist/include/clang/Sema/DelayedDiagnostic.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Sema/TemplateDeduction.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/CheckerManager.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h vendor/clang/dist/include/clang/Tooling/ArgumentsAdjusters.h vendor/clang/dist/include/clang/Tooling/Core/Diagnostic.h vendor/clang/dist/include/clang/Tooling/Tooling.h vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/Decl.cpp vendor/clang/dist/lib/AST/DeclBase.cpp vendor/clang/dist/lib/AST/DeclCXX.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/ExternalASTMerger.cpp vendor/clang/dist/lib/AST/ODRHash.cpp vendor/clang/dist/lib/Analysis/AnalysisDeclContext.cpp vendor/clang/dist/lib/Analysis/CFG.cpp vendor/clang/dist/lib/Analysis/CloneDetection.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/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/CGExprCXX.cpp vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/CodeGen/CodeGenABITypes.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/ItaniumCXXABI.cpp vendor/clang/dist/lib/CodeGen/MicrosoftCXXABI.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.h vendor/clang/dist/lib/Driver/Driver.cpp vendor/clang/dist/lib/Driver/ToolChain.cpp vendor/clang/dist/lib/Driver/ToolChains/Arch/ARM.cpp vendor/clang/dist/lib/Driver/ToolChains/Arch/Mips.cpp vendor/clang/dist/lib/Driver/ToolChains/BareMetal.cpp vendor/clang/dist/lib/Driver/ToolChains/BareMetal.h vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Driver/ToolChains/CommonArgs.cpp vendor/clang/dist/lib/Driver/ToolChains/Cuda.cpp vendor/clang/dist/lib/Driver/ToolChains/Cuda.h vendor/clang/dist/lib/Driver/ToolChains/Darwin.cpp vendor/clang/dist/lib/Driver/ToolChains/Darwin.h vendor/clang/dist/lib/Driver/ToolChains/Fuchsia.cpp vendor/clang/dist/lib/Driver/ToolChains/Fuchsia.h vendor/clang/dist/lib/Driver/ToolChains/Gnu.cpp vendor/clang/dist/lib/Driver/ToolChains/Gnu.h vendor/clang/dist/lib/Driver/ToolChains/Hexagon.cpp vendor/clang/dist/lib/Driver/ToolChains/Hexagon.h vendor/clang/dist/lib/Driver/ToolChains/NetBSD.cpp vendor/clang/dist/lib/Driver/ToolChains/NetBSD.h vendor/clang/dist/lib/Driver/ToolChains/WebAssembly.cpp vendor/clang/dist/lib/Driver/ToolChains/WebAssembly.h vendor/clang/dist/lib/Driver/ToolChains/XCore.cpp vendor/clang/dist/lib/Driver/ToolChains/XCore.h 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/UnwrappedLineParser.cpp vendor/clang/dist/lib/Frontend/FrontendActions.cpp vendor/clang/dist/lib/Frontend/Rewrite/RewriteModernObjC.cpp vendor/clang/dist/lib/Frontend/Rewrite/RewriteObjC.cpp vendor/clang/dist/lib/Frontend/SerializedDiagnosticReader.cpp vendor/clang/dist/lib/Frontend/TextDiagnostic.cpp vendor/clang/dist/lib/Headers/bmiintrin.h vendor/clang/dist/lib/Headers/cpuid.h vendor/clang/dist/lib/Headers/immintrin.h vendor/clang/dist/lib/Headers/mmintrin.h vendor/clang/dist/lib/Index/IndexBody.cpp vendor/clang/dist/lib/Index/IndexDecl.cpp vendor/clang/dist/lib/Index/IndexSymbol.cpp vendor/clang/dist/lib/Index/IndexingContext.cpp vendor/clang/dist/lib/Lex/Lexer.cpp vendor/clang/dist/lib/Lex/PPLexerChange.cpp vendor/clang/dist/lib/Lex/Preprocessor.cpp vendor/clang/dist/lib/Parse/ParseCXXInlineMethods.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseObjc.cpp vendor/clang/dist/lib/Parse/Parser.cpp vendor/clang/dist/lib/Sema/AnalysisBasedWarnings.cpp vendor/clang/dist/lib/Sema/DelayedDiagnostic.cpp vendor/clang/dist/lib/Sema/Sema.cpp vendor/clang/dist/lib/Sema/SemaCast.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaCoroutine.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclObjC.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprMember.cpp vendor/clang/dist/lib/Sema/SemaLambda.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaObjCProperty.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaPseudoObject.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaTemplate.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/Serialization/ASTWriterDecl.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/AnalysisManager.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngine.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/PathDiagnostic.cpp vendor/clang/dist/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp vendor/clang/dist/lib/Tooling/ArgumentsAdjusters.cpp vendor/clang/dist/lib/Tooling/Core/Diagnostic.cpp vendor/clang/dist/lib/Tooling/Tooling.cpp vendor/clang/dist/test/Analysis/analyzer-config.c vendor/clang/dist/test/Analysis/analyzer-config.cpp vendor/clang/dist/test/Analysis/enum.cpp vendor/clang/dist/test/CXX/except/except.spec/p11.cpp vendor/clang/dist/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.import/p1.cpp 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/bitscan-builtins.c vendor/clang/dist/test/CodeGen/default-address-space.c vendor/clang/dist/test/CodeGen/mcount.c vendor/clang/dist/test/CodeGen/ms-barriers-intrinsics.c vendor/clang/dist/test/CodeGen/no-devirt.cpp vendor/clang/dist/test/CodeGen/pgo-sample-thinlto-summary.c vendor/clang/dist/test/CodeGenCXX/amdgcn-automatic-variable.cpp vendor/clang/dist/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp vendor/clang/dist/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp vendor/clang/dist/test/CodeGenCXX/vtable-available-externally.cpp vendor/clang/dist/test/CodeGenCXX/windows-itanium-type-info.cpp vendor/clang/dist/test/CodeGenOpenCL/address-spaces.cl vendor/clang/dist/test/CodeGenOpenCL/amdgcn-automatic-variable.cl vendor/clang/dist/test/CodeGenOpenCL/amdgpu-nullptr.cl vendor/clang/dist/test/Driver/autocomplete.c vendor/clang/dist/test/Driver/clang_f_opts.c vendor/clang/dist/test/Driver/fuchsia.c vendor/clang/dist/test/Driver/fuchsia.cpp vendor/clang/dist/test/Driver/mips-features.c vendor/clang/dist/test/Index/Core/index-source.cpp vendor/clang/dist/test/Index/Core/index-source.m vendor/clang/dist/test/Index/pipe-size.cl vendor/clang/dist/test/Index/print-type-declaration.cpp vendor/clang/dist/test/Index/usrs.m vendor/clang/dist/test/Modules/odr_hash.cpp vendor/clang/dist/test/Modules/preprocess-build.cpp vendor/clang/dist/test/Modules/relative-dep-gen.cpp vendor/clang/dist/test/OpenMP/taskloop_ast_print.cpp vendor/clang/dist/test/OpenMP/taskloop_codegen.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_ast_print.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_codegen.cpp vendor/clang/dist/test/Preprocessor/init.c vendor/clang/dist/test/Sema/address-packed.c vendor/clang/dist/test/Sema/attr-availability.c vendor/clang/dist/test/Sema/attr-deprecated.c vendor/clang/dist/test/Sema/attr-unavailable-message.c vendor/clang/dist/test/Sema/loop-control.c vendor/clang/dist/test/Sema/warn-cast-qual.c vendor/clang/dist/test/Sema/warn-documentation.cpp vendor/clang/dist/test/SemaCXX/attr-deprecated.cpp vendor/clang/dist/test/SemaCXX/coroutines.cpp vendor/clang/dist/test/SemaCXX/modules-ts.cppm vendor/clang/dist/test/SemaCXX/warn-loop-analysis.cpp vendor/clang/dist/test/SemaCXX/warn-throw-out-noexcept-func.cpp vendor/clang/dist/test/SemaObjC/attr-availability.m vendor/clang/dist/test/SemaObjC/default-synthesize-3.m vendor/clang/dist/test/SemaObjC/default-synthesize.m vendor/clang/dist/test/SemaObjC/forward-protocol-incomplete-impl-warn.m vendor/clang/dist/test/SemaObjC/objc-container-subscripting-1.m vendor/clang/dist/test/SemaObjC/objc-container-subscripting-2.m vendor/clang/dist/test/SemaObjC/unguarded-availability-new.m vendor/clang/dist/test/SemaObjC/unguarded-availability.m vendor/clang/dist/test/SemaOpenCL/cl20-device-side-enqueue.cl vendor/clang/dist/test/SemaOpenCL/images.cl vendor/clang/dist/test/SemaTemplate/constexpr-instantiate.cpp vendor/clang/dist/test/SemaTemplate/overload-candidates.cpp vendor/clang/dist/test/Unit/lit.cfg vendor/clang/dist/test/lit.cfg 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/diagtool/CMakeLists.txt vendor/clang/dist/tools/libclang/CIndex.cpp vendor/clang/dist/tools/libclang/CXIndexDataConsumer.cpp vendor/clang/dist/tools/libclang/libclang.exports vendor/clang/dist/unittests/ASTMatchers/ASTMatchersNodeTest.cpp vendor/clang/dist/unittests/Format/CMakeLists.txt vendor/clang/dist/unittests/Format/FormatTest.cpp vendor/clang/dist/unittests/Format/FormatTestComments.cpp vendor/clang/dist/unittests/Format/FormatTestJS.cpp vendor/clang/dist/unittests/Format/FormatTestProto.cpp vendor/clang/dist/unittests/Tooling/RecursiveASTVisitorTest.cpp vendor/clang/dist/utils/TableGen/NeonEmitter.cpp vendor/clang/dist/utils/bash-autocomplete.sh vendor/clang/dist/utils/perf-training/lit.cfg vendor/clang/dist/utils/perf-training/order-files.lit.cfg vendor/clang/dist/www/analyzer/checker_dev_manual.html vendor/clang/dist/www/analyzer/scripts/expandcollapse.js vendor/clang/dist/www/cxx_status.html Modified: vendor/clang/dist/bindings/python/clang/cindex.py ============================================================================== --- vendor/clang/dist/bindings/python/clang/cindex.py Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/bindings/python/clang/cindex.py Thu Jul 13 19:25:38 2017 (r320959) @@ -782,7 +782,7 @@ CursorKind.CONVERSION_FUNCTION = CursorKind(26) # A C++ template type parameter CursorKind.TEMPLATE_TYPE_PARAMETER = CursorKind(27) -# A C++ non-type template paramater. +# A C++ non-type template parameter. CursorKind.TEMPLATE_NON_TYPE_PARAMETER = CursorKind(28) # A C++ template template parameter. @@ -1478,6 +1478,11 @@ class Cursor(Structure): """ return conf.lib.clang_CXXMethod_isVirtual(self) + def is_scoped_enum(self): + """Returns True if the cursor refers to a scoped enum declaration. + """ + return conf.lib.clang_EnumDecl_isScoped(self) + def get_definition(self): """ If the cursor is a reference to a declaration or a declaration of @@ -3311,6 +3316,10 @@ functionList = [ bool), ("clang_CXXMethod_isVirtual", + [Cursor], + bool), + + ("clang_EnumDecl_isScoped", [Cursor], bool), Modified: vendor/clang/dist/bindings/python/tests/cindex/test_cursor.py ============================================================================== --- vendor/clang/dist/bindings/python/tests/cindex/test_cursor.py Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/bindings/python/tests/cindex/test_cursor.py Thu Jul 13 19:25:38 2017 (r320959) @@ -255,6 +255,22 @@ def test_is_virtual_method(): assert foo.is_virtual_method() assert not bar.is_virtual_method() +def test_is_scoped_enum(): + """Ensure Cursor.is_scoped_enum works.""" + source = 'class X {}; enum RegularEnum {}; enum class ScopedEnum {};' + tu = get_tu(source, lang='cpp') + + cls = get_cursor(tu, 'X') + regular_enum = get_cursor(tu, 'RegularEnum') + scoped_enum = get_cursor(tu, 'ScopedEnum') + assert cls is not None + assert regular_enum is not None + assert scoped_enum is not None + + assert not cls.is_scoped_enum() + assert not regular_enum.is_scoped_enum() + assert scoped_enum.is_scoped_enum() + def test_underlying_type(): tu = get_tu('typedef int foo;') typedef = get_cursor(tu, 'foo') Modified: vendor/clang/dist/docs/ControlFlowIntegrityDesign.rst ============================================================================== --- vendor/clang/dist/docs/ControlFlowIntegrityDesign.rst Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/docs/ControlFlowIntegrityDesign.rst Thu Jul 13 19:25:38 2017 (r320959) @@ -437,12 +437,17 @@ export this information, every DSO implements .. code-block:: none - void __cfi_check(uint64 CallSiteTypeId, void *TargetAddr) + void __cfi_check(uint64 CallSiteTypeId, void *TargetAddr, void *DiagData) -This function provides external modules with access to CFI checks for the -targets inside this DSO. For each known ``CallSiteTypeId``, this function -performs an ``llvm.type.test`` with the corresponding type identifier. It -aborts if the type is unknown, or if the check fails. +This function provides external modules with access to CFI checks for +the targets inside this DSO. For each known ``CallSiteTypeId``, this +function performs an ``llvm.type.test`` with the corresponding type +identifier. It reports an error if the type is unknown, or if the +check fails. Depending on the values of compiler flags +``-fsanitize-trap`` and ``-fsanitize-recover``, this function may +print an error, abort and/or return to the caller. ``DiagData`` is an +opaque pointer to the diagnostic information about the error, or +``null`` if the caller does not provide this information. The basic implementation is a large switch statement over all values of CallSiteTypeId supported by this DSO, and each case is similar to @@ -452,11 +457,10 @@ CFI Shadow ---------- To route CFI checks to the target DSO's __cfi_check function, a -mapping from possible virtual / indirect call targets to -the corresponding __cfi_check functions is maintained. This mapping is +mapping from possible virtual / indirect call targets to the +corresponding __cfi_check functions is maintained. This mapping is implemented as a sparse array of 2 bytes for every possible page (4096 -bytes) of memory. The table is kept readonly (FIXME: not yet) most of -the time. +bytes) of memory. The table is kept readonly most of the time. There are 3 types of shadow values: @@ -481,14 +485,24 @@ them. CFI_SlowPath ------------ -The slow path check is implemented in compiler-rt library as +The slow path check is implemented in a runtime support library as .. code-block:: none void __cfi_slowpath(uint64 CallSiteTypeId, void *TargetAddr) + void __cfi_slowpath_diag(uint64 CallSiteTypeId, void *TargetAddr, void *DiagData) -This functions loads a shadow value for ``TargetAddr``, finds the -address of __cfi_check as described above and calls that. +These functions loads a shadow value for ``TargetAddr``, finds the +address of ``__cfi_check`` as described above and calls +that. ``DiagData`` is an opaque pointer to diagnostic data which is +passed verbatim to ``__cfi_check``, and ``__cfi_slowpath`` passes +``nullptr`` instead. + +Compiler-RT library contains reference implementations of slowpath +functions, but they have unresolvable issues with correctness and +performance in the handling of dlopen(). It is recommended that +platforms provide their own implementations, usually as part of libc +or libdl. Position-independent executable requirement ------------------------------------------- Modified: vendor/clang/dist/docs/LibASTMatchersReference.html ============================================================================== --- vendor/clang/dist/docs/LibASTMatchersReference.html Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/docs/LibASTMatchersReference.html Thu Jul 13 19:25:38 2017 (r320959) @@ -1872,6 +1872,14 @@ floatLiteral(equals(3.14)) and floatLiteral(equals(314 integerLiteral(equals(42)) matches 42 +Note that you cannot directly match a negative numeric literal because the +minus sign is not part of the literal: It is a unary operator whose operand +is the positive numeric literal. Instead, you must use a unaryOperator() +matcher to match the minus sign: + +unaryOperator(hasOperatorName("-"), + hasUnaryOperand(integerLiteral(equals(13)))) + Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>, Matcher<FloatingLiteral>, Matcher<IntegerLiteral> @@ -2327,6 +2335,14 @@ floatLiteral(equals(3.14)) and floatLiteral(equals(314 integerLiteral(equals(42)) matches 42 +Note that you cannot directly match a negative numeric literal because the +minus sign is not part of the literal: It is a unary operator whose operand +is the positive numeric literal. Instead, you must use a unaryOperator() +matcher to match the minus sign: + +unaryOperator(hasOperatorName("-"), + hasUnaryOperand(integerLiteral(equals(13)))) + Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>, Matcher<FloatingLiteral>, Matcher<IntegerLiteral> @@ -2583,6 +2599,14 @@ floatLiteral(equals(3.14)) and floatLiteral(equals(314 integerLiteral(equals(42)) matches 42 +Note that you cannot directly match a negative numeric literal because the +minus sign is not part of the literal: It is a unary operator whose operand +is the positive numeric literal. Instead, you must use a unaryOperator() +matcher to match the minus sign: + +unaryOperator(hasOperatorName("-"), + hasUnaryOperand(integerLiteral(equals(13)))) + Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>, Matcher<FloatingLiteral>, Matcher<IntegerLiteral> @@ -2865,6 +2889,14 @@ floatLiteral(equals(3.14)) and floatLiteral(equals(314 match 3.14 integerLiteral(equals(42)) matches 42 + +Note that you cannot directly match a negative numeric literal because the +minus sign is not part of the literal: It is a unary operator whose operand +is the positive numeric literal. Instead, you must use a unaryOperator() +matcher to match the minus sign: + +unaryOperator(hasOperatorName("-"), + hasUnaryOperand(integerLiteral(equals(13)))) Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>, Matcher<FloatingLiteral>, Matcher<IntegerLiteral> Modified: vendor/clang/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.rst Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/docs/ReleaseNotes.rst Thu Jul 13 19:25:38 2017 (r320959) @@ -52,6 +52,9 @@ Major New Features Improvements to Clang's diagnostics ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- -Wcast-qual was implemented for C++. C-style casts are now properly + diagnosed. + - -Wunused-lambda-capture warns when a variable explicitly captured by a lambda is not used in the body of the lambda. @@ -59,6 +62,16 @@ New Compiler Flags ------------------ The option .... + +Deprecated Compiler Flags +------------------------- + +The following options are deprecated and ignored. They will be removed in +future versions of Clang. + +- -fslp-vectorize-aggressive used to enable the BB vectorizing pass. They have been superseeded + by the normal SLP vectorizer. +- -fno-slp-vectorize-aggressive used to be the default behavior of clang. New Pragmas in Clang ----------------------- Modified: vendor/clang/dist/docs/UsersManual.rst ============================================================================== --- vendor/clang/dist/docs/UsersManual.rst Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/docs/UsersManual.rst Thu Jul 13 19:25:38 2017 (r320959) @@ -332,6 +332,19 @@ output format of the diagnostics that it generates. using a structured YAML format, users can parse or sort the remarks in a convenient way. +.. _opt_foptimization-record-file: + +**-foptimization-record-file** + Control the file to which optimization reports are written. + + When optimization reports are being output (see + :ref:`-fsave-optimization-record `), this + option controls the file to which those reports are written. + + If this option is not used, optimization records are output to a file named + after the primary file being compiled. If that's "foo.c", for example, + optimization records are output to "foo.opt.yaml". + .. _opt_fdiagnostics-show-hotness: **-f[no-]diagnostics-show-hotness** Modified: vendor/clang/dist/include/clang-c/Index.h ============================================================================== --- vendor/clang/dist/include/clang-c/Index.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang-c/Index.h Thu Jul 13 19:25:38 2017 (r320959) @@ -4417,6 +4417,11 @@ CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCur CINDEX_LINKAGE unsigned clang_CXXMethod_isVirtual(CXCursor C); /** + * \brief Determine if an enum declaration refers to a scoped enum. + */ +CINDEX_LINKAGE unsigned clang_EnumDecl_isScoped(CXCursor C); + +/** * \brief Determine if a C++ member function or member function template is * declared 'const'. */ Modified: vendor/clang/dist/include/clang/AST/DeclBase.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclBase.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/AST/DeclBase.h Thu Jul 13 19:25:38 2017 (r320959) @@ -749,7 +749,7 @@ class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl { (pu /// Set that this declaration is globally visible, even if it came from a /// module that is not visible. void setVisibleDespiteOwningModule() { - if (hasOwningModule()) + if (isHidden()) setModuleOwnershipKind(ModuleOwnershipKind::Visible); } Modified: vendor/clang/dist/include/clang/AST/DeclCXX.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclCXX.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/AST/DeclCXX.h Thu Jul 13 19:25:38 2017 (r320959) @@ -1886,6 +1886,19 @@ class CXXMethodDecl : public FunctionDecl { (public) return (CD->begin_overridden_methods() != CD->end_overridden_methods()); } + /// If it's possible to devirtualize a call to this method, return the called + /// function. Otherwise, return null. + + /// \param Base The object on which this virtual function is called. + /// \param IsAppleKext True if we are compiling for Apple kext. + CXXMethodDecl *getDevirtualizedMethod(const Expr *Base, bool IsAppleKext); + + const CXXMethodDecl *getDevirtualizedMethod(const Expr *Base, + bool IsAppleKext) const { + return const_cast(this)->getDevirtualizedMethod( + Base, IsAppleKext); + } + /// \brief Determine whether this is a usual deallocation function /// (C++ [basic.stc.dynamic.deallocation]p2), which is an overloaded /// delete or delete[] operator with a particular signature. Modified: vendor/clang/dist/include/clang/AST/ExternalASTMerger.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ExternalASTMerger.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/AST/ExternalASTMerger.h Thu Jul 13 19:25:38 2017 (r320959) @@ -44,10 +44,6 @@ class ExternalASTMerger : public ExternalASTSource { ( FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref IsKindWeWant, SmallVectorImpl &Result) override; - - using ExternalASTSource::CompleteType; - - 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 Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Thu Jul 13 19:25:38 2017 (r320959) @@ -1799,6 +1799,7 @@ DEF_TRAVERSE_DECL(CXXRecordDecl, { TRY_TO(TraverseCXXR if (TypeSourceInfo *TSI = D->getTypeAsWritten()) \ TRY_TO(TraverseTypeLoc(TSI->getTypeLoc())); \ \ + TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc())); \ if (!getDerived().shouldVisitTemplateInstantiations() && \ D->getTemplateSpecializationKind() != TSK_ExplicitSpecialization) \ /* Returning from here skips traversing the \ Modified: vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h ============================================================================== --- vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Thu Jul 13 19:25:38 2017 (r320959) @@ -3821,6 +3821,14 @@ AST_MATCHER_P(CompoundStmt, statementCountIs, unsigned /// integerLiteral(equals(42)) /// matches 42 /// +/// Note that you cannot directly match a negative numeric literal because the +/// minus sign is not part of the literal: It is a unary operator whose operand +/// is the positive numeric literal. Instead, you must use a unaryOperator() +/// matcher to match the minus sign: +/// +/// unaryOperator(hasOperatorName("-"), +/// hasUnaryOperand(integerLiteral(equals(13)))) +/// /// Usable as: Matcher, Matcher, /// Matcher, Matcher template Modified: vendor/clang/dist/include/clang/Analysis/AnalysisContext.h ============================================================================== --- vendor/clang/dist/include/clang/Analysis/AnalysisContext.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Analysis/AnalysisContext.h Thu Jul 13 19:25:38 2017 (r320959) @@ -426,6 +426,7 @@ class AnalysisDeclContextManager { (public) bool addImplicitDtors = false, bool addInitializers = false, bool addTemporaryDtors = false, + bool addLifetime = false, bool synthesizeBodies = false, bool addStaticInitBranches = false, bool addCXXNewAllocator = true, Modified: vendor/clang/dist/include/clang/Analysis/CFG.h ============================================================================== --- vendor/clang/dist/include/clang/Analysis/CFG.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Analysis/CFG.h Thu Jul 13 19:25:38 2017 (r320959) @@ -58,6 +58,7 @@ class CFGElement { (public) Statement, Initializer, NewAllocator, + LifetimeEnds, // dtor kind AutomaticObjectDtor, DeleteDtor, @@ -167,6 +168,28 @@ class CFGNewAllocator : public CFGElement { (private) } }; +/// Represents the point where the lifetime of an automatic object ends +class CFGLifetimeEnds : public CFGElement { +public: + explicit CFGLifetimeEnds(const VarDecl *var, const Stmt *stmt) + : CFGElement(LifetimeEnds, var, stmt) {} + + const VarDecl *getVarDecl() const { + return static_cast(Data1.getPointer()); + } + + const Stmt *getTriggerStmt() const { + return static_cast(Data2.getPointer()); + } + +private: + friend class CFGElement; + CFGLifetimeEnds() {} + static bool isKind(const CFGElement &elem) { + return elem.getKind() == LifetimeEnds; + } +}; + /// CFGImplicitDtor - Represents C++ object destructor implicitly generated /// by compiler on various occasions. class CFGImplicitDtor : public CFGElement { @@ -701,6 +724,10 @@ class CFGBlock { (public) Elements.push_back(CFGAutomaticObjDtor(VD, S), C); } + void appendLifetimeEnds(VarDecl *VD, Stmt *S, BumpVectorContext &C) { + Elements.push_back(CFGLifetimeEnds(VD, S), C); + } + void appendDeleteDtor(CXXRecordDecl *RD, CXXDeleteExpr *DE, BumpVectorContext &C) { Elements.push_back(CFGDeleteDtor(RD, DE), C); } @@ -717,6 +744,19 @@ class CFGBlock { (public) *I = CFGAutomaticObjDtor(VD, S); return ++I; } + + // Scope leaving must be performed in reversed order. So insertion is in two + // steps. First we prepare space for some number of elements, then we insert + // the elements beginning at the last position in prepared space. + iterator beginLifetimeEndsInsert(iterator I, size_t Cnt, + BumpVectorContext &C) { + return iterator( + Elements.insert(I.base(), Cnt, CFGLifetimeEnds(nullptr, nullptr), C)); + } + iterator insertLifetimeEnds(iterator I, VarDecl *VD, Stmt *S) { + *I = CFGLifetimeEnds(VD, S); + return ++I; + } }; /// \brief CFGCallback defines methods that should be called when a logical @@ -753,6 +793,7 @@ class CFG { (public) bool AddEHEdges; bool AddInitializers; bool AddImplicitDtors; + bool AddLifetime; bool AddTemporaryDtors; bool AddStaticInitBranches; bool AddCXXNewAllocator; @@ -774,8 +815,10 @@ class CFG { (public) BuildOptions() : forcedBlkExprs(nullptr), Observer(nullptr), - PruneTriviallyFalseEdges(true), AddEHEdges(false), + PruneTriviallyFalseEdges(true), + AddEHEdges(false), AddInitializers(false), AddImplicitDtors(false), + AddLifetime(false), AddTemporaryDtors(false), AddStaticInitBranches(false), AddCXXNewAllocator(false), AddCXXDefaultInitExprInCtors(false) {} }; Modified: vendor/clang/dist/include/clang/Analysis/CloneDetection.h ============================================================================== --- vendor/clang/dist/include/clang/Analysis/CloneDetection.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Analysis/CloneDetection.h Thu Jul 13 19:25:38 2017 (r320959) @@ -15,6 +15,8 @@ #ifndef LLVM_CLANG_AST_CLONEDETECTION_H #define LLVM_CLANG_AST_CLONEDETECTION_H +#include "clang/AST/DeclTemplate.h" +#include "clang/AST/StmtVisitor.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" @@ -28,6 +30,192 @@ class Decl; class VarDecl; class ASTContext; class CompoundStmt; + +namespace clone_detection { + +/// Returns a string that represents all macro expansions that expanded into the +/// given SourceLocation. +/// +/// If 'getMacroStack(A) == getMacroStack(B)' is true, then the SourceLocations +/// A and B are expanded from the same macros in the same order. +std::string getMacroStack(SourceLocation Loc, ASTContext &Context); + +/// Collects the data of a single Stmt. +/// +/// This class defines what a code clone is: If it collects for two statements +/// the same data, then those two statements are considered to be clones of each +/// other. +/// +/// All collected data is forwarded to the given data consumer of the type T. +/// The data consumer class needs to provide a member method with the signature: +/// update(StringRef Str) +template +class StmtDataCollector : public ConstStmtVisitor> { + + ASTContext &Context; + /// The data sink to which all data is forwarded. + T &DataConsumer; + +public: + /// Collects data of the given Stmt. + /// \param S The given statement. + /// \param Context The ASTContext of S. + /// \param DataConsumer The data sink to which all data is forwarded. + StmtDataCollector(const Stmt *S, ASTContext &Context, T &DataConsumer) + : Context(Context), DataConsumer(DataConsumer) { + this->Visit(S); + } + + typedef unsigned DataPiece; + + // Below are utility methods for appending different data to the vector. + + void addData(DataPiece Integer) { + DataConsumer.update( + StringRef(reinterpret_cast(&Integer), sizeof(Integer))); + } + + void addData(llvm::StringRef Str) { DataConsumer.update(Str); } + + void addData(const QualType &QT) { addData(QT.getAsString()); } + +// The functions below collect the class specific data of each Stmt subclass. + +// Utility macro for defining a visit method for a given class. This method +// calls back to the ConstStmtVisitor to visit all parent classes. +#define DEF_ADD_DATA(CLASS, CODE) \ + void Visit##CLASS(const CLASS *S) { \ + CODE; \ + ConstStmtVisitor::Visit##CLASS(S); \ + } + + DEF_ADD_DATA(Stmt, { + addData(S->getStmtClass()); + // This ensures that macro generated code isn't identical to macro-generated + // code. + addData(getMacroStack(S->getLocStart(), Context)); + addData(getMacroStack(S->getLocEnd(), Context)); + }) + DEF_ADD_DATA(Expr, { addData(S->getType()); }) + + //--- Builtin functionality ----------------------------------------------// + DEF_ADD_DATA(ArrayTypeTraitExpr, { addData(S->getTrait()); }) + DEF_ADD_DATA(ExpressionTraitExpr, { addData(S->getTrait()); }) + DEF_ADD_DATA(PredefinedExpr, { addData(S->getIdentType()); }) + DEF_ADD_DATA(TypeTraitExpr, { + addData(S->getTrait()); + for (unsigned i = 0; i < S->getNumArgs(); ++i) + addData(S->getArg(i)->getType()); + }) + + //--- Calls --------------------------------------------------------------// + DEF_ADD_DATA(CallExpr, { + // Function pointers don't have a callee and we just skip hashing it. + if (const FunctionDecl *D = S->getDirectCallee()) { + // If the function is a template specialization, we also need to handle + // the template arguments as they are not included in the qualified name. + if (auto Args = D->getTemplateSpecializationArgs()) { + std::string ArgString; + + // Print all template arguments into ArgString + llvm::raw_string_ostream OS(ArgString); + for (unsigned i = 0; i < Args->size(); ++i) { + Args->get(i).print(Context.getLangOpts(), OS); + // Add a padding character so that 'foo()' != 'foo()'. + OS << '\n'; + } + OS.flush(); + + addData(ArgString); + } + addData(D->getQualifiedNameAsString()); + } + }) + + //--- Exceptions ---------------------------------------------------------// + DEF_ADD_DATA(CXXCatchStmt, { addData(S->getCaughtType()); }) + + //--- C++ OOP Stmts ------------------------------------------------------// + DEF_ADD_DATA(CXXDeleteExpr, { + addData(S->isArrayFormAsWritten()); + addData(S->isGlobalDelete()); + }) + + //--- Casts --------------------------------------------------------------// + DEF_ADD_DATA(ObjCBridgedCastExpr, { addData(S->getBridgeKind()); }) + + //--- Miscellaneous Exprs ------------------------------------------------// + DEF_ADD_DATA(BinaryOperator, { addData(S->getOpcode()); }) + DEF_ADD_DATA(UnaryOperator, { addData(S->getOpcode()); }) + + //--- Control flow -------------------------------------------------------// + DEF_ADD_DATA(GotoStmt, { addData(S->getLabel()->getName()); }) + DEF_ADD_DATA(IndirectGotoStmt, { + if (S->getConstantTarget()) + addData(S->getConstantTarget()->getName()); + }) + DEF_ADD_DATA(LabelStmt, { addData(S->getDecl()->getName()); }) + DEF_ADD_DATA(MSDependentExistsStmt, { addData(S->isIfExists()); }) + DEF_ADD_DATA(AddrLabelExpr, { addData(S->getLabel()->getName()); }) + + //--- Objective-C --------------------------------------------------------// + DEF_ADD_DATA(ObjCIndirectCopyRestoreExpr, { addData(S->shouldCopy()); }) + DEF_ADD_DATA(ObjCPropertyRefExpr, { + addData(S->isSuperReceiver()); + addData(S->isImplicitProperty()); + }) + DEF_ADD_DATA(ObjCAtCatchStmt, { addData(S->hasEllipsis()); }) + + //--- Miscellaneous Stmts ------------------------------------------------// + DEF_ADD_DATA(CXXFoldExpr, { + addData(S->isRightFold()); + addData(S->getOperator()); + }) + DEF_ADD_DATA(GenericSelectionExpr, { + for (unsigned i = 0; i < S->getNumAssocs(); ++i) { + addData(S->getAssocType(i)); + } + }) + DEF_ADD_DATA(LambdaExpr, { + for (const LambdaCapture &C : S->captures()) { + addData(C.isPackExpansion()); + addData(C.getCaptureKind()); + if (C.capturesVariable()) + addData(C.getCapturedVar()->getType()); + } + addData(S->isGenericLambda()); + addData(S->isMutable()); + }) + DEF_ADD_DATA(DeclStmt, { + auto numDecls = std::distance(S->decl_begin(), S->decl_end()); + addData(static_cast(numDecls)); + for (const Decl *D : S->decls()) { + if (const VarDecl *VD = dyn_cast(D)) { + addData(VD->getType()); + } + } + }) + DEF_ADD_DATA(AsmStmt, { + addData(S->isSimple()); + addData(S->isVolatile()); + addData(S->generateAsmString(Context)); + for (unsigned i = 0; i < S->getNumInputs(); ++i) { + addData(S->getInputConstraint(i)); + } + for (unsigned i = 0; i < S->getNumOutputs(); ++i) { + addData(S->getOutputConstraint(i)); + } + for (unsigned i = 0; i < S->getNumClobbers(); ++i) { + addData(S->getClobber(i)); + } + }) + DEF_ADD_DATA(AttributedStmt, { + for (const Attr *A : S->getAttrs()) { + addData(std::string(A->getSpelling())); + } + }) +}; +} // namespace clone_detection /// Identifies a list of statements. /// Modified: vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td Thu Jul 13 19:25:38 2017 (r320959) @@ -178,6 +178,8 @@ def warn_drv_optimization_value : Warning<"optimizatio InGroup; def warn_ignored_gcc_optimization : Warning<"optimization flag '%0' is not supported">, InGroup; +def warn_ignored_clang_option : Warning<"the flag '%0' has been deprecated and will be ignored">, + InGroup; def warn_drv_unsupported_opt_for_target : Warning< "optimization flag '%0' is not supported for target '%1'">, InGroup; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Thu Jul 13 19:25:38 2017 (r320959) @@ -179,6 +179,8 @@ def warn_incompatible_analyzer_plugin_api : Warning< def note_incompatible_analyzer_plugin_api : Note< "current API version is '%0', but plugin was compiled with version '%1'">; +def err_module_build_requires_fmodules : Error< + "module compilation requires '-fmodules'">; def err_module_interface_requires_modules_ts : Error< "module interface compilation requires '-fmodules-ts'">; def warn_module_config_mismatch : Warning< Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Thu Jul 13 19:25:38 2017 (r320959) @@ -1029,6 +1029,8 @@ def warn_auto_synthesizing_protocol_property :Warning< "auto property synthesis will not synthesize property %0" " declared in protocol %1">, InGroup>; +def note_add_synthesize_directive : Note< + "add a '@synthesize' directive">; def warn_no_autosynthesis_shared_ivar_property : Warning < "auto property synthesis will not synthesize property " "%0 because it cannot share an ivar with another synthesized property">, @@ -2878,7 +2880,7 @@ def warn_partial_availability : Warning<"%0 is only av def warn_partial_availability_new : Warning, InGroup; def note_partial_availability_silence : Note< - "explicitly redeclare %0 to silence this warning">; + "annotate %select{%1|anonymous %1}0 with an availability attribute to silence">; def note_unguarded_available_silence : Note< "enclose %0 in %select{an @available|a __builtin_available}1 check to silence" " this warning">; @@ -3516,6 +3518,8 @@ def note_ovl_candidate_substitution_failure : Note< "candidate template ignored: substitution failure%0%1">; def note_ovl_candidate_disabled_by_enable_if : Note< "candidate template ignored: disabled by %0%1">; +def note_ovl_candidate_disabled_by_requirement : Note< + "candidate template ignored: requirement '%0' was not satisfied%1">; def note_ovl_candidate_has_pass_object_size_params: Note< "candidate address cannot be taken because parameter %0 has " "pass_object_size attribute">; @@ -4429,6 +4433,9 @@ def err_typename_nested_not_found : Error<"no type nam def err_typename_nested_not_found_enable_if : Error< "no type named 'type' in %0; 'enable_if' cannot be used to disable " "this declaration">; +def err_typename_nested_not_found_requirement : Error< + "failed requirement '%0'; 'enable_if' cannot be used to disable this " + "declaration">; def err_typename_nested_not_type : Error< "typename specifier refers to non-type member %0 in %1">; def note_typename_refers_here : Note< @@ -6353,15 +6360,13 @@ def err_exceptions_disabled : Error< "cannot use '%0' with exceptions disabled">; def err_objc_exceptions_disabled : Error< "cannot use '%0' with Objective-C exceptions disabled">; -def warn_throw_in_noexcept_func - : Warning<"%0 has a non-throwing exception specification but can still " - "throw, resulting in unexpected program termination">, - InGroup; -def note_throw_in_dtor - : Note<"destructor or deallocator has a (possibly implicit) non-throwing " - "excepton specification">; -def note_throw_in_function - : Note<"non-throwing function declare here">; +def warn_throw_in_noexcept_func : Warning< + "%0 has a non-throwing exception specification but can still throw">, + InGroup; +def note_throw_in_dtor : Note< + "%select{destructor|deallocator}0 has a %select{non-throwing|implicit " + "non-throwing}1 exception specification">; +def note_throw_in_function : Note<"function declared non-throwing here">; def err_seh_try_outside_functions : Error< "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">; def err_mixing_cxx_try_seh_try : Error< @@ -8455,8 +8460,6 @@ def err_opencl_builtin_to_addr_invalid_arg : Error< // OpenCL v2.0 s6.13.17 Enqueue kernel restrictions. def err_opencl_enqueue_kernel_incorrect_args : Error< "illegal call to enqueue_kernel, incorrect argument types">; -def err_opencl_enqueue_kernel_expected_type : Error< - "illegal call to enqueue_kernel, expected %0 argument type">; def err_opencl_enqueue_kernel_local_size_args : Error< "mismatch in number of block parameters and local size arguments passed">; def err_opencl_enqueue_kernel_invalid_local_size_type : Error< @@ -8466,6 +8469,9 @@ def err_opencl_enqueue_kernel_blocks_non_local_void_ar def err_opencl_enqueue_kernel_blocks_no_args : Error< "blocks with parameters are not accepted in this prototype of enqueue_kernel call">; +def err_opencl_builtin_expected_type : Error< + "illegal call to %0, expected %1 argument type">; + // OpenCL v2.2 s2.1.2.3 - Vector Component Access def ext_opencl_ext_vector_type_rgba_selector: ExtWarn< "vector component name '%0' is an OpenCL version 2.2 feature">, @@ -8854,6 +8860,10 @@ def warn_omp_nesting_simd : Warning< def err_omp_orphaned_device_directive : Error< "orphaned 'omp %0' directives are prohibited" "; perhaps you forget to enclose the directive into a %select{|||target |teams }1region?">; +def err_omp_reduction_non_addressable_expression : Error< + "expected addressable reduction item for the task-based directives">; +def err_omp_reduction_with_nogroup : Error< + "'reduction' clause cannot be used with 'nogroup' clause">; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Thu Jul 13 19:25:38 2017 (r320959) @@ -127,11 +127,11 @@ def err_module_odr_violation_mismatch_decl : Error< "%select{definition in module '%2'|defined here}1 found " "%select{end of class|public access specifier|private access specifier|" "protected access specifier|static assert|field|method|type alias|typedef|" - "data member}3">; + "data member|friend declaration}3">; def note_module_odr_violation_mismatch_decl : Note<"but in '%0' found " "%select{end of class|public access specifier|private access specifier|" "protected access specifier|static assert|field|method|type alias|typedef|" - "data member}1">; + "data member|friend declaration}1">; def err_module_odr_violation_mismatch_decl_diff : Error< "%q0 has different definitions in different modules; first difference is " @@ -166,6 +166,9 @@ def err_module_odr_violation_mismatch_decl_diff : Erro "data member %4 with%select{out|}5 an initializer|" "data member %4 with an initializer|" "data member %4 %select{is constexpr|is not constexpr}5|" + "friend %select{class|function}4|" + "friend %4|" + "friend function %4|" "}3">; def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " @@ -199,18 +202,21 @@ def note_module_odr_violation_mismatch_decl_diff : Not "data member %2 with%select{out|}3 an initializer|" "data member %2 with a different initializer|" "data member %2 %select{is constexpr|is not constexpr}3|" + "friend %select{class|function}2|" + "friend %2|" + "friend function %2|" "}1">; def err_module_odr_violation_mismatch_decl_unknown : Error< "%q0 %select{with definition in module '%2'|defined here}1 has different " "definitions in different modules; first difference is this " "%select{||||static assert|field|method|type alias|typedef|data member|" - "unexpected decl}3">; + "friend declaration|unexpected decl}3">; def note_module_odr_violation_mismatch_decl_unknown : Note< "but in '%0' found " "%select{||||different static assert|different field|different method|" "different type alias|different typedef|different data member|" - "another unexpected decl}1">; + "different friend declaration|another unexpected decl}1">; def warn_duplicate_module_file_extension : Warning< "duplicate module file extension block name '%0'">, Modified: vendor/clang/dist/include/clang/Basic/Linkage.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/Linkage.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/Linkage.h Thu Jul 13 19:25:38 2017 (r320959) @@ -45,6 +45,17 @@ enum Linkage : unsigned char { /// translation units because of types defined in a inline function. VisibleNoLinkage, + /// \brief Internal linkage according to the Modules TS, but can be referred + /// to from other translation units indirectly through inline functions and + /// templates in the module interface. + ModuleInternalLinkage, + + /// \brief Module linkage, which indicates that the entity can be referred + /// to from other translation units within the same module, and indirectly + /// from arbitrary other translation units through inline functions and + /// templates in the module interface. + ModuleLinkage, + /// \brief External linkage, which indicates that the entity can /// be referred to from other translation units. ExternalLinkage @@ -74,15 +85,20 @@ inline bool isDiscardableGVALinkage(GVALinkage L) { } inline bool isExternallyVisible(Linkage L) { - return L == ExternalLinkage || L == VisibleNoLinkage; + return L >= VisibleNoLinkage; } inline Linkage getFormalLinkage(Linkage L) { - if (L == UniqueExternalLinkage) + switch (L) { + case UniqueExternalLinkage: return ExternalLinkage; - if (L == VisibleNoLinkage) + case VisibleNoLinkage: return NoLinkage; - return L; + case ModuleInternalLinkage: + return InternalLinkage; + default: + return L; + } } inline bool isExternalFormalLinkage(Linkage L) { Modified: vendor/clang/dist/include/clang/Basic/PartialDiagnostic.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/PartialDiagnostic.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/PartialDiagnostic.h Thu Jul 13 19:25:38 2017 (r320959) @@ -329,6 +329,15 @@ class PartialDiagnostic { (public) bool hasStorage() const { return DiagStorage != nullptr; } + /// Retrieve the string argument at the given index. + StringRef getStringArg(unsigned I) { + assert(DiagStorage && "No diagnostic storage?"); + assert(I < DiagStorage->NumDiagArgs && "Not enough diagnostic args"); + assert(DiagStorage->DiagArgumentsKind[I] + == DiagnosticsEngine::ak_std_string && "Not a string arg"); + return DiagStorage->DiagArgumentsStr[I]; + } + friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, unsigned I) { PD.AddTaggedVal(I, DiagnosticsEngine::ak_uint); Modified: vendor/clang/dist/include/clang/Basic/TargetInfo.h ============================================================================== --- vendor/clang/dist/include/clang/Basic/TargetInfo.h Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/TargetInfo.h Thu Jul 13 19:25:38 2017 (r320959) @@ -23,6 +23,7 @@ #include "clang/Basic/VersionTuple.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" @@ -952,6 +953,14 @@ class TargetInfo : public RefCountedBase { const LangAS::Map &getAddressSpaceMap() const { return *AddrSpaceMap; + } + + /// \brief Return an AST address space which can be used opportunistically + /// for constant global memory. It must be possible to convert pointers into + /// this address space to LangAS::Default. If no such address space exists, + /// this may return None, and such optimizations will be disabled. + virtual llvm::Optional getConstantAddressSpace() const { + return LangAS::Default; } /// \brief Retrieve the name of the platform as it is used in the Modified: vendor/clang/dist/include/clang/Basic/arm_neon.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/arm_neon.td Thu Jul 13 19:25:27 2017 (r320958) +++ vendor/clang/dist/include/clang/Basic/arm_neon.td Thu Jul 13 19:25:38 2017 (r320959) @@ -227,7 +227,6 @@ def OP_UNAVAILABLE : Operation { // u: unsigned integer (int/float args) // f: float (int args) // F: double (int args) -// H: half (int args) // d: default // g: default, ignore 'Q' size modifier. // j: default, force 'Q' size modifier. @@ -346,7 +345,6 @@ def OP_MLSLHi : Op<(call "vmlsl", $p0, (call "vget_h (call "vget_high", $p2))>; def OP_MLSLHi_N : Op<(call "vmlsl_n", $p0, (call "vget_high", $p1), $p2)>; def OP_MUL_N : Op<(op "*", $p0, (dup $p1))>; -def OP_MULX_N : Op<(call "vmulx", $p0, (dup $p1))>; def OP_MLA_N : Op<(op "+", $p0, (op "*", $p1, (dup $p2)))>; def OP_MLS_N : Op<(op "-", $p0, (op "*", $p1, (dup $p2)))>; def OP_FMLA_N : Op<(call "vfma", $p0, $p1, (dup $p2))>; @@ -1662,187 +1660,4 @@ def SCALAR_SQRDMLSH_LANEQ : SOpInst<"vqrdmlsh_laneq", def SCALAR_VDUP_LANE : IInst<"vdup_lane", "sdi", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">; def SCALAR_VDUP_LANEQ : IInst<"vdup_laneq", "sji", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">; -} - -// ARMv8.2-A FP16 intrinsics. -let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarch64__)" in { - - // ARMv8.2-A FP16 one-operand vector intrinsics. - - // Comparison - def CMEQH : SInst<"vceqz", "ud", "hQh">; - def CMGEH : SInst<"vcgez", "ud", "hQh">; - def CMGTH : SInst<"vcgtz", "ud", "hQh">; - def CMLEH : SInst<"vclez", "ud", "hQh">; - def CMLTH : SInst<"vcltz", "ud", "hQh">; - - // Vector conversion - def VCVT_F16 : SInst<"vcvt_f16", "Hd", "sUsQsQUs">; - def VCVT_S16 : SInst<"vcvt_s16", "xd", "hQh">; - def VCVT_U16 : SInst<"vcvt_u16", "ud", "hQh">; - def VCVTA_S16 : SInst<"vcvta_s16", "xd", "hQh">; - def VCVTA_U16 : SInst<"vcvta_u16", "ud", "hQh">; - def VCVTM_S16 : SInst<"vcvtm_s16", "xd", "hQh">; - def VCVTM_U16 : SInst<"vcvtm_u16", "ud", "hQh">; - def VCVTN_S16 : SInst<"vcvtn_s16", "xd", "hQh">; - def VCVTN_U16 : SInst<"vcvtn_u16", "ud", "hQh">; - def VCVTP_S16 : SInst<"vcvtp_s16", "xd", "hQh">; - def VCVTP_U16 : SInst<"vcvtp_u16", "ud", "hQh">; - - // Vector rounding - def FRINTZH : SInst<"vrnd", "dd", "hQh">; - def FRINTNH : SInst<"vrndn", "dd", "hQh">; - def FRINTAH : SInst<"vrnda", "dd", "hQh">; - def FRINTPH : SInst<"vrndp", "dd", "hQh">; - def FRINTMH : SInst<"vrndm", "dd", "hQh">; - def FRINTXH : SInst<"vrndx", "dd", "hQh">; - def FRINTIH : SInst<"vrndi", "dd", "hQh">; - - // Misc. - def VABSH : SInst<"vabs", "dd", "hQh">; - def VNEGH : SOpInst<"vneg", "dd", "hQh", OP_NEG>; - def VRECPEH : SInst<"vrecpe", "dd", "hQh">; - def FRSQRTEH : SInst<"vrsqrte", "dd", "hQh">; - def FSQRTH : SInst<"vsqrt", "dd", "hQh">; - - // ARMv8.2-A FP16 two-operands vector intrinsics. - - // Misc. - def VADDH : SOpInst<"vadd", "ddd", "hQh", OP_ADD>; - def VABDH : SInst<"vabd", "ddd", "hQh">; - def VSUBH : SOpInst<"vsub", "ddd", "hQh", OP_SUB>; - - // Comparison - let InstName = "vacge" in { - def VCAGEH : SInst<"vcage", "udd", "hQh">; - def VCALEH : SInst<"vcale", "udd", "hQh">; - } - let InstName = "vacgt" in { - def VCAGTH : SInst<"vcagt", "udd", "hQh">; - def VCALTH : SInst<"vcalt", "udd", "hQh">; - } - def VCEQH : SOpInst<"vceq", "udd", "hQh", OP_EQ>; - def VCGEH : SOpInst<"vcge", "udd", "hQh", OP_GE>; - def VCGTH : SOpInst<"vcgt", "udd", "hQh", OP_GT>; - let InstName = "vcge" in - def VCLEH : SOpInst<"vcle", "udd", "hQh", OP_LE>; - let InstName = "vcgt" in - def VCLTH : SOpInst<"vclt", "udd", "hQh", OP_LT>; - - // Vector conversion - let isVCVT_N = 1 in { - def VCVT_N_F16 : SInst<"vcvt_n_f16", "Hdi", "sUsQsQUs">; - def VCVT_N_S16 : SInst<"vcvt_n_s16", "xdi", "hQh">; - def VCVT_N_U16 : SInst<"vcvt_n_u16", "udi", "hQh">; - } - - // Max/Min - def VMAXH : SInst<"vmax", "ddd", "hQh">; - def VMINH : SInst<"vmin", "ddd", "hQh">; - def FMAXNMH : SInst<"vmaxnm", "ddd", "hQh">; - def FMINNMH : SInst<"vminnm", "ddd", "hQh">; - - // Multiplication/Division - def VMULH : SOpInst<"vmul", "ddd", "hQh", OP_MUL>; - def MULXH : SInst<"vmulx", "ddd", "hQh">; - def FDIVH : IOpInst<"vdiv", "ddd", "hQh", OP_DIV>; - - // Pairwise addition - def VPADDH : SInst<"vpadd", "ddd", "hQh">; - - // Pairwise Max/Min - def VPMAXH : SInst<"vpmax", "ddd", "hQh">; - def VPMINH : SInst<"vpmin", "ddd", "hQh">; - // Pairwise MaxNum/MinNum - def FMAXNMPH : SInst<"vpmaxnm", "ddd", "hQh">; - def FMINNMPH : SInst<"vpminnm", "ddd", "hQh">; - *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***