From 83820d9427a76aa37250a9c7a2bf67334709dfd1 Mon Sep 17 00:00:00 2001 From: joerg Date: Tue, 4 Mar 2014 19:53:10 +0000 Subject: [PATCH] Import Clang 3.5svn r202566. --- .../tests/cindex/test_translation_unit.py | 11 +- .../dist/clang/docs/AttributeReference.rst | 1020 +++++++ .../clang/docs/ClangFormatStyleOptions.rst | 26 +- .../llvm/dist/clang/docs/InternalsManual.rst | 26 +- .../dist/clang/docs/LanguageExtensions.rst | 865 +----- .../clang/docs/LibASTMatchersReference.html | 225 +- .../clang/docs/LibASTMatchersTutorial.rst | 8 +- .../dist/clang/docs/MSVCCompatibility.rst | 121 + external/bsd/llvm/dist/clang/docs/Modules.rst | 36 +- .../bsd/llvm/dist/clang/docs/ReleaseNotes.rst | 22 +- .../dist/clang/docs/ThreadSafetyAnalysis.rst | 818 +++++ .../bsd/llvm/dist/clang/docs/UsersManual.rst | 12 +- external/bsd/llvm/dist/clang/docs/index.rst | 3 + .../clang/docs/tools/dump_ast_matchers.py | 17 +- .../clang/docs/tools/dump_format_style.py | 4 +- .../llvm/dist/clang/examples/CMakeLists.txt | 1 + .../PrintFunctionNames/CMakeLists.txt | 26 +- .../examples/PrintFunctionNames/Makefile | 2 +- .../examples/analyzer-plugin/CMakeLists.txt | 26 +- .../analyzer-plugin/MainCallChecker.cpp | 2 +- .../dist/clang/include/clang-c/BuildSystem.h | 87 + .../dist/clang/include/clang-c/CXErrorCode.h | 64 + .../llvm/dist/clang/include/clang-c/Index.h | 120 +- .../dist/clang/include/clang/AST/ASTContext.h | 8 +- .../dist/clang/include/clang/AST/CharUnits.h | 7 +- .../clang/AST/DataRecursiveASTVisitor.h | 20 +- .../dist/clang/include/clang/AST/DeclCXX.h | 12 +- .../include/clang/AST/ExternalASTSource.h | 2 +- .../clang/include/clang/AST/OpenMPClause.h | 438 +++ .../include/clang/AST/RecursiveASTVisitor.h | 20 +- .../dist/clang/include/clang/AST/StmtOpenMP.h | 471 +-- .../clang/include/clang/AST/TemplateBase.h | 16 +- .../clang/include/clang/AST/VTableBuilder.h | 114 +- .../include/clang/ASTMatchers/ASTMatchers.h | 69 +- .../clang/ASTMatchers/ASTMatchersInternal.h | 20 + .../dist/clang/include/clang/Analysis/CFG.h | 77 +- .../include/clang/Analysis/ProgramPoint.h | 6 +- .../dist/clang/include/clang/Basic/Attr.td | 388 ++- .../clang/include/clang/Basic/AttrDocs.td | 939 ++++++ .../clang/include/clang/Basic/Builtins.def | 5 + .../clang/include/clang/Basic/BuiltinsX86.def | 1 + .../clang/include/clang/Basic/Diagnostic.h | 1 + .../clang/include/clang/Basic/Diagnostic.td | 3 + .../clang/Basic/DiagnosticDriverKinds.td | 7 + .../clang/Basic/DiagnosticFrontendKinds.td | 6 + .../include/clang/Basic/DiagnosticGroups.td | 10 +- .../clang/include/clang/Basic/DiagnosticIDs.h | 17 +- .../include/clang/Basic/DiagnosticLexKinds.td | 2 +- .../clang/Basic/DiagnosticParseKinds.td | 7 +- .../clang/Basic/DiagnosticSemaKinds.td | 97 +- .../Basic/DiagnosticSerializationKinds.td | 5 +- .../clang/include/clang/Basic/FileManager.h | 65 +- .../include/clang/Basic/FileSystemStatCache.h | 25 +- .../clang/include/clang/Basic/LangOptions.def | 2 + .../clang/include/clang/Basic/LangOptions.h | 7 + .../dist/clang/include/clang/Basic/Module.h | 9 +- .../clang/include/clang/Basic/OpenMPKinds.def | 10 + .../include/clang/Basic/SourceLocation.h | 2 +- .../clang/include/clang/Basic/StmtNodes.td | 1 + .../clang/include/clang/Basic/TokenKinds.def | 7 +- .../include/clang/Basic/VirtualFileSystem.h | 170 ++ .../clang/include/clang/Basic/arm_neon.td | 295 +- .../include/clang/CodeGen/CGFunctionInfo.h | 12 + .../clang/include/clang/Driver/CC1Options.td | 4 + .../include/clang/Driver/CLCompatOptions.td | 19 +- .../dist/clang/include/clang/Driver/Job.h | 2 + .../clang/include/clang/Driver/Multilib.h | 167 ++ .../clang/include/clang/Driver/Options.td | 28 +- .../include/clang/Driver/SanitizerArgs.h | 4 +- .../clang/include/clang/Driver/ToolChain.h | 5 + .../dist/clang/include/clang/Format/Format.h | 3 +- .../clang/include/clang/Frontend/ASTUnit.h | 26 +- .../clang/Frontend/ChainedIncludesSource.h | 4 +- .../include/clang/Frontend/CodeGenOptions.def | 1 + .../include/clang/Frontend/CompilerInstance.h | 33 +- .../dist/clang/include/clang/Frontend/Utils.h | 11 + .../clang/include/clang/Lex/CMakeLists.txt | 2 +- .../clang/include/clang/Lex/DirectoryLookup.h | 9 +- .../dist/clang/include/clang/Lex/HeaderMap.h | 5 + .../include/clang/Lex/HeaderSearchOptions.h | 22 +- .../llvm/dist/clang/include/clang/Lex/Lexer.h | 22 +- .../clang/include/clang/Lex/LiteralSupport.h | 7 +- .../clang/include/clang/Lex/Preprocessor.h | 5 + .../dist/clang/include/clang/Parse/Parser.h | 16 +- .../clang/include/clang/Sema/AttributeList.h | 34 - .../dist/clang/include/clang/Sema/DeclSpec.h | 49 +- .../llvm/dist/clang/include/clang/Sema/Sema.h | 93 +- .../clang/include/clang/Sema/TypoCorrection.h | 5 +- .../include/clang/Serialization/ASTBitCodes.h | 1 + .../include/clang/Serialization/ASTReader.h | 64 +- .../include/clang/Serialization/Module.h | 13 + .../Core/BugReporter/BugReporter.h | 11 +- .../StaticAnalyzer/Core/BugReporter/BugType.h | 28 +- .../Core/BugReporter/PathDiagnostic.h | 6 +- .../clang/StaticAnalyzer/Core/Checker.h | 17 +- .../StaticAnalyzer/Core/CheckerManager.h | 23 + .../dist/clang/lib/ARCMigrate/CMakeLists.txt | 15 +- .../clang/lib/ARCMigrate/FileRemapper.cpp | 9 +- .../llvm/dist/clang/lib/ARCMigrate/ObjCMT.cpp | 2 +- .../clang/lib/ARCMigrate/PlistReporter.cpp | 2 +- .../llvm/dist/clang/lib/AST/ASTContext.cpp | 34 +- .../llvm/dist/clang/lib/AST/CMakeLists.txt | 24 +- external/bsd/llvm/dist/clang/lib/AST/Decl.cpp | 8 +- .../llvm/dist/clang/lib/AST/DeclPrinter.cpp | 24 +- .../dist/clang/lib/AST/DeclarationName.cpp | 2 + external/bsd/llvm/dist/clang/lib/AST/Expr.cpp | 6 +- .../llvm/dist/clang/lib/AST/ExprConstant.cpp | 10 +- .../llvm/dist/clang/lib/AST/ItaniumMangle.cpp | 12 +- .../dist/clang/lib/AST/MicrosoftCXXABI.cpp | 6 + .../dist/clang/lib/AST/MicrosoftMangle.cpp | 56 +- .../clang/lib/AST/RecordLayoutBuilder.cpp | 197 +- external/bsd/llvm/dist/clang/lib/AST/Stmt.cpp | 79 +- .../llvm/dist/clang/lib/AST/StmtPrinter.cpp | 44 +- .../llvm/dist/clang/lib/AST/StmtProfile.cpp | 15 +- external/bsd/llvm/dist/clang/lib/AST/Type.cpp | 4 + .../llvm/dist/clang/lib/AST/TypePrinter.cpp | 2 +- .../llvm/dist/clang/lib/AST/VTableBuilder.cpp | 271 +- .../dist/clang/lib/ASTMatchers/CMakeLists.txt | 13 +- .../lib/ASTMatchers/Dynamic/CMakeLists.txt | 3 +- .../lib/ASTMatchers/Dynamic/Registry.cpp | 1 + .../lib/Analysis/AnalysisDeclContext.cpp | 10 +- .../bsd/llvm/dist/clang/lib/Analysis/CFG.cpp | 91 +- .../lib/Analysis/CFGReachabilityAnalysis.cpp | 3 +- .../dist/clang/lib/Analysis/CMakeLists.txt | 13 +- .../dist/clang/lib/Analysis/CallGraph.cpp | 7 +- .../dist/clang/lib/Analysis/ProgramPoint.cpp | 7 +- .../dist/clang/lib/Analysis/ReachableCode.cpp | 132 +- .../dist/clang/lib/Analysis/ThreadSafety.cpp | 27 +- .../lib/Analysis/UninitializedValues.cpp | 5 + .../llvm/dist/clang/lib/Basic/CMakeLists.txt | 18 +- .../dist/clang/lib/Basic/DiagnosticIDs.cpp | 15 +- .../llvm/dist/clang/lib/Basic/FileManager.cpp | 153 +- .../clang/lib/Basic/FileSystemStatCache.cpp | 45 +- .../llvm/dist/clang/lib/Basic/OpenMPKinds.cpp | 11 + .../dist/clang/lib/Basic/SourceManager.cpp | 5 +- .../bsd/llvm/dist/clang/lib/Basic/Targets.cpp | 81 +- .../clang/lib/Basic/VirtualFileSystem.cpp | 832 ++++++ .../dist/clang/lib/CodeGen/BackendUtil.cpp | 9 +- .../llvm/dist/clang/lib/CodeGen/CGBuiltin.cpp | 2637 ++++++++--------- .../llvm/dist/clang/lib/CodeGen/CGCXXABI.cpp | 15 +- .../llvm/dist/clang/lib/CodeGen/CGCXXABI.h | 16 +- .../llvm/dist/clang/lib/CodeGen/CGCall.cpp | 24 +- .../dist/clang/lib/CodeGen/CGDebugInfo.cpp | 50 +- .../llvm/dist/clang/lib/CodeGen/CGExpr.cpp | 11 +- .../llvm/dist/clang/lib/CodeGen/CGExprAgg.cpp | 4 - .../llvm/dist/clang/lib/CodeGen/CGExprCXX.cpp | 2 +- .../dist/clang/lib/CodeGen/CGExprComplex.cpp | 4 - .../dist/clang/lib/CodeGen/CGExprScalar.cpp | 10 +- .../llvm/dist/clang/lib/CodeGen/CGObjC.cpp | 8 +- .../llvm/dist/clang/lib/CodeGen/CGObjCGNU.cpp | 5 +- .../llvm/dist/clang/lib/CodeGen/CGObjCMac.cpp | 261 +- .../dist/clang/lib/CodeGen/CGObjCRuntime.h | 3 +- .../lib/CodeGen/CGRecordLayoutBuilder.cpp | 1522 ++++------ .../llvm/dist/clang/lib/CodeGen/CGStmt.cpp | 144 +- .../dist/clang/lib/CodeGen/CMakeLists.txt | 15 +- .../dist/clang/lib/CodeGen/CodeGenAction.cpp | 25 +- .../clang/lib/CodeGen/CodeGenFunction.cpp | 41 +- .../dist/clang/lib/CodeGen/CodeGenFunction.h | 27 +- .../dist/clang/lib/CodeGen/CodeGenModule.cpp | 13 +- .../dist/clang/lib/CodeGen/CodeGenPGO.cpp | 419 ++- .../llvm/dist/clang/lib/CodeGen/CodeGenPGO.h | 91 +- .../dist/clang/lib/CodeGen/CodeGenTypes.cpp | 5 +- .../dist/clang/lib/CodeGen/ItaniumCXXABI.cpp | 20 +- .../clang/lib/CodeGen/MicrosoftCXXABI.cpp | 156 +- .../dist/clang/lib/CodeGen/TargetInfo.cpp | 44 + .../llvm/dist/clang/lib/Driver/CMakeLists.txt | 10 +- .../dist/clang/lib/Driver/Compilation.cpp | 3 +- .../bsd/llvm/dist/clang/lib/Driver/Driver.cpp | 69 +- .../bsd/llvm/dist/clang/lib/Driver/Job.cpp | 7 + .../llvm/dist/clang/lib/Driver/Multilib.cpp | 360 +++ .../llvm/dist/clang/lib/Driver/ToolChain.cpp | 4 +- .../llvm/dist/clang/lib/Driver/ToolChains.cpp | 569 ++-- .../llvm/dist/clang/lib/Driver/ToolChains.h | 56 +- .../bsd/llvm/dist/clang/lib/Driver/Tools.cpp | 630 ++-- .../bsd/llvm/dist/clang/lib/Driver/Tools.h | 4 + .../llvm/dist/clang/lib/Edit/CMakeLists.txt | 12 +- .../llvm/dist/clang/lib/Format/CMakeLists.txt | 12 +- .../dist/clang/lib/Format/TokenAnnotator.cpp | 12 +- .../llvm/dist/clang/lib/Frontend/ASTUnit.cpp | 184 +- .../dist/clang/lib/Frontend/CMakeLists.txt | 18 +- .../dist/clang/lib/Frontend/CacheTokens.cpp | 4 +- .../lib/Frontend/ChainedIncludesSource.cpp | 22 +- .../clang/lib/Frontend/CompilerInstance.cpp | 70 +- .../clang/lib/Frontend/CompilerInvocation.cpp | 52 +- .../clang/lib/Frontend/DependencyFile.cpp | 2 +- .../clang/lib/Frontend/DependencyGraph.cpp | 2 +- .../clang/lib/Frontend/FrontendAction.cpp | 36 +- .../clang/lib/Frontend/FrontendActions.cpp | 2 +- .../clang/lib/Frontend/HeaderIncludeGen.cpp | 3 +- .../clang/lib/Frontend/InitPreprocessor.cpp | 8 +- .../lib/Frontend/LogDiagnosticPrinter.cpp | 5 +- .../lib/Frontend/PrintPreprocessedOutput.cpp | 53 +- .../clang/lib/Frontend/TextDiagnostic.cpp | 6 +- .../clang/lib/FrontendTool/CMakeLists.txt | 26 +- .../bsd/llvm/dist/clang/lib/Headers/Intrin.h | 18 - .../bsd/llvm/dist/clang/lib/Headers/float.h | 2 +- .../bsd/llvm/dist/clang/lib/Headers/limits.h | 5 +- .../bsd/llvm/dist/clang/lib/Headers/stdarg.h | 2 +- .../bsd/llvm/dist/clang/lib/Headers/stddef.h | 10 + .../bsd/llvm/dist/clang/lib/Headers/stdint.h | 3 +- .../llvm/dist/clang/lib/Headers/xmmintrin.h | 2 + .../llvm/dist/clang/lib/Index/CMakeLists.txt | 3 +- .../dist/clang/lib/Index/USRGeneration.cpp | 47 +- .../llvm/dist/clang/lib/Lex/CMakeLists.txt | 9 +- .../bsd/llvm/dist/clang/lib/Lex/HeaderMap.cpp | 25 +- .../llvm/dist/clang/lib/Lex/HeaderSearch.cpp | 86 +- .../bsd/llvm/dist/clang/lib/Lex/Lexer.cpp | 153 +- .../dist/clang/lib/Lex/LiteralSupport.cpp | 79 +- .../bsd/llvm/dist/clang/lib/Lex/MacroInfo.cpp | 2 +- .../dist/clang/lib/Lex/PPMacroExpansion.cpp | 10 +- .../bsd/llvm/dist/clang/lib/Lex/PTHLexer.cpp | 5 +- .../bsd/llvm/dist/clang/lib/Lex/Pragma.cpp | 35 +- .../llvm/dist/clang/lib/Lex/Preprocessor.cpp | 62 +- .../llvm/dist/clang/lib/Lex/TokenLexer.cpp | 10 +- .../llvm/dist/clang/lib/Parse/CMakeLists.txt | 15 +- .../llvm/dist/clang/lib/Parse/ParseDecl.cpp | 11 +- .../dist/clang/lib/Parse/ParseDeclCXX.cpp | 50 +- .../llvm/dist/clang/lib/Parse/ParseOpenMP.cpp | 53 +- .../llvm/dist/clang/lib/Parse/ParsePragma.cpp | 324 +- .../bsd/llvm/dist/clang/lib/Parse/Parser.cpp | 123 +- .../clang/lib/Rewrite/Core/CMakeLists.txt | 14 +- .../clang/lib/Rewrite/Frontend/CMakeLists.txt | 14 +- .../lib/Rewrite/Frontend/FixItRewriter.cpp | 2 +- .../Rewrite/Frontend/RewriteModernObjC.cpp | 78 +- .../lib/Rewrite/Frontend/RewriteObjC.cpp | 43 +- .../clang/lib/Sema/AnalysisBasedWarnings.cpp | 11 + .../llvm/dist/clang/lib/Sema/CMakeLists.txt | 22 +- .../bsd/llvm/dist/clang/lib/Sema/DeclSpec.cpp | 28 +- .../bsd/llvm/dist/clang/lib/Sema/Sema.cpp | 12 +- .../bsd/llvm/dist/clang/lib/Sema/SemaAttr.cpp | 43 +- .../llvm/dist/clang/lib/Sema/SemaChecking.cpp | 667 ++++- .../dist/clang/lib/Sema/SemaCodeComplete.cpp | 13 +- .../bsd/llvm/dist/clang/lib/Sema/SemaDecl.cpp | 151 +- .../llvm/dist/clang/lib/Sema/SemaDeclAttr.cpp | 196 +- .../llvm/dist/clang/lib/Sema/SemaDeclCXX.cpp | 113 +- .../llvm/dist/clang/lib/Sema/SemaDeclObjC.cpp | 16 +- .../bsd/llvm/dist/clang/lib/Sema/SemaExpr.cpp | 70 +- .../llvm/dist/clang/lib/Sema/SemaExprCXX.cpp | 8 +- .../llvm/dist/clang/lib/Sema/SemaExprObjC.cpp | 12 +- .../bsd/llvm/dist/clang/lib/Sema/SemaInit.cpp | 15 +- .../llvm/dist/clang/lib/Sema/SemaLambda.cpp | 11 +- .../llvm/dist/clang/lib/Sema/SemaLookup.cpp | 32 +- .../dist/clang/lib/Sema/SemaObjCProperty.cpp | 200 +- .../llvm/dist/clang/lib/Sema/SemaOpenMP.cpp | 75 +- .../llvm/dist/clang/lib/Sema/SemaOverload.cpp | 5 +- .../llvm/dist/clang/lib/Sema/SemaTemplate.cpp | 1 - .../lib/Sema/SemaTemplateInstantiateDecl.cpp | 13 +- .../bsd/llvm/dist/clang/lib/Sema/SemaType.cpp | 91 +- .../llvm/dist/clang/lib/Sema/TreeTransform.h | 72 +- .../clang/lib/Serialization/ASTReader.cpp | 381 ++- .../clang/lib/Serialization/ASTReaderDecl.cpp | 2 +- .../clang/lib/Serialization/ASTReaderStmt.cpp | 35 +- .../clang/lib/Serialization/ASTWriter.cpp | 142 +- .../clang/lib/Serialization/ASTWriterStmt.cpp | 17 +- .../clang/lib/Serialization/CMakeLists.txt | 18 +- .../clang/lib/Serialization/ModuleManager.cpp | 10 + .../Checkers/AnalyzerStatsChecker.cpp | 4 +- .../Checkers/ArrayBoundChecker.cpp | 5 +- .../Checkers/ArrayBoundCheckerV2.cpp | 3 +- .../Checkers/BasicObjCFoundationChecks.cpp | 25 +- .../Checkers/BoolAssignmentChecker.cpp | 2 +- .../StaticAnalyzer/Checkers/CMakeLists.txt | 12 +- .../Checkers/CStringChecker.cpp | 46 +- .../Checkers/CStringSyntaxChecker.cpp | 13 +- .../Checkers/CallAndMessageChecker.cpp | 50 +- .../Checkers/CastSizeChecker.cpp | 86 +- .../Checkers/CastToStructChecker.cpp | 9 +- .../Checkers/CheckObjCDealloc.cpp | 16 +- .../Checkers/CheckObjCInstMethSignature.cpp | 17 +- .../Checkers/CheckSecuritySyntaxOnly.cpp | 51 +- .../Checkers/CheckSizeofPointer.cpp | 8 +- .../lib/StaticAnalyzer/Checkers/Checkers.td | 8 +- .../StaticAnalyzer/Checkers/ChrootChecker.cpp | 6 +- .../Checkers/DeadStoresChecker.cpp | 17 +- .../Checkers/DereferenceChecker.cpp | 5 +- .../Checkers/DirectIvarAssignment.cpp | 21 +- .../Checkers/DivZeroChecker.cpp | 2 +- .../Checkers/ExprInspectionChecker.cpp | 6 +- .../Checkers/FixedAddressChecker.cpp | 9 +- .../Checkers/GenericTaintChecker.cpp | 2 +- .../Checkers/IdenticalExprChecker.cpp | 346 ++- .../Checkers/IvarInvalidationChecker.cpp | 47 +- .../Checkers/LLVMConventionsChecker.cpp | 36 +- .../Checkers/MacOSKeychainAPIChecker.cpp | 4 +- .../Checkers/MacOSXAPIChecker.cpp | 2 +- .../StaticAnalyzer/Checkers/MallocChecker.cpp | 235 +- .../MallocOverflowSecurityChecker.cpp | 14 +- .../Checkers/MallocSizeofChecker.cpp | 6 +- .../Checkers/NSAutoreleasePoolChecker.cpp | 2 +- .../Checkers/NSErrorChecker.cpp | 29 +- .../Checkers/NoReturnFunctionChecker.cpp | 1 - .../Checkers/NonNullParamChecker.cpp | 9 +- .../Checkers/ObjCAtSyncChecker.cpp | 9 +- .../Checkers/ObjCContainersASTChecker.cpp | 15 +- .../Checkers/ObjCContainersChecker.cpp | 2 +- .../Checkers/ObjCMissingSuperCallChecker.cpp | 2 +- .../Checkers/ObjCSelfInitChecker.cpp | 27 +- .../Checkers/ObjCUnusedIVarsChecker.cpp | 7 +- .../Checkers/PointerArithChecker.cpp | 9 +- .../Checkers/PointerSubChecker.cpp | 7 +- .../Checkers/PthreadLockChecker.cpp | 5 +- .../Checkers/RetainCountChecker.cpp | 76 +- .../Checkers/ReturnPointerRangeChecker.cpp | 7 +- .../Checkers/ReturnUndefChecker.cpp | 8 +- .../Checkers/SimpleStreamChecker.cpp | 8 +- .../Checkers/StackAddrEscapeChecker.cpp | 14 +- .../StaticAnalyzer/Checkers/StreamChecker.cpp | 22 +- .../Checkers/TaintTesterChecker.cpp | 2 +- .../Checkers/UndefBranchChecker.cpp | 4 +- .../Checkers/UndefCapturedBlockVarChecker.cpp | 3 +- .../Checkers/UndefResultChecker.cpp | 3 +- .../UndefinedArraySubscriptChecker.cpp | 2 +- .../Checkers/UndefinedAssignmentChecker.cpp | 2 +- .../Checkers/UnixAPIChecker.cpp | 18 +- .../Checkers/UnreachableCodeChecker.cpp | 7 +- .../Checkers/VLASizeChecker.cpp | 3 +- .../Checkers/VirtualCallChecker.cpp | 22 +- .../lib/StaticAnalyzer/Core/BugReporter.cpp | 28 +- .../lib/StaticAnalyzer/Core/CMakeLists.txt | 12 +- .../clang/lib/StaticAnalyzer/Core/Checker.cpp | 19 +- .../StaticAnalyzer/Core/CheckerRegistry.cpp | 1 + .../lib/StaticAnalyzer/Core/ExplodedGraph.cpp | 9 +- .../lib/StaticAnalyzer/Core/ExprEngine.cpp | 17 +- .../Core/ExprEngineCallAndReturn.cpp | 2 +- .../StaticAnalyzer/Core/HTMLDiagnostics.cpp | 4 +- .../StaticAnalyzer/Core/PathDiagnostic.cpp | 5 +- .../StaticAnalyzer/Core/PlistDiagnostics.cpp | 2 +- .../lib/StaticAnalyzer/Core/SymbolManager.cpp | 6 +- .../StaticAnalyzer/Frontend/CMakeLists.txt | 13 +- .../dist/clang/lib/Tooling/CMakeLists.txt | 12 +- .../llvm/dist/clang/runtime/CMakeLists.txt | 66 +- .../test/Analysis/NewDeleteLeaks-PR18394.cpp | 16 + .../Analysis/auto-obj-dtors-cfg-output.cpp | 16 +- .../bsd/llvm/dist/clang/test/Analysis/casts.c | 3 +- .../bsd/llvm/dist/clang/test/Analysis/cfg.cpp | 7 +- .../test/Analysis/identical-expressions.cpp | 248 ++ .../test/Analysis/inlining/path-notes.cpp | 6 +- .../llvm/dist/clang/test/Analysis/malloc.c | 216 ++ .../test/Analysis/misc-ps-region-store.cpp | 1 + .../dist/clang/test/Analysis/no-outofbounds.c | 4 +- .../llvm/dist/clang/test/Analysis/nonnull.m | 47 +- .../llvm/dist/clang/test/Analysis/ptr-arith.c | 4 +- .../dist/clang/test/Analysis/stackaddrleak.c | 4 +- .../dist/clang/test/Analysis/superclass.m | 2 +- .../Analysis/temp-obj-dtors-cfg-output.cpp | 93 +- .../dist/clang/test/Analysis/weak-functions.c | 2 +- .../clang/test/CXX/dcl.dcl/dcl.link/p2.cpp | 14 + .../dcl.type/dcl.type.simple/p5-cxx0x.cpp | 32 +- .../dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp | 2 +- .../dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp | 3 +- .../dcl.init.list/p7-cxx11-nowarn.cpp | 3 +- .../dcl.decl/dcl.meaning/dcl.ref/p6-0x.cpp | 5 +- .../llvm/dist/clang/test/CXX/drs/dr0xx.cpp | 5 +- .../llvm/dist/clang/test/CXX/drs/dr1xx.cpp | 8 +- .../llvm/dist/clang/test/CXX/drs/dr2xx.cpp | 27 +- .../CXX/expr/expr.unary/expr.unary.op/p6.cpp | 2 +- .../clang/test/CXX/special/class.dtor/p9.cpp | 19 - .../clang/test/CodeCompletion/objc-message.mm | 46 + .../clang/test/CodeGen/2010-06-17-asmcrash.c | 3 +- .../test/CodeGen/Inputs/instr-profile.pgodata | 67 +- .../test/CodeGen/PR4611-bitfield-layout.c | 2 +- .../clang/test/CodeGen/aarch64-neon-fma.c | 29 + .../test/CodeGen/aarch64-neon-ld-sideeffect.c | 14 + .../dist/clang/test/CodeGen/arm-neon-vcvtX.c | 99 + .../clang/test/CodeGen/arm_neon_intrinsics.c | 24 + .../llvm/dist/clang/test/CodeGen/bitfield-2.c | 8 +- .../clang/test/CodeGen/debug-info-block.c | 1 - .../dist/clang/test/CodeGen/instr-profile.c | 221 +- .../llvm/dist/clang/test/CodeGen/libcalls.c | 4 +- .../clang/test/CodeGen/ms_struct-bitfield.c | 76 +- .../test/CodeGen/noduplicate-cxx11-test.cpp | 20 + .../clang/test/CodeGen/packed-nest-unpacked.c | 2 +- .../dist/clang/test/CodeGen/packed-union.c | 4 +- .../dist/clang/test/CodeGen/pragma-pack-1.c | 4 +- .../dist/clang/test/CodeGen/pragma-pack-2.c | 3 +- .../dist/clang/test/CodeGen/sparcv9-dwarf.c | 99 + .../clang/test/CodeGen/struct-x86-darwin.c | 20 +- .../bsd/llvm/dist/clang/test/CodeGen/union.c | 13 + .../llvm/dist/clang/test/CodeGen/volatile.c | 21 +- .../2004-03-08-ReinterpretCastCopy.cpp | 4 +- .../Inputs/instr-profile-throws.pgodata | 4 +- .../aarch64-mangle-neon-vectors.cpp | 4 +- .../CodeGenCXX/abstract-class-ctors-dtors.cpp | 2 +- .../clang/test/CodeGenCXX/bitfield-layout.cpp | 2 +- .../clang/test/CodeGenCXX/class-layout.cpp | 2 +- .../CodeGenCXX/copy-constructor-synthesis.cpp | 12 +- .../clang/test/CodeGenCXX/ctor-dtor-alias.cpp | 2 +- ...initializer-stdinitializerlist-pr12086.cpp | 6 +- .../test/CodeGenCXX/debug-info-namespace.cpp | 12 +- .../test/CodeGenCXX/debug-info-varargs.cpp | 22 + .../dist/clang/test/CodeGenCXX/extern-c.cpp | 9 +- .../test/CodeGenCXX/inline-functions.cpp | 2 +- .../test/CodeGenCXX/instr-profile-throws.cpp | 18 +- .../clang/test/CodeGenCXX/int64_uint64.cpp | 25 + .../dist/clang/test/CodeGenCXX/linkage.cpp | 34 +- .../CodeGenCXX/mangle-ms-arg-qualifiers.cpp | 20 + .../mangle-ms-return-qualifiers.cpp | 6 + .../dist/clang/test/CodeGenCXX/mangle-ms.cpp | 8 + .../CodeGenCXX/microsoft-abi-byval-sret.cpp | 7 +- .../microsoft-abi-member-pointers.cpp | 38 + .../CodeGenCXX/microsoft-abi-structors.cpp | 75 + .../microsoft-abi-virtual-inheritance.cpp | 7 +- ...crosoft-abi-vtables-single-inheritance.cpp | 31 +- ...bi-vtables-virtual-inheritance-pr18967.cpp | 27 + ...rosoft-abi-vtables-virtual-inheritance.cpp | 43 +- .../test/CodeGenCXX/microsoft-interface.cpp | 3 - .../llvm/dist/clang/test/CodeGenCXX/new.cpp | 4 +- .../dist/clang/test/CodeGenCXX/pr18962.cpp | 32 + .../clang/test/CodeGenCXX/pragma-pack-3.cpp | 3 +- .../CodeGenCXX/vtable-layout-abi-examples.cpp | 2 +- .../CodeGenObjC/Inputs/instr-profile.profdata | 7 + .../dist/clang/test/CodeGenObjC/arc-foreach.m | 2 +- .../llvm/dist/clang/test/CodeGenObjC/arc.m | 4 +- .../clang/test/CodeGenObjC/block-var-layout.m | 8 + .../llvm/dist/clang/test/CodeGenObjC/boxing.m | 24 +- .../clang/test/CodeGenObjC/complex-property.m | 4 +- .../test/CodeGenObjC/debug-property-synth.m | 28 +- .../test/CodeGenObjC/encode-cstyle-method.m | 2 +- .../clang/test/CodeGenObjC/encode-test-6.m | 8 +- .../dist/clang/test/CodeGenObjC/encode-test.m | 2 +- .../externally-initialized-selectors.m | 2 +- .../clang/test/CodeGenObjC/instr-profile.m | 38 + .../test/CodeGenObjC/interface-layout-64.m | 18 +- .../clang/test/CodeGenObjC/ivar-layout-64.m | 26 +- .../test/CodeGenObjC/metadata-symbols-32.m | 46 +- .../test/CodeGenObjC/metadata-symbols-64.m | 44 +- .../clang/test/CodeGenObjC/metadata_symbols.m | 4 +- .../clang/test/CodeGenObjC/non-lazy-classes.m | 4 +- .../dist/clang/test/CodeGenObjC/objc-align.m | 34 +- .../test/CodeGenObjC/objc2-weak-block-call.m | 2 +- .../CodeGenObjC/objc2-weak-import-attribute.m | 2 +- .../test/CodeGenObjC/property-array-type.m | 30 + .../test/CodeGenObjC/property-category-impl.m | 4 +- .../test/CodeGenObjC/property-list-in-class.m | 2 +- .../CodeGenObjC/reorder-synthesized-ivars.m | 36 +- .../clang/test/CodeGenObjCXX/arc-blocks.mm | 2 +- .../dist/clang/test/CodeGenObjCXX/encode.mm | 2 +- .../externally-initialized-selectors.mm | 2 +- .../test/CodeGenObjCXX/lambda-expressions.mm | 4 +- .../dist/clang/test/Driver/aarch64-mfpu.c | 2 + .../llvm/dist/clang/test/Driver/arm-mfpu.c | 15 +- .../llvm/dist/clang/test/Driver/cl-fallback.c | 9 +- .../llvm/dist/clang/test/Driver/cl-options.c | 29 +- .../dist/clang/test/Driver/clang_f_opts.c | 11 +- .../llvm/dist/clang/test/Driver/coverage-ld.c | 9 + .../clang/test/Driver/darwin-asan-nofortify.c | 4 +- .../dist/clang/test/Driver/darwin-dsymutil.c | 3 + .../dist/clang/test/Driver/debug-options.c | 6 +- .../bsd/llvm/dist/clang/test/Driver/freebsd.c | 26 +- .../dist/clang/test/Driver/integrated-as.c | 11 + .../llvm/dist/clang/test/Driver/linux-ld.c | 40 + .../bsd/llvm/dist/clang/test/Driver/mips-as.c | 14 +- .../bsd/llvm/dist/clang/test/Driver/modules.m | 10 + .../bsd/llvm/dist/clang/test/Driver/netbsd.c | 75 +- .../llvm/dist/clang/test/Driver/netbsd.cpp | 40 + .../dist/clang/test/Driver/no-integrated-as.c | 19 + .../dist/clang/test/Driver/nostdincxx.cpp | 4 +- .../bsd/llvm/dist/clang/test/Driver/openbsd.c | 6 + .../dist/clang/test/Driver/ppc-features.cpp | 6 + .../clang/test/Driver/preprocess-multiple.c | 6 + .../llvm/dist/clang/test/Driver/qa_override.c | 2 - .../test/Driver/sanitize_unwind_tables.c | 11 + .../dist/clang/test/Driver/sanitizer-ld.c | 2 + .../dist/clang/test/Driver/unknown-gcc-arch.c | 2 +- .../llvm/dist/clang/test/Driver/vfsoverlay.c | 5 + .../dist/clang/test/Driver/visibility.cpp | 16 +- .../llvm/dist/clang/test/Driver/xcore-opts.c | 22 +- .../clang/test/Frontend/backend-diagnostic.c | 8 +- .../bsd/llvm/dist/clang/test/Headers/c11.c | 4 + .../test/Index/annotate-comments-typedef.m | 2 +- .../clang/test/Index/comment-cplus-decls.cpp | 2 +- .../Index/comment-cplus-template-decls.cpp | 2 +- .../Index/comment-to-html-xml-conversion.cpp | 4 +- .../test/Index/complete-property-flags.m | 12 +- .../test/Index/crash-recovery-code-complete.c | 2 +- .../dist/clang/test/Index/cxx11-lambdas.cpp | 4 +- .../llvm/dist/clang/test/Index/index-refs.cpp | 2 +- .../Index/pch-depending-on-deleted-module.c | 14 + .../llvm/dist/clang/test/Index/print-type.cpp | 97 +- .../bsd/llvm/dist/clang/test/Index/usrs.cpp | 14 +- .../bsd/llvm/dist/clang/test/Index/usrs.m | 18 +- .../clang/test/Layout/ms-x86-basic-layout.cpp | 36 +- .../test/Layout/ms-x86-empty-virtual-base.cpp | 73 +- .../test/Layout/ms-x86-pack-and-align.cpp | 70 +- .../test/Layout/ms-x86-primary-bases.cpp | 16 +- .../test/Layout/ms-x86-vfvb-alignment.cpp | 12 +- .../clang/test/Layout/ms-x86-vtordisp.cpp | 122 +- .../test/Lexer/cxx1y_digit_separators.cpp | 22 + .../dist/clang/test/Misc/ast-dump-attr.cpp | 6 +- .../dist/clang/test/Misc/ast-dump-color.cpp | 2 +- .../dist/clang/test/Misc/ast-dump-decl.cpp | 2 +- .../clang/test/Modules/Inputs/macros_other.h | 7 +- .../clang/test/Modules/Inputs/macros_right.h | 2 + .../test/Modules/Inputs/macros_right_undef.h | 3 + .../clang/test/Modules/Inputs/macros_top.h | 6 + .../dist/clang/test/Modules/Inputs/module.map | 1 + .../test/Modules/fatal-module-loader-error.m | 2 +- ...fmodules-validate-once-per-build-session.c | 45 + .../bsd/llvm/dist/clang/test/Modules/macros.c | 39 +- .../llvm/dist/clang/test/Modules/macros2.c | 77 + .../dist/clang/test/Modules/namespaces.cpp | 4 +- .../clang/test/OpenMP/parallel_ast_print.cpp | 12 +- .../test/OpenMP/parallel_if_messages.cpp | 43 + .../dist/clang/test/OpenMP/simd_ast_print.cpp | 75 + .../clang/test/OpenMP/simd_misc_messages.c | 73 + .../llvm/dist/clang/test/PCH/macro-undef.cpp | 36 + .../llvm/dist/clang/test/PCH/objc_container.m | 4 +- .../dist/clang/test/Parser/cxx-reference.cpp | 2 +- .../test/Parser/cxx0x-rvalue-reference.cpp | 2 +- .../Parser/cxx11-user-defined-literals.cpp | 34 +- .../llvm/dist/clang/test/Parser/diag-crash.c | 6 + .../headermap-rel/Foo.framework/Headers/Foo.h | 2 + .../Inputs/headermap-rel/foo.hmap | Bin 0 -> 804 bytes .../microsoft-header-search/a/b/include3.h | 4 +- .../Inputs/microsoft-header-search/falsepos.h | 3 + .../Preprocessor/aarch64-target-features.c | 4 +- .../test/Preprocessor/arm-target-features.c | 2 +- .../clang/test/Preprocessor/headermap-rel.c | 10 + .../llvm/dist/clang/test/Preprocessor/init.c | 126 +- .../test/Preprocessor/macro_expand_empty.c | 9 +- .../Preprocessor/microsoft-header-search.c | 2 + .../Preprocessor/print-pragma-microsoft.c | 20 + .../test/Preprocessor/x86_target_features.c | 10 +- .../clang/test/Rewriter/dllimport-typedef.c | 2 +- .../Rewriter/no-integrated-preprocessing.m | 4 +- .../clang/test/Sema/Inputs/warn-unreachable.h | 7 + .../clang/test/Sema/aarch64-neon-ranges.c | 217 ++ .../llvm/dist/clang/test/Sema/attr-aligned.c | 7 + .../dist/clang/test/Sema/attr-capabilities.c | 57 + .../dist/clang/test/Sema/attr-noduplicate.c | 8 + .../dist/clang/test/Sema/bitfield-layout.c | 15 + .../llvm/dist/clang/test/Sema/const-eval.c | 2 +- .../dist/clang/test/Sema/decl-in-prototype.c | 4 +- .../bsd/llvm/dist/clang/test/Sema/dllexport.c | 113 + .../bsd/llvm/dist/clang/test/Sema/dllimport.c | 72 + .../dist/clang/test/Sema/format-strings.c | 15 + .../dist/clang/test/Sema/ms_class_layout.cpp | 18 +- .../bsd/llvm/dist/clang/test/Sema/return.c | 7 + .../llvm/dist/clang/test/Sema/static-init.c | 2 +- .../test/Sema/warn-absolute-value-header.c | 36 + .../clang/test/Sema/warn-absolute-value.c | 782 +++++ .../bsd/llvm/dist/clang/test/Sema/warn-null.c | 4 +- .../dist/clang/test/Sema/warn-unreachable.c | 66 +- .../clang/test/SemaCXX/alias-template.cpp | 2 +- .../dist/clang/test/SemaCXX/ast-print.cpp | 25 +- .../SemaCXX/constant-expression-cxx11.cpp | 2 +- .../test/SemaCXX/constant-expression.cpp | 8 + .../clang/test/SemaCXX/cxx11-attr-print.cpp | 3 - .../llvm/dist/clang/test/SemaCXX/decltype.cpp | 10 + .../dist/clang/test/SemaCXX/dllexport.cpp | 189 ++ .../dist/clang/test/SemaCXX/dllimport.cpp | 131 + .../dist/clang/test/SemaCXX/enable_if.cpp | 7 + .../clang/test/SemaCXX/member-pointer-ms.cpp | 53 +- .../test/SemaCXX/microsoft-dtor-lookup.cpp | 9 +- .../dist/clang/test/SemaCXX/ms_struct.cpp | 26 +- .../test/SemaCXX/null_in_arithmetic_ops.cpp | 2 +- .../SemaCXX/nullptr_in_arithmetic_ops.cpp | 2 +- .../clang/test/SemaCXX/pragma-vtordisp.cpp | 40 + .../dist/clang/test/SemaCXX/references.cpp | 12 +- .../SemaCXX/switch-implicit-fallthrough.cpp | 13 + .../clang/test/SemaCXX/trailing-return-0x.cpp | 4 +- .../test/SemaCXX/typo-correction-pt2.cpp | 20 + .../clang/test/SemaCXX/undefined-internal.cpp | 4 +- .../dist/clang/test/SemaCXX/vararg-class.cpp | 48 + .../dist/clang/test/SemaCXX/vtordisp-mode.cpp | 26 + .../SemaCXX/warn-absolute-value-header.cpp | 37 + .../test/SemaCXX/warn-bool-conversion.cpp | 96 + .../SemaCXX/warn-tautological-compare.cpp | 111 + .../SemaCXX/warn-thread-safety-parsing.cpp | 32 +- .../clang/test/SemaObjC/format-strings-objc.m | 3 + .../clang/test/SemaObjC/property-inherited.m | 26 + .../SemaObjC/protocols-suppress-conformance.m | 47 +- .../dist/clang/test/SemaOpenCL/func_ptr.cl | 16 + .../test/SemaTemplate/instantiate-enum.cpp | 15 + .../SemaTemplate/instantiate-local-class.cpp | 15 +- .../resolve-single-template-id.cpp | 16 +- .../bsd/llvm/dist/clang/test/Unit/lit.cfg | 24 +- .../llvm/dist/clang/test/Unit/lit.site.cfg.in | 1 - .../clang/test/VFS/Inputs/actual_header.h | 1 + .../clang/test/VFS/Inputs/actual_module.map | 4 + .../clang/test/VFS/Inputs/external-names.h | 4 + .../dist/clang/test/VFS/Inputs/include_real.h | 1 + .../clang/test/VFS/Inputs/invalid-yaml.yaml | 4 + .../clang/test/VFS/Inputs/missing-key.yaml | 4 + .../clang/test/VFS/Inputs/public_header.h | 1 + .../clang/test/VFS/Inputs/unknown-key.yaml | 5 + .../clang/test/VFS/Inputs/unknown-value.yaml | 5 + .../test/VFS/Inputs/use-external-names.yaml | 7 + .../clang/test/VFS/Inputs/vfsoverlay.yaml | 21 + .../llvm/dist/clang/test/VFS/external-names.c | 35 + .../dist/clang/test/VFS/framework-import.m | 9 + .../dist/clang/test/VFS/implicit-include.c | 7 + .../test/VFS/include-mixed-real-and-virtual.c | 14 + .../test/VFS/include-real-from-virtual.c | 12 + .../test/VFS/include-virtual-from-real.c | 12 + .../bsd/llvm/dist/clang/test/VFS/include.c | 9 + .../llvm/dist/clang/test/VFS/module-import.m | 10 + .../llvm/dist/clang/test/VFS/parse-errors.c | 14 + external/bsd/llvm/dist/clang/test/lit.cfg | 18 + .../clang/tools/c-index-test/c-index-test.c | 266 +- .../clang/tools/clang-format/ClangFormat.cpp | 7 +- .../dist/clang/tools/diagtool/CMakeLists.txt | 4 - .../tools/diagtool/ShowEnabledWarnings.cpp | 1 + .../dist/clang/tools/driver/cc1as_main.cpp | 2 +- .../llvm/dist/clang/tools/driver/driver.cpp | 6 +- .../dist/clang/tools/libclang/BuildSystem.cpp | 195 ++ .../llvm/dist/clang/tools/libclang/CIndex.cpp | 160 +- .../clang/tools/libclang/CIndexDiagnostic.cpp | 8 +- .../dist/clang/tools/libclang/CMakeLists.txt | 86 +- .../dist/clang/tools/libclang/CXCursor.cpp | 6 +- .../tools/libclang/CXStoredDiagnostic.cpp | 1 + .../clang/tools/libclang/CXTranslationUnit.h | 4 + .../llvm/dist/clang/tools/libclang/CXType.cpp | 34 + .../dist/clang/tools/libclang/Indexing.cpp | 38 +- .../llvm/dist/clang/tools/libclang/Makefile | 7 - .../clang/tools/libclang/libclang.exports | 9 + .../dist/clang/tools/scan-build/ccc-analyzer | 84 +- .../dist/clang/tools/scan-build/scan-build | 353 ++- .../dist/clang/tools/scan-build/scan-build.1 | 4 +- .../dist/clang/tools/scan-build/scanview.css | 6 +- .../clang/tools/scan-build/set-xcode-analyzer | 11 +- .../dist/clang/tools/scan-build/sorttable.js | 55 +- .../clang/unittests/AST/DeclPrinterTest.cpp | 49 +- .../unittests/AST/SourceLocationTest.cpp | 10 + .../clang/unittests/AST/StmtPrinterTest.cpp | 56 +- .../unittests/ASTMatchers/ASTMatchersTest.cpp | 66 +- .../dist/clang/unittests/Basic/CMakeLists.txt | 1 + .../clang/unittests/Basic/FileManagerTest.cpp | 11 +- .../unittests/Basic/VirtualFileSystemTest.cpp | 579 ++++ .../llvm/dist/clang/unittests/CMakeLists.txt | 4 + .../clang/unittests/Driver/CMakeLists.txt | 11 + .../llvm/dist/clang/unittests/Driver/Makefile | 16 + .../clang/unittests/Driver/MultilibTest.cpp | 356 +++ .../clang/unittests/Format/FormatTest.cpp | 24 +- .../bsd/llvm/dist/clang/unittests/Makefile | 2 +- .../clang/unittests/libclang/CMakeLists.txt | 7 + .../clang/unittests/libclang/LibclangTest.cpp | 141 + .../dist/clang/unittests/libclang/Makefile | 27 + .../clang/utils/TableGen/ClangAttrEmitter.cpp | 251 +- .../TableGen/ClangDiagnosticsEmitter.cpp | 13 + .../dist/clang/utils/TableGen/NeonEmitter.cpp | 370 +-- .../dist/clang/utils/TableGen/TableGen.cpp | 8 +- .../clang/utils/TableGen/TableGenBackends.h | 2 + .../www/analyzer/latest_checker.html.incl | 2 +- .../clang/www/analyzer/release_notes.html | 12 + .../llvm/dist/clang/www/cxx_dr_status.html | 4 +- .../bsd/llvm/dist/clang/www/cxx_status.html | 12 +- 647 files changed, 23748 insertions(+), 9566 deletions(-) create mode 100644 external/bsd/llvm/dist/clang/docs/AttributeReference.rst create mode 100644 external/bsd/llvm/dist/clang/docs/MSVCCompatibility.rst create mode 100644 external/bsd/llvm/dist/clang/docs/ThreadSafetyAnalysis.rst create mode 100644 external/bsd/llvm/dist/clang/include/clang-c/BuildSystem.h create mode 100644 external/bsd/llvm/dist/clang/include/clang-c/CXErrorCode.h create mode 100644 external/bsd/llvm/dist/clang/include/clang/AST/OpenMPClause.h create mode 100644 external/bsd/llvm/dist/clang/include/clang/Basic/AttrDocs.td create mode 100644 external/bsd/llvm/dist/clang/include/clang/Basic/VirtualFileSystem.h create mode 100644 external/bsd/llvm/dist/clang/include/clang/Driver/Multilib.h create mode 100644 external/bsd/llvm/dist/clang/lib/Basic/VirtualFileSystem.cpp create mode 100644 external/bsd/llvm/dist/clang/lib/Driver/Multilib.cpp create mode 100644 external/bsd/llvm/dist/clang/test/Analysis/NewDeleteLeaks-PR18394.cpp create mode 100644 external/bsd/llvm/dist/clang/test/CXX/dcl.dcl/dcl.link/p2.cpp create mode 100644 external/bsd/llvm/dist/clang/test/CodeCompletion/objc-message.mm create mode 100644 external/bsd/llvm/dist/clang/test/CodeGen/aarch64-neon-ld-sideeffect.c create mode 100644 external/bsd/llvm/dist/clang/test/CodeGen/arm-neon-vcvtX.c create mode 100644 external/bsd/llvm/dist/clang/test/CodeGen/noduplicate-cxx11-test.cpp create mode 100644 external/bsd/llvm/dist/clang/test/CodeGen/sparcv9-dwarf.c create mode 100644 external/bsd/llvm/dist/clang/test/CodeGenCXX/debug-info-varargs.cpp create mode 100644 external/bsd/llvm/dist/clang/test/CodeGenCXX/int64_uint64.cpp create mode 100644 external/bsd/llvm/dist/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-pr18967.cpp create mode 100644 external/bsd/llvm/dist/clang/test/CodeGenCXX/pr18962.cpp create mode 100644 external/bsd/llvm/dist/clang/test/CodeGenObjC/Inputs/instr-profile.profdata create mode 100644 external/bsd/llvm/dist/clang/test/CodeGenObjC/instr-profile.m create mode 100644 external/bsd/llvm/dist/clang/test/CodeGenObjC/property-array-type.m create mode 100644 external/bsd/llvm/dist/clang/test/Driver/no-integrated-as.c create mode 100644 external/bsd/llvm/dist/clang/test/Driver/preprocess-multiple.c create mode 100644 external/bsd/llvm/dist/clang/test/Driver/sanitize_unwind_tables.c create mode 100644 external/bsd/llvm/dist/clang/test/Driver/vfsoverlay.c create mode 100644 external/bsd/llvm/dist/clang/test/Index/pch-depending-on-deleted-module.c create mode 100644 external/bsd/llvm/dist/clang/test/Modules/fmodules-validate-once-per-build-session.c create mode 100644 external/bsd/llvm/dist/clang/test/Modules/macros2.c create mode 100644 external/bsd/llvm/dist/clang/test/OpenMP/parallel_if_messages.cpp create mode 100644 external/bsd/llvm/dist/clang/test/OpenMP/simd_ast_print.cpp create mode 100644 external/bsd/llvm/dist/clang/test/OpenMP/simd_misc_messages.c create mode 100644 external/bsd/llvm/dist/clang/test/PCH/macro-undef.cpp create mode 100644 external/bsd/llvm/dist/clang/test/Parser/diag-crash.c create mode 100644 external/bsd/llvm/dist/clang/test/Preprocessor/Inputs/headermap-rel/Foo.framework/Headers/Foo.h create mode 100644 external/bsd/llvm/dist/clang/test/Preprocessor/Inputs/headermap-rel/foo.hmap create mode 100644 external/bsd/llvm/dist/clang/test/Preprocessor/Inputs/microsoft-header-search/falsepos.h create mode 100644 external/bsd/llvm/dist/clang/test/Preprocessor/headermap-rel.c create mode 100644 external/bsd/llvm/dist/clang/test/Preprocessor/print-pragma-microsoft.c create mode 100644 external/bsd/llvm/dist/clang/test/Sema/Inputs/warn-unreachable.h create mode 100644 external/bsd/llvm/dist/clang/test/Sema/aarch64-neon-ranges.c create mode 100644 external/bsd/llvm/dist/clang/test/Sema/attr-capabilities.c create mode 100644 external/bsd/llvm/dist/clang/test/Sema/attr-noduplicate.c create mode 100644 external/bsd/llvm/dist/clang/test/Sema/dllexport.c create mode 100644 external/bsd/llvm/dist/clang/test/Sema/dllimport.c create mode 100644 external/bsd/llvm/dist/clang/test/Sema/warn-absolute-value-header.c create mode 100644 external/bsd/llvm/dist/clang/test/Sema/warn-absolute-value.c create mode 100644 external/bsd/llvm/dist/clang/test/SemaCXX/dllexport.cpp create mode 100644 external/bsd/llvm/dist/clang/test/SemaCXX/dllimport.cpp create mode 100644 external/bsd/llvm/dist/clang/test/SemaCXX/pragma-vtordisp.cpp create mode 100644 external/bsd/llvm/dist/clang/test/SemaCXX/vararg-class.cpp create mode 100644 external/bsd/llvm/dist/clang/test/SemaCXX/vtordisp-mode.cpp create mode 100644 external/bsd/llvm/dist/clang/test/SemaCXX/warn-absolute-value-header.cpp create mode 100644 external/bsd/llvm/dist/clang/test/SemaOpenCL/func_ptr.cl create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/actual_header.h create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/actual_module.map create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/external-names.h create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/include_real.h create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/invalid-yaml.yaml create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/missing-key.yaml create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/public_header.h create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/unknown-key.yaml create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/unknown-value.yaml create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/use-external-names.yaml create mode 100644 external/bsd/llvm/dist/clang/test/VFS/Inputs/vfsoverlay.yaml create mode 100644 external/bsd/llvm/dist/clang/test/VFS/external-names.c create mode 100644 external/bsd/llvm/dist/clang/test/VFS/framework-import.m create mode 100644 external/bsd/llvm/dist/clang/test/VFS/implicit-include.c create mode 100644 external/bsd/llvm/dist/clang/test/VFS/include-mixed-real-and-virtual.c create mode 100644 external/bsd/llvm/dist/clang/test/VFS/include-real-from-virtual.c create mode 100644 external/bsd/llvm/dist/clang/test/VFS/include-virtual-from-real.c create mode 100644 external/bsd/llvm/dist/clang/test/VFS/include.c create mode 100644 external/bsd/llvm/dist/clang/test/VFS/module-import.m create mode 100644 external/bsd/llvm/dist/clang/test/VFS/parse-errors.c create mode 100644 external/bsd/llvm/dist/clang/tools/libclang/BuildSystem.cpp create mode 100644 external/bsd/llvm/dist/clang/unittests/Basic/VirtualFileSystemTest.cpp create mode 100644 external/bsd/llvm/dist/clang/unittests/Driver/CMakeLists.txt create mode 100644 external/bsd/llvm/dist/clang/unittests/Driver/Makefile create mode 100644 external/bsd/llvm/dist/clang/unittests/Driver/MultilibTest.cpp create mode 100644 external/bsd/llvm/dist/clang/unittests/libclang/CMakeLists.txt create mode 100644 external/bsd/llvm/dist/clang/unittests/libclang/LibclangTest.cpp create mode 100644 external/bsd/llvm/dist/clang/unittests/libclang/Makefile diff --git a/external/bsd/llvm/dist/clang/bindings/python/tests/cindex/test_translation_unit.py b/external/bsd/llvm/dist/clang/bindings/python/tests/cindex/test_translation_unit.py index f77998e52457..be6cd671ae0c 100644 --- a/external/bsd/llvm/dist/clang/bindings/python/tests/cindex/test_translation_unit.py +++ b/external/bsd/llvm/dist/clang/bindings/python/tests/cindex/test_translation_unit.py @@ -1,5 +1,6 @@ import gc import os +import tempfile from clang.cindex import CursorKind from clang.cindex import Cursor @@ -93,15 +94,7 @@ def save_tu(tu): Returns the filename it was saved to. """ - - # FIXME Generate a temp file path using system APIs. - base = 'TEMP_FOR_TRANSLATIONUNIT_SAVE.c' - path = os.path.join(kInputsDir, base) - - # Just in case. - if os.path.exists(path): - os.unlink(path) - + _, path = tempfile.mkstemp() tu.save(path) return path diff --git a/external/bsd/llvm/dist/clang/docs/AttributeReference.rst b/external/bsd/llvm/dist/clang/docs/AttributeReference.rst new file mode 100644 index 000000000000..fb0ca6a87b65 --- /dev/null +++ b/external/bsd/llvm/dist/clang/docs/AttributeReference.rst @@ -0,0 +1,1020 @@ +.. + ------------------------------------------------------------------- + NOTE: This file is automatically generated by running clang-tblgen + -gen-attr-docs. Do not edit this file by hand!! + ------------------------------------------------------------------- + +=================== +Attributes in Clang +=================== +.. contents:: + :local: + +Introduction +============ + +This page lists the attributes currently supported by Clang. + +Function Attributes +=================== + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Clang supports the GNU style ``__attribute__((interrupt("TYPE")))`` attribute on +ARM targets. This attribute may be attached to a function definition and +instructs the backend to generate appropriate function entry/exit code so that +it can be used directly as an interrupt service routine. + +The parameter passed to the interrupt attribute is optional, but if +provided it must be a string literal with one of the following values: "IRQ", +"FIQ", "SWI", "ABORT", "UNDEF". + +The semantics are as follows: + +- If the function is AAPCS, Clang instructs the backend to realign the stack to + 8 bytes on entry. This is a general requirement of the AAPCS at public + interfaces, but may not hold when an exception is taken. Doing this allows + other AAPCS functions to be called. +- If the CPU is M-class this is all that needs to be done since the architecture + itself is designed in such a way that functions obeying the normal AAPCS ABI + constraints are valid exception handlers. +- If the CPU is not M-class, the prologue and epilogue are modified to save all + non-banked registers that are used, so that upon return the user-mode state + will not be corrupted. Note that to avoid unnecessary overhead, only + general-purpose (integer) registers are saved in this way. If VFP operations + are needed, that state must be saved manually. + + Specifically, interrupt kinds other than "FIQ" will save all core registers + except "lr" and "sp". "FIQ" interrupts will save r0-r7. +- If the CPU is not M-class, the return instruction is changed to one of the + canonical sequences permitted by the architecture for exception return. Where + possible the function itself will make the necessary "lr" adjustments so that + the "preferred return address" is selected. + + Unfortunately the compiler is unable to make this guarantee for an "UNDEF" + handler, where the offset from "lr" to the preferred return address depends on + the execution state of the code which generated the exception. In this case + a sequence equivalent to "movs pc, lr" will be used. + + +acquire_capability (acquire_shared_capability, clang::acquire_capability, clang::acquire_shared_capability) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","X","","" + +Marks a function as acquiring a capability. + + +assert_capability (assert_shared_capability, clang::assert_capability, clang::assert_shared_capability) +------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","X","","" + +Marks a function that dynamically tests whether a capability is held, and halts +the program if it is not held. + + +availability +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +The ``availability`` attribute can be placed on declarations to describe the +lifecycle of that declaration relative to operating system versions. Consider +the function declaration for a hypothetical function ``f``: + +.. code-block:: c++ + + void f(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6,obsoleted=10.7))); + +The availability attribute states that ``f`` was introduced in Mac OS X 10.4, +deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information +is used by Clang to determine when it is safe to use ``f``: for example, if +Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()`` +succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call +succeeds but Clang emits a warning specifying that the function is deprecated. +Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call +fails because ``f()`` is no longer available. + +The availability attribute is a comma-separated list starting with the +platform name and then including clauses specifying important milestones in the +declaration's lifetime (in any order) along with additional information. Those +clauses can be: + +introduced=\ *version* + The first version in which this declaration was introduced. + +deprecated=\ *version* + The first version in which this declaration was deprecated, meaning that + users should migrate away from this API. + +obsoleted=\ *version* + The first version in which this declaration was obsoleted, meaning that it + was removed completely and can no longer be used. + +unavailable + This declaration is never available on this platform. + +message=\ *string-literal* + Additional message text that Clang will provide when emitting a warning or + error about use of a deprecated or obsoleted declaration. Useful to direct + users to replacement APIs. + +Multiple availability attributes can be placed on a declaration, which may +correspond to different platforms. Only the availability attribute with the +platform corresponding to the target platform will be used; any others will be +ignored. If no availability attribute specifies availability for the current +target platform, the availability attributes are ignored. Supported platforms +are: + +``ios`` + Apple's iOS operating system. The minimum deployment target is specified by + the ``-mios-version-min=*version*`` or ``-miphoneos-version-min=*version*`` + command-line arguments. + +``macosx`` + Apple's Mac OS X operating system. The minimum deployment target is + specified by the ``-mmacosx-version-min=*version*`` command-line argument. + +A declaration can be used even when deploying back to a platform version prior +to when the declaration was introduced. When this happens, the declaration is +`weakly linked +`_, +as if the ``weak_import`` attribute were added to the declaration. A +weakly-linked declaration may or may not be present a run-time, and a program +can determine whether the declaration is present by checking whether the +address of that declaration is non-NULL. + +If there are multiple declarations of the same entity, the availability +attributes must either match on a per-platform basis or later +declarations must not have availability attributes for that +platform. For example: + +.. code-block:: c + + void g(void) __attribute__((availability(macosx,introduced=10.4))); + void g(void) __attribute__((availability(macosx,introduced=10.4))); // okay, matches + void g(void) __attribute__((availability(ios,introduced=4.0))); // okay, adds a new platform + void g(void); // okay, inherits both macosx and ios availability from above. + void g(void) __attribute__((availability(macosx,introduced=10.5))); // error: mismatch + +When one method overrides another, the overriding method can be more widely available than the overridden method, e.g.,: + +.. code-block:: objc + + @interface A + - (id)method __attribute__((availability(macosx,introduced=10.4))); + - (id)method2 __attribute__((availability(macosx,introduced=10.4))); + @end + + @interface B : A + - (id)method __attribute__((availability(macosx,introduced=10.3))); // okay: method moved into base class later + - (id)method __attribute__((availability(macosx,introduced=10.5))); // error: this method was available via the base class in 10.4 + @end + + +_Noreturn +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "","","","X" + +A function declared as ``_Noreturn`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``_Noreturn`` +that appears to be capable of returning to its caller. + + +noreturn +-------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "","X","","" + +A function declared as ``[[noreturn]]`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``[[noreturn]]`` +that appears to be capable of returning to its caller. + + +carries_dependency +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","X","","" + +The ``carries_dependency`` attribute specifies dependency propagation into and +out of functions. + +When specified on a function or Objective-C method, the ``carries_depedency`` +attribute means that the return value carries a dependency out of the function, +so that the implementation need not constrain ordering upon return from that +function. Implementations of the function and its caller may choose to preserve +dependencies instead of emitting memory ordering instructions such as fences. + +Note, this attribute does not change the meaning of the program, but may result +in generatation of more efficient code. + + +enable_if +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +The ``enable_if`` attribute can be placed on function declarations to control +which overload is selected based on the values of the function's arguments. +When combined with the ``overloadable`` attribute, this feature is also +available in C. + +.. code-block:: c++ + + int isdigit(int c); + int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); + + void foo(char c) { + isdigit(c); + isdigit(10); + isdigit(-10); // results in a compile-time error. + } + +The enable_if attribute takes two arguments, the first is an expression written +in terms of the function parameters, the second is a string explaining why this +overload candidate could not be selected to be displayed in diagnostics. The +expression is part of the function signature for the purposes of determining +whether it is a redeclaration (following the rules used when determining +whether a C++ template specialization is ODR-equivalent), but is not part of +the type. + +The enable_if expression is evaluated as if it were the body of a +bool-returning constexpr function declared with the arguments of the function +it is being applied to, then called with the parameters at the callsite. If the +result is false or could not be determined through constant expression +evaluation, then this overload will not be chosen and the provided string may +be used in a diagnostic if the compile fails as a result. + +Because the enable_if expression is an unevaluated context, there are no global +state changes, nor the ability to pass information from the enable_if +expression to the function body. For example, suppose we want calls to +strnlen(strbuf, maxlen) to resolve to strnlen_chk(strbuf, maxlen, size of +strbuf) only if the size of strbuf can be determined: + +.. code-block:: c++ + + __attribute__((always_inline)) + static inline size_t strnlen(const char *s, size_t maxlen) + __attribute__((overloadable)) + __attribute__((enable_if(__builtin_object_size(s, 0) != -1))), + "chosen when the buffer size is known but 'maxlen' is not"))) + { + return strnlen_chk(s, maxlen, __builtin_object_size(s, 0)); + } + +Multiple enable_if attributes may be applied to a single declaration. In this +case, the enable_if expressions are evaluated from left to right in the +following manner. First, the candidates whose enable_if expressions evaluate to +false or cannot be evaluated are discarded. If the remaining candidates do not +share ODR-equivalent enable_if expressions, the overload resolution is +ambiguous. Otherwise, enable_if overload resolution continues with the next +enable_if attribute on the candidates that have not been discarded and have +remaining enable_if attributes. In this way, we pick the most specific +overload out of a number of viable overloads using enable_if. + +.. code-block:: c++ + + void f() __attribute__((enable_if(true, ""))); // #1 + void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 + + void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 + void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 + +In this example, a call to f() is always resolved to #2, as the first enable_if +expression is ODR-equivalent for both declarations, but #1 does not have another +enable_if expression to continue evaluating, so the next round of evaluation has +only a single candidate. In a call to g(1, 1), the call is ambiguous even though +#2 has more enable_if attributes, because the first enable_if expressions are +not ODR-equivalent. + +Query for this feature with ``__has_attribute(enable_if)``. + + +format (gnu::format) +-------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","X","","" + +Clang supports the ``format`` attribute, which indicates that the function +accepts a ``printf`` or ``scanf``-like format string and corresponding +arguments or a ``va_list`` that contains these arguments. + +Please see `GCC documentation about format attribute +`_ to find details +about attribute syntax. + +Clang implements two kinds of checks with this attribute. + +#. Clang checks that the function with the ``format`` attribute is called with + a format string that uses format specifiers that are allowed, and that + arguments match the format string. This is the ``-Wformat`` warning, it is + on by default. + +#. Clang checks that the format string argument is a literal string. This is + the ``-Wformat-nonliteral`` warning, it is off by default. + + Clang implements this mostly the same way as GCC, but there is a difference + for functions that accept a ``va_list`` argument (for example, ``vprintf``). + GCC does not emit ``-Wformat-nonliteral`` warning for calls to such + fuctions. Clang does not warn if the format string comes from a function + parameter, where the function is annotated with a compatible attribute, + otherwise it warns. For example: + + .. code-block:: c + + __attribute__((__format__ (__scanf__, 1, 3))) + void foo(const char* s, char *buf, ...) { + va_list ap; + va_start(ap, buf); + + vprintf(s, ap); // warning: format string is not a string literal + } + + In this case we warn because ``s`` contains a format string for a + ``scanf``-like function, but it is passed to a ``printf``-like function. + + If the attribute is removed, clang still warns, because the format string is + not a string literal. + + Another example: + + .. code-block:: c + + __attribute__((__format__ (__printf__, 1, 3))) + void foo(const char* s, char *buf, ...) { + va_list ap; + va_start(ap, buf); + + vprintf(s, ap); // warning + } + + In this case Clang does not warn because the format string ``s`` and + the corresponding arguments are annotated. If the arguments are + incorrect, the caller of ``foo`` will receive a warning. + + +noduplicate (clang::noduplicate) +-------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","X","","" + +The ``noduplicate`` attribute can be placed on function declarations to control +whether function calls to this function can be duplicated or not as a result of +optimizations. This is required for the implementation of functions with +certain special requirements, like the OpenCL "barrier" function, that might +need to be run concurrently by all the threads that are executing in lockstep +on the hardware. For example this attribute applied on the function +"nodupfunc" in the code below avoids that: + +.. code-block:: c + + void nodupfunc() __attribute__((noduplicate)); + // Setting it as a C++11 attribute is also valid + // void nodupfunc() [[clang::noduplicate]]; + void foo(); + void bar(); + + nodupfunc(); + if (a > n) { + foo(); + } else { + bar(); + } + +gets possibly modified by some optimizations into code similar to this: + +.. code-block:: c + + if (a > n) { + nodupfunc(); + foo(); + } else { + nodupfunc(); + bar(); + } + +where the call to "nodupfunc" is duplicated and sunk into the two branches +of the condition. + + +no_sanitize_address (no_address_safety_analysis, gnu::no_address_safety_analysis, gnu::no_sanitize_address) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","X","","" + +Use ``__attribute__((no_sanitize_address))`` on a function declaration to +specify that address safety instrumentation (e.g. AddressSanitizer) should +not be applied to that function. + + +no_sanitize_memory +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Use ``__attribute__((no_sanitize_memory))`` on a function declaration to +specify that checks for uninitialized memory should not be inserted +(e.g. by MemorySanitizer). The function may still be instrumented by the tool +to avoid false positives in other places. + + +no_sanitize_thread +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Use ``__attribute__((no_sanitize_thread))`` on a function declaration to +specify that checks for data races on plain (non-atomic) memory accesses should +not be inserted by ThreadSanitizer. The function is still instrumented by the +tool to avoid false positives and provide meaningful stack traces. + + +objc_method_family +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Many methods in Objective-C have conventional meanings determined by their +selectors. It is sometimes useful to be able to mark a method as having a +particular conventional meaning despite not having the right selector, or as +not having the conventional meaning that its selector would suggest. For these +use cases, we provide an attribute to specifically describe the "method family" +that a method belongs to. + +**Usage**: ``__attribute__((objc_method_family(X)))``, where ``X`` is one of +``none``, ``alloc``, ``copy``, ``init``, ``mutableCopy``, or ``new``. This +attribute can only be placed at the end of a method declaration: + +.. code-block:: objc + + - (NSString *)initMyStringValue __attribute__((objc_method_family(none))); + +Users who do not wish to change the conventional meaning of a method, and who +merely want to document its non-standard retain and release semantics, should +use the retaining behavior attributes (``ns_returns_retained``, +``ns_returns_not_retained``, etc). + +Query for this feature with ``__has_attribute(objc_method_family)``. + + +objc_requires_super +------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Some Objective-C classes allow a subclass to override a particular method in a +parent class but expect that the overriding method also calls the overridden +method in the parent class. For these cases, we provide an attribute to +designate that a method requires a "call to ``super``" in the overriding +method in the subclass. + +**Usage**: ``__attribute__((objc_requires_super))``. This attribute can only +be placed at the end of a method declaration: + +.. code-block:: objc + + - (void)foo __attribute__((objc_requires_super)); + +This attribute can only be applied the method declarations within a class, and +not a protocol. Currently this attribute does not enforce any placement of +where the call occurs in the overriding method (such as in the case of +``-dealloc`` where the call must appear at the end). It checks only that it +exists. + +Note that on both OS X and iOS that the Foundation framework provides a +convenience macro ``NS_REQUIRES_SUPER`` that provides syntactic sugar for this +attribute: + +.. code-block:: objc + + - (void)foo NS_REQUIRES_SUPER; + +This macro is conditionally defined depending on the compiler's support for +this attribute. If the compiler does not support the attribute the macro +expands to nothing. + +Operationally, when a method has this annotation the compiler will warn if the +implementation of an override in a subclass does not call super. For example: + +.. code-block:: objc + + warning: method possibly missing a [super AnnotMeth] call + - (void) AnnotMeth{}; + ^ + + +overloadable +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Clang provides support for C++ function overloading in C. Function overloading +in C is introduced using the ``overloadable`` attribute. For example, one +might provide several overloaded versions of a ``tgsin`` function that invokes +the appropriate standard function computing the sine of a value with ``float``, +``double``, or ``long double`` precision: + +.. code-block:: c + + #include + float __attribute__((overloadable)) tgsin(float x) { return sinf(x); } + double __attribute__((overloadable)) tgsin(double x) { return sin(x); } + long double __attribute__((overloadable)) tgsin(long double x) { return sinl(x); } + +Given these declarations, one can call ``tgsin`` with a ``float`` value to +receive a ``float`` result, with a ``double`` to receive a ``double`` result, +etc. Function overloading in C follows the rules of C++ function overloading +to pick the best overload given the call arguments, with a few C-specific +semantics: + +* Conversion from ``float`` or ``double`` to ``long double`` is ranked as a + floating-point promotion (per C99) rather than as a floating-point conversion + (as in C++). + +* A conversion from a pointer of type ``T*`` to a pointer of type ``U*`` is + considered a pointer conversion (with conversion rank) if ``T`` and ``U`` are + compatible types. + +* A conversion from type ``T`` to a value of type ``U`` is permitted if ``T`` + and ``U`` are compatible types. This conversion is given "conversion" rank. + +The declaration of ``overloadable`` functions is restricted to function +declarations and definitions. Most importantly, if any function with a given +name is given the ``overloadable`` attribute, then all function declarations +and definitions with that name (and in that scope) must have the +``overloadable`` attribute. This rule even applies to redeclarations of +functions whose original declaration had the ``overloadable`` attribute, e.g., + +.. code-block:: c + + int f(int) __attribute__((overloadable)); + float f(float); // error: declaration of "f" must have the "overloadable" attribute + + int g(int) __attribute__((overloadable)); + int g(int) { } // error: redeclaration of "g" must also have the "overloadable" attribute + +Functions marked ``overloadable`` must have prototypes. Therefore, the +following code is ill-formed: + +.. code-block:: c + + int h() __attribute__((overloadable)); // error: h does not have a prototype + +However, ``overloadable`` functions are allowed to use a ellipsis even if there +are no named parameters (as is permitted in C++). This feature is particularly +useful when combined with the ``unavailable`` attribute: + +.. code-block:: c++ + + void honeypot(...) __attribute__((overloadable, unavailable)); // calling me is an error + +Functions declared with the ``overloadable`` attribute have their names mangled +according to the same rules as C++ function names. For example, the three +``tgsin`` functions in our motivating example get the mangled names +``_Z5tgsinf``, ``_Z5tgsind``, and ``_Z5tgsine``, respectively. There are two +caveats to this use of name mangling: + +* Future versions of Clang may change the name mangling of functions overloaded + in C, so you should not depend on an specific mangling. To be completely + safe, we strongly urge the use of ``static inline`` with ``overloadable`` + functions. + +* The ``overloadable`` attribute has almost no meaning when used in C++, + because names will already be mangled and functions are already overloadable. + However, when an ``overloadable`` function occurs within an ``extern "C"`` + linkage specification, it's name *will* be mangled in the same way as it + would in C. + +Query for this feature with ``__has_extension(attribute_overloadable)``. + + +release_capability (release_shared_capability, clang::release_capability, clang::release_shared_capability) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","X","","" + +Marks a function as releasing a capability. + + +try_acquire_capability (try_acquire_shared_capability, clang::try_acquire_capability, clang::try_acquire_shared_capability) +--------------------------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","X","","" + +Marks a function that attempts to acquire a capability. This function may fail to +actually acquire the capability; they accept a Boolean value determining +whether acquiring the capability means success (true), or failing to acquire +the capability means success (false). + + +Variable Attributes +=================== + + +tls_model (gnu::tls_model) +-------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","X","","" + +The ``tls_model`` attribute allows you to specify which thread-local storage +model to use. It accepts the following strings: + +* global-dynamic +* local-dynamic +* initial-exec +* local-exec + +TLS models are mutually exclusive. + + +Type Attributes +=============== + + +__single_inhertiance, __multiple_inheritance, __virtual_inheritance +------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "","","","X" + +This collection of keywords is enabled under ``-fms-extensions`` and controls +the pointer-to-member representation used on ``*-*-win32`` targets. + +The ``*-*-win32`` targets utilize a pointer-to-member representation which +varies in size and alignment depending on the definition of the underlying +class. + +However, this is problematic when a forward declaration is only available and +no definition has been made yet. In such cases, Clang is forced to utilize the +most general representation that is available to it. + +These keywords make it possible to use a pointer-to-member representation other +than the most general one regardless of whether or not the definition will ever +be present in the current translation unit. + +This family of keywords belong between the ``class-key`` and ``class-name``: + +.. code-block:: c++ + + struct __single_inheritance S; + int S::*i; + struct S {}; + +This keyword can be applied to class templates but only has an effect when used +on full specializations: + +.. code-block:: c++ + + template struct __single_inheritance A; // warning: inheritance model ignored on primary template + template struct __multiple_inheritance A; // warning: inheritance model ignored on partial specialization + template <> struct __single_inheritance A; + +Note that choosing an inheritance model less general than strictly necessary is +an error: + +.. code-block:: c++ + + struct __multiple_inheritance S; // error: inheritance model does not match definition + int S::*i; + struct S {}; + + +Statement Attributes +==================== + + +fallthrough (clang::fallthrough) +-------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "","X","","" + +The ``clang::fallthrough`` attribute is used along with the +``-Wimplicit-fallthrough`` argument to annotate intentional fall-through +between switch labels. It can only be applied to a null statement placed at a +point of execution between any statement and the next switch label. It is +common to mark these places with a specific comment, but this attribute is +meant to replace comments with a more strict annotation, which can be checked +by the compiler. This attribute doesn't change semantics of the code and can +be used wherever an intended fall-through occurs. It is designed to mimic +control-flow statements like ``break;``, so it can be placed in most places +where ``break;`` can, but only if there are no statements on the execution path +between it and the next switch label. + +Here is an example: + +.. code-block:: c++ + + // compile with -Wimplicit-fallthrough + switch (n) { + case 22: + case 33: // no warning: no statements between case labels + f(); + case 44: // warning: unannotated fall-through + g(); + [[clang::fallthrough]]; + case 55: // no warning + if (x) { + h(); + break; + } + else { + i(); + [[clang::fallthrough]]; + } + case 66: // no warning + p(); + [[clang::fallthrough]]; // warning: fallthrough annotation does not + // directly precede case label + q(); + case 77: // warning: unannotated fall-through + r(); + } + + +Consumed Annotation Checking +============================ +Clang supports additional attributes for checking basic resource management +properties, specifically for unique objects that have a single owning reference. +The following attributes are currently supported, although **the implementation +for these annotations is currently in development and are subject to change.** + +callable_when +------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Use ``__attribute__((callable_when(...)))`` to indicate what states a method +may be called in. Valid states are unconsumed, consumed, or unknown. Each +argument to this attribute must be a quoted string. E.g.: + +``__attribute__((callable_when("unconsumed", "unknown")))`` + + +consumable +---------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Each ``class`` that uses any of the typestate annotations must first be marked +using the ``consumable`` attribute. Failure to do so will result in a warning. + +This attribute accepts a single parameter that must be one of the following: +``unknown``, ``consumed``, or ``unconsumed``. + + +param_typestate +--------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +This attribute specifies expectations about function parameters. Calls to an +function with annotated parameters will issue a warning if the corresponding +argument isn't in the expected state. The attribute is also used to set the +initial state of the parameter when analyzing the function's body. + + +return_typestate +---------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +The ``return_typestate`` attribute can be applied to functions or parameters. +When applied to a function the attribute specifies the state of the returned +value. The function's body is checked to ensure that it always returns a value +in the specified state. On the caller side, values returned by the annotated +function are initialized to the given state. + +When applied to a function parameter it modifies the state of an argument after +a call to the function returns. The function's body is checked to ensure that +the parameter is in the expected state before returning. + + +set_typestate +------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Annotate methods that transition an object into a new state with +``__attribute__((set_typestate(new_state)))``. The new new state must be +unconsumed, consumed, or unknown. + + +test_typestate +-------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Use ``__attribute__((test_typestate(tested_state)))`` to indicate that a method +returns true if the object is in the specified state.. + + +Type Safety Checking +==================== +Clang supports additional attributes to enable checking type safety properties +that can't be enforced by the C type system. Use cases include: + +* MPI library implementations, where these attributes enable checking that + the buffer type matches the passed ``MPI_Datatype``; +* for HDF5 library there is a similar use case to MPI; +* checking types of variadic functions' arguments for functions like + ``fcntl()`` and ``ioctl()``. + +You can detect support for these attributes with ``__has_attribute()``. For +example: + +.. code-block:: c++ + + #if defined(__has_attribute) + # if __has_attribute(argument_with_type_tag) && \ + __has_attribute(pointer_with_type_tag) && \ + __has_attribute(type_tag_for_datatype) + # define ATTR_MPI_PWT(buffer_idx, type_idx) __attribute__((pointer_with_type_tag(mpi,buffer_idx,type_idx))) + /* ... other macros ... */ + # endif + #endif + + #if !defined(ATTR_MPI_PWT) + # define ATTR_MPI_PWT(buffer_idx, type_idx) + #endif + + int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */) + ATTR_MPI_PWT(1,3); + +argument_with_type_tag +---------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Use ``__attribute__((argument_with_type_tag(arg_kind, arg_idx, +type_tag_idx)))`` on a function declaration to specify that the function +accepts a type tag that determines the type of some other argument. +``arg_kind`` is an identifier that should be used when annotating all +applicable type tags. + +This attribute is primarily useful for checking arguments of variadic functions +(``pointer_with_type_tag`` can be used in most non-variadic cases). + +For example: + +.. code-block:: c++ + + int fcntl(int fd, int cmd, ...) + __attribute__(( argument_with_type_tag(fcntl,3,2) )); + + +pointer_with_type_tag +--------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Use ``__attribute__((pointer_with_type_tag(ptr_kind, ptr_idx, type_tag_idx)))`` +on a function declaration to specify that the function accepts a type tag that +determines the pointee type of some other pointer argument. + +For example: + +.. code-block:: c++ + + int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */) + __attribute__(( pointer_with_type_tag(mpi,1,3) )); + + +type_tag_for_datatype +--------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword" + + "X","","","" + +Clang supports annotating type tags of two forms. + +* **Type tag that is an expression containing a reference to some declared + identifier.** Use ``__attribute__((type_tag_for_datatype(kind, type)))`` on a + declaration with that identifier: + + .. code-block:: c++ + + extern struct mpi_datatype mpi_datatype_int + __attribute__(( type_tag_for_datatype(mpi,int) )); + #define MPI_INT ((MPI_Datatype) &mpi_datatype_int) + +* **Type tag that is an integral literal.** Introduce a ``static const`` + variable with a corresponding initializer value and attach + ``__attribute__((type_tag_for_datatype(kind, type)))`` on that declaration, + for example: + + .. code-block:: c++ + + #define MPI_INT ((MPI_Datatype) 42) + static const MPI_Datatype mpi_datatype_int + __attribute__(( type_tag_for_datatype(mpi,int) )) = 42 + +The attribute also accepts an optional third argument that determines how the +expression is compared to the type tag. There are two supported flags: + +* ``layout_compatible`` will cause types to be compared according to + layout-compatibility rules (C++11 [class.mem] p 17, 18). This is + implemented to support annotating types like ``MPI_DOUBLE_INT``. + + For example: + + .. code-block:: c++ + + /* In mpi.h */ + struct internal_mpi_double_int { double d; int i; }; + extern struct mpi_datatype mpi_datatype_double_int + __attribute__(( type_tag_for_datatype(mpi, struct internal_mpi_double_int, layout_compatible) )); + + #define MPI_DOUBLE_INT ((MPI_Datatype) &mpi_datatype_double_int) + + /* In user code */ + struct my_pair { double a; int b; }; + struct my_pair *buffer; + MPI_Send(buffer, 1, MPI_DOUBLE_INT /*, ... */); // no warning + + struct my_int_pair { int a; int b; } + struct my_int_pair *buffer2; + MPI_Send(buffer2, 1, MPI_DOUBLE_INT /*, ... */); // warning: actual buffer element + // type 'struct my_int_pair' + // doesn't match specified MPI_Datatype + +* ``must_be_null`` specifies that the expression should be a null pointer + constant, for example: + + .. code-block:: c++ + + /* In mpi.h */ + extern struct mpi_datatype mpi_datatype_null + __attribute__(( type_tag_for_datatype(mpi, void, must_be_null) )); + + #define MPI_DATATYPE_NULL ((MPI_Datatype) &mpi_datatype_null) + + /* In user code */ + MPI_Send(buffer, 1, MPI_DATATYPE_NULL /*, ... */); // warning: MPI_DATATYPE_NULL + // was specified but buffer + // is not a null pointer + + diff --git a/external/bsd/llvm/dist/clang/docs/ClangFormatStyleOptions.rst b/external/bsd/llvm/dist/clang/docs/ClangFormatStyleOptions.rst index bbe92c6cd80b..662f49d9946d 100644 --- a/external/bsd/llvm/dist/clang/docs/ClangFormatStyleOptions.rst +++ b/external/bsd/llvm/dist/clang/docs/ClangFormatStyleOptions.rst @@ -146,6 +146,10 @@ the configuration (without a prefix: ``Auto``). Like ``Attach``, but break before function definitions. * ``BS_Allman`` (in configuration: ``Allman``) Always break before braces. + * ``BS_GNU`` (in configuration: ``GNU``) + Always break before braces and add an extra level of indentation to + braces of control statements, not to those of class, function + or other definitions. **BreakBeforeTernaryOperators** (``bool``) @@ -162,6 +166,10 @@ the configuration (without a prefix: ``Auto``). clang-format will respect the input's line breaking decisions within statements unless they contradict other rules. +**CommentPragmas** (``std::string``) + A regular expression that describes comments with special meaning, + which should not be split into lines or otherwise changed. + **ConstructorInitializerAllOnOneLineOrOnePerLine** (``bool``) If the constructor initializers don't fit on a line, put each initializer on its own line. @@ -189,7 +197,8 @@ the configuration (without a prefix: ``Auto``). a zero-length name is assumed. **DerivePointerBinding** (``bool``) - If ``true``, analyze the formatted file for the most common binding. + If ``true``, analyze the formatted file for the most common binding + and use ``PointerBindsToType`` only as fallback. **ExperimentalAutoDetectBinPacking** (``bool``) If ``true``, clang-format detects whether function calls and @@ -227,6 +236,9 @@ the configuration (without a prefix: ``Auto``). Should be used for C, C++, ObjectiveC, ObjectiveC++. * ``LK_JavaScript`` (in configuration: ``JavaScript``) Should be used for JavaScript. + * ``LK_Proto`` (in configuration: ``Proto``) + Should be used for Protocol Buffers + (https://developers.google.com/protocol-buffers/). **MaxEmptyLinesToKeep** (``unsigned``) @@ -245,6 +257,10 @@ the configuration (without a prefix: ``Auto``). Indent in all namespaces. +**ObjCSpaceAfterProperty** (``bool``) + Add a space after ``@property`` in Objective-C, i.e. use + ``@property (readonly)`` instead of ``@property(readonly)``. + **ObjCSpaceBeforeProtocolList** (``bool``) Add a space in front of an Objective-C protocol list, i.e. use ``Foo `` instead of ``Foo``. @@ -292,7 +308,7 @@ the configuration (without a prefix: ``Auto``). **SpaceInEmptyParentheses** (``bool``) - If ``false``, spaces may be inserted into '()'. + If ``true``, spaces may be inserted into '()'. **SpacesBeforeTrailingComments** (``unsigned``) The number of spaces to before trailing line comments. @@ -302,7 +318,11 @@ the configuration (without a prefix: ``Auto``). template argument lists **SpacesInCStyleCastParentheses** (``bool``) - If ``false``, spaces may be inserted into C style casts. + If ``true``, spaces may be inserted into C style casts. + +**SpacesInContainerLiterals** (``bool``) + If ``true``, spaces are inserted inside container literals (e.g. + ObjC and Javascript array and dict literals). **SpacesInParentheses** (``bool``) If ``true``, spaces will be inserted after '(' and before ')'. diff --git a/external/bsd/llvm/dist/clang/docs/InternalsManual.rst b/external/bsd/llvm/dist/clang/docs/InternalsManual.rst index 96d43ab57dcc..5830a7e50608 100644 --- a/external/bsd/llvm/dist/clang/docs/InternalsManual.rst +++ b/external/bsd/llvm/dist/clang/docs/InternalsManual.rst @@ -87,7 +87,8 @@ start with ``err_``, ``warn_``, ``ext_`` to encode the severity into the name. Since the enum is referenced in the C++ code that produces the diagnostic, it is somewhat useful for it to be reasonably short. -The severity of the diagnostic comes from the set {``NOTE``, ``WARNING``, +The severity of the diagnostic comes from the set {``NOTE``, ``REMARK``, +``WARNING``, ``EXTENSION``, ``EXTWARN``, ``ERROR``}. The ``ERROR`` severity is used for diagnostics indicating the program is never acceptable under any circumstances. When an error is emitted, the AST for the input code may not be fully built. @@ -97,11 +98,13 @@ represent them in the AST, but we produce diagnostics to tell the user their code is non-portable. The difference is that the former are ignored by default, and the later warn by default. The ``WARNING`` severity is used for constructs that are valid in the currently selected source language but that -are dubious in some way. The ``NOTE`` level is used to staple more information -onto previous diagnostics. +are dubious in some way. The ``REMARK`` severity provides generic information +about the compilation that is not necessarily related to any dubious code. The +``NOTE`` level is used to staple more information onto previous diagnostics. These *severities* are mapped into a smaller set (the ``Diagnostic::Level`` -enum, {``Ignored``, ``Note``, ``Warning``, ``Error``, ``Fatal``}) of output +enum, {``Ignored``, ``Note``, ``Remark``, ``Warning``, ``Error``, ``Fatal``}) of +output *levels* by the diagnostics subsystem based on various configuration options. Clang internally supports a fully fine grained mapping mechanism that allows you to map almost any diagnostic to the output level that you want. The only @@ -1727,6 +1730,21 @@ If additional functionality is desired for the semantic form of the attribute, the ``AdditionalMembers`` field specifies code to be copied verbatim into the semantic attribute class object. +All attributes must have one or more form of documentation, which is provided +in the ``Documentation`` list. Generally, the documentation for an attribute +is a stand-alone definition in `include/clang/Basic/AttrDocs.td +`_ +that is named after the attribute being documented. Each documentation element +is given a ``Category`` (variable, function, or type) and ``Content``. A single +attribute may contain multiple documentation elements for distinct categories. +For instance, an attribute which can appertain to both function and types (such +as a calling convention attribute), should contain two documentation elements. +The ``Content`` for an attribute uses reStructuredText (RST) syntax. + +If an attribute is used internally by the compiler, but is not written by users +(such as attributes with an empty spelling list), it can use the +``Undocumented`` documentation element. + Boilerplate ^^^^^^^^^^^ diff --git a/external/bsd/llvm/dist/clang/docs/LanguageExtensions.rst b/external/bsd/llvm/dist/clang/docs/LanguageExtensions.rst index 48bb6e8cc98f..ce4656e50802 100644 --- a/external/bsd/llvm/dist/clang/docs/LanguageExtensions.rst +++ b/external/bsd/llvm/dist/clang/docs/LanguageExtensions.rst @@ -12,7 +12,7 @@ Clang Language Extensions ObjectiveCLiterals BlockLanguageSpec Block-ABI-Apple - AutomaticReferenceCounting + AutomaticReferenceCounting Introduction ============ @@ -426,103 +426,6 @@ should be treated as a system framework, regardless of how it was found in the framework search path. For consistency, we recommend that such files never be included in installed versions of the framework. -Availability attribute -====================== - -Clang introduces the ``availability`` attribute, which can be placed on -declarations to describe the lifecycle of that declaration relative to -operating system versions. Consider the function declaration for a -hypothetical function ``f``: - -.. code-block:: c++ - - void f(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6,obsoleted=10.7))); - -The availability attribute states that ``f`` was introduced in Mac OS X 10.4, -deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information -is used by Clang to determine when it is safe to use ``f``: for example, if -Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()`` -succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call -succeeds but Clang emits a warning specifying that the function is deprecated. -Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call -fails because ``f()`` is no longer available. - -The availability attribute is a comma-separated list starting with the -platform name and then including clauses specifying important milestones in the -declaration's lifetime (in any order) along with additional information. Those -clauses can be: - -introduced=\ *version* - The first version in which this declaration was introduced. - -deprecated=\ *version* - The first version in which this declaration was deprecated, meaning that - users should migrate away from this API. - -obsoleted=\ *version* - The first version in which this declaration was obsoleted, meaning that it - was removed completely and can no longer be used. - -unavailable - This declaration is never available on this platform. - -message=\ *string-literal* - Additional message text that Clang will provide when emitting a warning or - error about use of a deprecated or obsoleted declaration. Useful to direct - users to replacement APIs. - -Multiple availability attributes can be placed on a declaration, which may -correspond to different platforms. Only the availability attribute with the -platform corresponding to the target platform will be used; any others will be -ignored. If no availability attribute specifies availability for the current -target platform, the availability attributes are ignored. Supported platforms -are: - -``ios`` - Apple's iOS operating system. The minimum deployment target is specified by - the ``-mios-version-min=*version*`` or ``-miphoneos-version-min=*version*`` - command-line arguments. - -``macosx`` - Apple's Mac OS X operating system. The minimum deployment target is - specified by the ``-mmacosx-version-min=*version*`` command-line argument. - -A declaration can be used even when deploying back to a platform version prior -to when the declaration was introduced. When this happens, the declaration is -`weakly linked -`_, -as if the ``weak_import`` attribute were added to the declaration. A -weakly-linked declaration may or may not be present a run-time, and a program -can determine whether the declaration is present by checking whether the -address of that declaration is non-NULL. - -If there are multiple declarations of the same entity, the availability -attributes must either match on a per-platform basis or later -declarations must not have availability attributes for that -platform. For example: - -.. code-block:: c - - void g(void) __attribute__((availability(macosx,introduced=10.4))); - void g(void) __attribute__((availability(macosx,introduced=10.4))); // okay, matches - void g(void) __attribute__((availability(ios,introduced=4.0))); // okay, adds a new platform - void g(void); // okay, inherits both macosx and ios availability from above. - void g(void) __attribute__((availability(macosx,introduced=10.5))); // error: mismatch - -When one method overrides another, the overriding method can be more widely available than the overridden method, e.g.,: - -.. code-block:: objc - - @interface A - - (id)method __attribute__((availability(macosx,introduced=10.4))); - - (id)method2 __attribute__((availability(macosx,introduced=10.4))); - @end - - @interface B : A - - (id)method __attribute__((availability(macosx,introduced=10.3))); // okay: method moved into base class later - - (id)method __attribute__((availability(macosx,introduced=10.5))); // error: this method was available via the base class in 10.4 - @end - Checks for Standard Language Features ===================================== @@ -1195,77 +1098,6 @@ feature, clang provides default synthesis of those properties not declared ``__has_feature(objc_default_synthesize_properties)`` checks for availability of this feature in version of clang being used. -.. _langext-objc_method_family: - - -Objective-C requiring a call to ``super`` in an override --------------------------------------------------------- - -Some Objective-C classes allow a subclass to override a particular method in a -parent class but expect that the overriding method also calls the overridden -method in the parent class. For these cases, we provide an attribute to -designate that a method requires a "call to ``super``" in the overriding -method in the subclass. - -**Usage**: ``__attribute__((objc_requires_super))``. This attribute can only -be placed at the end of a method declaration: - -.. code-block:: objc - - - (void)foo __attribute__((objc_requires_super)); - -This attribute can only be applied the method declarations within a class, and -not a protocol. Currently this attribute does not enforce any placement of -where the call occurs in the overriding method (such as in the case of -``-dealloc`` where the call must appear at the end). It checks only that it -exists. - -Note that on both OS X and iOS that the Foundation framework provides a -convenience macro ``NS_REQUIRES_SUPER`` that provides syntactic sugar for this -attribute: - -.. code-block:: objc - - - (void)foo NS_REQUIRES_SUPER; - -This macro is conditionally defined depending on the compiler's support for -this attribute. If the compiler does not support the attribute the macro -expands to nothing. - -Operationally, when a method has this annotation the compiler will warn if the -implementation of an override in a subclass does not call super. For example: - -.. code-block:: objc - - warning: method possibly missing a [super AnnotMeth] call - - (void) AnnotMeth{}; - ^ - -Objective-C Method Families ---------------------------- - -Many methods in Objective-C have conventional meanings determined by their -selectors. It is sometimes useful to be able to mark a method as having a -particular conventional meaning despite not having the right selector, or as -not having the conventional meaning that its selector would suggest. For these -use cases, we provide an attribute to specifically describe the "method family" -that a method belongs to. - -**Usage**: ``__attribute__((objc_method_family(X)))``, where ``X`` is one of -``none``, ``alloc``, ``copy``, ``init``, ``mutableCopy``, or ``new``. This -attribute can only be placed at the end of a method declaration: - -.. code-block:: objc - - - (NSString *)initMyStringValue __attribute__((objc_method_family(none))); - -Users who do not wish to change the conventional meaning of a method, and who -merely want to document its non-standard retain and release semantics, should -use the :ref:`retaining behavior attributes ` -described below. - -Query for this feature with ``__has_attribute(objc_method_family)``. - .. _langext-objc-retain-release: Objective-C retaining behavior attributes @@ -1278,8 +1110,7 @@ conventions for ownership of object arguments and return values. However, there are exceptions, and so Clang provides attributes to allow these exceptions to be documented. This are used by ARC and the `static analyzer `_ Some exceptions may be -better described using the :ref:`objc_method_family -` attribute instead. +better described using the ``objc_method_family`` attribute instead. **Usage**: The ``ns_returns_retained``, ``ns_returns_not_retained``, ``ns_returns_autoreleased``, ``cf_returns_retained``, and @@ -1338,167 +1169,6 @@ Query the presence of this new mangling with .. _langext-overloading: -Function Overloading in C -========================= - -Clang provides support for C++ function overloading in C. Function overloading -in C is introduced using the ``overloadable`` attribute. For example, one -might provide several overloaded versions of a ``tgsin`` function that invokes -the appropriate standard function computing the sine of a value with ``float``, -``double``, or ``long double`` precision: - -.. code-block:: c - - #include - float __attribute__((overloadable)) tgsin(float x) { return sinf(x); } - double __attribute__((overloadable)) tgsin(double x) { return sin(x); } - long double __attribute__((overloadable)) tgsin(long double x) { return sinl(x); } - -Given these declarations, one can call ``tgsin`` with a ``float`` value to -receive a ``float`` result, with a ``double`` to receive a ``double`` result, -etc. Function overloading in C follows the rules of C++ function overloading -to pick the best overload given the call arguments, with a few C-specific -semantics: - -* Conversion from ``float`` or ``double`` to ``long double`` is ranked as a - floating-point promotion (per C99) rather than as a floating-point conversion - (as in C++). - -* A conversion from a pointer of type ``T*`` to a pointer of type ``U*`` is - considered a pointer conversion (with conversion rank) if ``T`` and ``U`` are - compatible types. - -* A conversion from type ``T`` to a value of type ``U`` is permitted if ``T`` - and ``U`` are compatible types. This conversion is given "conversion" rank. - -The declaration of ``overloadable`` functions is restricted to function -declarations and definitions. Most importantly, if any function with a given -name is given the ``overloadable`` attribute, then all function declarations -and definitions with that name (and in that scope) must have the -``overloadable`` attribute. This rule even applies to redeclarations of -functions whose original declaration had the ``overloadable`` attribute, e.g., - -.. code-block:: c - - int f(int) __attribute__((overloadable)); - float f(float); // error: declaration of "f" must have the "overloadable" attribute - - int g(int) __attribute__((overloadable)); - int g(int) { } // error: redeclaration of "g" must also have the "overloadable" attribute - -Functions marked ``overloadable`` must have prototypes. Therefore, the -following code is ill-formed: - -.. code-block:: c - - int h() __attribute__((overloadable)); // error: h does not have a prototype - -However, ``overloadable`` functions are allowed to use a ellipsis even if there -are no named parameters (as is permitted in C++). This feature is particularly -useful when combined with the ``unavailable`` attribute: - -.. code-block:: c++ - - void honeypot(...) __attribute__((overloadable, unavailable)); // calling me is an error - -Functions declared with the ``overloadable`` attribute have their names mangled -according to the same rules as C++ function names. For example, the three -``tgsin`` functions in our motivating example get the mangled names -``_Z5tgsinf``, ``_Z5tgsind``, and ``_Z5tgsine``, respectively. There are two -caveats to this use of name mangling: - -* Future versions of Clang may change the name mangling of functions overloaded - in C, so you should not depend on an specific mangling. To be completely - safe, we strongly urge the use of ``static inline`` with ``overloadable`` - functions. - -* The ``overloadable`` attribute has almost no meaning when used in C++, - because names will already be mangled and functions are already overloadable. - However, when an ``overloadable`` function occurs within an ``extern "C"`` - linkage specification, it's name *will* be mangled in the same way as it - would in C. - -Query for this feature with ``__has_extension(attribute_overloadable)``. - -Controlling Overload Resolution -=============================== - -Clang introduces the ``enable_if`` attribute, which can be placed on function -declarations to control which overload is selected based on the values of the -function's arguments. When combined with the -:ref:`overloadable` attribute, this feature is also -available in C. - -.. code-block:: c++ - - int isdigit(int c); - int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); - - void foo(char c) { - isdigit(c); - isdigit(10); - isdigit(-10); // results in a compile-time error. - } - -The enable_if attribute takes two arguments, the first is an expression written -in terms of the function parameters, the second is a string explaining why this -overload candidate could not be selected to be displayed in diagnostics. The -expression is part of the function signature for the purposes of determining -whether it is a redeclaration (following the rules used when determining -whether a C++ template specialization is ODR-equivalent), but is not part of -the type. - -The enable_if expression is evaluated as if it were the body of a -bool-returning constexpr function declared with the arguments of the function -it is being applied to, then called with the parameters at the callsite. If the -result is false or could not be determined through constant expression -evaluation, then this overload will not be chosen and the provided string may -be used in a diagnostic if the compile fails as a result. - -Because the enable_if expression is an unevaluated context, there are no global -state changes, nor the ability to pass information from the enable_if -expression to the function body. For example, suppose we want calls to -strnlen(strbuf, maxlen) to resolve to strnlen_chk(strbuf, maxlen, size of -strbuf) only if the size of strbuf can be determined: - -.. code-block:: c++ - - __attribute__((always_inline)) - static inline size_t strnlen(const char *s, size_t maxlen) - __attribute__((overloadable)) - __attribute__((enable_if(__builtin_object_size(s, 0) != -1))), - "chosen when the buffer size is known but 'maxlen' is not"))) - { - return strnlen_chk(s, maxlen, __builtin_object_size(s, 0)); - } - -Multiple enable_if attributes may be applied to a single declaration. In this -case, the enable_if expressions are evaluated from left to right in the -following manner. First, the candidates whose enable_if expressions evaluate to -false or cannot be evaluated are discarded. If the remaining candidates do not -share ODR-equivalent enable_if expressions, the overload resolution is -ambiguous. Otherwise, enable_if overload resolution continues with the next -enable_if attribute on the candidates that have not been discarded and have -remaining enable_if attributes. In this way, we pick the most specific -overload out of a number of viable overloads using enable_if. - -.. code-block:: c++ - - void f() __attribute__((enable_if(true, ""))); // #1 - void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 - - void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 - void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 - -In this example, a call to f() is always resolved to #2, as the first enable_if -expression is ODR-equivalent for both declarations, but #1 does not have another -enable_if expression to continue evaluating, so the next round of evaluation has -only a single candidate. In a call to g(1, 1), the call is ambiguous even though -#2 has more enable_if attributes, because the first enable_if expressions are -not ODR-equivalent. - -Query for this feature with ``__has_attribute(enable_if)``. - Initializer lists for complex numbers in C ========================================== @@ -1900,55 +1570,7 @@ Non-standard C++11 Attributes Clang's non-standard C++11 attributes live in the ``clang`` attribute namespace. -The ``clang::fallthrough`` attribute ------------------------------------- - -The ``clang::fallthrough`` attribute is used along with the -``-Wimplicit-fallthrough`` argument to annotate intentional fall-through -between switch labels. It can only be applied to a null statement placed at a -point of execution between any statement and the next switch label. It is -common to mark these places with a specific comment, but this attribute is -meant to replace comments with a more strict annotation, which can be checked -by the compiler. This attribute doesn't change semantics of the code and can -be used wherever an intended fall-through occurs. It is designed to mimic -control-flow statements like ``break;``, so it can be placed in most places -where ``break;`` can, but only if there are no statements on the execution path -between it and the next switch label. - -Here is an example: - -.. code-block:: c++ - - // compile with -Wimplicit-fallthrough - switch (n) { - case 22: - case 33: // no warning: no statements between case labels - f(); - case 44: // warning: unannotated fall-through - g(); - [[clang::fallthrough]]; - case 55: // no warning - if (x) { - h(); - break; - } - else { - i(); - [[clang::fallthrough]]; - } - case 66: // no warning - p(); - [[clang::fallthrough]]; // warning: fallthrough annotation does not - // directly precede case label - q(); - case 77: // warning: unannotated fall-through - r(); - } - -``gnu::`` attributes --------------------- - -Clang also supports GCC's ``gnu`` attribute namespace. All GCC attributes which +Clang supports GCC's ``gnu`` attribute namespace. All GCC attributes which are accepted with the ``__attribute__((foo))`` syntax are also accepted as ``[[gnu::foo]]``. This only extends to attributes which are specified by GCC (see the list of `GCC function attributes @@ -2004,48 +1626,6 @@ Which compiles to (on X86-32): movl %gs:(%eax), %eax ret -ARM Language Extensions ------------------------ - -Interrupt attribute -^^^^^^^^^^^^^^^^^^^ - -Clang supports the GNU style ``__attribute__((interrupt("TYPE")))`` attribute on -ARM targets. This attribute may be attached to a function definition and -instructs the backend to generate appropriate function entry/exit code so that -it can be used directly as an interrupt service routine. - - The parameter passed to the interrupt attribute is optional, but if -provided it must be a string literal with one of the following values: "IRQ", -"FIQ", "SWI", "ABORT", "UNDEF". - -The semantics are as follows: - -- If the function is AAPCS, Clang instructs the backend to realign the stack to - 8 bytes on entry. This is a general requirement of the AAPCS at public - interfaces, but may not hold when an exception is taken. Doing this allows - other AAPCS functions to be called. -- If the CPU is M-class this is all that needs to be done since the architecture - itself is designed in such a way that functions obeying the normal AAPCS ABI - constraints are valid exception handlers. -- If the CPU is not M-class, the prologue and epilogue are modified to save all - non-banked registers that are used, so that upon return the user-mode state - will not be corrupted. Note that to avoid unnecessary overhead, only - general-purpose (integer) registers are saved in this way. If VFP operations - are needed, that state must be saved manually. - - Specifically, interrupt kinds other than "FIQ" will save all core registers - except "lr" and "sp". "FIQ" interrupts will save r0-r7. -- If the CPU is not M-class, the return instruction is changed to one of the - canonical sequences permitted by the architecture for exception return. Where - possible the function itself will make the necessary "lr" adjustments so that - the "preferred return address" is selected. - - Unfortunately the compiler is unable to make this guarantee for an "UNDEF" - handler, where the offset from "lr" to the preferred return address depends on - the execution state of the code which generated the exception. In this case - a sequence equivalent to "movs pc, lr" will be used. - Extensions for Static Analysis ============================== @@ -2059,450 +1639,11 @@ in the analyzer's `list of source-level annotations Extensions for Dynamic Analysis =============================== -.. _langext-address_sanitizer: - -AddressSanitizer ----------------- - Use ``__has_feature(address_sanitizer)`` to check if the code is being built with :doc:`AddressSanitizer`. -Use ``__attribute__((no_sanitize_address))`` -on a function declaration -to specify that address safety instrumentation (e.g. AddressSanitizer) should -not be applied to that function. - -.. _langext-thread_sanitizer: - -ThreadSanitizer ----------------- - Use ``__has_feature(thread_sanitizer)`` to check if the code is being built with :doc:`ThreadSanitizer`. -Use ``__attribute__((no_sanitize_thread))`` on a function declaration -to specify that checks for data races on plain (non-atomic) memory accesses -should not be inserted by ThreadSanitizer. -The function is still instrumented by the tool to avoid false positives and -provide meaningful stack traces. - -.. _langext-memory_sanitizer: - -MemorySanitizer ----------------- Use ``__has_feature(memory_sanitizer)`` to check if the code is being built with :doc:`MemorySanitizer`. - -Use ``__attribute__((no_sanitize_memory))`` on a function declaration -to specify that checks for uninitialized memory should not be inserted -(e.g. by MemorySanitizer). The function may still be instrumented by the tool -to avoid false positives in other places. - - -Thread-Safety Annotation Checking -================================= - -Clang supports additional attributes for checking basic locking policies in -multithreaded programs. Clang currently parses the following list of -attributes, although **the implementation for these annotations is currently in -development.** For more details, see the `GCC implementation -`_. - -``no_thread_safety_analysis`` ------------------------------ - -Use ``__attribute__((no_thread_safety_analysis))`` on a function declaration to -specify that the thread safety analysis should not be run on that function. -This attribute provides an escape hatch (e.g. for situations when it is -difficult to annotate the locking policy). - -``lockable`` ------------- - -Use ``__attribute__((lockable))`` on a class definition to specify that it has -a lockable type (e.g. a Mutex class). This annotation is primarily used to -check consistency. - -``scoped_lockable`` -------------------- - -Use ``__attribute__((scoped_lockable))`` on a class definition to specify that -it has a "scoped" lockable type. Objects of this type will acquire the lock -upon construction and release it upon going out of scope. This annotation is -primarily used to check consistency. - -``guarded_var`` ---------------- - -Use ``__attribute__((guarded_var))`` on a variable declaration to specify that -the variable must be accessed while holding some lock. - -``pt_guarded_var`` ------------------- - -Use ``__attribute__((pt_guarded_var))`` on a pointer declaration to specify -that the pointer must be dereferenced while holding some lock. - -``guarded_by(l)`` ------------------ - -Use ``__attribute__((guarded_by(l)))`` on a variable declaration to specify -that the variable must be accessed while holding lock ``l``. - -``pt_guarded_by(l)`` --------------------- - -Use ``__attribute__((pt_guarded_by(l)))`` on a pointer declaration to specify -that the pointer must be dereferenced while holding lock ``l``. - -``acquired_before(...)`` ------------------------- - -Use ``__attribute__((acquired_before(...)))`` on a declaration of a lockable -variable to specify that the lock must be acquired before all attribute -arguments. Arguments must be lockable type, and there must be at least one -argument. - -``acquired_after(...)`` ------------------------ - -Use ``__attribute__((acquired_after(...)))`` on a declaration of a lockable -variable to specify that the lock must be acquired after all attribute -arguments. Arguments must be lockable type, and there must be at least one -argument. - -``exclusive_lock_function(...)`` --------------------------------- - -Use ``__attribute__((exclusive_lock_function(...)))`` on a function declaration -to specify that the function acquires all listed locks exclusively. This -attribute takes zero or more arguments: either of lockable type or integers -indexing into function parameters of lockable type. If no arguments are given, -the acquired lock is implicitly ``this`` of the enclosing object. - -``shared_lock_function(...)`` ------------------------------ - -Use ``__attribute__((shared_lock_function(...)))`` on a function declaration to -specify that the function acquires all listed locks, although the locks may be -shared (e.g. read locks). This attribute takes zero or more arguments: either -of lockable type or integers indexing into function parameters of lockable -type. If no arguments are given, the acquired lock is implicitly ``this`` of -the enclosing object. - -``exclusive_trylock_function(...)`` ------------------------------------ - -Use ``__attribute__((exclusive_lock_function(...)))`` on a function declaration -to specify that the function will try (without blocking) to acquire all listed -locks exclusively. This attribute takes one or more arguments. The first -argument is an integer or boolean value specifying the return value of a -successful lock acquisition. The remaining arugments are either of lockable -type or integers indexing into function parameters of lockable type. If only -one argument is given, the acquired lock is implicitly ``this`` of the -enclosing object. - -``shared_trylock_function(...)`` --------------------------------- - -Use ``__attribute__((shared_lock_function(...)))`` on a function declaration to -specify that the function will try (without blocking) to acquire all listed -locks, although the locks may be shared (e.g. read locks). This attribute -takes one or more arguments. The first argument is an integer or boolean value -specifying the return value of a successful lock acquisition. The remaining -arugments are either of lockable type or integers indexing into function -parameters of lockable type. If only one argument is given, the acquired lock -is implicitly ``this`` of the enclosing object. - -``unlock_function(...)`` ------------------------- - -Use ``__attribute__((unlock_function(...)))`` on a function declaration to -specify that the function release all listed locks. This attribute takes zero -or more arguments: either of lockable type or integers indexing into function -parameters of lockable type. If no arguments are given, the acquired lock is -implicitly ``this`` of the enclosing object. - -``lock_returned(l)`` --------------------- - -Use ``__attribute__((lock_returned(l)))`` on a function declaration to specify -that the function returns lock ``l`` (``l`` must be of lockable type). This -annotation is used to aid in resolving lock expressions. - -``locks_excluded(...)`` ------------------------ - -Use ``__attribute__((locks_excluded(...)))`` on a function declaration to -specify that the function must not be called with the listed locks. Arguments -must be lockable type, and there must be at least one argument. - -``exclusive_locks_required(...)`` ---------------------------------- - -Use ``__attribute__((exclusive_locks_required(...)))`` on a function -declaration to specify that the function must be called while holding the -listed exclusive locks. Arguments must be lockable type, and there must be at -least one argument. - -``shared_locks_required(...)`` ------------------------------- - -Use ``__attribute__((shared_locks_required(...)))`` on a function declaration -to specify that the function must be called while holding the listed shared -locks. Arguments must be lockable type, and there must be at least one -argument. - -Consumed Annotation Checking -============================ - -Clang supports additional attributes for checking basic resource management -properties, specifically for unique objects that have a single owning reference. -The following attributes are currently supported, although **the implementation -for these annotations is currently in development and are subject to change.** - -``consumable`` --------------- - -Each class that uses any of the following annotations must first be marked -using the consumable attribute. Failure to do so will result in a warning. - -``set_typestate(new_state)`` ----------------------------- - -Annotate methods that transition an object into a new state with -``__attribute__((set_typestate(new_state)))``. The new new state must be -unconsumed, consumed, or unknown. - -``callable_when(...)`` ----------------------- - -Use ``__attribute__((callable_when(...)))`` to indicate what states a method -may be called in. Valid states are unconsumed, consumed, or unknown. Each -argument to this attribute must be a quoted string. E.g.: - -``__attribute__((callable_when("unconsumed", "unknown")))`` - -``tests_typestate(tested_state)`` ---------------------------------- - -Use ``__attribute__((tests_typestate(tested_state)))`` to indicate that a method -returns true if the object is in the specified state.. - -``param_typestate(expected_state)`` ------------------------------------ - -This attribute specifies expectations about function parameters. Calls to an -function with annotated parameters will issue a warning if the corresponding -argument isn't in the expected state. The attribute is also used to set the -initial state of the parameter when analyzing the function's body. - -``return_typestate(ret_state)`` -------------------------------- - -The ``return_typestate`` attribute can be applied to functions or parameters. -When applied to a function the attribute specifies the state of the returned -value. The function's body is checked to ensure that it always returns a value -in the specified state. On the caller side, values returned by the annotated -function are initialized to the given state. - -If the attribute is applied to a function parameter it modifies the state of -an argument after a call to the function returns. The function's body is -checked to ensure that the parameter is in the expected state before returning. - -Type Safety Checking -==================== - -Clang supports additional attributes to enable checking type safety properties -that can't be enforced by the C type system. Use cases include: - -* MPI library implementations, where these attributes enable checking that - the buffer type matches the passed ``MPI_Datatype``; -* for HDF5 library there is a similar use case to MPI; -* checking types of variadic functions' arguments for functions like - ``fcntl()`` and ``ioctl()``. - -You can detect support for these attributes with ``__has_attribute()``. For -example: - -.. code-block:: c++ - - #if defined(__has_attribute) - # if __has_attribute(argument_with_type_tag) && \ - __has_attribute(pointer_with_type_tag) && \ - __has_attribute(type_tag_for_datatype) - # define ATTR_MPI_PWT(buffer_idx, type_idx) __attribute__((pointer_with_type_tag(mpi,buffer_idx,type_idx))) - /* ... other macros ... */ - # endif - #endif - - #if !defined(ATTR_MPI_PWT) - # define ATTR_MPI_PWT(buffer_idx, type_idx) - #endif - - int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */) - ATTR_MPI_PWT(1,3); - -``argument_with_type_tag(...)`` -------------------------------- - -Use ``__attribute__((argument_with_type_tag(arg_kind, arg_idx, -type_tag_idx)))`` on a function declaration to specify that the function -accepts a type tag that determines the type of some other argument. -``arg_kind`` is an identifier that should be used when annotating all -applicable type tags. - -This attribute is primarily useful for checking arguments of variadic functions -(``pointer_with_type_tag`` can be used in most non-variadic cases). - -For example: - -.. code-block:: c++ - - int fcntl(int fd, int cmd, ...) - __attribute__(( argument_with_type_tag(fcntl,3,2) )); - -``pointer_with_type_tag(...)`` ------------------------------- - -Use ``__attribute__((pointer_with_type_tag(ptr_kind, ptr_idx, type_tag_idx)))`` -on a function declaration to specify that the function accepts a type tag that -determines the pointee type of some other pointer argument. - -For example: - -.. code-block:: c++ - - int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */) - __attribute__(( pointer_with_type_tag(mpi,1,3) )); - -``type_tag_for_datatype(...)`` ------------------------------- - -Clang supports annotating type tags of two forms. - -* **Type tag that is an expression containing a reference to some declared - identifier.** Use ``__attribute__((type_tag_for_datatype(kind, type)))`` on a - declaration with that identifier: - - .. code-block:: c++ - - extern struct mpi_datatype mpi_datatype_int - __attribute__(( type_tag_for_datatype(mpi,int) )); - #define MPI_INT ((MPI_Datatype) &mpi_datatype_int) - -* **Type tag that is an integral literal.** Introduce a ``static const`` - variable with a corresponding initializer value and attach - ``__attribute__((type_tag_for_datatype(kind, type)))`` on that declaration, - for example: - - .. code-block:: c++ - - #define MPI_INT ((MPI_Datatype) 42) - static const MPI_Datatype mpi_datatype_int - __attribute__(( type_tag_for_datatype(mpi,int) )) = 42 - -The attribute also accepts an optional third argument that determines how the -expression is compared to the type tag. There are two supported flags: - -* ``layout_compatible`` will cause types to be compared according to - layout-compatibility rules (C++11 [class.mem] p 17, 18). This is - implemented to support annotating types like ``MPI_DOUBLE_INT``. - - For example: - - .. code-block:: c++ - - /* In mpi.h */ - struct internal_mpi_double_int { double d; int i; }; - extern struct mpi_datatype mpi_datatype_double_int - __attribute__(( type_tag_for_datatype(mpi, struct internal_mpi_double_int, layout_compatible) )); - - #define MPI_DOUBLE_INT ((MPI_Datatype) &mpi_datatype_double_int) - - /* In user code */ - struct my_pair { double a; int b; }; - struct my_pair *buffer; - MPI_Send(buffer, 1, MPI_DOUBLE_INT /*, ... */); // no warning - - struct my_int_pair { int a; int b; } - struct my_int_pair *buffer2; - MPI_Send(buffer2, 1, MPI_DOUBLE_INT /*, ... */); // warning: actual buffer element - // type 'struct my_int_pair' - // doesn't match specified MPI_Datatype - -* ``must_be_null`` specifies that the expression should be a null pointer - constant, for example: - - .. code-block:: c++ - - /* In mpi.h */ - extern struct mpi_datatype mpi_datatype_null - __attribute__(( type_tag_for_datatype(mpi, void, must_be_null) )); - - #define MPI_DATATYPE_NULL ((MPI_Datatype) &mpi_datatype_null) - - /* In user code */ - MPI_Send(buffer, 1, MPI_DATATYPE_NULL /*, ... */); // warning: MPI_DATATYPE_NULL - // was specified but buffer - // is not a null pointer - -Format String Checking -====================== - -Clang supports the ``format`` attribute, which indicates that the function -accepts a ``printf`` or ``scanf``-like format string and corresponding -arguments or a ``va_list`` that contains these arguments. - -Please see `GCC documentation about format attribute -`_ to find details -about attribute syntax. - -Clang implements two kinds of checks with this attribute. - -#. Clang checks that the function with the ``format`` attribute is called with - a format string that uses format specifiers that are allowed, and that - arguments match the format string. This is the ``-Wformat`` warning, it is - on by default. - -#. Clang checks that the format string argument is a literal string. This is - the ``-Wformat-nonliteral`` warning, it is off by default. - - Clang implements this mostly the same way as GCC, but there is a difference - for functions that accept a ``va_list`` argument (for example, ``vprintf``). - GCC does not emit ``-Wformat-nonliteral`` warning for calls to such - fuctions. Clang does not warn if the format string comes from a function - parameter, where the function is annotated with a compatible attribute, - otherwise it warns. For example: - - .. code-block:: c - - __attribute__((__format__ (__scanf__, 1, 3))) - void foo(const char* s, char *buf, ...) { - va_list ap; - va_start(ap, buf); - - vprintf(s, ap); // warning: format string is not a string literal - } - - In this case we warn because ``s`` contains a format string for a - ``scanf``-like function, but it is passed to a ``printf``-like function. - - If the attribute is removed, clang still warns, because the format string is - not a string literal. - - Another example: - - .. code-block:: c - - __attribute__((__format__ (__printf__, 1, 3))) - void foo(const char* s, char *buf, ...) { - va_list ap; - va_start(ap, buf); - - vprintf(s, ap); // warning - } - - In this case Clang does not warn because the format string ``s`` and - the corresponding arguments are annotated. If the arguments are - incorrect, the caller of ``foo`` will receive a warning. diff --git a/external/bsd/llvm/dist/clang/docs/LibASTMatchersReference.html b/external/bsd/llvm/dist/clang/docs/LibASTMatchersReference.html index 2c9b3aae0a89..ce922598135b 100644 --- a/external/bsd/llvm/dist/clang/docs/LibASTMatchersReference.html +++ b/external/bsd/llvm/dist/clang/docs/LibASTMatchersReference.html @@ -250,7 +250,7 @@ Example matches f
Matches method declarations.
 
 Example matches y
-  class X { void y() };
+  class X { void y(); };
 
@@ -1311,7 +1311,7 @@ Usable as: Any Matcher -Matcher<*>unlessMatcher<*> InnerMatcher +Matcher<*>unlessMatcher<*>
Matches if the provided matcher does not match.
 
 Example matches Y (matcher = recordDecl(unless(hasName("X"))))
@@ -1352,6 +1352,11 @@ Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2)))
 
+Matcher<CXXConstructExpr>isListInitialization +
Matches a constructor call expression which uses list initialization.
+
+ + Matcher<CXXConstructorDecl>isImplicit
Matches a constructor declaration that has been implicitly added
 by the compiler (eg. implicit defaultcopy constructors).
@@ -1422,6 +1427,18 @@ Given
 
+Matcher<CXXMethodDecl>isPure +
Matches if the given method declaration is pure.
+
+Given
+  class A {
+   public:
+    virtual void x() = 0;
+  };
+  matches A::x
+
+ + Matcher<CXXMethodDecl>isVirtual
Matches if the given method declaration is virtual.
 
@@ -2026,24 +2043,6 @@ Usable as: Any Matcher
 
-Matcher<*>forEachMatcher<*> -
Matches AST nodes that have child AST nodes that match the
-provided matcher.
-
-Example matches X, Y (matcher = recordDecl(forEach(recordDecl(hasName("X")))
-  class X {};  Matches X, because X::X is a class of name X inside X.
-  class Y { class X {}; };
-  class Z { class Y { class X {}; }; };  Does not match Z.
-
-ChildT must be an AST base type.
-
-As opposed to 'has', 'forEach' will cause a match for each result that
-matches instead of only on the first one.
-
-Usable as: Any Matcher
-
- - Matcher<*>forEachDescendantMatcher<*>
Matches AST nodes that have descendant AST nodes that match the
 provided matcher.
@@ -2068,17 +2067,20 @@ Usable as: Any Matcher
 
-Matcher<*>hasMatcher<*> -
Matches AST nodes that have child AST nodes that match the
+Matcher<*>forEachMatcher<*>
+
Matches AST nodes that have child AST nodes that match the
 provided matcher.
 
-Example matches X, Y (matcher = recordDecl(has(recordDecl(hasName("X")))
+Example matches X, Y (matcher = recordDecl(forEach(recordDecl(hasName("X")))
   class X {};  Matches X, because X::X is a class of name X inside X.
   class Y { class X {}; };
   class Z { class Y { class X {}; }; };  Does not match Z.
 
 ChildT must be an AST base type.
 
+As opposed to 'has', 'forEach' will cause a match for each result that
+matches instead of only on the first one.
+
 Usable as: Any Matcher
 
@@ -2112,6 +2114,21 @@ Usable as: Any Matcher
+Matcher<*>hasMatcher<*> +
Matches AST nodes that have child AST nodes that match the
+provided matcher.
+
+Example matches X, Y (matcher = recordDecl(has(recordDecl(hasName("X")))
+  class X {};  Matches X, because X::X is a class of name X inside X.
+  class Y { class X {}; };
+  class Z { class Y { class X {}; }; };  Does not match Z.
+
+ChildT must be an AST base type.
+
+Usable as: Any Matcher
+
+ + Matcher<*>hasParentMatcher<*>
Matches AST nodes that have a parent that matches the provided
 matcher.
@@ -2313,8 +2330,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -2378,6 +2393,20 @@ with withInitializer matching (1)
 
+Matcher<CXXForRangeStmt>hasLoopVariableMatcher<VarDecl> InnerMatcher +
Matches the initialization statement of a for loop.
+
+Example:
+    forStmt(hasLoopVariable(anything()))
+matches 'int x' in
+    for (int x : a) { }
+
+ + +Matcher<CXXMemberCallExpr>onImplicitObjectArgumentMatcher<Expr> InnerMatcher +

+
+
 Matcher<CXXMemberCallExpr>onMatcher<Expr> InnerMatcher
 
Matches on the implicit object argument of a member call expression.
 
@@ -2389,15 +2418,17 @@ FIXME: Overload to allow directly matching types?
 
-Matcher<CXXMemberCallExpr>onImplicitObjectArgumentMatcher<Expr> InnerMatcher -

-
-
 Matcher<CXXMemberCallExpr>thisPointerTypeMatcher<Decl> InnerMatcher
 
Overloaded to match the type's declaration.
 
+Matcher<CXXMemberCallExpr>thisPointerTypeMatcher<QualType> InnerMatcher +
Matches if the expression's type either matches the specified
+matcher, or is a pointer to a type that matches the InnerMatcher.
+
+ + Matcher<CXXMethodDecl>ofClassMatcher<CXXRecordDecl> InnerMatcher
Matches the class declaration that the given method declaration
 belongs to.
@@ -2466,6 +2497,24 @@ Example matches y.x() (matcher = callExpr(callee(methodDecl(hasName("x")))))
 
+Matcher<CallExpr>calleeMatcher<Stmt> InnerMatcher +
Matches if the call expression's callee expression matches.
+
+Given
+  class Y { void x() { this->x(); x(); Y y; y.x(); } };
+  void f() { f(); }
+callExpr(callee(expr()))
+  matches this->x(), x(), y.x(), f()
+with callee(...)
+  matching this->x, x, y.x, f respectively
+
+Note: Callee cannot take the more general internal::Matcher<Expr>
+because this introduces ambiguous overloads with calls to Callee taking a
+internal::Matcher<Decl>, as the matcher hierarchy is purely
+implemented in terms of implicit casts.
+
+ + Matcher<CallExpr>hasAnyArgumentMatcher<Expr> InnerMatcher
Matches any argument of a call expression or a constructor call
 expression.
@@ -2506,8 +2555,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -2647,8 +2694,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -2813,8 +2858,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -2852,6 +2895,17 @@ Usable as: Matcher<Expr>hasTypeMatcher<QualType> InnerMatcher
+
Matches if the expression's or declaration's type matches a type
+matcher.
+
+Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
+            and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+ class X {};
+ void y(X &x) { x; X z; }
+
+ + Matcher<Expr>ignoringImpCastsMatcher<Expr> InnerMatcher
Matches expressions that match InnerMatcher after any implicit casts
 are stripped off.
@@ -3034,8 +3088,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3058,8 +3110,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3082,8 +3132,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3290,8 +3338,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3307,11 +3353,36 @@ Usable as: Matcher<QualType>pointsToMatcher<QualType> InnerMatcher
+
Matches if the matched type is a pointer type and the pointee type
+matches the specified matcher.
+
+Example matches y->x()
+    (matcher = callExpr(on(hasType(pointsTo(recordDecl(hasName("Y")))))))
+  class Y { public: void x(); };
+  void z() { Y *y; y->x(); }
+
+ + Matcher<QualType>referencesMatcher<Decl> InnerMatcher
Overloaded to match the referenced type's declaration.
 
+Matcher<QualType>referencesMatcher<QualType> InnerMatcher +
Matches if the matched type is a reference type and the referenced
+type matches the specified matcher.
+
+Example matches X &x and const X &y
+    (matcher = varDecl(hasType(references(recordDecl(hasName("X"))))))
+  class X {
+    void a(X b) {
+      X &x = b;
+      const X &y = b;
+  };
+
+ + Matcher<RecordType>hasDeclarationMatcher<Decl> InnerMatcher
Matches a node if the declaration associated with that node
 matches the given matcher.
@@ -3324,8 +3395,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3405,8 +3474,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3417,8 +3484,23 @@ Usable as: Matcher<TemplateArgument>isExprMatcher<Expr> InnerMatcher
+
Matches a sugar TemplateArgument that refers to a certain expression.
+
+Given
+  template<typename T> struct A {};
+  struct B { B* next; };
+  A<&B::next> a;
+templateSpecializationType(hasAnyTemplateArgument(
+  isExpr(hasDescendant(declRefExpr(to(fieldDecl(hasName("next"))))))))
+  matches the specialization A<&B::next> with fieldDecl(...) matching
+    B::next
+
+ + Matcher<TemplateArgument>refersToDeclarationMatcher<Decl> InnerMatcher -
Matches a TemplateArgument that refers to a certain declaration.
+
Matches a canonical TemplateArgument that refers to a certain
+declaration.
 
 Given
   template<typename T> struct A {};
@@ -3444,6 +3526,20 @@ classTemplateSpecializationDecl(hasAnyTemplateArgument(
 
+Matcher<TemplateSpecializationType>hasAnyTemplateArgumentMatcher<TemplateArgument> InnerMatcher +
Matches classTemplateSpecializations that have at least one
+TemplateArgument matching the given InnerMatcher.
+
+Given
+  template<typename T> class A {};
+  template<> class A<double> {};
+  A<int> a;
+classTemplateSpecializationDecl(hasAnyTemplateArgument(
+    refersToType(asString("int"))))
+  matches the specialization A<int>
+
+ + Matcher<TemplateSpecializationType>hasDeclarationMatcher<Decl> InnerMatcher
Matches a node if the declaration associated with that node
 matches the given matcher.
@@ -3456,8 +3552,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3468,6 +3562,20 @@ Usable as: Matcher<TemplateSpecializationType>hasTemplateArgumentunsigned N, Matcher<TemplateArgument> InnerMatcher
+
Matches classTemplateSpecializations where the n'th TemplateArgument
+matches the given InnerMatcher.
+
+Given
+  template<typename T, typename U> class A {};
+  A<bool, int> b;
+  A<int, bool> c;
+classTemplateSpecializationDecl(hasTemplateArgument(
+    1, refersToType(asString("int"))))
+  matches the specialization A<bool, int>
+
+ + Matcher<TemplateTypeParmType>hasDeclarationMatcher<Decl> InnerMatcher
Matches a node if the declaration associated with that node
 matches the given matcher.
@@ -3480,8 +3588,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3525,8 +3631,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3567,8 +3671,6 @@ The associated declaration is:
 
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
-FIXME: Add all node types for which this is matcher is usable due to
-getDecl().
 
 Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
   Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
@@ -3620,6 +3722,17 @@ Usable as: Matcher<ValueDecl>hasTypeMatcher<QualType> InnerMatcher
+
Matches if the expression's or declaration's type matches a type
+matcher.
+
+Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
+            and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+ class X {};
+ void y(X &x) { x; X z; }
+
+ + Matcher<VarDecl>hasInitializerMatcher<Expr> InnerMatcher
Matches a variable declaration that has an initializer expression
 that matches the given matcher.
diff --git a/external/bsd/llvm/dist/clang/docs/LibASTMatchersTutorial.rst b/external/bsd/llvm/dist/clang/docs/LibASTMatchersTutorial.rst
index 5bd62a133649..13749fbc41f1 100644
--- a/external/bsd/llvm/dist/clang/docs/LibASTMatchersTutorial.rst
+++ b/external/bsd/llvm/dist/clang/docs/LibASTMatchersTutorial.rst
@@ -137,6 +137,10 @@ documentation `_.
       using namespace clang::tooling;
       using namespace llvm;
 
+      // Apply a custom category to all command-line options so that they are the
+      // only ones displayed.
+      static llvm::cl::OptionCategory MyToolCategory("my-tool options");
+
       // CommonOptionsParser declares HelpMessage with a description of the common
       // command-line options related to the compilation database and input files.
       // It's nice to have this help message in all tools.
@@ -146,7 +150,7 @@ documentation `_.
       static cl::extrahelp MoreHelp("\nMore help text...");
 
       int main(int argc, const char **argv) {
-        CommonOptionsParser OptionsParser(argc, argv);
+        CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
         ClangTool Tool(OptionsParser.getCompilations(),
                        OptionsParser.getSourcePathList());
         return Tool.run(newFrontendActionFactory());
@@ -287,7 +291,7 @@ And change ``main()`` to:
 .. code-block:: c++
 
       int main(int argc, const char **argv) {
-        CommonOptionsParser OptionsParser(argc, argv);
+        CommonOptionsParser OptionsParser(argc, argv, MyToolCategory);
         ClangTool Tool(OptionsParser.getCompilations(),
                        OptionsParser.getSourcePathList());
 
diff --git a/external/bsd/llvm/dist/clang/docs/MSVCCompatibility.rst b/external/bsd/llvm/dist/clang/docs/MSVCCompatibility.rst
new file mode 100644
index 000000000000..346b860e764f
--- /dev/null
+++ b/external/bsd/llvm/dist/clang/docs/MSVCCompatibility.rst
@@ -0,0 +1,121 @@
+.. raw:: html
+
+  
+
+.. role:: none
+.. role:: partial
+.. role:: good
+
+==================
+MSVC compatibility
+==================
+
+When Clang compiles C++ code for Windows, it attempts to be compatible with
+MSVC.  There are multiple dimensions to compatibility.
+
+First, Clang attempts to be ABI-compatible, meaning that Clang-compiled code
+should be able to link against MSVC-compiled code successfully.  However, C++
+ABIs are particular large and complicated, and Clang's support for MSVC's C++
+ABI is a work in progress.  If you don't require MSVC ABI compatibility or don't
+want to use Microsoft's C and C++ runtimes, the mingw32 toolchain might be a
+better fit for your project.
+
+Second, Clang implements many MSVC language extensions, such as
+``__declspec(dllexport)`` and a handful of pragmas.  These are typically
+controlled by ``-fms-extensions``.
+
+Finally, MSVC accepts some C++ code that Clang will typically diagnose as
+invalid.  When these constructs are present in widely included system headers,
+Clang attempts to recover and continue compiling the user's program.  Most
+parsing and semantic compatibility tweaks are controlled by
+``-fms-compatibility`` and ``-fdelayed-template-parsing``, and they are a work
+in progress.
+
+ABI features
+============
+
+The status of major ABI-impacting C++ features:
+
+* Record layout: :good:`Mostly complete`.  We've attacked this with a fuzzer,
+  and most of the remaining failures involve ``#pragma pack``,
+  ``__declspec(align(N))``, or other pragmas.
+
+* Class inheritance: :good:`Mostly complete`.  This covers all of the standard
+  OO features you would expect: virtual method inheritance, multiple
+  inheritance, and virtual inheritance.  Every so often we uncover a bug where
+  our tables are incompatible, but this is pretty well in hand.
+
+* Name mangling: :good:`Ongoing`.  Every new C++ feature generally needs its own
+  mangling.  For example, member pointer template arguments have an interesting
+  and distinct mangling.  Fortunately, incorrect manglings usually do not result
+  in runtime errors.  Non-inline functions with incorrect manglings usually
+  result in link errors, which are relatively easy to diagnose.  Incorrect
+  manglings for inline functions and templates result in multiple copies in the
+  final image.  The C++ standard requires that those addresses be equal, but few
+  programs rely on this.
+
+* Member pointers: :good:`Mostly complete`.  Standard C++ member pointers are
+  fully implemented and should be ABI compatible.  Both `#pragma
+  pointers_to_members`_ and the `/vm`_ flags are supported. However, MSVC
+  supports an extension to allow creating a `pointer to a member of a virtual
+  base class`_.  Clang does not yet support this.
+
+.. _#pragma pointers_to_members:
+  http://msdn.microsoft.com/en-us/library/83cch5a6.aspx
+.. _/vm: http://msdn.microsoft.com/en-us/library/yad46a6z.aspx
+.. _pointer to a member of a virtual base class: http://llvm.org/PR15713
+
+* Debug info: :partial:`Minimal`.  Clang emits CodeView line tables into the
+  object file, similar to what MSVC emits when given the ``/Z7`` flag.
+  Microsoft's link.exe will read this information and use it to create a PDB,
+  enabling stack traces in all modern Windows debuggers.  Clang does not emit
+  any type info or description of variable layout.
+
+* `RTTI`_: :none:`Unstarted`.  See the bug for a discussion of what needs to
+  happen first.
+
+.. _RTTI: http://llvm.org/PR18951
+
+* Exceptions and SEH: :none:`Unstarted`.  Clang can parse both constructs, but
+  does not know how to emit compatible handlers.  This depends on RTTI.
+
+* Thread-safe initialization of local statics: :none:`Unstarted`.  We are ABI
+  compatible with MSVC 2012, which does not support thread-safe local statics.
+  MSVC 2013 changed the ABI to make initialization of local statics thread safe,
+  and we have not yet implemented this.
+
+* Lambdas in ABI boundaries: :none:`Infeasible`.  It is unlikely that we will
+  ever be fully ABI compatible with lambdas declared in inline functions due to
+  what appears to be a hash code in the name mangling.  Lambdas that are not
+  externally visible should work fine.
+
+Template instantiation and name lookup
+======================================
+
+In addition to the usual `dependent name lookup FAQs `_, Clang is often unable
+to parse certain invalid C++ constructs that MSVC allows.  As of this writing,
+Clang will reject code with missing ``typename`` annotations:
+
+.. _dependent name lookup FAQs:
+  http://clang.llvm.org/compatibility.html#dep_lookup
+
+.. code-block:: c++
+
+  struct X {
+    typedef int type;
+  };
+  template int f() {
+    // missing typename keyword
+    return sizeof(/*typename*/ T::type);
+  }
+  template void f();
+
+Accepting code like this is ongoing work.  Ultimately, it may be cleaner to
+`implement a token-based template instantiation mode`_ than it is to add
+compatibility hacks to the existing AST-based instantiation.
+
+.. _implement a token-based template instantiation mode: http://llvm.org/PR18714
diff --git a/external/bsd/llvm/dist/clang/docs/Modules.rst b/external/bsd/llvm/dist/clang/docs/Modules.rst
index 9fb4c774874c..037add7074e9 100644
--- a/external/bsd/llvm/dist/clang/docs/Modules.rst
+++ b/external/bsd/llvm/dist/clang/docs/Modules.rst
@@ -198,6 +198,40 @@ Command-line parameters
 ``-fmodule-map-file=``
   Load the given module map file if a header from its directory or one of its subdirectories is loaded.
 
+Module Semantics
+================
+
+Modules are modeled as if each submodule were a separate translation unit, and a module import makes names from the other translation unit visible. Each submodule starts with a new preprocessor state and an empty translation unit.
+
+.. note::
+
+  This behavior is currently only approximated when building a module. Entities within a submodule that has already been built are visible when building later submodules in that module. This can lead to fragile modules that depend on the build order used for the submodules of the module, and should not be relied upon.
+
+As an example, in C, this implies that if two structs are defined in different submodules with the same name, those two types are distinct types (but may be *compatible* types if their definitions match. In C++, two structs defined with the same name in different submodules are the *same* type, and must be equivalent under C++'s One Definition Rule.
+
+.. note::
+
+  Clang currently only performs minimal checking for violations of the One Definition Rule.
+
+Macros
+------
+
+The C and C++ preprocessor assumes that the input text is a single linear buffer, but with modules this is not the case. It is possible to import two modules that have conflicting definitions for a macro (or where one ``#define``\s a macro and the other ``#undef``\ines it). The rules for handling macro definitions in the presence of modules are as follows:
+
+* Each definition and undefinition of a macro is considered to be a distinct entity.
+* Such entities are *visible* if they are from the current submodule or translation unit, or if they were exported from a submodule that has been imported.
+* A ``#define X`` or ``#undef X`` directive *overrides* all definitions of ``X`` that are visible at the point of the directive.
+* A ``#define`` or ``#undef`` directive is *active* if it is visible and no visible directive overrides it.
+* A set of macro directives is *consistent* if it consists of only ``#undef`` directives, or if all ``#define`` directives in the set define the macro name to the same sequence of tokens (following the usual rules for macro redefinitions).
+* If a macro name is used and the set of active directives is not consistent, the program is ill-formed. Otherwise, the (unique) meaning of the macro name is used.
+
+For example, suppose:
+
+* ```` defines a macro ``getc`` (and exports its ``#define``)
+* ```` imports the ```` module and undefines the macro (and exports its ``#undef``)
+  
+The ``#undef`` overrides the ``#define``, and a source file that imports both modules *in any order* will not see ``getc`` defined as a macro.
+
 Module Map Language
 ===================
 
@@ -573,7 +607,7 @@ A *use-declaration* specifies one of the other modules that the module is allowe
     use B
   }
 
-When compiling a source file that implements a module, use the option ``-fmodule-name=``module-id to indicate that the source file is logically part of that module.
+When compiling a source file that implements a module, use the option ``-fmodule-name=module-id`` to indicate that the source file is logically part of that module.
 
 The compiler at present only applies restrictions to the module directly being built.
 
diff --git a/external/bsd/llvm/dist/clang/docs/ReleaseNotes.rst b/external/bsd/llvm/dist/clang/docs/ReleaseNotes.rst
index 12194f0d7abf..28c19716ee45 100644
--- a/external/bsd/llvm/dist/clang/docs/ReleaseNotes.rst
+++ b/external/bsd/llvm/dist/clang/docs/ReleaseNotes.rst
@@ -48,13 +48,13 @@ Major New Features
 ------------------
 
 - Clang uses the new MingW ABI
-GCC 4.7 changed the mingw ABI. Clang 3.4 and older use the GCC 4.6
-ABI. Clang 3.5 and newer use the GCC 4.7 abi.
+  GCC 4.7 changed the mingw ABI. Clang 3.4 and older use the GCC 4.6
+  ABI. Clang 3.5 and newer use the GCC 4.7 abi.
 
 - The __has_attribute feature test is now target-aware. Older versions of Clang 
-would return true when the attribute spelling was known, regardless of whether 
-the attribute was available to the specific target. Clang now returns true only 
-when the attribute pertains to the current compilation target.
+  would return true when the attribute spelling was known, regardless of whether 
+  the attribute was available to the specific target. Clang now returns true only 
+  when the attribute pertains to the current compilation target.
 
 
 Improvements to Clang's diagnostics
@@ -70,16 +70,24 @@ New Compiler Flags
 ------------------
 
 The integrated assembler is now turned on by default on ARM (and Thumb),
-so the use of the option `-integrated-as` is now redundant on those
+so the use of the option `-fintegrated-as` is now redundant on those
 architectures. This is an important move to both *eat our own dog food*
 and to ease cross-compilation tremendously.
 
 We are aware of the problems that this may cause for code bases that
 rely on specific GNU syntax or extensions, and we're working towards
 getting them all fixed. Please, report bugs or feature requests if
-you find anything. In the meantime, use `-no-integrated-as` to revert
+you find anything. In the meantime, use `-fno-integrated-as` to revert
 back the call to GNU assembler.
 
+In order to provide better diagnostics, the integrated assembler validates
+inline assembly when the integrated assembler is enabled.  Because this is
+considered a feature of the compiler, it is controlled via the `fintegrated-as`
+and `fno-integrated-as` flags which enable and disable the integrated assembler
+respectively.  `-integrated-as` and `-no-integrated-as` are now considered
+legacy flags (but are available as an alias to prevent breaking existing users),
+and users are encouraged to switch to the equivalent new feature flag.
+
 C Language Changes in Clang
 ---------------------------
 
diff --git a/external/bsd/llvm/dist/clang/docs/ThreadSafetyAnalysis.rst b/external/bsd/llvm/dist/clang/docs/ThreadSafetyAnalysis.rst
new file mode 100644
index 000000000000..dfef80b69fa2
--- /dev/null
+++ b/external/bsd/llvm/dist/clang/docs/ThreadSafetyAnalysis.rst
@@ -0,0 +1,818 @@
+
+======================
+Thread Safety Analysis
+======================
+
+Introduction
+============
+
+Clang Thread Safety Analysis is a C++ language extension which warns about
+potential race conditions in code.  The analysis is completely static (i.e.
+compile-time); there is no run-time overhead.  The analysis is still
+under active development, but it is mature enough to be deployed in an
+industrial setting.  It being developed by Google, and is used extensively
+on their internal code base.
+
+Thread safety analysis works very much like a type system for multi-threaded
+programs.  In addition to declaring the *type* of data (e.g. ``int``, ``float``,
+etc.), the programmer can (optionally) declare how access to that data is
+controlled in a multi-threaded environment.  For example, if ``foo`` is
+*guarded by* the mutex ``mu``, then the analysis will issue a warning whenever
+a piece of code reads or writes to ``foo`` without first locking ``mu``.
+Similarly, if there are particular routines that should only be called by
+the GUI thread, then the analysis will warn if other threads call those
+routines. 
+
+Getting Started
+----------------
+
+.. code-block:: c++
+
+  #include "mutex.h"
+
+  class BankAccount {
+  private:
+    Mutex mu;
+    int   balance GUARDED_BY(mu);
+  
+    void depositImpl(int amount) {
+      balance += amount;       // WARNING! Cannot write balance without locking mu.
+    }
+  
+    void withdrawImpl(int amount) EXCLUSIVE_LOCKS_REQUIRED(mu) {
+      balance -= amount;       // OK. Caller must have locked mu.
+    }
+  
+  public:
+    void withdraw(int amount) {
+      mu.Lock();
+      withdrawImpl(amount);    // OK.  We've locked mu.
+    }                          // WARNING!  Failed to unlock mu.
+  
+    void transferFrom(BankAccount& b, int amount) {
+      mu.Lock();
+      b.withdrawImpl(amount);  // WARNING!  Calling withdrawImpl() requires locking b.mu.
+      depositImpl(amount);     // OK.  depositImpl() has no requirements.
+      mu.Unlock();
+    }
+  };
+
+This example demonstrates the basic concepts behind the analysis.  The
+``GUARDED_BY`` attribute declares that a thread must lock ``mu`` before it can
+read or write to ``balance``, thus ensuring that the increment and decrement
+operations are atomic.  Similarly, ``EXCLUSIVE_LOCKS_REQUIRED`` declares that
+the calling thread must lock ``mu`` before calling ``withdrawImpl``.
+Because the caller is assumed to have locked ``mu``, it is safe to modify
+``balance`` within the body of the method.
+
+The ``depositImpl()`` method does not have ``EXCLUSIVE_LOCKS_REQUIRED``, so the
+analysis issues a warning.  Thread safety analysis is not inter-procedural, so
+caller requirements must be explicitly declared.
+There is also a warning in ``transferFrom()``, because although the method
+locks ``this->mu``, it does not lock ``b.mu``.  The analysis understands
+that these are two separate mutexes, in two different objects.  
+
+Finally, there is a warning in the ``withdraw()`` method, because it fails to
+unlock ``mu``.  Every lock must have a corresponding unlock, and the analysis
+will detect both double locks, and double unlocks.  A function is allowed to
+acquire a lock without releasing it, (or vice versa), but it must be annotated
+as such (using ``LOCK``/``UNLOCK_FUNCTION``).
+
+
+Running The Analysis
+--------------------
+
+To run the analysis, simply compile with the ``-Wthread-safety`` flag, e.g.
+
+.. code-block:: bash
+
+  clang -c -Wthread-safety example.cpp
+
+Note that this example assumes the presence of a suitably annotated
+:ref:`mutexheader` that declares which methods perform locking,
+unlocking, and so on. 
+
+
+Basic Concepts: Capabilities
+============================
+
+Thread safety analysis provides a way of protecting *resources* with
+*capabilities*.  A resource is either a data member, or a function/method
+that provides access to some underlying resource.  The analysis ensures that
+the calling thread cannot access the *resource* (i.e. call the function, or
+read/write the data) unless it has the *capability* to do so.
+
+Capabilities are associated with named C++ objects which declare specific
+methods to acquire and release the capability.  The name of the object serves
+to identify the capability.  The most common example is a mutex.  For example,
+if ``mu`` is a mutex, then calling ``mu.Lock()`` causes the calling thread
+to acquire the capability to access data that is protected by ``mu``. Similarly, 
+calling ``mu.Unlock()`` releases that capability.
+
+A thread may hold a capability either *exclusively* or *shared*.  An exclusive
+capability can be held by only one thread at a time, while a shared capability
+can be held by many threads at the same time.  This mechanism enforces a
+multiple-reader, single-writer pattern.  Write operations to protected data
+require exclusive access, while read operations require only shared access.  
+
+At any given moment during program execution, a thread holds a specific set of
+capabilities (e.g. the set of mutexes that it has locked.)  These act like keys
+or tokens that allow the thread to access a given resource.  Just like physical
+security keys, a thread cannot make copy of a capability, nor can it destroy
+one.  A thread can only release a capability to another thread, or acquire one
+from another thread.  The annotations are deliberately agnostic about the
+exact mechanism used to acquire and release capabilities; it assumes that the 
+underlying implementation (e.g. the Mutex implementation) does the handoff in
+an appropriate manner.
+
+The set of capabilities that are actually held by a given thread at a given
+point in program execution is a run-time concept.  The static analysis works
+by calculating an approximation of that set, called the *capability
+environment*.  The capability environment is calculated for every program point,
+and describes the set of capabilities that are statically known to be held, or
+not held, at that particular point.  This environment is a conservative
+approximation of the full set of capabilities that will actually held by a
+thread at run-time.
+
+
+Reference Guide
+===============
+
+The thread safety analysis uses attributes to declare threading constraints.
+Attributes must be attached to named declarations, such as classes, methods,
+and data members. Users are *strongly advised* to define macros for the various
+attributes; example definitions can be found in :ref:`mutexheader`, below.
+The following documentation assumes the use of macros.
+
+
+GUARDED_BY(c) and PT_GUARDED_BY(c)
+----------------------------------
+
+``GUARDED_BY`` is an attribute on data members, which declares that the data
+member is protected by the given capability.  Read operations on the data
+require shared access, while write operations require exclusive access.
+
+``PT_GUARDED_BY`` is similar, but is intended for use on pointers and smart
+pointers. There is no constraint on the data member itself, but the *data that
+it points to* is protected by the given capability.  
+
+.. code-block:: c++
+
+  Mutex mu;
+  int *p1            GUARDED_BY(mu);
+  int *p2            PT_GUARDED_BY(mu);
+  unique_ptr p3 PT_GUARDED_BY(mu);
+  
+  void test() {
+    p1 = 0;             // Warning!
+  
+    p2 = new int;       // OK.
+    *p2 = 42;           // Warning!
+  
+    p3.reset(new int);  // OK.
+    *p3 = 42;           // Warning!
+  }
+
+
+EXCLUSIVE_LOCKS_REQUIRED(...), SHARED_LOCKS_REQUIRED(...)
+---------------------------------------------------------
+
+``EXCLUSIVE_LOCKS_REQUIRED`` is an attribute on functions or methods, which
+declares that the calling thread must have exclusive access to the given
+capabilities.  More than one capability may be specified.  The capabilities
+must be held on entry to the function, *and must still be held on exit*.  
+
+``SHARED_LOCKS_REQUIRED`` is similar, but requires only shared access.
+
+.. code-block:: c++
+
+  Mutex mu1, mu2;
+  int a GUARDED_BY(mu1);
+  int b GUARDED_BY(mu2);
+  
+  void foo() EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2) {
+    a = 0;
+    b = 0;
+  }
+  
+  void test() {
+    mu1.Lock();
+    foo();         // Warning!  Requires mu2.
+    mu1.Unlock();
+  }
+
+
+EXCLUSIVE_LOCK_FUNCTION(...), SHARED_LOCK_FUNCTION(...), UNLOCK_FUNCTION(...)
+-----------------------------------------------------------------------------
+
+``EXCLUSIVE_LOCK_FUNCTION`` is an attribute on functions or methods, which
+declares that the function acquires a capability, but does not release it.  The
+caller must not hold the given capability on entry, and it will hold the
+capability on exit.  ``SHARED_LOCK_FUNCTION`` is similar. 
+
+``UNLOCK_FUNCTION`` declares that the function releases the given capability.
+The caller must hold the capability on entry, and will no longer hold it on
+exit. It does not matter whether the given capability is shared or exclusive.
+
+.. code-block:: c++
+
+  Mutex mu;
+  MyClass myObject GUARDED_BY(mu);
+  
+  void lockAndInit() EXCLUSIVE_LOCK_FUNCTION(mu) {
+    mu.Lock();
+    myObject.init();
+  }
+  
+  void cleanupAndUnlock() UNLOCK_FUNCTION(mu) {
+    myObject.cleanup();
+  }  // Warning!  Need to unlock mu.
+  
+  void test() {
+    lockAndInit();
+    myObject.doSomething();
+    cleanupAndUnlock();
+    myObject.doSomething();  // Warning, mu is not locked.
+  }
+
+If no argument is passed to ``(UN)LOCK_FUNCTION``, then the argument is assumed
+to be ``this``, and the analysis will not check the body of the function.  This
+pattern is intended for use by classes which hide locking details behind an
+abstract interface.  E.g.
+
+.. code-block:: c++
+
+  template 
+  class LOCKABLE Container {
+  private:
+    Mutex mu;
+    T* data;
+  
+  public:
+    // Hide mu from public interface.
+    void Lock() EXCLUSIVE_LOCK_FUNCTION() { mu.Lock(); }
+    void Unlock() UNLOCK_FUNCTION() { mu.Unlock(); }
+  
+    T& getElem(int i) { return data[i]; }
+  };
+  
+  void test() {
+    Container c;
+    c.Lock();
+    int i = c.getElem(0);
+    c.Unlock();
+  }
+
+
+LOCKS_EXCLUDED(...)
+-------------------
+
+``LOCKS_EXCLUDED`` is an attribute on functions or methods, which declares that
+the caller must *not* hold the given capabilities.  This annotation is
+used to prevent deadlock.  Many mutex implementations are not re-entrant, so
+deadlock can occur if the function in question acquires the mutex a second time.
+
+.. code-block:: c++
+
+  Mutex mu;
+  int a GUARDED_BY(mu);
+  
+  void clear() LOCKS_EXCLUDED(mu) {
+    mu.Lock();
+    a = 0;
+    mu.Unlock();
+  }
+  
+  void reset() {
+    mu.Lock();
+    clear();     // Warning!  Caller cannot hold 'mu'.
+    mu.Unlock();
+  }
+
+Unlike ``LOCKS_REQUIRED``, ``LOCKS_EXCLUDED`` is optional.  The analysis will
+not issue a warning if the attribute is missing.  See :ref:`limitations`.
+
+
+NO_THREAD_SAFETY_ANALYSIS
+-------------------------
+
+``NO_THREAD_SAFETY_ANALYSIS`` is an attribute on functions or methods, which
+turns off thread safety checking for that method.  It provides an escape hatch
+for functions which are either (1) deliberately thread-unsafe, or (2) are
+thread-safe, but too complicated for the analysis to understand.  Reasons for
+(2) will be described in the :ref:`limitations`, below.
+
+.. code-block:: c++
+
+  class Counter {
+    Mutex mu;
+    int a GUARDED_BY(mu);
+  
+    void unsafeIncrement() NO_THREAD_SAFETY_ANALYSIS { a++; }
+  };
+
+
+LOCK_RETURNED(c)
+----------------
+
+``LOCK_RETURNED`` is an attribute on functions or methods, which declares that
+the function returns a reference to the given capability.  It is used to
+annotate getter methods that return mutexes.
+
+.. code-block:: c++
+
+  class MyClass {
+  private:
+    Mutex mu;
+    int a GUARDED_BY(mu);
+  
+  public:
+    Mutex* getMu() LOCK_RETURNED(mu) { return μ }
+  
+    // analysis knows that getMu() == mu
+    void clear() EXCLUSIVE_LOCKS_REQUIRED(getMu()) { a = 0; }
+  };
+
+
+ACQUIRED_BEFORE(...), ACQUIRED_AFTER(...)
+-----------------------------------------
+
+``ACQUIRED_BEFORE`` and ``ACQUIRED_AFTER`` are attributes on member
+declarations, specifically declarations of mutexes or other capabilities.
+These declarations enforce a particular order in which the mutexes must be
+acquired, in order to prevent deadlock.
+
+.. code-block:: c++
+
+  Mutex m1;
+  Mutex m2 ACQUIRED_AFTER(m1);
+  
+  // Alternative declaration
+  // Mutex m2;
+  // Mutex m1 ACQUIRED_BEFORE(m2);
+  
+  void foo() {
+    m2.Lock();
+    m1.Lock();  // Warning!  m2 must be acquired after m1.
+    m1.Unlock();
+    m2.Unlock();
+  }
+
+
+LOCKABLE
+--------
+
+``LOCKABLE`` is an attribute on classes, which specifies that objects of the
+class can be used as a capability.  See the ``Container`` example given above,
+or the ``Mutex`` class in :ref:`mutexheader`.
+
+
+SCOPED_LOCKABLE
+---------------
+
+``SCOPED_LOCKABLE`` is an attribute on classes that implement RAII-style
+locking, in which a capability is acquired in the constructor, and released in
+the destructor.  Such classes require special handling because the constructor
+and destructor refer to the capability via different names; see the
+``MutexLocker`` class in :ref:`mutexheader`, below.
+
+
+EXCLUSIVE_TRYLOCK_FUNCTION(, ...), SHARED_TRYLOCK_FUNCTION(, ...)
+-----------------------------------------------------------------------------
+
+These are attributes on a function or method that tries to acquire the given
+capability, and returns a boolean value indicating success or failure.
+The first argument must be ``true`` or ``false``, to specify which return value
+indicates success, and the remaining arguments are interpreted in the same way
+as ``(UN)LOCK_FUNCTION``.  See :ref:`mutexheader`, below, for example uses.
+
+
+ASSERT_EXCLUSIVE_LOCK(...) and ASSERT_SHARED_LOCK(...)
+------------------------------------------------------
+
+These are attributes on a function or method that does a run-time test to see
+whether the calling thread holds the given capability.  The function is assumed
+to fail (no return) if the capability is not held.  See :ref:`mutexheader`,
+below, for example uses.
+
+
+GUARDED_VAR and PT_GUARDED_VAR
+------------------------------
+
+Use of these attributes has been deprecated.
+
+
+Warning flags
+-------------
+
+* ``-Wthread-safety``:  Umbrella flag which turns on the following three:
+
+  + ``-Wthread-safety-attributes``: Sanity checks on attribute syntax.
+  + ``-Wthread-safety-analysis``: The core analysis.
+  + ``-Wthread-safety-precise``: Requires that mutex expressions match precisely.
+    This warning can be disabled for code which has a lot of aliases.
+
+When new features and checks are added to the analysis, they can often introduce
+additional warnings.  Those warnings are initially released as *beta* warnings
+for a period of time, after which they are migrated to the standard analysis.  
+
+* ``-Wthread-safety-beta``:  New features.  Off by default. 
+
+
+.. _faq:
+
+Frequently Asked Questions
+==========================
+
+(Q) Should I put attributes in the header file, or in the .cc/.cpp/.cxx file?
+
+(A) Attributes should always go in the header.
+
+
+(Q) "*Mutex is not locked on every path through here?*"  What does that mean?
+
+(A) See :ref:`conditional_locks`, below.
+
+
+.. _limitations:
+
+Known Limitations 
+=================
+
+Lexical scope
+-------------
+
+Thread safety attributes contain ordinary C++ expressions, and thus follow
+ordinary C++ scoping rules.  In particular, this means that mutexes and other
+capabilities must be declared before they can be used in an attribute.
+Use-before-declaration is okay within a single class, because attributes are
+parsed at the same time as method bodies. (C++ delays parsing of method bodies
+until the end of the class.)  However, use-before-declaration is not allowed
+between classes, as illustrated below.  
+
+.. code-block:: c++
+
+  class Foo;
+
+  class Bar {
+    void bar(Foo* f) EXCLUSIVE_LOCKS_REQUIRED(f->mu);  // Error: mu undeclared.
+  };
+
+  class Foo {
+    Mutex mu;
+  };
+
+
+Private Mutexes
+---------------
+
+Good software engineering practice dictates that mutexes should be private
+members, because the locking mechanism used by a thread-safe class is part of
+its internal implementation.  However, private mutexes can sometimes leak into
+the public interface of a class.
+Thread safety attributes follow normal C++ access restrictions, so if ``mu``
+is a private member of ``c``, then it is an error to write ``c.mu`` in an
+attribute.
+
+One workround is to (ab)use the ``LOCK_RETURNED`` attribute to provide a public
+*name* for a private mutex, without actually exposing the underlying mutex.
+For example:
+
+.. code-block:: c++
+
+  class MyClass {
+  private:
+    Mutex mu;
+
+  public:
+    // For thread safety analysis only.  Does not actually return mu.
+    Mutex* getMu() LOCK_RETURNED(mu) { return 0; }
+
+    void doSomething() EXCLUSIVE_LOCKS_REQUIRED(mu); 
+  };
+
+  void doSomethingTwice(MyClass& c) EXCLUSIVE_LOCKS_REQUIRED(c.getMu()) {
+    // The analysis thinks that c.getMu() == c.mu
+    c.doSomething();
+    c.doSomething();
+  }
+
+In the above example, ``doSomethingTwice()`` is an external routine that
+requires ``c.mu`` to be locked, which cannot be declared directly because ``mu``
+is private.  This pattern is discouraged because it
+violates encapsulation, but it is sometimes necessary, especially when adding
+annotations to an existing code base.  The workaround is to define ``getMu()``
+as a fake getter method, which is provided only for the benefit of thread
+safety analysis.
+
+
+False negatives on pass by reference.
+-------------------------------------
+
+The current version of the analysis only checks operations which refer to
+guarded data members directly by name.  If the data members are accessed
+indirectly, via a pointer or reference, then no warning is generated.  Thus,
+no warnings will be generated for the following code:
+
+.. code-block:: c++
+
+  Mutex mu;
+  int a GUARDED_BY(mu);
+
+  void clear(int& ra) { ra = 0; }
+
+  void test() {
+    int *p = &a;
+    *p = 0;       // No warning.  *p is an alias to a.  
+       
+    clear(a);     // No warning.  'a' is passed by reference.
+  }
+
+This issue is by far the biggest source of false negatives in the current
+version of the analysis.  At a fundamental level, the
+false negatives are caused by the fact that annotations are attached to data
+members, rather than types.  The type of ``&a`` should really be
+``int GUARDED_BY(mu)*``, rather than ``int*``, and the statement ``p = &a``
+should thus generate a type error.  However, attaching attributes to types
+would be an invasive change to the C++ type system, with potential
+ramifications with respect to template instantation, function overloading,
+and so on.  Thus, a complete solution to this issue is simply not feasible.
+
+Future versions of the analysis will include better support for pointer
+alias analysis, along with limited checking of guarded types, in order to
+reduce the number of false negatives.
+
+
+.. _conditional_locks:
+
+No conditionally held locks.
+----------------------------
+
+The analysis must be able to determine whether a lock is held, or not held, at
+every program point.  Thus, sections of code where a lock *might be held* will
+generate spurious warnings (false positives).  For example:
+
+.. code-block:: c++
+
+  void foo() {
+    bool b = needsToLock();
+    if (b) mu.Lock();
+    ...  // Warning!  Mutex 'mu' is not held on every path through here. 
+    if (b) mu.Unlock();
+  }
+
+
+No checking inside constructors and destructors.
+------------------------------------------------
+
+The analysis currently does not do any checking inside constructors or
+destructors.  In other words, every constructor and destructor is treated as
+if it was annotated with ``NO_THREAD_SAFETY_ANALYSIS``.  
+The reason for this is that during initialization, only one thread typically
+has access to the object which is being initialized, and it is thus safe (and
+common practice) to initialize guarded members without acquiring any locks.
+The same is true of destructors.
+
+Ideally, the analysis would allow initialization of guarded members inside the
+object being initialized or destroyed, while still enforcing the usual access
+restrictions on everything else.  However, this is difficult to enforce in
+practice, because in complex pointer-based data structures, it is hard to
+determine what data is "owned by" the enclosing object.
+
+No inlining.
+------------
+
+Thread safety analysis is strictly intra-procedural, just like ordinary type
+checking.  It relies only on the declared attributes of a function, and will
+not attempt to "step inside", or inline any method calls.  As a result, code
+such as the following will not work:
+
+.. code-block:: c++
+
+  template
+  class AutoCleanup {
+    T* object;
+    void (T::*mp)();
+    
+  public:
+    AutoCleanup(T* obj, void (T::*imp)()) : object(obj), mp(imp) { }
+    ~AutoCleanup() { (object->*mp)(); }
+  };
+
+  Mutex mu;
+  void foo() {
+    mu.Lock();
+    AutoCleanup(&mu, &Mutex::Unlock); 
+    ...
+  }  // Warning, mu is not unlocked.
+
+In this case, the destructor of ``Autocleanup`` calls ``mu.Unlock()``, so
+the warning is bogus.  However,
+thread safety analysis cannot see the unlock, because it does not attempt to
+inline the destructor.  Moreover, there is no way to annotate the destructor,
+because the destructor is calling a function that is not statically known.
+This pattern is simply not supported. 
+
+
+LOCKS_EXCLUDED is not transitive.
+---------------------------------
+
+A function which calls a method marked with LOCKS_EXCLUDED is not required to
+put LOCKS_EXCLUDED in its own interface.  LOCKS_EXCLUDED behaves differently
+from LOCKS_REQUIRED in this respect, and it can result in false negatives:
+
+.. code-block:: c++
+
+  class Foo {
+    Mutex mu;
+    
+    void foo() {
+      mu.Lock();
+      bar();                // No warning
+      mu.Unlock();
+    }
+    
+    void bar() { baz(); }   // No warning.  (Should have LOCKS_EXCLUDED(mu).)
+    
+    void baz() LOCKS_EXCLUDED(mu);
+  };
+
+The lack of transitivity is due to the fact that LOCKS_EXCLUDED can easily
+break encapsulation; it would be a bad idea to require functions to list the
+names private locks which happen to be acquired internally.  
+
+
+No alias analysis.
+------------------
+
+The analysis currently does not track pointer aliases.  Thus, there can be
+false positives if two pointers both point to the same mutex.  
+
+
+.. code-block:: c++
+
+  class MutexUnlocker {
+    Mutex* mu;
+
+  public:
+    MutexUnlocker(Mutex* m) UNLOCK_FUNCTION(m) : mu(m)  { mu->Unlock(); }
+    ~MutexUnlocker() EXCLUSIVE_LOCK_FUNCTION(mu) { mu->Lock(); }
+  };
+
+  Mutex mutex;
+  void test() EXCLUSIVE_LOCKS_REQUIRED(mutex) {
+    { 
+      MutexUnlocker munl(&mutex);  // unlocks mutex
+      doSomeIO();
+    }                              // Warning: locks munl.mu
+  }
+
+The MutexUnlocker class is intended to be the dual of the MutexLocker class,
+defined in :ref:`mutexheader`.  However, it doesn't work because the analysis
+doesn't know that munl.mu == mutex.  The SCOPED_LOCKABLE attribute handles
+aliasing 
+
+
+ACQUIRED_BEFORE(...) and ACQUIRED_AFTER(...) are currently unimplemented.
+-------------------------------------------------------------------------
+
+To be fixed in a future update. 
+
+
+.. _mutexheader:
+
+mutex.h
+=======
+
+Thread safety analysis can be used with any threading library, but it does
+require that the threading API be wrapped in classes and methods which have the
+appropriate annotations.  The following code provides ``mutex.h`` as an example;
+these methods should be filled in to call the appropriate underlying
+implementation. 
+
+
+.. code-block:: c++
+
+  #ifndef THREAD_SAFETY_ANALYSIS_MUTEX_H
+  #define THREAD_SAFETY_ANALYSIS_MUTEX_H
+  
+  // Enable thread safety attributes only with clang.
+  // The attributes can be safely erased when compiling with other compilers.
+  #if defined(__clang__) && (!defined(SWIG))
+  #define THREAD_ANNOTATION_ATTRIBUTE__(x)   __attribute__((x))
+  #else
+  #define THREAD_ANNOTATION_ATTRIBUTE__(x)   // no-op
+  #endif
+  
+  #define THREAD_ANNOTATION_ATTRIBUTE__(x)   __attribute__((x))
+  
+  #define GUARDED_BY(x) \
+    THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
+  
+  #define GUARDED_VAR \
+    THREAD_ANNOTATION_ATTRIBUTE__(guarded)
+  
+  #define PT_GUARDED_BY(x) \
+    THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
+  
+  #define PT_GUARDED_VAR \
+    THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded)
+  
+  #define ACQUIRED_AFTER(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
+  
+  #define ACQUIRED_BEFORE(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
+  
+  #define EXCLUSIVE_LOCKS_REQUIRED(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__))
+  
+  #define SHARED_LOCKS_REQUIRED(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__))
+  
+  #define LOCKS_EXCLUDED(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
+  
+  #define LOCK_RETURNED(x) \
+    THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
+  
+  #define LOCKABLE \
+    THREAD_ANNOTATION_ATTRIBUTE__(lockable)
+  
+  #define SCOPED_LOCKABLE \
+    THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
+  
+  #define EXCLUSIVE_LOCK_FUNCTION(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__))
+  
+  #define SHARED_LOCK_FUNCTION(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__))
+  
+  #define ASSERT_EXCLUSIVE_LOCK(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(assert_exclusive_lock(__VA_ARGS__))
+  
+  #define ASSERT_SHARED_LOCK(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_lock(__VA_ARGS__))
+  
+  #define EXCLUSIVE_TRYLOCK_FUNCTION(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__))
+  
+  #define SHARED_TRYLOCK_FUNCTION(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__))
+  
+  #define UNLOCK_FUNCTION(...) \
+    THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__))
+  
+  #define NO_THREAD_SAFETY_ANALYSIS \
+    THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
+  
+  
+  // Defines an annotated interface for mutexes.
+  // These methods can be implemented to use any internal mutex implementation.
+  class LOCKABLE Mutex {
+  public:
+    // Acquire/lock this mutex exclusively.  Only one thread can have exclusive
+    // access at any one time.  Write operations to guarded data require an
+    // exclusive lock.
+    void Lock() EXCLUSIVE_LOCK_FUNCTION();
+  
+    // Acquire/lock this mutex for read operations, which require only a shared
+    // lock.  This assumes a multiple-reader, single writer semantics.  Multiple
+    // threads may acquire the mutex simultaneously as readers, but a writer must
+    // wait for all of them to release the mutex before it can acquire it
+    // exclusively.  
+    void ReaderLock() SHARED_LOCK_FUNCTION();
+  
+    // Release/unlock the mutex, regardless of whether it is exclusive or shared.
+    void Unlock() UNLOCK_FUNCTION();
+  
+    // Try to acquire the mutex.  Returns true on success, and false on failure.
+    bool TryLock() EXCLUSIVE_TRYLOCK_FUNCTION(true);
+  
+    // Try to acquire the mutex for read operations.
+    bool ReaderTryLock() SHARED_TRYLOCK_FUNCTION(true);
+  
+    // Assert that this mutex is currently held by the calling thread.
+    void AssertHeld() ASSERT_EXCLUSIVE_LOCK();
+  
+    // Assert that is mutex is currently held for read operations. 
+    void AssertReaderHeld() ASSERT_SHARED_LOCK();
+  };
+  
+  
+  // MutexLocker is an RAII class that acquires a mutex in its constructor, and
+  // releases it in its destructor.  
+  class SCOPED_LOCKABLE MutexLocker {
+  private:
+    Mutex* mut;
+  
+  public:
+    MutexLocker(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) : mut(mu) {
+      mu->Lock();
+    }  
+    ~MutexLocker() UNLOCK_FUNCTION() {
+      mut->Unlock();
+    }
+  };
+  
+  #endif  // THREAD_SAFETY_ANALYSIS_MUTEX_H
diff --git a/external/bsd/llvm/dist/clang/docs/UsersManual.rst b/external/bsd/llvm/dist/clang/docs/UsersManual.rst
index 4ca8435c368c..ba9150182303 100644
--- a/external/bsd/llvm/dist/clang/docs/UsersManual.rst
+++ b/external/bsd/llvm/dist/clang/docs/UsersManual.rst
@@ -112,11 +112,11 @@ Options to Control Error and Warning Messages
 
 .. option:: -w
 
-  Disable all warnings.
+  Disable all diagnostics.
 
 .. option:: -Weverything
 
-  :ref:`Enable all warnings. `
+  :ref:`Enable all diagnostics. `
 
 .. option:: -pedantic
 
@@ -582,6 +582,7 @@ All diagnostics are mapped into one of these 5 classes:
 
 -  Ignored
 -  Note
+-  Remark
 -  Warning
 -  Error
 -  Fatal
@@ -722,11 +723,12 @@ is treated as a system header.
 
 .. _diagnostics_enable_everything:
 
-Enabling All Warnings
-^^^^^^^^^^^^^^^^^^^^^
+Enabling All Diagnostics
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 In addition to the traditional ``-W`` flags, one can enable **all**
-warnings by passing :option:`-Weverything`. This works as expected with
+diagnostics by passing :option:`-Weverything`. This works as expected
+with
 :option:`-Werror`, and also includes the warnings from :option:`-pedantic`.
 
 Note that when combined with :option:`-w` (which disables all warnings), that
diff --git a/external/bsd/llvm/dist/clang/docs/index.rst b/external/bsd/llvm/dist/clang/docs/index.rst
index b18deb9b063d..bf2de7ebfdab 100644
--- a/external/bsd/llvm/dist/clang/docs/index.rst
+++ b/external/bsd/llvm/dist/clang/docs/index.rst
@@ -18,7 +18,9 @@ Using Clang as a Compiler
 
    UsersManual
    LanguageExtensions
+   AttributeReference
    CrossCompilation
+   ThreadSafetyAnalysis
    AddressSanitizer
    ThreadSanitizer
    MemorySanitizer
@@ -26,6 +28,7 @@ Using Clang as a Compiler
    LeakSanitizer
    SanitizerSpecialCaseList
    Modules
+   MSVCCompatibility
    FAQ
 
 Using Clang as a Library
diff --git a/external/bsd/llvm/dist/clang/docs/tools/dump_ast_matchers.py b/external/bsd/llvm/dist/clang/docs/tools/dump_ast_matchers.py
index 564dc380d648..c04df8573a50 100644
--- a/external/bsd/llvm/dist/clang/docs/tools/dump_ast_matchers.py
+++ b/external/bsd/llvm/dist/clang/docs/tools/dump_ast_matchers.py
@@ -119,9 +119,9 @@ def add_matcher(result_type, name, args, comment, is_dyncast=False):
   # arguments.
   elif ('Matcher<' not in args or
         name in ['allOf', 'anyOf', 'anything', 'unless']):
-    narrowing_matchers[result_type + name] = matcher_html
+    narrowing_matchers[result_type + name + esc(args)] = matcher_html
   else:
-    traversal_matchers[result_type + name] = matcher_html
+    traversal_matchers[result_type + name + esc(args)] = matcher_html
 
 def act_on_decl(declaration, comment, allowed_types):
   """Parse the matcher out of the given declaration and comment.
@@ -242,12 +242,17 @@ def act_on_decl(declaration, comment, allowed_types):
 
     # Parse Variadic operator matchers.
     m = re.match(
-        r"""^.*VariadicOperatorMatcherFunc\s*([a-zA-Z]*)\s*=\s*{.*};$""",
+        r"""^.*VariadicOperatorMatcherFunc\s*<\s*([^,]+),\s*([^\s>]+)\s*>\s*
+              ([a-zA-Z]*)\s*=\s*{.*};$""",
         declaration, flags=re.X)
     if m:
-      name = m.groups()[0]
-      add_matcher('*', name, 'Matcher<*>, ..., Matcher<*>', comment)
-      return
+      min_args, max_args, name = m.groups()[:3]
+      if max_args == '1':
+        add_matcher('*', name, 'Matcher<*>', comment)
+        return
+      elif max_args == 'UINT_MAX':
+        add_matcher('*', name, 'Matcher<*>, ..., Matcher<*>', comment)
+        return
 
 
     # Parse free standing matcher functions, like:
diff --git a/external/bsd/llvm/dist/clang/docs/tools/dump_format_style.py b/external/bsd/llvm/dist/clang/docs/tools/dump_format_style.py
index 0c8ca6d610f1..addda2abc2c6 100644
--- a/external/bsd/llvm/dist/clang/docs/tools/dump_format_style.py
+++ b/external/bsd/llvm/dist/clang/docs/tools/dump_format_style.py
@@ -98,7 +98,7 @@ def read_options(header):
         enum = Enum(name, comment)
       elif line.endswith(';'):
         state = State.InStruct
-        field_type, field_name = re.match(r'(\w+)\s+(\w+);', line).groups()
+        field_type, field_name = re.match(r'([:\w]+)\s+(\w+);', line).groups()
         option = Option(str(field_name), str(field_type), comment)
         options.append(option)
       else:
@@ -122,7 +122,7 @@ def read_options(header):
     raise Exception('Not finished by the end of file')
 
   for option in options:
-    if not option.type in ['bool', 'unsigned', 'int']:
+    if not option.type in ['bool', 'unsigned', 'int', 'std::string']:
       if enums.has_key(option.type):
         option.enum = enums[option.type]
       else:
diff --git a/external/bsd/llvm/dist/clang/examples/CMakeLists.txt b/external/bsd/llvm/dist/clang/examples/CMakeLists.txt
index 6213bc7c2a6c..5d4b5fcdb0f6 100644
--- a/external/bsd/llvm/dist/clang/examples/CMakeLists.txt
+++ b/external/bsd/llvm/dist/clang/examples/CMakeLists.txt
@@ -1,5 +1,6 @@
 if(NOT CLANG_BUILD_EXAMPLES)
   set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON)
+  set(EXCLUDE_FROM_ALL ON)
 endif()
 
 if(CLANG_ENABLE_STATIC_ANALYZER)
diff --git a/external/bsd/llvm/dist/clang/examples/PrintFunctionNames/CMakeLists.txt b/external/bsd/llvm/dist/clang/examples/PrintFunctionNames/CMakeLists.txt
index cd88f973f5ef..876b5da87c4b 100644
--- a/external/bsd/llvm/dist/clang/examples/PrintFunctionNames/CMakeLists.txt
+++ b/external/bsd/llvm/dist/clang/examples/PrintFunctionNames/CMakeLists.txt
@@ -1,7 +1,3 @@
-set( LLVM_LINK_COMPONENTS
-  Support
-  )
-
 # If we don't need RTTI or EH, there's no reason to export anything
 # from the plugin.
 if( NOT WIN32 ) # Win32 mangles symbols differently, and
@@ -13,24 +9,4 @@ if( NOT WIN32 ) # Win32 mangles symbols differently, and
   endif()
 endif()
 
-add_clang_library(PrintFunctionNames MODULE PrintFunctionNames.cpp)
-
-add_dependencies(PrintFunctionNames
-  ClangAttrClasses
-  ClangAttrList
-  ClangCommentNodes
-  ClangDeclNodes
-  ClangDiagnosticCommon
-  ClangStmtNodes
-  )
-
-target_link_libraries(PrintFunctionNames
-  clangAST
-  clangBasic
-  clangFrontend
-  )
-
-set_target_properties(PrintFunctionNames
-  PROPERTIES
-  LINKER_LANGUAGE CXX
-  PREFIX "")
+add_llvm_loadable_module(PrintFunctionNames PrintFunctionNames.cpp)
diff --git a/external/bsd/llvm/dist/clang/examples/PrintFunctionNames/Makefile b/external/bsd/llvm/dist/clang/examples/PrintFunctionNames/Makefile
index 23a53054019d..5865098bd305 100644
--- a/external/bsd/llvm/dist/clang/examples/PrintFunctionNames/Makefile
+++ b/external/bsd/llvm/dist/clang/examples/PrintFunctionNames/Makefile
@@ -19,7 +19,7 @@ endif
 endif
 
 LINK_LIBS_IN_SHARED = 0
-SHARED_LIBRARY = 1
+LOADABLE_MODULE = 1
 
 include $(CLANG_LEVEL)/Makefile
 
diff --git a/external/bsd/llvm/dist/clang/examples/analyzer-plugin/CMakeLists.txt b/external/bsd/llvm/dist/clang/examples/analyzer-plugin/CMakeLists.txt
index 9984880b2eb7..b2a20e127827 100644
--- a/external/bsd/llvm/dist/clang/examples/analyzer-plugin/CMakeLists.txt
+++ b/external/bsd/llvm/dist/clang/examples/analyzer-plugin/CMakeLists.txt
@@ -1,25 +1 @@
-set(LLVM_LINK_COMPONENTS
-  Support
-  )
-
-add_clang_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp)
-
-add_dependencies(SampleAnalyzerPlugin
-  ClangAttrClasses
-  ClangAttrList
-  ClangCommentNodes
-  ClangDeclNodes
-  ClangDiagnosticCommon
-  ClangStmtNodes
-  )
-
-target_link_libraries(SampleAnalyzerPlugin
-  clangAST
-  clangAnalysis
-  clangStaticAnalyzerCore
-  )
-
-set_target_properties(SampleAnalyzerPlugin
-  PROPERTIES
-  LINKER_LANGUAGE CXX
-  PREFIX "")
+add_llvm_loadable_module(SampleAnalyzerPlugin MainCallChecker.cpp)
diff --git a/external/bsd/llvm/dist/clang/examples/analyzer-plugin/MainCallChecker.cpp b/external/bsd/llvm/dist/clang/examples/analyzer-plugin/MainCallChecker.cpp
index 8801f9a158fa..66e105f11958 100644
--- a/external/bsd/llvm/dist/clang/examples/analyzer-plugin/MainCallChecker.cpp
+++ b/external/bsd/llvm/dist/clang/examples/analyzer-plugin/MainCallChecker.cpp
@@ -35,7 +35,7 @@ void MainCallChecker::checkPreStmt(const CallExpr *CE, CheckerContext &C) const
       return;
 
     if (!BT)
-      BT.reset(new BugType("call to main", "example analyzer plugin"));
+      BT.reset(new BugType(this, "call to main", "example analyzer plugin"));
 
     BugReport *report = new BugReport(*BT, BT->getName(), N);
     report->addRange(Callee->getSourceRange());
diff --git a/external/bsd/llvm/dist/clang/include/clang-c/BuildSystem.h b/external/bsd/llvm/dist/clang/include/clang-c/BuildSystem.h
new file mode 100644
index 000000000000..ab581fdccedd
--- /dev/null
+++ b/external/bsd/llvm/dist/clang/include/clang-c/BuildSystem.h
@@ -0,0 +1,87 @@
+/*==-- clang-c/BuildSysetm.h - Utilities for use by build systems -*- C -*-===*\
+|*                                                                            *|
+|*                     The LLVM Compiler Infrastructure                       *|
+|*                                                                            *|
+|* This file is distributed under the University of Illinois Open Source      *|
+|* License. See LICENSE.TXT for details.                                      *|
+|*                                                                            *|
+|*===----------------------------------------------------------------------===*|
+|*                                                                            *|
+|* This header provides various utilities for use by build systems.           *|
+|*                                                                            *|
+\*===----------------------------------------------------------------------===*/
+
+#ifndef CLANG_C_BUILD_SYSTEM_H
+#define CLANG_C_BUILD_SYSTEM_H
+
+#include "clang-c/Platform.h"
+#include "clang-c/CXErrorCode.h"
+#include "clang-c/CXString.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup BUILD_SYSTEM Build system utilities
+ * @{
+ */
+
+/**
+ * \brief Return the timestamp for use with Clang's
+ * \c -fbuild-session-timestamp= option.
+ */
+CINDEX_LINKAGE unsigned long long clang_getBuildSessionTimestamp(void);
+
+/**
+ * \brief Object encapsulating information about overlaying virtual
+ * file/directories over the real file system.
+ */
+typedef struct CXVirtualFileOverlayImpl *CXVirtualFileOverlay;
+
+/**
+ * \brief Create a \c CXVirtualFileOverlay object.
+ * Must be disposed with \c clang_VirtualFileOverlay_dispose().
+ *
+ * \param options is reserved, always pass 0.
+ */
+CINDEX_LINKAGE CXVirtualFileOverlay
+clang_VirtualFileOverlay_create(unsigned options);
+
+/**
+ * \brief Map an absolute virtual file path to an absolute real one.
+ * The virtual path must be canonicalized (not contain "."/"..").
+ * \returns 0 for success, non-zero to indicate an error.
+ */
+CINDEX_LINKAGE enum CXErrorCode
+clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay,
+                                        const char *virtualPath,
+                                        const char *realPath);
+
+/**
+ * \brief Write out the \c CXVirtualFileOverlay object to a char buffer.
+ *
+ * \param options is reserved, always pass 0.
+ * \param out_buffer pointer to receive the CXString object, which should be
+ * disposed using \c clang_disposeString().
+ * \returns 0 for success, non-zero to indicate an error.
+ */
+CINDEX_LINKAGE enum CXErrorCode
+clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay, unsigned options,
+                                       CXString *out_buffer);
+
+/**
+ * \brief Dispose a \c CXVirtualFileOverlay object.
+ */
+CINDEX_LINKAGE void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CLANG_C_BUILD_SYSTEM_H */
+
diff --git a/external/bsd/llvm/dist/clang/include/clang-c/CXErrorCode.h b/external/bsd/llvm/dist/clang/include/clang-c/CXErrorCode.h
new file mode 100644
index 000000000000..a026c95a5bb9
--- /dev/null
+++ b/external/bsd/llvm/dist/clang/include/clang-c/CXErrorCode.h
@@ -0,0 +1,64 @@
+/*===-- clang-c/CXErrorCode.h - C Index Error Codes  --------------*- C -*-===*\
+|*                                                                            *|
+|*                     The LLVM Compiler Infrastructure                       *|
+|*                                                                            *|
+|* This file is distributed under the University of Illinois Open Source      *|
+|* License. See LICENSE.TXT for details.                                      *|
+|*                                                                            *|
+|*===----------------------------------------------------------------------===*|
+|*                                                                            *|
+|* This header provides the CXErrorCode enumerators.                          *|
+|*                                                                            *|
+\*===----------------------------------------------------------------------===*/
+
+#ifndef CLANG_C_CXERRORCODE_H
+#define CLANG_C_CXERRORCODE_H
+
+#include "clang-c/Platform.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Error codes returned by libclang routines.
+ *
+ * Zero (\c CXError_Success) is the only error code indicating success.  Other
+ * error codes, including not yet assigned non-zero values, indicate errors.
+ */
+enum CXErrorCode {
+  /**
+   * \brief No error.
+   */
+  CXError_Success = 0,
+
+  /**
+   * \brief A generic error code, no further details are available.
+   *
+   * Errors of this kind can get their own specific error codes in future
+   * libclang versions.
+   */
+  CXError_Failure = 1,
+
+  /**
+   * \brief libclang crashed while performing the requested operation.
+   */
+  CXError_Crashed = 2,
+
+  /**
+   * \brief The function detected that the arguments violate the function
+   * contract.
+   */
+  CXError_InvalidArguments = 3,
+
+  /**
+   * \brief An AST deserialization error has occurred.
+   */
+  CXError_ASTReadError = 4
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
diff --git a/external/bsd/llvm/dist/clang/include/clang-c/Index.h b/external/bsd/llvm/dist/clang/include/clang-c/Index.h
index d98c1e66fdd5..7eff0a4216a7 100644
--- a/external/bsd/llvm/dist/clang/include/clang-c/Index.h
+++ b/external/bsd/llvm/dist/clang/include/clang-c/Index.h
@@ -19,7 +19,9 @@
 #include 
 
 #include "clang-c/Platform.h"
+#include "clang-c/CXErrorCode.h"
 #include "clang-c/CXString.h"
+#include "clang-c/BuildSystem.h"
 
 /**
  * \brief The version constants for the libclang API.
@@ -30,7 +32,7 @@
  * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
  */
 #define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 21
+#define CINDEX_VERSION_MINOR 24
 
 #define CINDEX_VERSION_ENCODE(major, minor) ( \
       ((major) * 10000)                       \
@@ -650,6 +652,12 @@ enum CXDiagnosticSeverity {
    */
   CXDiagnostic_Note    = 1,
 
+  /**
+   * \brief This diagnostic is a remark that provides additional information
+   * for the user.
+   */
+  CXDiagnostic_Remark = 5,
+
   /**
    * \brief This diagnostic indicates suspicious code that may not be
    * wrong.
@@ -1076,10 +1084,27 @@ CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnitFromSourceFile(
                                          struct CXUnsavedFile *unsaved_files);
 
 /**
- * \brief Create a translation unit from an AST file (-emit-ast).
+ * \brief Same as \c clang_createTranslationUnit2, but returns
+ * the \c CXTranslationUnit instead of an error code.  In case of an error this
+ * routine returns a \c NULL \c CXTranslationUnit, without further detailed
+ * error codes.
  */
-CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnit(CXIndex,
-                                             const char *ast_filename);
+CINDEX_LINKAGE CXTranslationUnit clang_createTranslationUnit(
+    CXIndex CIdx,
+    const char *ast_filename);
+
+/**
+ * \brief Create a translation unit from an AST file (\c -emit-ast).
+ *
+ * \param[out] out_TU A non-NULL pointer to store the created
+ * \c CXTranslationUnit.
+ *
+ * \returns Zero on success, otherwise returns an error code.
+ */
+CINDEX_LINKAGE enum CXErrorCode clang_createTranslationUnit2(
+    CXIndex CIdx,
+    const char *ast_filename,
+    CXTranslationUnit *out_TU);
 
 /**
  * \brief Flags that control the creation of translation units.
@@ -1193,7 +1218,22 @@ enum CXTranslationUnit_Flags {
  * set of optimizations enabled may change from one version to the next.
  */
 CINDEX_LINKAGE unsigned clang_defaultEditingTranslationUnitOptions(void);
-  
+
+/**
+ * \brief Same as \c clang_parseTranslationUnit2, but returns
+ * the \c CXTranslationUnit instead of an error code.  In case of an error this
+ * routine returns a \c NULL \c CXTranslationUnit, without further detailed
+ * error codes.
+ */
+CINDEX_LINKAGE CXTranslationUnit
+clang_parseTranslationUnit(CXIndex CIdx,
+                           const char *source_filename,
+                           const char *const *command_line_args,
+                           int num_command_line_args,
+                           struct CXUnsavedFile *unsaved_files,
+                           unsigned num_unsaved_files,
+                           unsigned options);
+
 /**
  * \brief Parse the given source file and the translation unit corresponding
  * to that file.
@@ -1208,7 +1248,7 @@ CINDEX_LINKAGE unsigned clang_defaultEditingTranslationUnitOptions(void);
  * associated.
  *
  * \param source_filename The name of the source file to load, or NULL if the
- * source file is included in \p command_line_args.
+ * source file is included in \c command_line_args.
  *
  * \param command_line_args The command-line arguments that would be
  * passed to the \c clang executable if it were being invoked out-of-process.
@@ -1217,7 +1257,7 @@ CINDEX_LINKAGE unsigned clang_defaultEditingTranslationUnitOptions(void);
  * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \'.
  *
  * \param num_command_line_args The number of command-line arguments in
- * \p command_line_args.
+ * \c command_line_args.
  *
  * \param unsaved_files the files that have not yet been saved to disk
  * but may be required for parsing, including the contents of
@@ -1232,18 +1272,22 @@ CINDEX_LINKAGE unsigned clang_defaultEditingTranslationUnitOptions(void);
  * is managed but not its compilation. This should be a bitwise OR of the
  * CXTranslationUnit_XXX flags.
  *
- * \returns A new translation unit describing the parsed code and containing
- * any diagnostics produced by the compiler. If there is a failure from which
- * the compiler cannot recover, returns NULL.
+ * \param[out] out_TU A non-NULL pointer to store the created
+ * \c CXTranslationUnit, describing the parsed code and containing any
+ * diagnostics produced by the compiler.
+ *
+ * \returns Zero on success, otherwise returns an error code.
  */
-CINDEX_LINKAGE CXTranslationUnit clang_parseTranslationUnit(CXIndex CIdx,
-                                                    const char *source_filename,
-                                         const char * const *command_line_args,
-                                                      int num_command_line_args,
-                                            struct CXUnsavedFile *unsaved_files,
-                                                     unsigned num_unsaved_files,
-                                                            unsigned options);
-  
+CINDEX_LINKAGE enum CXErrorCode
+clang_parseTranslationUnit2(CXIndex CIdx,
+                            const char *source_filename,
+                            const char *const *command_line_args,
+                            int num_command_line_args,
+                            struct CXUnsavedFile *unsaved_files,
+                            unsigned num_unsaved_files,
+                            unsigned options,
+                            CXTranslationUnit *out_TU);
+
 /**
  * \brief Flags that control how translation units are saved.
  *
@@ -1395,10 +1439,11 @@ CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU);
  * The function \c clang_defaultReparseOptions() produces a default set of
  * options recommended for most uses, based on the translation unit.
  *
- * \returns 0 if the sources could be reparsed. A non-zero value will be
+ * \returns 0 if the sources could be reparsed.  A non-zero error code will be
  * returned if reparsing was impossible, such that the translation unit is
- * invalid. In such cases, the only valid call for \p TU is 
- * \c clang_disposeTranslationUnit(TU).
+ * invalid. In such cases, the only valid call for \c TU is
+ * \c clang_disposeTranslationUnit(TU).  The error codes returned by this
+ * routine are described by the \c CXErrorCode enum.
  */
 CINDEX_LINKAGE int clang_reparseTranslationUnit(CXTranslationUnit TU,
                                                 unsigned num_unsaved_files,
@@ -2096,7 +2141,11 @@ enum CXCursorKind {
    */
   CXCursor_OMPParallelDirective          = 232,
 
-  CXCursor_LastStmt                      = CXCursor_OMPParallelDirective,
+  /** \brief OpenMP simd directive.
+   */
+  CXCursor_OMPSimdDirective              = 233,
+
+  CXCursor_LastStmt                      = CXCursor_OMPSimdDirective,
 
   /**
    * \brief Cursor that represents the translation unit itself.
@@ -3037,6 +3086,24 @@ enum CXRefQualifierKind {
   CXRefQualifier_RValue
 };
 
+/**
+ * \brief Returns the number of template arguments for given class template
+ * specialization, or -1 if type \c T is not a class template specialization.
+ *
+ * Variadic argument packs count as only one argument, and can not be inspected
+ * further.
+ */
+CINDEX_LINKAGE int clang_Type_getNumTemplateArguments(CXType T);
+
+/**
+ * \brief Returns the type template argument of a template class specialization
+ * at given index.
+ *
+ * This function only returns template type arguments and does not handle
+ * template template arguments or variadic packs.
+ */
+CINDEX_LINKAGE CXType clang_Type_getTemplateArgumentAsType(CXType T, unsigned i);
+
 /**
  * \brief Retrieve the ref-qualifier kind of a function or method.
  *
@@ -5789,11 +5856,12 @@ typedef enum {
  * \param index_options A bitmask of options that affects how indexing is
  * performed. This should be a bitwise OR of the CXIndexOpt_XXX flags.
  *
- * \param out_TU [out] pointer to store a CXTranslationUnit that can be reused
- * after indexing is finished. Set to NULL if you do not require it.
+ * \param[out] out_TU pointer to store a \c CXTranslationUnit that can be
+ * reused after indexing is finished. Set to \c NULL if you do not require it.
  *
- * \returns If there is a failure from which the there is no recovery, returns
- * non-zero, otherwise returns 0.
+ * \returns 0 on success or if there were errors from which the compiler could
+ * recover.  If there is a failure from which the there is no recovery, returns
+ * a non-zero \c CXErrorCode.
  *
  * The rest of the parameters are the same as #clang_parseTranslationUnit.
  */
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/ASTContext.h b/external/bsd/llvm/dist/clang/include/clang/AST/ASTContext.h
index 2152390f7a6e..6ed7c0804b12 100644
--- a/external/bsd/llvm/dist/clang/include/clang/AST/ASTContext.h
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/ASTContext.h
@@ -416,7 +416,7 @@ public:
   SelectorTable &Selectors;
   Builtin::Context &BuiltinInfo;
   mutable DeclarationNameTable DeclarationNames;
-  OwningPtr ExternalSource;
+  IntrusiveRefCntPtr ExternalSource;
   ASTMutationListener *Listener;
 
   /// \brief Contains parents of a node.
@@ -811,11 +811,13 @@ public:
   /// The external AST source provides the ability to load parts of
   /// the abstract syntax tree as needed from some external storage,
   /// e.g., a precompiled header.
-  void setExternalSource(OwningPtr &Source);
+  void setExternalSource(IntrusiveRefCntPtr Source);
 
   /// \brief Retrieve a pointer to the external AST source associated
   /// with this AST context, if any.
-  ExternalASTSource *getExternalSource() const { return ExternalSource.get(); }
+  ExternalASTSource *getExternalSource() const {
+    return ExternalSource.getPtr();
+  }
 
   /// \brief Attach an AST mutation listener to the AST context.
   ///
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/CharUnits.h b/external/bsd/llvm/dist/clang/include/clang/AST/CharUnits.h
index 69dee4cdf67d..72ca9f5cd67d 100644
--- a/external/bsd/llvm/dist/clang/include/clang/AST/CharUnits.h
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/CharUnits.h
@@ -173,12 +173,7 @@ namespace clang {
       /// Given that this is a non-zero alignment value, what is the
       /// alignment at the given offset?
       CharUnits alignmentAtOffset(CharUnits offset) {
-        // alignment: 0010000
-        // offset:    1011100
-        // lowBits:   0001011
-        // result:    0000100
-        QuantityType lowBits = (Quantity-1) & (offset.Quantity-1);
-        return CharUnits((lowBits + 1) & ~lowBits);
+        return CharUnits(llvm::MinAlign(Quantity, offset.Quantity));
       }
 
 
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/DataRecursiveASTVisitor.h b/external/bsd/llvm/dist/clang/include/clang/AST/DataRecursiveASTVisitor.h
index 068fe08cfd16..cbefbdc287ef 100644
--- a/external/bsd/llvm/dist/clang/include/clang/AST/DataRecursiveASTVisitor.h
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/DataRecursiveASTVisitor.h
@@ -424,6 +424,7 @@ private:
   bool TraverseFunctionHelper(FunctionDecl *D);
   bool TraverseVarHelper(VarDecl *D);
   bool TraverseOMPClause(OMPClause *C);
+  bool TraverseOMPExecutableDirective(OMPExecutableDirective *S);
 #define OPENMP_CLAUSE(Name, Class)                                      \
   bool Visit##Class(Class *C);
 #include "clang/Basic/OpenMPKinds.def"
@@ -2331,11 +2332,22 @@ DEF_TRAVERSE_STMT(ObjCDictionaryLiteral, { })
 DEF_TRAVERSE_STMT(AsTypeExpr, { })
 
 // OpenMP directives.
-DEF_TRAVERSE_STMT(OMPParallelDirective, {
+template
+bool DataRecursiveASTVisitor::TraverseOMPExecutableDirective(
+                                               OMPExecutableDirective *S) {
   ArrayRef Clauses = S->clauses();
   for (ArrayRef::iterator I = Clauses.begin(), E = Clauses.end();
        I != E; ++I)
     if (!TraverseOMPClause(*I)) return false;
+  return true;
+}
+
+DEF_TRAVERSE_STMT(OMPParallelDirective, {
+  if (!TraverseOMPExecutableDirective(S)) return false;
+})
+
+DEF_TRAVERSE_STMT(OMPSimdDirective, {
+  if (!TraverseOMPExecutableDirective(S)) return false;
 })
 
 // OpenMP clauses.
@@ -2352,6 +2364,12 @@ bool DataRecursiveASTVisitor::TraverseOMPClause(OMPClause *C) {
   return true;
 }
 
+template
+bool DataRecursiveASTVisitor::VisitOMPIfClause(OMPIfClause *C) {
+  TraverseStmt(C->getCondition());
+  return true;
+}
+
 template
 bool DataRecursiveASTVisitor::VisitOMPDefaultClause(OMPDefaultClause *C) {
   return true;
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/DeclCXX.h b/external/bsd/llvm/dist/clang/include/clang/AST/DeclCXX.h
index 93c64805aa9f..3def88549984 100644
--- a/external/bsd/llvm/dist/clang/include/clang/AST/DeclCXX.h
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/DeclCXX.h
@@ -1615,6 +1615,10 @@ public:
            (hasDefinition() && isPolymorphic());
   }
 
+  /// \brief Controls when vtordisps will be emitted if this record is used as a
+  /// virtual base.
+  MSVtorDispAttr::Mode getMSVtorDispMode() const;
+
   /// \brief Determine whether this lambda expression was known to be dependent
   /// at the time it was created, even if its context does not appear to be
   /// dependent.
@@ -2303,8 +2307,12 @@ public:
                                    bool isImplicitlyDeclared);
   static CXXDestructorDecl *CreateDeserialized(ASTContext & C, unsigned ID);
 
-  void setOperatorDelete(FunctionDecl *OD) { OperatorDelete = OD; }
-  const FunctionDecl *getOperatorDelete() const { return OperatorDelete; }
+  void setOperatorDelete(FunctionDecl *OD) {
+    cast(getFirstDecl())->OperatorDelete = OD;
+  }
+  const FunctionDecl *getOperatorDelete() const {
+    return cast(getFirstDecl())->OperatorDelete;
+  }
 
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) { return classofKind(D->getKind()); }
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/ExternalASTSource.h b/external/bsd/llvm/dist/clang/include/clang/AST/ExternalASTSource.h
index b077426e6a47..54e96d99bc90 100644
--- a/external/bsd/llvm/dist/clang/include/clang/AST/ExternalASTSource.h
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/ExternalASTSource.h
@@ -53,7 +53,7 @@ enum ExternalLoadResult {
 /// sources can resolve types and declarations from abstract IDs into
 /// actual type and declaration nodes, and read parts of declaration
 /// contexts.
-class ExternalASTSource {
+class ExternalASTSource : public RefCountedBase {
   /// \brief Whether this AST source also provides information for
   /// semantic analysis.
   bool SemaSource;
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/OpenMPClause.h b/external/bsd/llvm/dist/clang/include/clang/AST/OpenMPClause.h
new file mode 100644
index 000000000000..4a3c9e0a4937
--- /dev/null
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/OpenMPClause.h
@@ -0,0 +1,438 @@
+//===- OpenMPClause.h - Classes for OpenMP clauses --------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+/// \file
+/// \brief This file defines OpenMP AST classes for clauses.
+/// There are clauses for executable directives, clauses for declarative
+/// directives and clauses which can be used in both kinds of directives.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_OPENMPCLAUSE_H
+#define LLVM_CLANG_AST_OPENMPCLAUSE_H
+
+#include "clang/AST/Expr.h"
+#include "clang/AST/Stmt.h"
+#include "clang/Basic/OpenMPKinds.h"
+#include "clang/Basic/SourceLocation.h"
+
+namespace clang {
+
+//===----------------------------------------------------------------------===//
+// AST classes for clauses.
+//===----------------------------------------------------------------------===//
+
+/// \brief This is a basic class for representing single OpenMP clause.
+///
+class OMPClause {
+  /// \brief Starting location of the clause (the clause keyword).
+  SourceLocation StartLoc;
+  /// \brief Ending location of the clause.
+  SourceLocation EndLoc;
+  /// \brief Kind of the clause.
+  OpenMPClauseKind Kind;
+
+protected:
+  OMPClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
+      : StartLoc(StartLoc), EndLoc(EndLoc), Kind(K) {}
+
+public:
+  /// \brief Returns the starting location of the clause.
+  SourceLocation getLocStart() const { return StartLoc; }
+  /// \brief Returns the ending location of the clause.
+  SourceLocation getLocEnd() const { return EndLoc; }
+
+  /// \brief Sets the starting location of the clause.
+  void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
+  /// \brief Sets the ending location of the clause.
+  void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
+
+  /// \brief Returns kind of OpenMP clause (private, shared, reduction, etc.).
+  OpenMPClauseKind getClauseKind() const { return Kind; }
+
+  bool isImplicit() const { return StartLoc.isInvalid(); }
+
+  StmtRange children();
+  ConstStmtRange children() const {
+    return const_cast(this)->children();
+  }
+  static bool classof(const OMPClause *T) { return true; }
+};
+
+/// \brief This represents clauses with the list of variables like 'private',
+/// 'firstprivate', 'copyin', 'shared', or 'reduction' clauses in the
+/// '#pragma omp ...' directives.
+template  class OMPVarListClause : public OMPClause {
+  friend class OMPClauseReader;
+  /// \brief Location of '('.
+  SourceLocation LParenLoc;
+  /// \brief Number of variables in the list.
+  unsigned NumVars;
+
+protected:
+  /// \brief Fetches list of variables associated with this clause.
+  llvm::MutableArrayRef getVarRefs() {
+    return llvm::MutableArrayRef(
+        reinterpret_cast(
+            reinterpret_cast(this) +
+            llvm::RoundUpToAlignment(sizeof(T), llvm::alignOf())),
+        NumVars);
+  }
+
+  /// \brief Sets the list of variables for this clause.
+  void setVarRefs(ArrayRef VL) {
+    assert(VL.size() == NumVars &&
+           "Number of variables is not the same as the preallocated buffer");
+    std::copy(
+        VL.begin(), VL.end(),
+        reinterpret_cast(
+            reinterpret_cast(this) +
+            llvm::RoundUpToAlignment(sizeof(T), llvm::alignOf())));
+  }
+
+  /// \brief Build clause with number of variables \a N.
+  ///
+  /// \param K Kind of the clause.
+  /// \param StartLoc Starting location of the clause (the clause keyword).
+  /// \param LParenLoc Location of '('.
+  /// \param EndLoc Ending location of the clause.
+  /// \param N Number of the variables in the clause.
+  ///
+  OMPVarListClause(OpenMPClauseKind K, SourceLocation StartLoc,
+                   SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
+      : OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
+
+public:
+  typedef llvm::MutableArrayRef::iterator varlist_iterator;
+  typedef ArrayRef::iterator varlist_const_iterator;
+
+  unsigned varlist_size() const { return NumVars; }
+  bool varlist_empty() const { return NumVars == 0; }
+  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
+  varlist_iterator varlist_end() { return getVarRefs().end(); }
+  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
+  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
+
+  /// \brief Sets the location of '('.
+  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
+  /// \brief Returns the location of '('.
+  SourceLocation getLParenLoc() const { return LParenLoc; }
+
+  /// \brief Fetches list of all variables in the clause.
+  ArrayRef getVarRefs() const {
+    return ArrayRef(
+        reinterpret_cast(
+            reinterpret_cast(this) +
+            llvm::RoundUpToAlignment(sizeof(T), llvm::alignOf())),
+        NumVars);
+  }
+};
+
+/// \brief This represents 'if' clause in the '#pragma omp ...' directive.
+///
+/// \code
+/// #pragma omp parallel if(a > 5)
+/// \endcode
+/// In this example directive '#pragma omp parallel' has simple 'if'
+/// clause with condition 'a > 5'.
+///
+class OMPIfClause : public OMPClause {
+  friend class OMPClauseReader;
+  /// \brief Location of '('.
+  SourceLocation LParenLoc;
+  /// \brief Condition of the 'if' clause.
+  Stmt *Condition;
+
+  /// \brief Set condition.
+  ///
+  void setCondition(Expr *Cond) { Condition = Cond; }
+
+public:
+  /// \brief Build 'if' clause with condition \a Cond.
+  ///
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param Cond Condition of the clause.
+  /// \param EndLoc Ending location of the clause.
+  ///
+  OMPIfClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc,
+              SourceLocation EndLoc)
+      : OMPClause(OMPC_if, StartLoc, EndLoc), LParenLoc(LParenLoc),
+        Condition(Cond) {}
+
+  /// \brief Build an empty clause.
+  ///
+  OMPIfClause()
+      : OMPClause(OMPC_if, SourceLocation(), SourceLocation()),
+        LParenLoc(SourceLocation()), Condition(0) {}
+
+  /// \brief Sets the location of '('.
+  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
+  /// \brief Returns the location of '('.
+  SourceLocation getLParenLoc() const { return LParenLoc; }
+
+  /// \brief Returns condition.
+  Expr *getCondition() const { return cast_or_null(Condition); }
+
+  static bool classof(const OMPClause *T) {
+    return T->getClauseKind() == OMPC_if;
+  }
+
+  StmtRange children() { return StmtRange(&Condition, &Condition + 1); }
+};
+
+/// \brief This represents 'default' clause in the '#pragma omp ...' directive.
+///
+/// \code
+/// #pragma omp parallel default(shared)
+/// \endcode
+/// In this example directive '#pragma omp parallel' has simple 'default'
+/// clause with kind 'shared'.
+///
+class OMPDefaultClause : public OMPClause {
+  friend class OMPClauseReader;
+  /// \brief Location of '('.
+  SourceLocation LParenLoc;
+  /// \brief A kind of the 'default' clause.
+  OpenMPDefaultClauseKind Kind;
+  /// \brief Start location of the kind in source code.
+  SourceLocation KindKwLoc;
+
+  /// \brief Set kind of the clauses.
+  ///
+  /// \param K Argument of clause.
+  ///
+  void setDefaultKind(OpenMPDefaultClauseKind K) { Kind = K; }
+
+  /// \brief Set argument location.
+  ///
+  /// \param KLoc Argument location.
+  ///
+  void setDefaultKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
+
+public:
+  /// \brief Build 'default' clause with argument \a A ('none' or 'shared').
+  ///
+  /// \param A Argument of the clause ('none' or 'shared').
+  /// \param ALoc Starting location of the argument.
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param EndLoc Ending location of the clause.
+  ///
+  OMPDefaultClause(OpenMPDefaultClauseKind A, SourceLocation ALoc,
+                   SourceLocation StartLoc, SourceLocation LParenLoc,
+                   SourceLocation EndLoc)
+      : OMPClause(OMPC_default, StartLoc, EndLoc), LParenLoc(LParenLoc),
+        Kind(A), KindKwLoc(ALoc) {}
+
+  /// \brief Build an empty clause.
+  ///
+  OMPDefaultClause()
+      : OMPClause(OMPC_default, SourceLocation(), SourceLocation()),
+        LParenLoc(SourceLocation()), Kind(OMPC_DEFAULT_unknown),
+        KindKwLoc(SourceLocation()) {}
+
+  /// \brief Sets the location of '('.
+  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
+  /// \brief Returns the location of '('.
+  SourceLocation getLParenLoc() const { return LParenLoc; }
+
+  /// \brief Returns kind of the clause.
+  OpenMPDefaultClauseKind getDefaultKind() const { return Kind; }
+
+  /// \brief Returns location of clause kind.
+  SourceLocation getDefaultKindKwLoc() const { return KindKwLoc; }
+
+  static bool classof(const OMPClause *T) {
+    return T->getClauseKind() == OMPC_default;
+  }
+
+  StmtRange children() { return StmtRange(); }
+};
+
+/// \brief This represents clause 'private' in the '#pragma omp ...' directives.
+///
+/// \code
+/// #pragma omp parallel private(a,b)
+/// \endcode
+/// In this example directive '#pragma omp parallel' has clause 'private'
+/// with the variables 'a' and 'b'.
+///
+class OMPPrivateClause : public OMPVarListClause {
+  /// \brief Build clause with number of variables \a N.
+  ///
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param EndLoc Ending location of the clause.
+  /// \param N Number of the variables in the clause.
+  ///
+  OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
+                   SourceLocation EndLoc, unsigned N)
+      : OMPVarListClause(OMPC_private, StartLoc, LParenLoc,
+                                           EndLoc, N) {}
+
+  /// \brief Build an empty clause.
+  ///
+  /// \param N Number of variables.
+  ///
+  explicit OMPPrivateClause(unsigned N)
+      : OMPVarListClause(OMPC_private, SourceLocation(),
+                                           SourceLocation(), SourceLocation(),
+                                           N) {}
+
+public:
+  /// \brief Creates clause with a list of variables \a VL.
+  ///
+  /// \param C AST context.
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param EndLoc Ending location of the clause.
+  /// \param VL List of references to the variables.
+  ///
+  static OMPPrivateClause *Create(const ASTContext &C, SourceLocation StartLoc,
+                                  SourceLocation LParenLoc,
+                                  SourceLocation EndLoc, ArrayRef VL);
+  /// \brief Creates an empty clause with the place for \a N variables.
+  ///
+  /// \param C AST context.
+  /// \param N The number of variables.
+  ///
+  static OMPPrivateClause *CreateEmpty(const ASTContext &C, unsigned N);
+
+  StmtRange children() {
+    return StmtRange(reinterpret_cast(varlist_begin()),
+                     reinterpret_cast(varlist_end()));
+  }
+
+  static bool classof(const OMPClause *T) {
+    return T->getClauseKind() == OMPC_private;
+  }
+};
+
+/// \brief This represents clause 'firstprivate' in the '#pragma omp ...'
+/// directives.
+///
+/// \code
+/// #pragma omp parallel firstprivate(a,b)
+/// \endcode
+/// In this example directive '#pragma omp parallel' has clause 'firstprivate'
+/// with the variables 'a' and 'b'.
+///
+class OMPFirstprivateClause : public OMPVarListClause {
+  /// \brief Build clause with number of variables \a N.
+  ///
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param EndLoc Ending location of the clause.
+  /// \param N Number of the variables in the clause.
+  ///
+  OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
+                        SourceLocation EndLoc, unsigned N)
+      : OMPVarListClause(OMPC_firstprivate, StartLoc,
+                                                LParenLoc, EndLoc, N) {}
+
+  /// \brief Build an empty clause.
+  ///
+  /// \param N Number of variables.
+  ///
+  explicit OMPFirstprivateClause(unsigned N)
+      : OMPVarListClause(
+            OMPC_firstprivate, SourceLocation(), SourceLocation(),
+            SourceLocation(), N) {}
+
+public:
+  /// \brief Creates clause with a list of variables \a VL.
+  ///
+  /// \param C AST context.
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param EndLoc Ending location of the clause.
+  /// \param VL List of references to the variables.
+  ///
+  static OMPFirstprivateClause *
+  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
+         SourceLocation EndLoc, ArrayRef VL);
+  /// \brief Creates an empty clause with the place for \a N variables.
+  ///
+  /// \param C AST context.
+  /// \param N The number of variables.
+  ///
+  static OMPFirstprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
+
+  StmtRange children() {
+    return StmtRange(reinterpret_cast(varlist_begin()),
+                     reinterpret_cast(varlist_end()));
+  }
+
+  static bool classof(const OMPClause *T) {
+    return T->getClauseKind() == OMPC_firstprivate;
+  }
+};
+
+/// \brief This represents clause 'shared' in the '#pragma omp ...' directives.
+///
+/// \code
+/// #pragma omp parallel shared(a,b)
+/// \endcode
+/// In this example directive '#pragma omp parallel' has clause 'shared'
+/// with the variables 'a' and 'b'.
+///
+class OMPSharedClause : public OMPVarListClause {
+  /// \brief Build clause with number of variables \a N.
+  ///
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param EndLoc Ending location of the clause.
+  /// \param N Number of the variables in the clause.
+  ///
+  OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
+                  SourceLocation EndLoc, unsigned N)
+      : OMPVarListClause(OMPC_shared, StartLoc, LParenLoc,
+                                          EndLoc, N) {}
+
+  /// \brief Build an empty clause.
+  ///
+  /// \param N Number of variables.
+  ///
+  explicit OMPSharedClause(unsigned N)
+      : OMPVarListClause(OMPC_shared, SourceLocation(),
+                                          SourceLocation(), SourceLocation(),
+                                          N) {}
+
+public:
+  /// \brief Creates clause with a list of variables \a VL.
+  ///
+  /// \param C AST context.
+  /// \param StartLoc Starting location of the clause.
+  /// \param LParenLoc Location of '('.
+  /// \param EndLoc Ending location of the clause.
+  /// \param VL List of references to the variables.
+  ///
+  static OMPSharedClause *Create(const ASTContext &C, SourceLocation StartLoc,
+                                 SourceLocation LParenLoc,
+                                 SourceLocation EndLoc, ArrayRef VL);
+  /// \brief Creates an empty clause with \a N variables.
+  ///
+  /// \param C AST context.
+  /// \param N The number of variables.
+  ///
+  static OMPSharedClause *CreateEmpty(const ASTContext &C, unsigned N);
+
+  StmtRange children() {
+    return StmtRange(reinterpret_cast(varlist_begin()),
+                     reinterpret_cast(varlist_end()));
+  }
+
+  static bool classof(const OMPClause *T) {
+    return T->getClauseKind() == OMPC_shared;
+  }
+};
+
+} // end namespace clang
+
+#endif
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/RecursiveASTVisitor.h b/external/bsd/llvm/dist/clang/include/clang/AST/RecursiveASTVisitor.h
index 75774451c8fb..8e3c9f724daf 100644
--- a/external/bsd/llvm/dist/clang/include/clang/AST/RecursiveASTVisitor.h
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/RecursiveASTVisitor.h
@@ -441,6 +441,7 @@ private:
   bool TraverseFunctionHelper(FunctionDecl *D);
   bool TraverseVarHelper(VarDecl *D);
   bool TraverseOMPClause(OMPClause *C);
+  bool TraverseOMPExecutableDirective(OMPExecutableDirective *S);
 #define OPENMP_CLAUSE(Name, Class)                                      \
   bool Visit##Class(Class *C);
 #include "clang/Basic/OpenMPKinds.def"
@@ -2355,11 +2356,22 @@ DEF_TRAVERSE_STMT(ObjCDictionaryLiteral, { })
 DEF_TRAVERSE_STMT(AsTypeExpr, { })
 
 // OpenMP directives.
-DEF_TRAVERSE_STMT(OMPParallelDirective, {
+template
+bool RecursiveASTVisitor::TraverseOMPExecutableDirective(
+                                           OMPExecutableDirective *S) {
   ArrayRef Clauses = S->clauses();
   for (ArrayRef::iterator I = Clauses.begin(), E = Clauses.end();
        I != E; ++I)
     if (!TraverseOMPClause(*I)) return false;
+  return true;
+}
+
+DEF_TRAVERSE_STMT(OMPParallelDirective, {
+  if (!TraverseOMPExecutableDirective(S)) return false;
+})
+
+DEF_TRAVERSE_STMT(OMPSimdDirective, {
+  if (!TraverseOMPExecutableDirective(S)) return false;
 })
 
 // OpenMP clauses.
@@ -2376,6 +2388,12 @@ bool RecursiveASTVisitor::TraverseOMPClause(OMPClause *C) {
   return true;
 }
 
+template
+bool RecursiveASTVisitor::VisitOMPIfClause(OMPIfClause *C) {
+  TraverseStmt(C->getCondition());
+  return true;
+}
+
 template
 bool RecursiveASTVisitor::VisitOMPDefaultClause(OMPDefaultClause *C) {
   return true;
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/StmtOpenMP.h b/external/bsd/llvm/dist/clang/include/clang/AST/StmtOpenMP.h
index 5ed5f25023b9..5e1a04b042dd 100644
--- a/external/bsd/llvm/dist/clang/include/clang/AST/StmtOpenMP.h
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/StmtOpenMP.h
@@ -1,4 +1,4 @@
-//===- StmtOpenMP.h - Classes for OpenMP directives and clauses --*- C++ -*-===//
+//===- StmtOpenMP.h - Classes for OpenMP directives  ------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -16,357 +16,13 @@
 #define LLVM_CLANG_AST_STMTOPENMP_H
 
 #include "clang/AST/Expr.h"
+#include "clang/AST/OpenMPClause.h"
 #include "clang/AST/Stmt.h"
 #include "clang/Basic/OpenMPKinds.h"
 #include "clang/Basic/SourceLocation.h"
 
 namespace clang {
 
-//===----------------------------------------------------------------------===//
-// AST classes for clauses.
-//===----------------------------------------------------------------------===//
-
-/// \brief This is a basic class for representing single OpenMP clause.
-///
-class OMPClause {
-  /// \brief Starting location of the clause (the clause keyword).
-  SourceLocation StartLoc;
-  /// \brief Ending location of the clause.
-  SourceLocation EndLoc;
-  /// \brief Kind of the clause.
-  OpenMPClauseKind Kind;
-protected:
-  OMPClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
-    : StartLoc(StartLoc), EndLoc(EndLoc), Kind(K) {}
-
-public:
-
-  /// \brief Returns the starting location of the clause.
-  SourceLocation getLocStart() const { return StartLoc; }
-  /// \brief Returns the ending location of the clause.
-  SourceLocation getLocEnd() const { return EndLoc; }
-
-  /// \brief Sets the starting location of the clause.
-  void setLocStart(SourceLocation Loc) { StartLoc = Loc; }
-  /// \brief Sets the ending location of the clause.
-  void setLocEnd(SourceLocation Loc) { EndLoc = Loc; }
-
-  /// \brief Returns kind of OpenMP clause (private, shared, reduction, etc.).
-  OpenMPClauseKind getClauseKind() const { return Kind; }
-
-  bool isImplicit() const { return StartLoc.isInvalid();}
-
-  StmtRange children();
-  ConstStmtRange children() const {
-    return const_cast(this)->children();
-  }
-  static bool classof(const OMPClause *T) {
-    return true;
-  }
-};
-
-/// \brief This represents clauses with the list of variables like 'private',
-/// 'firstprivate', 'copyin', 'shared', or 'reduction' clauses in the
-/// '#pragma omp ...' directives.
-template 
-class OMPVarList {
-  friend class OMPClauseReader;
-  /// \brief Location of '('.
-  SourceLocation LParenLoc;
-  /// \brief Number of variables in the list.
-  unsigned NumVars;
-protected:
-  /// \brief Fetches list of variables associated with this clause.
-  llvm::MutableArrayRef getVarRefs() {
-    return llvm::MutableArrayRef(
-                         reinterpret_cast(static_cast(this) + 1),
-                         NumVars);
-  }
-
-  /// \brief Sets the list of variables for this clause.
-  void setVarRefs(ArrayRef VL) {
-    assert(VL.size() == NumVars &&
-           "Number of variables is not the same as the preallocated buffer");
-    std::copy(VL.begin(), VL.end(),
-              reinterpret_cast(static_cast(this) + 1));
-  }
-
-  /// \brief Build clause with number of variables \a N.
-  ///
-  /// \param N Number of the variables in the clause.
-  ///
-  OMPVarList(SourceLocation LParenLoc, unsigned N)
-    : LParenLoc(LParenLoc), NumVars(N) { }
-public:
-  typedef llvm::MutableArrayRef::iterator varlist_iterator;
-  typedef ArrayRef::iterator varlist_const_iterator;
-
-  unsigned varlist_size() const { return NumVars; }
-  bool varlist_empty() const { return NumVars == 0; }
-  varlist_iterator varlist_begin() { return getVarRefs().begin(); }
-  varlist_iterator varlist_end() { return getVarRefs().end(); }
-  varlist_const_iterator varlist_begin() const { return getVarRefs().begin(); }
-  varlist_const_iterator varlist_end() const { return getVarRefs().end(); }
-
-  /// \brief Sets the location of '('.
-  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
-  /// \brief Returns the location of '('.
-  SourceLocation getLParenLoc() const { return LParenLoc; }
-
-  /// \brief Fetches list of all variables in the clause.
-  ArrayRef getVarRefs() const {
-    return ArrayRef(
-       reinterpret_cast(static_cast(this) + 1),
-       NumVars);
-  }
-};
-
-/// \brief This represents 'default' clause in the '#pragma omp ...' directive.
-///
-/// \code
-/// #pragma omp parallel default(shared)
-/// \endcode
-/// In this example directive '#pragma omp parallel' has simple 'default'
-/// clause with kind 'shared'.
-///
-class OMPDefaultClause : public OMPClause {
-  friend class OMPClauseReader;
-  /// \brief Location of '('.
-  SourceLocation LParenLoc;
-  /// \brief A kind of the 'default' clause.
-  OpenMPDefaultClauseKind Kind;
-  /// \brief Start location of the kind in source code.
-  SourceLocation KindKwLoc;
-
-  /// \brief Set kind of the clauses.
-  ///
-  /// \param K Argument of clause.
-  ///
-  void setDefaultKind(OpenMPDefaultClauseKind K) { Kind = K; }
-
-  /// \brief Set argument location.
-  ///
-  /// \param KLoc Argument location.
-  ///
-  void setDefaultKindKwLoc(SourceLocation KLoc) { KindKwLoc = KLoc; }
-public:
-  /// \brief Build 'default' clause with argument \a A ('none' or 'shared').
-  ///
-  /// \param A Argument of the clause ('none' or 'shared').
-  /// \param ALoc Starting location of the argument.
-  /// \param StartLoc Starting location of the clause.
-  /// \param LParenLoc Location of '('.
-  /// \param EndLoc Ending location of the clause.
-  ///
-  OMPDefaultClause(OpenMPDefaultClauseKind A, SourceLocation ALoc,
-                   SourceLocation StartLoc, SourceLocation LParenLoc,
-                   SourceLocation EndLoc)
-    : OMPClause(OMPC_default, StartLoc, EndLoc), LParenLoc(LParenLoc),
-      Kind(A), KindKwLoc(ALoc) { }
-
-  /// \brief Build an empty clause.
-  ///
-  OMPDefaultClause()
-    : OMPClause(OMPC_default, SourceLocation(), SourceLocation()),
-      LParenLoc(SourceLocation()), Kind(OMPC_DEFAULT_unknown),
-      KindKwLoc(SourceLocation()) { }
-
-  /// \brief Sets the location of '('.
-  void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
-  /// \brief Returns the location of '('.
-  SourceLocation getLParenLoc() const { return LParenLoc; }
-
-  /// \brief Returns kind of the clause.
-  OpenMPDefaultClauseKind getDefaultKind() const { return Kind; }
-
-  /// \brief Returns location of clause kind.
-  SourceLocation getDefaultKindKwLoc() const { return KindKwLoc; }
-
-  static bool classof(const OMPClause *T) {
-    return T->getClauseKind() == OMPC_default;
-  }
-
-  StmtRange children() {
-    return StmtRange();
-  }
-};
-
-/// \brief This represents clause 'private' in the '#pragma omp ...' directives.
-///
-/// \code
-/// #pragma omp parallel private(a,b)
-/// \endcode
-/// In this example directive '#pragma omp parallel' has clause 'private'
-/// with the variables 'a' and 'b'.
-///
-class OMPPrivateClause : public OMPClause, public OMPVarList {
-  /// \brief Build clause with number of variables \a N.
-  ///
-  /// \param StartLoc Starting location of the clause.
-  /// \param LParenLoc Location of '('.
-  /// \param EndLoc Ending location of the clause.
-  /// \param N Number of the variables in the clause.
-  ///
-  OMPPrivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
-                   SourceLocation EndLoc, unsigned N)
-    : OMPClause(OMPC_private, StartLoc, EndLoc),
-      OMPVarList(LParenLoc, N) { }
-
-  /// \brief Build an empty clause.
-  ///
-  /// \param N Number of variables.
-  ///
-  explicit OMPPrivateClause(unsigned N)
-    : OMPClause(OMPC_private, SourceLocation(), SourceLocation()),
-      OMPVarList(SourceLocation(), N) { }
-public:
-  /// \brief Creates clause with a list of variables \a VL.
-  ///
-  /// \param C AST context.
-  /// \param StartLoc Starting location of the clause.
-  /// \param LParenLoc Location of '('.
-  /// \param EndLoc Ending location of the clause.
-  /// \param VL List of references to the variables.
-  ///
-  static OMPPrivateClause *Create(const ASTContext &C, SourceLocation StartLoc,
-                                  SourceLocation LParenLoc,
-                                  SourceLocation EndLoc,
-                                  ArrayRef VL);
-  /// \brief Creates an empty clause with the place for \a N variables.
-  ///
-  /// \param C AST context.
-  /// \param N The number of variables.
-  ///
-  static OMPPrivateClause *CreateEmpty(const ASTContext &C, unsigned N);
-
-  StmtRange children() {
-    return StmtRange(reinterpret_cast(varlist_begin()),
-                     reinterpret_cast(varlist_end()));
-  }
-
-  static bool classof(const OMPClause *T) {
-    return T->getClauseKind() == OMPC_private;
-  }
-};
-
-/// \brief This represents clause 'firstprivate' in the '#pragma omp ...'
-/// directives.
-///
-/// \code
-/// #pragma omp parallel firstprivate(a,b)
-/// \endcode
-/// In this example directive '#pragma omp parallel' has clause 'firstprivate'
-/// with the variables 'a' and 'b'.
-///
-class OMPFirstprivateClause : public OMPClause,
-                              public OMPVarList {
-  /// \brief Build clause with number of variables \a N.
-  ///
-  /// \param StartLoc Starting location of the clause.
-  /// \param LParenLoc Location of '('.
-  /// \param EndLoc Ending location of the clause.
-  /// \param N Number of the variables in the clause.
-  ///
-  OMPFirstprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc,
-                   SourceLocation EndLoc, unsigned N)
-    : OMPClause(OMPC_firstprivate, StartLoc, EndLoc),
-      OMPVarList(LParenLoc, N) { }
-
-  /// \brief Build an empty clause.
-  ///
-  /// \param N Number of variables.
-  ///
-  explicit OMPFirstprivateClause(unsigned N)
-    : OMPClause(OMPC_firstprivate, SourceLocation(), SourceLocation()),
-      OMPVarList(SourceLocation(), N) { }
-public:
-  /// \brief Creates clause with a list of variables \a VL.
-  ///
-  /// \param C AST context.
-  /// \param StartLoc Starting location of the clause.
-  /// \param LParenLoc Location of '('.
-  /// \param EndLoc Ending location of the clause.
-  /// \param VL List of references to the variables.
-  ///
-  static OMPFirstprivateClause *Create(const ASTContext &C,
-                                       SourceLocation StartLoc,
-                                       SourceLocation LParenLoc,
-                                       SourceLocation EndLoc,
-                                       ArrayRef VL);
-  /// \brief Creates an empty clause with the place for \a N variables.
-  ///
-  /// \param C AST context.
-  /// \param N The number of variables.
-  ///
-  static OMPFirstprivateClause *CreateEmpty(const ASTContext &C, unsigned N);
-
-  StmtRange children() {
-    return StmtRange(reinterpret_cast(varlist_begin()),
-                     reinterpret_cast(varlist_end()));
-  }
-
-  static bool classof(const OMPClause *T) {
-    return T->getClauseKind() == OMPC_firstprivate;
-  }
-};
-
-/// \brief This represents clause 'shared' in the '#pragma omp ...' directives.
-///
-/// \code
-/// #pragma omp parallel shared(a,b)
-/// \endcode
-/// In this example directive '#pragma omp parallel' has clause 'shared'
-/// with the variables 'a' and 'b'.
-///
-class OMPSharedClause : public OMPClause, public OMPVarList {
-  /// \brief Build clause with number of variables \a N.
-  ///
-  /// \param StartLoc Starting location of the clause.
-  /// \param LParenLoc Location of '('.
-  /// \param EndLoc Ending location of the clause.
-  /// \param N Number of the variables in the clause.
-  ///
-  OMPSharedClause(SourceLocation StartLoc, SourceLocation LParenLoc,
-                  SourceLocation EndLoc, unsigned N)
-    : OMPClause(OMPC_shared, StartLoc, EndLoc),
-      OMPVarList(LParenLoc, N) { }
-
-  /// \brief Build an empty clause.
-  ///
-  /// \param N Number of variables.
-  ///
-  explicit OMPSharedClause(unsigned N)
-    : OMPClause(OMPC_shared, SourceLocation(), SourceLocation()),
-      OMPVarList(SourceLocation(), N) { }
-public:
-  /// \brief Creates clause with a list of variables \a VL.
-  ///
-  /// \param C AST context.
-  /// \param StartLoc Starting location of the clause.
-  /// \param LParenLoc Location of '('.
-  /// \param EndLoc Ending location of the clause.
-  /// \param VL List of references to the variables.
-  ///
-  static OMPSharedClause *Create(const ASTContext &C, SourceLocation StartLoc,
-                                 SourceLocation LParenLoc,
-                                 SourceLocation EndLoc, ArrayRef VL);
-  /// \brief Creates an empty clause with \a N variables.
-  ///
-  /// \param C AST context.
-  /// \param N The number of variables.
-  ///
-  static OMPSharedClause *CreateEmpty(const ASTContext &C, unsigned N);
-
-  StmtRange children() {
-    return StmtRange(reinterpret_cast(varlist_begin()),
-                     reinterpret_cast(varlist_end()));
-  }
-
-  static bool classof(const OMPClause *T) {
-    return T->getClauseKind() == OMPC_shared;
-  }
-};
-
 //===----------------------------------------------------------------------===//
 // AST classes for directives.
 //===----------------------------------------------------------------------===//
@@ -386,6 +42,7 @@ class OMPExecutableDirective : public Stmt {
   llvm::MutableArrayRef Clauses;
   /// \brief Associated statement (if any) and expressions.
   llvm::MutableArrayRef StmtAndExpressions;
+
 protected:
   /// \brief Build instance of directive of class \a K.
   ///
@@ -398,11 +55,14 @@ protected:
   OMPExecutableDirective(const T *, StmtClass SC, OpenMPDirectiveKind K,
                          SourceLocation StartLoc, SourceLocation EndLoc,
                          unsigned NumClauses, unsigned NumberOfExpressions)
-    : Stmt(SC), Kind(K), StartLoc(StartLoc), EndLoc(EndLoc),
-      Clauses(reinterpret_cast(static_cast(this) + 1),
-              NumClauses),
-      StmtAndExpressions(reinterpret_cast(Clauses.end()),
-                         NumberOfExpressions) { }
+      : Stmt(SC), Kind(K), StartLoc(StartLoc), EndLoc(EndLoc),
+        Clauses(reinterpret_cast(
+                    reinterpret_cast(this) +
+                    llvm::RoundUpToAlignment(sizeof(T),
+                                             llvm::alignOf())),
+                NumClauses),
+        StmtAndExpressions(reinterpret_cast(Clauses.end()),
+                           NumberOfExpressions) {}
 
   /// \brief Sets the list of variables for this clause.
   ///
@@ -414,9 +74,7 @@ protected:
   ///
   /// /param S Associated statement.
   ///
-  void setAssociatedStmt(Stmt *S) {
-    StmtAndExpressions[0] = S;
-  }
+  void setAssociatedStmt(Stmt *S) { StmtAndExpressions[0] = S; }
 
 public:
   /// \brief Returns starting location of directive kind.
@@ -448,9 +106,7 @@ public:
   }
 
   /// \brief Returns statement associated with the directive.
-  Stmt *getAssociatedStmt() const {
-    return StmtAndExpressions[0];
-  }
+  Stmt *getAssociatedStmt() const { return StmtAndExpressions[0]; }
 
   OpenMPDirectiveKind getDirectiveKind() const { return Kind; }
 
@@ -484,17 +140,19 @@ class OMPParallelDirective : public OMPExecutableDirective {
   /// \param EndLoc Ending Location of the directive.
   ///
   OMPParallelDirective(SourceLocation StartLoc, SourceLocation EndLoc,
-                       unsigned N)
-    : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
-                             StartLoc, EndLoc, N, 1) { }
+                       unsigned NumClauses)
+      : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
+                               StartLoc, EndLoc, NumClauses, 1) {}
 
   /// \brief Build an empty directive.
   ///
-  /// \param N Number of clauses.
+  /// \param NumClauses Number of clauses.
   ///
-  explicit OMPParallelDirective(unsigned N)
-    : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
-                             SourceLocation(), SourceLocation(), N, 1) { }
+  explicit OMPParallelDirective(unsigned NumClauses)
+      : OMPExecutableDirective(this, OMPParallelDirectiveClass, OMPD_parallel,
+                               SourceLocation(), SourceLocation(),
+                               NumClauses, 1) {}
+
 public:
   /// \brief Creates directive with a list of \a Clauses.
   ///
@@ -504,18 +162,17 @@ public:
   /// \param Clauses List of clauses.
   /// \param AssociatedStmt Statement associated with the directive.
   ///
-  static OMPParallelDirective *Create(const ASTContext &C,
-                                      SourceLocation StartLoc,
-                                      SourceLocation EndLoc,
-                                      ArrayRef Clauses,
-                                      Stmt *AssociatedStmt);
+  static OMPParallelDirective *
+  Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
+         ArrayRef Clauses, Stmt *AssociatedStmt);
 
   /// \brief Creates an empty directive with the place for \a N clauses.
   ///
   /// \param C AST context.
-  /// \param N The number of clauses.
+  /// \param NumClauses Number of clauses.
   ///
-  static OMPParallelDirective *CreateEmpty(const ASTContext &C, unsigned N,
+  static OMPParallelDirective *CreateEmpty(const ASTContext &C,
+                                           unsigned NumClauses,
                                            EmptyShell);
 
   static bool classof(const Stmt *T) {
@@ -523,6 +180,76 @@ public:
   }
 };
 
-}  // end namespace clang
+/// \brief This represents '#pragma omp simd' directive.
+///
+/// \code
+/// #pragma omp simd private(a,b) linear(i,j:s) reduction(+:c,d)
+/// \endcode
+/// In this example directive '#pragma omp simd' has clauses 'private'
+/// with the variables 'a' and 'b', 'linear' with variables 'i', 'j' and
+/// linear step 's', 'reduction' with operator '+' and variables 'c' and 'd'.
+///
+class OMPSimdDirective : public OMPExecutableDirective {
+  friend class ASTStmtReader;
+  /// \brief Number of collapsed loops as specified by 'collapse' clause.
+  unsigned CollapsedNum;
+  /// \brief Build directive with the given start and end location.
+  ///
+  /// \param StartLoc Starting location of the directive kind.
+  /// \param EndLoc Ending location of the directive.
+  /// \param CollapsedNum Number of collapsed nested loops.
+  /// \param NumClauses Number of clauses.
+  ///
+  OMPSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc,
+                  unsigned CollapsedNum, unsigned NumClauses)
+    : OMPExecutableDirective(this, OMPSimdDirectiveClass, OMPD_simd,
+                             StartLoc, EndLoc, NumClauses, 1),
+      CollapsedNum(CollapsedNum) { }
+
+  /// \brief Build an empty directive.
+  ///
+  /// \param CollapsedNum Number of collapsed nested loops.
+  /// \param NumClauses Number of clauses.
+  ///
+  explicit OMPSimdDirective(unsigned CollapsedNum, unsigned NumClauses)
+    : OMPExecutableDirective(this, OMPSimdDirectiveClass, OMPD_simd,
+                             SourceLocation(), SourceLocation(),
+                             NumClauses, 1),
+                             CollapsedNum(CollapsedNum) { }
+public:
+  /// \brief Creates directive with a list of \a Clauses.
+  ///
+  /// \param C AST context.
+  /// \param StartLoc Starting location of the directive kind.
+  /// \param EndLoc Ending Location of the directive.
+  /// \param Clauses List of clauses.
+  /// \param AssociatedStmt Statement, associated with the directive.
+  ///
+  static OMPSimdDirective *Create(const ASTContext &C,
+                                  SourceLocation StartLoc,
+                                  SourceLocation EndLoc,
+                                  ArrayRef Clauses,
+                                  Stmt *AssociatedStmt);
+
+  /// \brief Creates an empty directive with the place
+  /// for \a NumClauses clauses.
+  ///
+  /// \param C AST context.
+  /// \param CollapsedNum Number of collapsed nested loops.
+  /// \param NumClauses Number of clauses.
+  ///
+  static OMPSimdDirective *CreateEmpty(const ASTContext &C,
+                                       unsigned NumClauses,
+                                       unsigned CollapsedNum,
+                                       EmptyShell);
+
+  unsigned getCollapsedNumber() const { return CollapsedNum; }
+
+  static bool classof(const Stmt *T) {
+    return T->getStmtClass() == OMPSimdDirectiveClass;
+  }
+};
+
+} // end namespace clang
 
 #endif
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/TemplateBase.h b/external/bsd/llvm/dist/clang/include/clang/AST/TemplateBase.h
index 6c40eb1168ce..7810c306dd9d 100644
--- a/external/bsd/llvm/dist/clang/include/clang/AST/TemplateBase.h
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/TemplateBase.h
@@ -34,8 +34,7 @@ struct PrintingPolicy;
 class TypeSourceInfo;
 class ValueDecl;
 
-/// \brief Represents a template argument within a class template
-/// specialization.
+/// \brief Represents a template argument.
 class TemplateArgument {
 public:
   /// \brief The kind of template argument we're storing.
@@ -52,16 +51,19 @@ public:
     /// was provided for a non-type template parameter.
     NullPtr,
     /// The template argument is an integral value stored in an llvm::APSInt
-    /// that was provided for an integral non-type template parameter. 
+    /// that was provided for an integral non-type template parameter.
     Integral,
-    /// The template argument is a template name that was provided for a 
+    /// The template argument is a template name that was provided for a
     /// template template parameter.
     Template,
-    /// The template argument is a pack expansion of a template name that was 
+    /// The template argument is a pack expansion of a template name that was
     /// provided for a template template parameter.
     TemplateExpansion,
-    /// The template argument is a value- or type-dependent expression or a
-    /// non-dependent __uuidof expression stored in an Expr*.
+    /// The template argument is an expression, and we've not resolved it to one
+    /// of the other forms yet, either because it's dependent or because we're
+    /// representing a non-canonical template argument (for instance, in a
+    /// TemplateSpecializationType). Also used to represent a non-dependent
+    /// __uuidof expression (a Microsoft extension).
     Expression,
     /// The template argument is actually a parameter pack. Arguments are stored
     /// in the Args struct.
diff --git a/external/bsd/llvm/dist/clang/include/clang/AST/VTableBuilder.h b/external/bsd/llvm/dist/clang/include/clang/AST/VTableBuilder.h
index 223aad2e4b00..b1acad3200b2 100644
--- a/external/bsd/llvm/dist/clang/include/clang/AST/VTableBuilder.h
+++ b/external/bsd/llvm/dist/clang/include/clang/AST/VTableBuilder.h
@@ -366,76 +366,37 @@ public:
   }
 };
 
-struct VFPtrInfo {
+/// Holds information about the inheritance path to a virtual base or function
+/// table pointer.  A record may contain as many vfptrs or vbptrs as there are
+/// base subobjects.
+struct VPtrInfo {
   typedef SmallVector BasePath;
 
-  // Don't pass the PathToMangle as it should be calculated later.
-  VFPtrInfo(CharUnits VFPtrOffset, const BasePath &PathToBaseWithVFPtr)
-      : VBTableIndex(0), LastVBase(0), VFPtrOffset(VFPtrOffset),
-        PathToBaseWithVFPtr(PathToBaseWithVFPtr), VFPtrFullOffset(VFPtrOffset) {
-  }
-
-  // Don't pass the PathToMangle as it should be calculated later.
-  VFPtrInfo(uint64_t VBTableIndex, const CXXRecordDecl *LastVBase,
-            CharUnits VFPtrOffset, const BasePath &PathToBaseWithVFPtr,
-            CharUnits VFPtrFullOffset)
-      : VBTableIndex(VBTableIndex), LastVBase(LastVBase),
-        VFPtrOffset(VFPtrOffset), PathToBaseWithVFPtr(PathToBaseWithVFPtr),
-        VFPtrFullOffset(VFPtrFullOffset) {
-    assert(VBTableIndex && "The full constructor should only be used "
-                           "for vfptrs in virtual bases");
-    assert(LastVBase);
-  }
-
-  /// If nonzero, holds the vbtable index of the virtual base with the vfptr.
-  uint64_t VBTableIndex;
-
-  /// Stores the last vbase on the path from the complete type to the vfptr.
-  const CXXRecordDecl *LastVBase;
-
-  /// This is the offset of the vfptr from the start of the last vbase,
-  /// or the complete type if there are no virtual bases.
-  CharUnits VFPtrOffset;
-
-  /// This holds the base classes path from the complete type to the first base
-  /// with the given vfptr offset, in the base-to-derived order.
-  BasePath PathToBaseWithVFPtr;
-
-  /// This holds the subset of records that need to be mangled into the vftable
-  /// symbol name in order to get a unique name, in the derived-to-base order.
-  BasePath PathToMangle;
-
-  /// This is the full offset of the vfptr from the start of the complete type.
-  CharUnits VFPtrFullOffset;
-};
-
-/// Holds information for a virtual base table for a single subobject.  A record
-/// may contain as many vbptrs as there are base subobjects.
-struct VBTableInfo {
-  VBTableInfo(const CXXRecordDecl *RD)
-      : ReusingBase(RD), BaseWithVBPtr(RD), NextBaseToMangle(RD) {}
+  VPtrInfo(const CXXRecordDecl *RD)
+      : ReusingBase(RD), BaseWithVPtr(RD), NextBaseToMangle(RD) {}
 
   // Copy constructor.
   // FIXME: Uncomment when we've moved to C++11.
-  //VBTableInfo(const VBTableInfo &) = default;
+  // VPtrInfo(const VPtrInfo &) = default;
 
-  /// The vbtable will hold all of the virtual bases of ReusingBase.  This may
-  /// or may not be the same class as VBPtrSubobject.Base.  A derived class will
-  /// reuse the vbptr of the first non-virtual base subobject that has one.
+  /// The vtable will hold all of the virtual bases or virtual methods of
+  /// ReusingBase.  This may or may not be the same class as VPtrSubobject.Base.
+  /// A derived class will reuse the vptr of the first non-virtual base
+  /// subobject that has one.
   const CXXRecordDecl *ReusingBase;
 
-  /// BaseWithVBPtr is at this offset from its containing complete object or
+  /// BaseWithVPtr is at this offset from its containing complete object or
   /// virtual base.
   CharUnits NonVirtualOffset;
 
-  /// The vbptr is stored inside this subobject.
-  const CXXRecordDecl *BaseWithVBPtr;
+  /// The vptr is stored inside this subobject.
+  const CXXRecordDecl *BaseWithVPtr;
 
   /// The bases from the inheritance path that got used to mangle the vbtable
   /// name.  This is not really a full path like a CXXBasePath.  It holds the
   /// subset of records that need to be mangled into the vbtable symbol name in
   /// order to get a unique name.
-  SmallVector MangledPath;
+  BasePath MangledPath;
 
   /// The next base to push onto the mangled path if this path is ambiguous in a
   /// derived class.  If it's null, then it's already been pushed onto the path.
@@ -443,22 +404,31 @@ struct VBTableInfo {
 
   /// The set of possibly indirect vbases that contain this vbtable.  When a
   /// derived class indirectly inherits from the same vbase twice, we only keep
-  /// vbtables and their paths from the first instance.
-  SmallVector ContainingVBases;
+  /// vtables and their paths from the first instance.
+  BasePath ContainingVBases;
 
-  /// The vbptr is stored inside the non-virtual component of this virtual base.
-  const CXXRecordDecl *getVBaseWithVBPtr() const {
+  /// This holds the base classes path from the complete type to the first base
+  /// with the given vfptr offset, in the base-to-derived order.  Only used for
+  /// vftables.
+  BasePath PathToBaseWithVPtr;
+
+  /// Static offset from the top of the most derived class to this vfptr,
+  /// including any virtual base offset.  Only used for vftables.
+  CharUnits FullOffsetInMDC;
+
+  /// The vptr is stored inside the non-virtual component of this virtual base.
+  const CXXRecordDecl *getVBaseWithVPtr() const {
     return ContainingVBases.empty() ? 0 : ContainingVBases.front();
   }
 };
 
-typedef SmallVector VBTableVector;
+typedef SmallVector VPtrInfoVector;
 
 /// All virtual base related information about a given record decl.  Includes
 /// information on all virtual base tables and the path components that are used
 /// to mangle them.
 struct VirtualBaseInfo {
-  ~VirtualBaseInfo() { llvm::DeleteContainerPointers(VBTables); }
+  ~VirtualBaseInfo() { llvm::DeleteContainerPointers(VBPtrPaths); }
 
   /// A map from virtual base to vbtable index for doing a conversion from the
   /// the derived class to the a base.
@@ -466,7 +436,7 @@ struct VirtualBaseInfo {
 
   /// Information on all virtual base tables used when this record is the most
   /// derived class.
-  VBTableVector VBTables;
+  VPtrInfoVector VBPtrPaths;
 };
 
 class MicrosoftVTableContext : public VTableContextBase {
@@ -508,8 +478,6 @@ public:
     }
   };
 
-  typedef SmallVector VFPtrListTy;
-
 private:
   ASTContext &Context;
 
@@ -517,7 +485,7 @@ private:
     MethodVFTableLocationsTy;
   MethodVFTableLocationsTy MethodVFTableLocations;
 
-  typedef llvm::DenseMap
+  typedef llvm::DenseMap
     VFPtrLocationsMapTy;
   VFPtrLocationsMapTy VFPtrLocations;
 
@@ -527,16 +495,7 @@ private:
 
   llvm::DenseMap VBaseInfo;
 
-  typedef llvm::SmallSetVector BasesSetVectorTy;
-  void enumerateVFPtrs(const CXXRecordDecl *MostDerivedClass,
-                       const ASTRecordLayout &MostDerivedClassLayout,
-                       BaseSubobject Base, const CXXRecordDecl *LastVBase,
-                       const VFPtrInfo::BasePath &PathFromCompleteClass,
-                       BasesSetVectorTy &VisitedVBases,
-                       MicrosoftVTableContext::VFPtrListTy &Result);
-
-  void enumerateVFPtrs(const CXXRecordDecl *ForClass,
-                       MicrosoftVTableContext::VFPtrListTy &Result);
+  void enumerateVFPtrs(const CXXRecordDecl *ForClass, VPtrInfoVector &Result);
 
   void computeVTableRelatedInformation(const CXXRecordDecl *RD);
 
@@ -547,7 +506,8 @@ private:
   const VirtualBaseInfo *
   computeVBTableRelatedInformation(const CXXRecordDecl *RD);
 
-  void computeVBTablePaths(const CXXRecordDecl *RD, VBTableVector &Paths);
+  void computeVTablePaths(bool ForVBTables, const CXXRecordDecl *RD,
+                          VPtrInfoVector &Paths);
 
 public:
   MicrosoftVTableContext(ASTContext &Context)
@@ -555,7 +515,7 @@ public:
 
   ~MicrosoftVTableContext();
 
-  const VFPtrListTy &getVFPtrOffsets(const CXXRecordDecl *RD);
+  const VPtrInfoVector &getVFPtrOffsets(const CXXRecordDecl *RD);
 
   const VTableLayout &getVFTableLayout(const CXXRecordDecl *RD,
                                        CharUnits VFPtrOffset);
@@ -577,7 +537,7 @@ public:
   unsigned getVBTableIndex(const CXXRecordDecl *Derived,
                            const CXXRecordDecl *VBase);
 
-  const VBTableVector &enumerateVBTables(const CXXRecordDecl *RD);
+  const VPtrInfoVector &enumerateVBTables(const CXXRecordDecl *RD);
 
   static bool classof(const VTableContextBase *VT) { return VT->isMicrosoft(); }
 };
diff --git a/external/bsd/llvm/dist/clang/include/clang/ASTMatchers/ASTMatchers.h b/external/bsd/llvm/dist/clang/include/clang/ASTMatchers/ASTMatchers.h
index 5355a9a85786..81faa922ed2a 100644
--- a/external/bsd/llvm/dist/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/external/bsd/llvm/dist/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -323,9 +323,13 @@ AST_MATCHER(Decl, isPrivate) {
 /// classTemplateSpecializationDecl(hasAnyTemplateArgument(
 ///     refersToType(asString("int"))))
 ///   matches the specialization \c A
-AST_MATCHER_P(ClassTemplateSpecializationDecl, hasAnyTemplateArgument,
-              internal::Matcher, InnerMatcher) {
-  llvm::ArrayRef List = Node.getTemplateArgs().asArray();
+AST_POLYMORPHIC_MATCHER_P(
+    hasAnyTemplateArgument,
+    AST_POLYMORPHIC_SUPPORTED_TYPES_2(ClassTemplateSpecializationDecl,
+                                      TemplateSpecializationType),
+    internal::Matcher, InnerMatcher) {
+  llvm::ArrayRef List =
+      internal::getTemplateSpecializationArgs(Node);
   return matchesFirstInRange(InnerMatcher, List.begin(), List.end(), Finder,
                              Builder);
 }
@@ -419,12 +423,16 @@ AST_MATCHER_P(Expr, ignoringParenImpCasts,
 /// classTemplateSpecializationDecl(hasTemplateArgument(
 ///     1, refersToType(asString("int"))))
 ///   matches the specialization \c A
-AST_MATCHER_P2(ClassTemplateSpecializationDecl, hasTemplateArgument,
-               unsigned, N, internal::Matcher, InnerMatcher) {
-  const TemplateArgumentList &List = Node.getTemplateArgs();
+AST_POLYMORPHIC_MATCHER_P2(
+    hasTemplateArgument,
+    AST_POLYMORPHIC_SUPPORTED_TYPES_2(ClassTemplateSpecializationDecl,
+                                      TemplateSpecializationType),
+    unsigned, N, internal::Matcher, InnerMatcher) {
+  llvm::ArrayRef List =
+      internal::getTemplateSpecializationArgs(Node);
   if (List.size() <= N)
     return false;
-  return InnerMatcher.matches(List.get(N), Finder, Builder);
+  return InnerMatcher.matches(List[N], Finder, Builder);
 }
 
 /// \brief Matches a TemplateArgument that refers to a certain type.
@@ -445,7 +453,8 @@ AST_MATCHER_P(TemplateArgument, refersToType,
   return InnerMatcher.matches(Node.getAsType(), Finder, Builder);
 }
 
-/// \brief Matches a TemplateArgument that refers to a certain declaration.
+/// \brief Matches a canonical TemplateArgument that refers to a certain
+/// declaration.
 ///
 /// Given
 /// \code
@@ -464,6 +473,24 @@ AST_MATCHER_P(TemplateArgument, refersToDeclaration,
   return false;
 }
 
+/// \brief Matches a sugar TemplateArgument that refers to a certain expression.
+///
+/// Given
+/// \code
+///   template struct A {};
+///   struct B { B* next; };
+///   A<&B::next> a;
+/// \endcode
+/// templateSpecializationType(hasAnyTemplateArgument(
+///   isExpr(hasDescendant(declRefExpr(to(fieldDecl(hasName("next"))))))))
+///   matches the specialization \c A<&B::next> with \c fieldDecl(...) matching
+///     \c B::next
+AST_MATCHER_P(TemplateArgument, isExpr, internal::Matcher, InnerMatcher) {
+  if (Node.getKind() == TemplateArgument::Expression)
+    return InnerMatcher.matches(*Node.getAsExpr(), Finder, Builder);
+  return false;
+}
+
 /// \brief Matches C++ constructor declarations.
 ///
 /// Example matches Foo::Foo() and Foo::Foo(int)
@@ -518,7 +545,7 @@ const internal::VariadicDynCastAllOfMatcher<
 ///
 /// Example matches y
 /// \code
-///   class X { void y() };
+///   class X { void y(); };
 /// \endcode
 const internal::VariadicDynCastAllOfMatcher methodDecl;
 
@@ -2283,16 +2310,6 @@ AST_POLYMORPHIC_MATCHER_P(
           InnerMatcher.matches(*Condition, Finder, Builder));
 }
 
-namespace internal {
-struct NotEqualsBoundNodePredicate {
-  bool operator()(const internal::BoundNodesMap &Nodes) const {
-    return Nodes.getNode(ID) != Node;
-  }
-  std::string ID;
-  ast_type_traits::DynTypedNode Node;
-};
-} // namespace internal
-
 /// \brief Matches if a node equals a previously bound node.
 ///
 /// Matches a node if it equals the node previously bound to \p ID.
@@ -2619,6 +2636,20 @@ AST_MATCHER(CXXMethodDecl, isVirtual) {
   return Node.isVirtual();
 }
 
+/// \brief Matches if the given method declaration is pure.
+///
+/// Given
+/// \code
+///   class A {
+///    public:
+///     virtual void x() = 0;
+///   };
+/// \endcode
+///   matches A::x
+AST_MATCHER(CXXMethodDecl, isPure) {
+  return Node.isPure();
+}
+
 /// \brief Matches if the given method declaration is const.
 ///
 /// Given
diff --git a/external/bsd/llvm/dist/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/external/bsd/llvm/dist/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
index e66bf0907161..32a37d2705c9 100644
--- a/external/bsd/llvm/dist/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
+++ b/external/bsd/llvm/dist/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
@@ -1579,6 +1579,26 @@ TypeTraversePolymorphicMatcher<
   return Self(InnerMatchers);
 }
 
+// FIXME: unify ClassTemplateSpecializationDecl and TemplateSpecializationType's
+// APIs for accessing the template argument list.
+inline llvm::ArrayRef
+getTemplateSpecializationArgs(const ClassTemplateSpecializationDecl &D) {
+  return D.getTemplateArgs().asArray();
+}
+
+inline llvm::ArrayRef
+getTemplateSpecializationArgs(const TemplateSpecializationType &T) {
+  return llvm::ArrayRef(T.getArgs(), T.getNumArgs());
+}
+
+struct NotEqualsBoundNodePredicate {
+  bool operator()(const internal::BoundNodesMap &Nodes) const {
+    return Nodes.getNode(ID) != Node;
+  }
+  std::string ID;
+  ast_type_traits::DynTypedNode Node;
+};
+
 } // end namespace internal
 } // end namespace ast_matchers
 } // end namespace clang
diff --git a/external/bsd/llvm/dist/clang/include/clang/Analysis/CFG.h b/external/bsd/llvm/dist/clang/include/clang/Analysis/CFG.h
index 8332f68581a3..56ad6af91395 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Analysis/CFG.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Analysis/CFG.h
@@ -412,9 +412,64 @@ class CFGBlock {
   ///   of the CFG.
   unsigned BlockID;
 
+public:
+  /// This class represents a potential adjacent block in the CFG.  It encodes
+  /// whether or not the block is actually reachable, or can be proved to be
+  /// trivially unreachable.  For some cases it allows one to encode scenarios
+  /// where a block was substituted because the original (now alternate) block
+  /// is unreachable.
+  class AdjacentBlock {
+    enum Kind {
+      AB_Normal,
+      AB_Unreachable,
+      AB_Alternate
+    };
+
+    CFGBlock *ReachableBlock;
+    llvm::PointerIntPair UnreachableBlock;
+
+  public:
+    /// Construct an AdjacentBlock with a possibly unreachable block.
+    AdjacentBlock(CFGBlock *B, bool IsReachable);
+    
+    /// Construct an AdjacentBlock with a reachable block and an alternate
+    /// unreachable block.
+    AdjacentBlock(CFGBlock *B, CFGBlock *AlternateBlock);
+
+    /// Get the reachable block, if one exists.
+    CFGBlock *getReachableBlock() const {
+      return ReachableBlock;
+    }
+
+    /// Get the potentially unreachable block.
+    CFGBlock *getPossiblyUnreachableBlock() const {
+      return UnreachableBlock.getPointer();
+    }
+
+    /// Provide an implicit conversion to CFGBlock* so that
+    /// AdjacentBlock can be substituted for CFGBlock*.
+    operator CFGBlock*() const {
+      return getReachableBlock();
+    }
+
+    CFGBlock& operator *() const {
+      return *getReachableBlock();
+    }
+
+    CFGBlock* operator ->() const {
+      return getReachableBlock();
+    }
+
+    bool isReachable() const {
+      Kind K = (Kind) UnreachableBlock.getInt();
+      return K == AB_Normal || K == AB_Alternate;
+    }
+  };
+
+private:
   /// Predecessors/Successors - Keep track of the predecessor / successor
   /// CFG blocks.
-  typedef BumpVector AdjacentBlocks;
+  typedef BumpVector AdjacentBlocks;
   AdjacentBlocks Preds;
   AdjacentBlocks Succs;
 
@@ -504,9 +559,11 @@ public:
   class FilterOptions {
   public:
     FilterOptions() {
+      IgnoreNullPredecessors = 1;
       IgnoreDefaultsWithCoveredEnums = 0;
     }
 
+    unsigned IgnoreNullPredecessors : 1;
     unsigned IgnoreDefaultsWithCoveredEnums : 1;
   };
 
@@ -519,11 +576,14 @@ public:
     IMPL I, E;
     const FilterOptions F;
     const CFGBlock *From;
-   public:
+  public:
     explicit FilteredCFGBlockIterator(const IMPL &i, const IMPL &e,
-              const CFGBlock *from,
-              const FilterOptions &f)
-      : I(i), E(e), F(f), From(from) {}
+                                      const CFGBlock *from,
+                                      const FilterOptions &f)
+        : I(i), E(e), F(f), From(from) {
+      while (hasMore() && Filter(*I))
+        ++I;
+    }
 
     bool hasMore() const { return I != E; }
 
@@ -588,11 +648,8 @@ public:
     OS << "BB#" << getBlockID();
   }
 
-  void addSuccessor(CFGBlock *Block, BumpVectorContext &C) {
-    if (Block)
-      Block->Preds.push_back(this, C);
-    Succs.push_back(Block, C);
-  }
+  /// Adds a (potentially unreachable) successor block to the current block.
+  void addSuccessor(AdjacentBlock Succ, BumpVectorContext &C);
 
   void appendStmt(Stmt *statement, BumpVectorContext &C) {
     Elements.push_back(CFGStmt(statement), C);
diff --git a/external/bsd/llvm/dist/clang/include/clang/Analysis/ProgramPoint.h b/external/bsd/llvm/dist/clang/include/clang/Analysis/ProgramPoint.h
index 333329d8c30b..314d53e3b446 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Analysis/ProgramPoint.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Analysis/ProgramPoint.h
@@ -658,11 +658,11 @@ protected:
 private:
   const void *TagKind;
 };
-  
+
 class SimpleProgramPointTag : public ProgramPointTag {
-  std::string desc;
+  std::string Desc;
 public:
-  SimpleProgramPointTag(StringRef description);
+  SimpleProgramPointTag(StringRef MsgProvider, StringRef Msg);
   StringRef getTagDescription() const;
 };
 
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/Attr.td b/external/bsd/llvm/dist/clang/include/clang/Basic/Attr.td
index b263c1bc1d61..b04aa46191ce 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/Attr.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/Attr.td
@@ -7,6 +7,54 @@
 //
 //===----------------------------------------------------------------------===//
 
+// The documentation is organized by category. Attributes can have category-
+// specific documentation that is collated within the larger document.
+class DocumentationCategory {
+  string Name = name;
+  code Content = [{}];
+}
+def DocCatFunction : DocumentationCategory<"Function Attributes">;
+def DocCatVariable : DocumentationCategory<"Variable Attributes">;
+def DocCatType : DocumentationCategory<"Type Attributes">;
+def DocCatStmt : DocumentationCategory<"Statement Attributes">;
+// Attributes listed under the Undocumented category do not generate any public
+// documentation. Ideally, this category should be used for internal-only
+// attributes which contain no spellings.
+def DocCatUndocumented : DocumentationCategory<"Undocumented">;
+
+class DocDeprecated {
+  // If the Replacement field is empty, no replacement will be listed with the
+  // documentation. Otherwise, the documentation will specify the attribute has
+  // been superseded by this replacement.
+  string Replacement = replacement;
+}
+
+// Specifies the documentation to be associated with the given category.
+class Documentation {
+  DocumentationCategory Category;
+  code Content;
+
+  // If the heading is empty, one may be picked automatically. If the attribute
+  // only has one spelling, no heading is required as the attribute's sole
+  // spelling is sufficient. If all spellings are semantically common, the
+  // heading will be the semantic spelling. If the spellings are not
+  // semantically common and no heading is provided, an error will be emitted.
+  string Heading = "";
+
+  // When set, specifies that the attribute is deprecated and can optionally
+  // specify a replacement attribute.
+  DocDeprecated Deprecated;
+}
+
+// Specifies that the attribute is explicitly undocumented. This can be a
+// helpful placeholder for the attribute while working on the implementation,
+// but should not be used once feature work has been completed.
+def Undocumented : Documentation {
+  let Category = DocCatUndocumented;
+}
+
+include "clang/Basic/AttrDocs.td"
+
 // An attribute's subject is whatever it appertains to. In this file, it is
 // more accurately a list of things that an attribute can appertain to. All
 // Decls and Stmts are possibly AttrSubjects (even though the syntax may not
@@ -225,6 +273,10 @@ class Attr {
   list LangOpts = [];
   // Any additional text that should be included verbatim in the class.
   code AdditionalMembers = [{}];
+  // Any documentation that should be associated with the attribute. Since an
+  // attribute may be documented under multiple categories, more than one
+  // Documentation entry may be listed.
+  list Documentation;
 }
 
 /// A type attribute is not processed on a declaration or a statement.
@@ -265,6 +317,7 @@ class IgnoredAttr : Attr {
   let Ignored = 1;
   let ASTNode = 0;
   let SemaHandler = 0;
+  let Documentation = [Undocumented];
 }
 
 //
@@ -274,11 +327,13 @@ class IgnoredAttr : Attr {
 def AddressSpace : TypeAttr {
   let Spellings = [GNU<"address_space">];
   let Args = [IntArgument<"AddressSpace">];
+  let Documentation = [Undocumented];
 }
 
 def Alias : Attr {
   let Spellings = [GCC<"alias">];
   let Args = [StringArgument<"Aliasee">];
+  let Documentation = [Undocumented];
 }
 
 def Aligned : InheritableAttr {
@@ -291,32 +346,38 @@ def Aligned : InheritableAttr {
                    Accessor<"isAlignas", [Keyword<"alignas">,
                                           Keyword<"_Alignas">]>,
                    Accessor<"isDeclspec",[Declspec<"align">]>];
+  let Documentation = [Undocumented];
 }
 
 def AlignMac68k : InheritableAttr {
   // This attribute has no spellings as it is only ever created implicitly.
   let Spellings = [];
   let SemaHandler = 0;
+  let Documentation = [Undocumented];
 }
 
 def AlwaysInline : InheritableAttr {
-  let Spellings = [GCC<"always_inline">];
+  let Spellings = [GCC<"always_inline">, Keyword<"__forceinline">];
   let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
 }
 
 def TLSModel : InheritableAttr {
   let Spellings = [GCC<"tls_model">];
   let Subjects = SubjectList<[TLSVar], ErrorDiag, "ExpectedTLSVar">;
   let Args = [StringArgument<"Model">];
+  let Documentation = [TLSModelDocs];
 }
 
 def AnalyzerNoReturn : InheritableAttr {
   let Spellings = [GNU<"analyzer_noreturn">];
+  let Documentation = [Undocumented];
 }
 
 def Annotate : InheritableParamAttr {
   let Spellings = [GNU<"annotate">];
   let Args = [StringArgument<"Annotation">];
+  let Documentation = [Undocumented];
 }
 
 def ARMInterrupt : InheritableAttr, TargetSpecificAttr {
@@ -329,12 +390,14 @@ def ARMInterrupt : InheritableAttr, TargetSpecificAttr {
                            1>];
   let ParseKind = "Interrupt";
   let HasCustomParsing = 1;
+  let Documentation = [ARMInterruptDocs];
 }
 
 def AsmLabel : InheritableAttr {
   let Spellings = [Keyword<"asm">, Keyword<"__asm__">];
   let Args = [StringArgument<"Label">];
   let SemaHandler = 0;
+  let Documentation = [Undocumented];
 }
 
 def Availability : InheritableAttr {
@@ -352,11 +415,13 @@ def Availability : InheritableAttr {
   let HasCustomParsing = 1;
   let DuplicatesAllowedWhileMerging = 1;
 //  let Subjects = SubjectList<[Named]>;
+  let Documentation = [AvailabilityDocs];
 }
 
 def Blocks : InheritableAttr {
   let Spellings = [GNU<"blocks">];
   let Args = [EnumArgument<"Type", "BlockType", ["byref"], ["ByRef"]>];
+  let Documentation = [Undocumented];
 }
 
 def Bounded : IgnoredAttr {
@@ -364,14 +429,15 @@ def Bounded : IgnoredAttr {
 }
 
 def CarriesDependency : InheritableParamAttr {
-  let Spellings = [GNU<"carries_dependency">, CXX11<"","carries_dependency">,
-                   CXX11<"std","carries_dependency">];
+  let Spellings = [GNU<"carries_dependency">, CXX11<"","carries_dependency">];
   let Subjects = SubjectList<[ParmVar, ObjCMethod, Function], ErrorDiag>;
+  let Documentation = [CarriesDependencyDocs];
 }
 
 def CDecl : InheritableAttr {
   let Spellings = [GCC<"cdecl">, Keyword<"__cdecl">, Keyword<"_cdecl">];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 // cf_audited_transfer indicates that the given function has been
@@ -381,6 +447,7 @@ def CDecl : InheritableAttr {
 def CFAuditedTransfer : InheritableAttr {
   let Spellings = [GNU<"cf_audited_transfer">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 // cf_unknown_transfer is an explicit opt-out of cf_audited_transfer.
@@ -389,71 +456,84 @@ def CFAuditedTransfer : InheritableAttr {
 def CFUnknownTransfer : InheritableAttr {
   let Spellings = [GNU<"cf_unknown_transfer">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def CFReturnsRetained : InheritableAttr {
   let Spellings = [GNU<"cf_returns_retained">];
 //  let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
+  let Documentation = [Undocumented];
 }
 
 def CFReturnsNotRetained : InheritableAttr {
   let Spellings = [GNU<"cf_returns_not_retained">];
 //  let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
+  let Documentation = [Undocumented];
 }
 
 def CFConsumed : InheritableParamAttr {
   let Spellings = [GNU<"cf_consumed">];
   let Subjects = SubjectList<[ParmVar]>;
+  let Documentation = [Undocumented];
 }
 
 def Cleanup : InheritableAttr {
   let Spellings = [GCC<"cleanup">];
   let Args = [FunctionArgument<"FunctionDecl">];
   let Subjects = SubjectList<[Var]>;
+  let Documentation = [Undocumented];
 }
 
 def Cold : InheritableAttr {
   let Spellings = [GCC<"cold">];
   let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
 }
 
 def Common : InheritableAttr {
   let Spellings = [GCC<"common">];
   let Subjects = SubjectList<[Var]>;
+  let Documentation = [Undocumented];
 }
 
 def Const : InheritableAttr {
   let Spellings = [GCC<"const">, GCC<"__const">];
+  let Documentation = [Undocumented];
 }
 
 def Constructor : InheritableAttr {
   let Spellings = [GCC<"constructor">];
   let Args = [DefaultIntArgument<"Priority", 65535>];
   let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
 }
 
 def CUDAConstant : InheritableAttr {
   let Spellings = [GNU<"constant">];
   let Subjects = SubjectList<[Var]>;
   let LangOpts = [CUDA];
+  let Documentation = [Undocumented];
 }
 
 def CUDADevice : InheritableAttr {
   let Spellings = [GNU<"device">];
   let Subjects = SubjectList<[Function, Var]>;
   let LangOpts = [CUDA];
+  let Documentation = [Undocumented];
 }
 
 def CUDAGlobal : InheritableAttr {
   let Spellings = [GNU<"global">];
   let Subjects = SubjectList<[Function]>;
   let LangOpts = [CUDA];
+  let Documentation = [Undocumented];
 }
 
 def CUDAHost : InheritableAttr {
   let Spellings = [GNU<"host">];
   let Subjects = SubjectList<[Function]>;
   let LangOpts = [CUDA];
+  let Documentation = [Undocumented];
 }
 
 def CUDALaunchBounds : InheritableAttr {
@@ -465,28 +545,33 @@ def CUDALaunchBounds : InheritableAttr {
   // An AST node is created for this attribute, but is not used by other parts
   // of the compiler. However, this node needs to exist in the AST because
   // non-LLVM backends may be relying on the attribute's presence.
+  let Documentation = [Undocumented];
 }
 
 def CUDAShared : InheritableAttr {
   let Spellings = [GNU<"shared">];
   let Subjects = SubjectList<[Var]>;
   let LangOpts = [CUDA];
+  let Documentation = [Undocumented];
 }
 
 def C11NoReturn : InheritableAttr {
   let Spellings = [Keyword<"_Noreturn">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
   let SemaHandler = 0;
+  let Documentation = [C11NoReturnDocs];
 }
 
 def CXX11NoReturn : InheritableAttr {
-  let Spellings = [CXX11<"","noreturn">, CXX11<"std","noreturn">];
+  let Spellings = [CXX11<"","noreturn">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [CXX11NoReturnDocs];
 }
 
 def OpenCLKernel : InheritableAttr {
   let Spellings = [Keyword<"__kernel">, Keyword<"kernel">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 // This attribute is both a type attribute, and a declaration attribute (for
@@ -502,34 +587,41 @@ def OpenCLImageAccess : Attr {
                                             Keyword<"read_write">]>,
                    Accessor<"isWriteOnly", [Keyword<"__write_only">,
                                             Keyword<"write_only">]>];
+  let Documentation = [Undocumented];
 }
 
 def OpenCLPrivateAddressSpace : TypeAttr {
   let Spellings = [Keyword<"__private">, Keyword<"private">];
+  let Documentation = [Undocumented];
 }
 
 def OpenCLGlobalAddressSpace : TypeAttr {
   let Spellings = [Keyword<"__global">, Keyword<"global">];
+  let Documentation = [Undocumented];
 }
 
 def OpenCLLocalAddressSpace : TypeAttr {
   let Spellings = [Keyword<"__local">, Keyword<"local">];
+  let Documentation = [Undocumented];
 }
 
 def OpenCLConstantAddressSpace : TypeAttr {
   let Spellings = [Keyword<"__constant">, Keyword<"constant">];
+  let Documentation = [Undocumented];
 }
 
 def Deprecated : InheritableAttr {
   let Spellings = [GCC<"deprecated">, Declspec<"deprecated">,
                    CXX11<"","deprecated">];
   let Args = [StringArgument<"Message", 1>];
+  let Documentation = [Undocumented];
 }
 
 def Destructor : InheritableAttr {
   let Spellings = [GCC<"destructor">];
   let Args = [DefaultIntArgument<"Priority", 65535>];
   let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
 }
 
 def EnableIf : InheritableAttr {
@@ -537,6 +629,7 @@ def EnableIf : InheritableAttr {
   let Subjects = SubjectList<[Function]>;
   let Args = [ExprArgument<"Cond">, StringArgument<"Message">];
   let TemplateDependent = 1;
+  let Documentation = [EnableIfDocs];
 }
 
 def ExtVectorType : Attr {
@@ -544,28 +637,33 @@ def ExtVectorType : Attr {
   let Subjects = SubjectList<[TypedefName], ErrorDiag>;
   let Args = [ExprArgument<"NumElements">];
   let ASTNode = 0;
+  let Documentation = [Undocumented];
 }
 
 def FallThrough : Attr {
   let Spellings = [CXX11<"clang", "fallthrough">];
 //  let Subjects = [NullStmt];
+  let Documentation = [FallthroughDocs];
 }
 
 def FastCall : InheritableAttr {
   let Spellings = [GCC<"fastcall">, Keyword<"__fastcall">,
                    Keyword<"_fastcall">];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 def Final : InheritableAttr {
   let Spellings = [Keyword<"final">, Keyword<"sealed">];
   let Accessors = [Accessor<"isSpelledAsSealed", [Keyword<"sealed">]>];
   let SemaHandler = 0;
+  let Documentation = [Undocumented];
 }
 
 def MinSize : InheritableAttr {
   let Spellings = [GNU<"minsize">];
   let Subjects = SubjectList<[Function, ObjCMethod], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def Format : InheritableAttr {
@@ -574,6 +672,7 @@ def Format : InheritableAttr {
               IntArgument<"FirstArg">];
   let Subjects = SubjectList<[ObjCMethod, Block, HasFunctionProto], WarnDiag,
                              "ExpectedFunction">;
+  let Documentation = [FormatDocs];
 }
 
 def FormatArg : InheritableAttr {
@@ -581,11 +680,13 @@ def FormatArg : InheritableAttr {
   let Args = [IntArgument<"FormatIdx">];
   let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag,
                              "ExpectedFunction">;
+  let Documentation = [Undocumented];
 }
 
 def GNUInline : InheritableAttr {
   let Spellings = [GCC<"gnu_inline">];
   let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
 }
 
 def Hot : InheritableAttr {
@@ -593,6 +694,7 @@ def Hot : InheritableAttr {
   let Subjects = SubjectList<[Function]>;
   // An AST node is created for this attribute, but not actually used beyond
   // semantic checking for mutual exclusion with the Cold attribute.
+  let Documentation = [Undocumented];
 }
 
 def IBAction : InheritableAttr {
@@ -602,22 +704,26 @@ def IBAction : InheritableAttr {
   // An AST node is created for this attribute, but is not used by other parts
   // of the compiler. However, this node needs to exist in the AST because
   // external tools rely on it.
+  let Documentation = [Undocumented];
 }
 
 def IBOutlet : InheritableAttr {
   let Spellings = [GNU<"iboutlet">];
 //  let Subjects = [ObjCIvar, ObjCProperty];
+  let Documentation = [Undocumented];
 }
 
 def IBOutletCollection : InheritableAttr {
   let Spellings = [GNU<"iboutletcollection">];
   let Args = [TypeArgument<"Interface", 1>];
 //  let Subjects = [ObjCIvar, ObjCProperty];
+  let Documentation = [Undocumented];
 }
 
 def Malloc : InheritableAttr {
   let Spellings = [GCC<"malloc">];
 //  let Subjects = [Function];
+  let Documentation = [Undocumented];
 }
 
 def MaxFieldAlignment : InheritableAttr {
@@ -625,16 +731,19 @@ def MaxFieldAlignment : InheritableAttr {
   let Spellings = [];
   let Args = [UnsignedArgument<"Alignment">];
   let SemaHandler = 0;
+  let Documentation = [Undocumented];
 }
 
 def MayAlias : InheritableAttr {
   // FIXME: this is a type attribute in GCC, but a declaration attribute here.
   let Spellings = [GCC<"may_alias">];
+  let Documentation = [Undocumented];
 }
 
 def MSABI : InheritableAttr {
   let Spellings = [GCC<"ms_abi">];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 def MSP430Interrupt : InheritableAttr, TargetSpecificAttr {
@@ -644,55 +753,72 @@ def MSP430Interrupt : InheritableAttr, TargetSpecificAttr {
   let Args = [UnsignedArgument<"Number">];
   let ParseKind = "Interrupt";
   let HasCustomParsing = 1;
+  let Documentation = [Undocumented];
 }
 
 def Mips16 : InheritableAttr, TargetSpecificAttr {
   let Spellings = [GCC<"mips16">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def Mode : Attr {
   let Spellings = [GCC<"mode">];
   let Args = [IdentifierArgument<"Mode">];
+  let Documentation = [Undocumented];
 }
 
 def Naked : InheritableAttr {
   let Spellings = [GCC<"naked">, Declspec<"naked">];
   let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
 }
 
 def NeonPolyVectorType : TypeAttr {
   let Spellings = [GNU<"neon_polyvector_type">];
   let Args = [IntArgument<"NumElements">];
+  let Documentation = [Undocumented];
 }
 
 def NeonVectorType : TypeAttr {
   let Spellings = [GNU<"neon_vector_type">];
   let Args = [IntArgument<"NumElements">];
+  let Documentation = [Undocumented];
 }
 
 def ReturnsTwice : InheritableAttr {
   let Spellings = [GCC<"returns_twice">];
   let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
 }
 
 def NoCommon : InheritableAttr {
   let Spellings = [GCC<"nocommon">];
   let Subjects = SubjectList<[Var]>;
+  let Documentation = [Undocumented];
 }
 
 def NoDebug : InheritableAttr {
   let Spellings = [GNU<"nodebug">];
+  let Documentation = [Undocumented];
+}
+
+def NoDuplicate : InheritableAttr {
+  let Spellings = [GNU<"noduplicate">, CXX11<"clang", "noduplicate">];
+  let Subjects = SubjectList<[Function]>;
+  let Documentation = [NoDuplicateDocs];
 }
 
 def NoInline : InheritableAttr {
   let Spellings = [GCC<"noinline">, Declspec<"noinline">];
   let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
 }
 
 def NoMips16 : InheritableAttr, TargetSpecificAttr {
   let Spellings = [GCC<"nomips16">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def NonNull : InheritableAttr {
@@ -708,38 +834,45 @@ def NonNull : InheritableAttr {
         return true;
     return false;
   } }];
+  let Documentation = [Undocumented];
 }
 
 def ReturnsNonNull : InheritableAttr {
   let Spellings = [GCC<"returns_nonnull">];
   let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag,
                              "ExpectedFunctionOrMethod">;
+  let Documentation = [Undocumented];
 }
 
 def NoReturn : InheritableAttr {
   let Spellings = [GCC<"noreturn">, Declspec<"noreturn">];
   // FIXME: Does GCC allow this on the function instead?
+  let Documentation = [Undocumented];
 }
 
 def NoInstrumentFunction : InheritableAttr {
   let Spellings = [GCC<"no_instrument_function">];
   let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
 }
 
 def NoThrow : InheritableAttr {
   let Spellings = [GCC<"nothrow">, Declspec<"nothrow">];
+  let Documentation = [Undocumented];
 }
 
 def ObjCBridge : InheritableAttr {
   let Spellings = [GNU<"objc_bridge">];
   let Subjects = SubjectList<[Record], ErrorDiag>;
   let Args = [IdentifierArgument<"BridgedType">];
+  let Documentation = [Undocumented];
 }
 
 def ObjCBridgeMutable : InheritableAttr {
   let Spellings = [GNU<"objc_bridge_mutable">];
   let Subjects = SubjectList<[Record], ErrorDiag>;
   let Args = [IdentifierArgument<"BridgedType">];
+  let Documentation = [Undocumented];
 }
 
 def ObjCBridgeRelated : InheritableAttr {
@@ -748,37 +881,44 @@ def ObjCBridgeRelated : InheritableAttr {
   let Args = [IdentifierArgument<"RelatedClass">,
           IdentifierArgument<"ClassMethod">,
           IdentifierArgument<"InstanceMethod">];
- let HasCustomParsing = 1;
+  let HasCustomParsing = 1;
+  let Documentation = [Undocumented];
 }
 
 def NSReturnsRetained : InheritableAttr {
   let Spellings = [GNU<"ns_returns_retained">];
 //  let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
+  let Documentation = [Undocumented];
 }
 
 def NSReturnsNotRetained : InheritableAttr {
   let Spellings = [GNU<"ns_returns_not_retained">];
 //  let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
+  let Documentation = [Undocumented];
 }
 
 def NSReturnsAutoreleased : InheritableAttr {
   let Spellings = [GNU<"ns_returns_autoreleased">];
 //  let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
+  let Documentation = [Undocumented];
 }
 
 def NSConsumesSelf : InheritableAttr {
   let Spellings = [GNU<"ns_consumes_self">];
   let Subjects = SubjectList<[ObjCMethod]>;
+  let Documentation = [Undocumented];
 }
 
 def NSConsumed : InheritableParamAttr {
   let Spellings = [GNU<"ns_consumed">];
   let Subjects = SubjectList<[ParmVar]>;
+  let Documentation = [Undocumented];
 }
 
 def ObjCException : InheritableAttr {
   let Spellings = [GNU<"objc_exception">];
   let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def ObjCMethodFamily : InheritableAttr {
@@ -788,51 +928,61 @@ def ObjCMethodFamily : InheritableAttr {
                ["none", "alloc", "copy", "init", "mutableCopy", "new"],
                ["OMF_None", "OMF_alloc", "OMF_copy", "OMF_init",
                 "OMF_mutableCopy", "OMF_new"]>];
+  let Documentation = [ObjCMethodFamilyDocs];
 }
 
 def ObjCNSObject : InheritableAttr {
   let Spellings = [GNU<"NSObject">];
+  let Documentation = [Undocumented];
 }
 
 def ObjCPreciseLifetime : InheritableAttr {
   let Spellings = [GNU<"objc_precise_lifetime">];
   let Subjects = SubjectList<[Var], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def ObjCReturnsInnerPointer : InheritableAttr {
   let Spellings = [GNU<"objc_returns_inner_pointer">];
   let Subjects = SubjectList<[ObjCMethod, ObjCProperty], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def ObjCRequiresSuper : InheritableAttr {
   let Spellings = [GNU<"objc_requires_super">];
   let Subjects = SubjectList<[ObjCMethod], ErrorDiag>;
+  let Documentation = [ObjCRequiresSuperDocs];
 }
 
 def ObjCRootClass : InheritableAttr {
   let Spellings = [GNU<"objc_root_class">];
   let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def ObjCExplicitProtocolImpl : InheritableAttr {
   let Spellings = [GNU<"objc_protocol_requires_explicit_implementation">];
   let Subjects = SubjectList<[ObjCProtocol], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def ObjCDesignatedInitializer : Attr {
   let Spellings = [GNU<"objc_designated_initializer">];
   let Subjects = SubjectList<[ObjCInterfaceDeclInitMethod], ErrorDiag,
                              "ExpectedObjCInterfaceDeclInitMethod">;
+  let Documentation = [Undocumented];
 }
 
 def Overloadable : Attr {
   let Spellings = [GNU<"overloadable">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [OverloadableDocs];
 }
 
 def Override : InheritableAttr { 
   let Spellings = [Keyword<"override">];
   let SemaHandler = 0;
+  let Documentation = [Undocumented];
 }
 
 def Ownership : InheritableAttr {
@@ -851,21 +1001,25 @@ def Ownership : InheritableAttr {
   }];
   let Args = [IdentifierArgument<"Module">, VariadicUnsignedArgument<"Args">];
   let Subjects = SubjectList<[HasFunctionProto], WarnDiag, "ExpectedFunction">;
+  let Documentation = [Undocumented];
 }
 
 def Packed : InheritableAttr {
   let Spellings = [GCC<"packed">];
 //  let Subjects = [Tag, Field];
+  let Documentation = [Undocumented];
 }
 
 def PnaclCall : InheritableAttr {
   let Spellings = [GNU<"pnaclcall">];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 def IntelOclBicc : InheritableAttr {
   let Spellings = [GNU<"intel_ocl_bicc">];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 def Pcs : InheritableAttr {
@@ -874,16 +1028,18 @@ def Pcs : InheritableAttr {
                            ["aapcs", "aapcs-vfp"],
                            ["AAPCS", "AAPCS_VFP"]>];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 def Pure : InheritableAttr {
   let Spellings = [GCC<"pure">];
+  let Documentation = [Undocumented];
 }
 
 def Regparm : TypeAttr {
   let Spellings = [GCC<"regparm">];
   let Args = [UnsignedArgument<"NumParams">];
-  let ASTNode = 0;
+  let Documentation = [Undocumented];
 }
 
 def ReqdWorkGroupSize : InheritableAttr {
@@ -891,6 +1047,7 @@ def ReqdWorkGroupSize : InheritableAttr {
   let Args = [UnsignedArgument<"XDim">, UnsignedArgument<"YDim">,
               UnsignedArgument<"ZDim">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def WorkGroupSizeHint :  InheritableAttr {
@@ -899,12 +1056,14 @@ def WorkGroupSizeHint :  InheritableAttr {
               UnsignedArgument<"YDim">,
               UnsignedArgument<"ZDim">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def InitPriority : InheritableAttr {
   let Spellings = [GNU<"init_priority">];
   let Args = [UnsignedArgument<"Priority">];
   let Subjects = SubjectList<[Var], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def Section : InheritableAttr {
@@ -913,6 +1072,7 @@ def Section : InheritableAttr {
   let Subjects = SubjectList<[Function, GlobalVar, 
                               ObjCMethod, ObjCProperty], ErrorDiag,
                              "ExpectedFunctionGlobalVarMethodOrProperty">;
+  let Documentation = [Undocumented];
 }
 
 def Sentinel : InheritableAttr {
@@ -920,58 +1080,69 @@ def Sentinel : InheritableAttr {
   let Args = [DefaultIntArgument<"Sentinel", 0>,
               DefaultIntArgument<"NullPos", 0>];
 //  let Subjects = SubjectList<[Function, ObjCMethod, Block, Var]>;
+  let Documentation = [Undocumented];
 }
 
 def StdCall : InheritableAttr {
   let Spellings = [GCC<"stdcall">, Keyword<"__stdcall">, Keyword<"_stdcall">];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 def SysVABI : InheritableAttr {
   let Spellings = [GCC<"sysv_abi">];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 def ThisCall : InheritableAttr {
   let Spellings = [GCC<"thiscall">, Keyword<"__thiscall">,
                    Keyword<"_thiscall">];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 def Pascal : InheritableAttr {
   let Spellings = [GNU<"pascal">, Keyword<"__pascal">, Keyword<"_pascal">];
 //  let Subjects = [Function, ObjCMethod];
+  let Documentation = [Undocumented];
 }
 
 def TransparentUnion : InheritableAttr {
   let Spellings = [GCC<"transparent_union">];
 //  let Subjects = SubjectList<[Record, TypedefName]>;
+  let Documentation = [Undocumented];
 }
 
 def Unavailable : InheritableAttr {
   let Spellings = [GNU<"unavailable">];
   let Args = [StringArgument<"Message", 1>];
+  let Documentation = [Undocumented];
 }
 
 def ArcWeakrefUnavailable : InheritableAttr {
   let Spellings = [GNU<"objc_arc_weak_reference_unavailable">];
   let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def ObjCGC : TypeAttr {
   let Spellings = [GNU<"objc_gc">];
   let Args = [IdentifierArgument<"Kind">];
+  let Documentation = [Undocumented];
 }
 
 def ObjCOwnership : InheritableAttr {
   let Spellings = [GNU<"objc_ownership">];
   let Args = [IdentifierArgument<"Kind">];
   let ASTNode = 0;
+  let Documentation = [Undocumented];
 }
 
 def ObjCRequiresPropertyDefs : InheritableAttr {
   let Spellings = [GNU<"objc_requires_property_definitions">];
   let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def Unused : InheritableAttr {
@@ -979,10 +1150,12 @@ def Unused : InheritableAttr {
   let Subjects = SubjectList<[Var, ObjCIvar, Type, Label, Field, ObjCMethod,
                               FunctionLike], WarnDiag,
                              "ExpectedVariableFunctionOrLabel">;
+  let Documentation = [Undocumented];
 }
 
 def Used : InheritableAttr {
   let Spellings = [GCC<"used">];
+  let Documentation = [Undocumented];
 }
 
 def Uuid : InheritableAttr {
@@ -990,17 +1163,20 @@ def Uuid : InheritableAttr {
   let Args = [StringArgument<"Guid">];
 //  let Subjects = SubjectList<[CXXRecord]>;
   let LangOpts = [MicrosoftExt, Borland];
+  let Documentation = [Undocumented];
 }
 
 def VectorSize : TypeAttr {
   let Spellings = [GCC<"vector_size">];
   let Args = [ExprArgument<"NumBytes">];
+  let Documentation = [Undocumented];
 }
 
 def VecTypeHint : InheritableAttr {
   let Spellings = [GNU<"vec_type_hint">];
   let Args = [TypeArgument<"TypeHint">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def Visibility : InheritableAttr {
@@ -1009,6 +1185,7 @@ def Visibility : InheritableAttr {
   let Args = [EnumArgument<"Visibility", "VisibilityType",
                            ["default", "hidden", "internal", "protected"],
                            ["Default", "Hidden", "Hidden", "Protected"]>];
+  let Documentation = [Undocumented];
 }
 
 def TypeVisibility : InheritableAttr {
@@ -1018,16 +1195,19 @@ def TypeVisibility : InheritableAttr {
                            ["default", "hidden", "internal", "protected"],
                            ["Default", "Hidden", "Hidden", "Protected"]>];
 //  let Subjects = [Tag, ObjCInterface, Namespace];
+  let Documentation = [Undocumented];
 }
 
 def VecReturn : InheritableAttr {
   let Spellings = [GNU<"vecreturn">];
   let Subjects = SubjectList<[CXXRecord], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def WarnUnused : InheritableAttr {
   let Spellings = [GNU<"warn_unused">];
   let Subjects = SubjectList<[Record]>;
+  let Documentation = [Undocumented];
 }
 
 def WarnUnusedResult : InheritableAttr {
@@ -1035,15 +1215,18 @@ def WarnUnusedResult : InheritableAttr {
                    CXX11<"clang", "warn_unused_result">];
   let Subjects = SubjectList<[ObjCMethod, CXXRecord, FunctionLike], WarnDiag,
                              "ExpectedFunctionMethodOrClass">;
+  let Documentation = [Undocumented];
 }
 
 def Weak : InheritableAttr {
   let Spellings = [GCC<"weak">];
   let Subjects = SubjectList<[Var, Function, CXXRecord]>;
+  let Documentation = [Undocumented];
 }
 
 def WeakImport : InheritableAttr {
   let Spellings = [GNU<"weak_import">];
+  let Documentation = [Undocumented];
 }
 
 def WeakRef : InheritableAttr {
@@ -1051,6 +1234,7 @@ def WeakRef : InheritableAttr {
   // A WeakRef that has an argument is treated as being an AliasAttr
   let Args = [StringArgument<"Aliasee", 1>];
   let Subjects = SubjectList<[Var, Function], ErrorDiag>;
+  let Documentation = [Undocumented];
 }
 
 def X86ForceAlignArgPointer : InheritableAttr, TargetSpecificAttr {
@@ -1058,6 +1242,7 @@ def X86ForceAlignArgPointer : InheritableAttr, TargetSpecificAttr {
   // Technically, this appertains to a FunctionDecl, but the target-specific
   // code silently allows anything function-like (such as typedefs or function
   // pointers), but does not apply the attribute to them.
+  let Documentation = [Undocumented];
 }
 
 // Attribute to disable AddressSanitizer (or equivalent) checks.
@@ -1065,18 +1250,21 @@ def NoSanitizeAddress : InheritableAttr {
   let Spellings = [GCC<"no_address_safety_analysis">,
                    GCC<"no_sanitize_address">];
   let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
+  let Documentation = [NoSanitizeAddressDocs];
 }
 
 // Attribute to disable ThreadSanitizer checks.
 def NoSanitizeThread : InheritableAttr {
   let Spellings = [GNU<"no_sanitize_thread">];
   let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
+  let Documentation = [NoSanitizeThreadDocs];
 }
 
 // Attribute to disable MemorySanitizer checks.
 def NoSanitizeMemory : InheritableAttr {
   let Spellings = [GNU<"no_sanitize_memory">];
   let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
+  let Documentation = [NoSanitizeMemoryDocs];
 }
 
 // C/C++ Thread safety attributes (e.g. for deadlock, data race checking)
@@ -1085,27 +1273,140 @@ def GuardedVar : InheritableAttr {
   let Spellings = [GNU<"guarded_var">];
   let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
                              "ExpectedFieldOrGlobalVar">;
+  let Documentation = [Undocumented];
 }
 
 def PtGuardedVar : InheritableAttr {
   let Spellings = [GNU<"pt_guarded_var">];
   let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
                              "ExpectedFieldOrGlobalVar">;
+  let Documentation = [Undocumented];
 }
 
 def Lockable : InheritableAttr {
   let Spellings = [GNU<"lockable">];
   let Subjects = SubjectList<[Record]>;
+  let Documentation = [Undocumented];
+  let ASTNode = 0;  // Replaced by Capability
 }
 
 def ScopedLockable : InheritableAttr {
   let Spellings = [GNU<"scoped_lockable">];
   let Subjects = SubjectList<[Record]>;
+  let Documentation = [Undocumented];
+}
+
+def Capability : InheritableAttr {
+  let Spellings = [GNU<"capability">, CXX11<"clang", "capability">,
+                   GNU<"shared_capability">,
+                   CXX11<"clang", "shared_capability">];
+  let Subjects = SubjectList<[Struct], ErrorDiag, "ExpectedStruct">;
+  let Args = [StringArgument<"Name">];
+  let Accessors = [Accessor<"isShared",
+                    [GNU<"shared_capability">,
+                     CXX11<"clang","shared_capability">]>];
+  let Documentation = [Undocumented];
+}
+
+def AssertCapability : InheritableAttr {
+  let Spellings = [GNU<"assert_capability">,
+                   CXX11<"clang", "assert_capability">,
+                   GNU<"assert_shared_capability">,
+                   CXX11<"clang", "assert_shared_capability">];
+  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let LateParsed = 1;
+  let TemplateDependent = 1;
+  let ParseArgumentsAsUnevaluated = 1;
+  let DuplicatesAllowedWhileMerging = 1;
+  let Args = [ExprArgument<"Expr">];
+  let Accessors = [Accessor<"isShared",
+                    [GNU<"assert_shared_capability">,
+                     CXX11<"clang", "assert_shared_capability">]>];
+  let Documentation = [AssertCapabilityDocs];
+}
+
+def AcquireCapability : InheritableAttr {
+  let Spellings = [GNU<"acquire_capability">,
+                   CXX11<"clang", "acquire_capability">,
+                   GNU<"acquire_shared_capability">,
+                   CXX11<"clang", "acquire_shared_capability">];
+  let Subjects = SubjectList<[Function, FunctionTemplate],
+                             ErrorDiag>;
+  let LateParsed = 1;
+  let TemplateDependent = 1;
+  let ParseArgumentsAsUnevaluated = 1;
+  let DuplicatesAllowedWhileMerging = 1;
+  let Args = [VariadicExprArgument<"Args">];
+  let Accessors = [Accessor<"isShared",
+                    [GNU<"acquire_shared_capability">,
+                     CXX11<"clang", "acquire_shared_capability">]>];
+  let Documentation = [AcquireCapabilityDocs];
+}
+
+def TryAcquireCapability : InheritableAttr {
+  let Spellings = [GNU<"try_acquire_capability">,
+                   CXX11<"clang", "try_acquire_capability">,
+                   GNU<"try_acquire_shared_capability">,
+                   CXX11<"clang", "try_acquire_shared_capability">];
+  let Subjects = SubjectList<[Function, FunctionTemplate],
+                             ErrorDiag>;
+  let LateParsed = 1;
+  let TemplateDependent = 1;
+  let ParseArgumentsAsUnevaluated = 1;
+  let DuplicatesAllowedWhileMerging = 1;
+  let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
+  let Accessors = [Accessor<"isShared",
+                    [GNU<"try_acquire_shared_capability">,
+                     CXX11<"clang", "try_acquire_shared_capability">]>];
+  let Documentation = [TryAcquireCapabilityDocs];
+}
+
+def ReleaseCapability : InheritableAttr {
+  let Spellings = [GNU<"release_capability">,
+                   CXX11<"clang", "release_capability">,
+                   GNU<"release_shared_capability">,
+                   CXX11<"clang", "release_shared_capability">,
+                   GNU<"release_generic_capability">,
+                   CXX11<"clang", "release_generic_capability">];
+  let Subjects = SubjectList<[Function, FunctionTemplate],
+                             ErrorDiag>;
+  let LateParsed = 1;
+  let TemplateDependent = 1;
+  let ParseArgumentsAsUnevaluated = 1;
+  let DuplicatesAllowedWhileMerging = 1;
+  let Args = [VariadicExprArgument<"Args">];
+  let Accessors = [Accessor<"isShared",
+                    [GNU<"release_shared_capability">,
+                     CXX11<"clang", "release_shared_capability">]>,
+                   Accessor<"isGeneric",
+                     [GNU<"release_generic_capability">,
+                      CXX11<"clang", "release_generic_capability">]>];
+  let Documentation = [ReleaseCapabilityDocs];
+}
+
+def RequiresCapability : InheritableAttr {
+  let Spellings = [GNU<"requires_capability">,
+                   CXX11<"clang", "requires_capability">,
+                   GNU<"exclusive_locks_required">,
+                   GNU<"requires_shared_capability">,
+                   CXX11<"clang", "requires_shared_capability">,
+                   GNU<"shared_locks_required">];
+  let Args = [VariadicExprArgument<"Args">];
+  let LateParsed = 1;
+  let TemplateDependent = 1;
+  let ParseArgumentsAsUnevaluated = 1;
+  let DuplicatesAllowedWhileMerging = 1;
+  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Accessors = [Accessor<"isShared", [GNU<"requires_shared_capability">,
+                                         GNU<"shared_locks_required">,
+                                CXX11<"clang","requires_shared_capability">]>];
+  let Documentation = [Undocumented];
 }
 
 def NoThreadSafetyAnalysis : InheritableAttr {
   let Spellings = [GNU<"no_thread_safety_analysis">];
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 def GuardedBy : InheritableAttr {
@@ -1117,6 +1418,7 @@ def GuardedBy : InheritableAttr {
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
                              "ExpectedFieldOrGlobalVar">;
+  let Documentation = [Undocumented];
 }
 
 def PtGuardedBy : InheritableAttr {
@@ -1128,6 +1430,7 @@ def PtGuardedBy : InheritableAttr {
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
                              "ExpectedFieldOrGlobalVar">;
+  let Documentation = [Undocumented];
 }
 
 def AcquiredAfter : InheritableAttr {
@@ -1139,6 +1442,7 @@ def AcquiredAfter : InheritableAttr {
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
                              "ExpectedFieldOrGlobalVar">;
+  let Documentation = [Undocumented];
 }
 
 def AcquiredBefore : InheritableAttr {
@@ -1150,6 +1454,7 @@ def AcquiredBefore : InheritableAttr {
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
                              "ExpectedFieldOrGlobalVar">;
+  let Documentation = [Undocumented];
 }
 
 def ExclusiveLockFunction : InheritableAttr {
@@ -1160,6 +1465,7 @@ def ExclusiveLockFunction : InheritableAttr {
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 def SharedLockFunction : InheritableAttr {
@@ -1170,6 +1476,7 @@ def SharedLockFunction : InheritableAttr {
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 def AssertExclusiveLock : InheritableAttr {
@@ -1180,6 +1487,7 @@ def AssertExclusiveLock : InheritableAttr {
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 def AssertSharedLock : InheritableAttr {
@@ -1190,6 +1498,7 @@ def AssertSharedLock : InheritableAttr {
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 // The first argument is an integer or boolean value specifying the return value
@@ -1202,6 +1511,7 @@ def ExclusiveTrylockFunction : InheritableAttr {
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 // The first argument is an integer or boolean value specifying the return value
@@ -1214,6 +1524,7 @@ def SharedTrylockFunction : InheritableAttr {
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 def UnlockFunction : InheritableAttr {
@@ -1224,6 +1535,7 @@ def UnlockFunction : InheritableAttr {
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 def LockReturned : InheritableAttr {
@@ -1233,6 +1545,7 @@ def LockReturned : InheritableAttr {
   let TemplateDependent = 1;
   let ParseArgumentsAsUnevaluated = 1;
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 def LocksExcluded : InheritableAttr {
@@ -1243,26 +1556,7 @@ def LocksExcluded : InheritableAttr {
   let ParseArgumentsAsUnevaluated = 1;
   let DuplicatesAllowedWhileMerging = 1;
   let Subjects = SubjectList<[Function, FunctionTemplate]>;
-}
-
-def ExclusiveLocksRequired : InheritableAttr {
-  let Spellings = [GNU<"exclusive_locks_required">];
-  let Args = [VariadicExprArgument<"Args">];
-  let LateParsed = 1;
-  let TemplateDependent = 1;
-  let ParseArgumentsAsUnevaluated = 1;
-  let DuplicatesAllowedWhileMerging = 1;
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
-}
-
-def SharedLocksRequired : InheritableAttr {
-  let Spellings = [GNU<"shared_locks_required">];
-  let Args = [VariadicExprArgument<"Args">];
-  let LateParsed = 1;
-  let TemplateDependent = 1;
-  let ParseArgumentsAsUnevaluated = 1;
-  let DuplicatesAllowedWhileMerging = 1;
-  let Subjects = SubjectList<[Function, FunctionTemplate]>;
+  let Documentation = [Undocumented];
 }
 
 // C/C++ consumed attributes.
@@ -1273,16 +1567,19 @@ def Consumable : InheritableAttr {
   let Args = [EnumArgument<"DefaultState", "ConsumedState",
                            ["unknown", "consumed", "unconsumed"],
                            ["Unknown", "Consumed", "Unconsumed"]>];
+  let Documentation = [ConsumableDocs];
 }
 
 def ConsumableAutoCast : InheritableAttr {
   let Spellings = [GNU<"consumable_auto_cast_state">];
   let Subjects = SubjectList<[CXXRecord]>;
+  let Documentation = [Undocumented];
 }
 
 def ConsumableSetOnRead : InheritableAttr {
   let Spellings = [GNU<"consumable_set_state_on_read">];
   let Subjects = SubjectList<[CXXRecord]>;
+  let Documentation = [Undocumented];
 }
 
 def CallableWhen : InheritableAttr {
@@ -1291,6 +1588,7 @@ def CallableWhen : InheritableAttr {
   let Args = [VariadicEnumArgument<"CallableState", "ConsumedState",
                                    ["unknown", "consumed", "unconsumed"],
                                    ["Unknown", "Consumed", "Unconsumed"]>];
+  let Documentation = [CallableWhenDocs];
 }
 
 def ParamTypestate : InheritableAttr {
@@ -1299,6 +1597,7 @@ def ParamTypestate : InheritableAttr {
   let Args = [EnumArgument<"ParamState", "ConsumedState",
                            ["unknown", "consumed", "unconsumed"],
                            ["Unknown", "Consumed", "Unconsumed"]>];
+  let Documentation = [ParamTypestateDocs];
 }
 
 def ReturnTypestate : InheritableAttr {
@@ -1307,6 +1606,7 @@ def ReturnTypestate : InheritableAttr {
   let Args = [EnumArgument<"State", "ConsumedState",
                            ["unknown", "consumed", "unconsumed"],
                            ["Unknown", "Consumed", "Unconsumed"]>];
+  let Documentation = [ReturnTypestateDocs];
 }
 
 def SetTypestate : InheritableAttr {
@@ -1315,6 +1615,7 @@ def SetTypestate : InheritableAttr {
   let Args = [EnumArgument<"NewState", "ConsumedState",
                            ["unknown", "consumed", "unconsumed"],
                            ["Unknown", "Consumed", "Unconsumed"]>];
+  let Documentation = [SetTypestateDocs];
 }
 
 def TestTypestate : InheritableAttr {
@@ -1323,6 +1624,7 @@ def TestTypestate : InheritableAttr {
   let Args = [EnumArgument<"TestState", "ConsumedState",
                            ["consumed", "unconsumed"],
                            ["Consumed", "Unconsumed"]>];
+  let Documentation = [TestTypestateDocs];
 }
 
 // Type safety attributes for `void *' pointers and type tags.
@@ -1335,6 +1637,7 @@ def ArgumentWithTypeTag : InheritableAttr {
               UnsignedArgument<"TypeTagIdx">,
               BoolArgument<"IsPointer">];
   let HasCustomParsing = 1;
+  let Documentation = [ArgumentWithTypeTagDocs, PointerWithTypeTagDocs];
 }
 
 def TypeTagForDatatype : InheritableAttr {
@@ -1345,6 +1648,7 @@ def TypeTagForDatatype : InheritableAttr {
               BoolArgument<"MustBeNull">];
 //  let Subjects = SubjectList<[Var], ErrorDiag>;
   let HasCustomParsing = 1;
+  let Documentation = [TypeTagForDatatypeDocs];
 }
 
 // Microsoft-related attributes
@@ -1356,27 +1660,26 @@ def MsProperty : IgnoredAttr {
 def MsStruct : InheritableAttr {
   let Spellings = [GCC<"ms_struct">];
   let Subjects = SubjectList<[Record]>;
+  let Documentation = [Undocumented];
 }
 
 def DLLExport : InheritableAttr, TargetSpecificAttr {
   let Spellings = [Declspec<"dllexport">, GCC<"dllexport">];
   let Subjects = SubjectList<[Function, Var]>;
+  let Documentation = [Undocumented];
 }
 
 def DLLImport : InheritableAttr, TargetSpecificAttr {
   let Spellings = [Declspec<"dllimport">, GCC<"dllimport">];
   // Technically, the subjects for DllImport are Function and Var, but there is
   // custom semantic handling required when MicrosoftExt is true.
-}
-
-def ForceInline : InheritableAttr {
-  let Spellings = [Keyword<"__forceinline">];
-  let LangOpts = [MicrosoftExt];
+  let Documentation = [Undocumented];
 }
 
 def SelectAny : InheritableAttr {
   let Spellings = [Declspec<"selectany">];
   let LangOpts = [MicrosoftExt];
+  let Documentation = [Undocumented];
 }
 
 def Win64 : IgnoredAttr {
@@ -1386,18 +1689,22 @@ def Win64 : IgnoredAttr {
 
 def Ptr32 : TypeAttr {
   let Spellings = [Keyword<"__ptr32">];
+  let Documentation = [Undocumented];
 }
 
 def Ptr64 : TypeAttr {
   let Spellings = [Keyword<"__ptr64">];
+  let Documentation = [Undocumented];
 }
 
 def SPtr : TypeAttr {
   let Spellings = [Keyword<"__sptr">];
+  let Documentation = [Undocumented];
 }
 
 def UPtr : TypeAttr {
   let Spellings = [Keyword<"__uptr">];
+  let Documentation = [Undocumented];
 }
 
 def MSInheritance : InheritableAttr {
@@ -1429,6 +1736,25 @@ def MSInheritance : InheritableAttr {
     return Inheritance <= Keyword_multiple_inheritance;
   }
   }];
+  let Documentation = [MSInheritanceDocs];
+}
+
+def MSVtorDisp : InheritableAttr {
+  // This attribute has no spellings as it is only ever created implicitly.
+  let Spellings = [];
+  let Args = [UnsignedArgument<"vdm">];
+  let SemaHandler = 0;
+
+  let AdditionalMembers = [{
+  enum Mode {
+    Never,
+    ForVBaseOverride,
+    ForVFTable
+  };
+
+  Mode getVtorDispMode() const { return Mode(vdm); }
+  }];
+  let Documentation = [Undocumented];
 }
 
 def Unaligned : IgnoredAttr {
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/AttrDocs.td b/external/bsd/llvm/dist/clang/include/clang/Basic/AttrDocs.td
new file mode 100644
index 000000000000..9defad37a883
--- /dev/null
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/AttrDocs.td
@@ -0,0 +1,939 @@
+//==--- AttrDocs.td - Attribute documentation ----------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===---------------------------------------------------------------------===//
+
+def GlobalDocumentation {
+  code Intro =[{..
+  -------------------------------------------------------------------
+  NOTE: This file is automatically generated by running clang-tblgen
+  -gen-attr-docs. Do not edit this file by hand!!
+  -------------------------------------------------------------------
+
+===================
+Attributes in Clang
+===================
+.. contents::
+   :local:
+
+Introduction
+============
+
+This page lists the attributes currently supported by Clang.
+}];
+}
+
+def TLSModelDocs : Documentation {
+  let Category = DocCatVariable;
+  let Content = [{
+The ``tls_model`` attribute allows you to specify which thread-local storage
+model to use. It accepts the following strings:
+
+* global-dynamic
+* local-dynamic
+* initial-exec
+* local-exec
+
+TLS models are mutually exclusive.
+  }];
+}
+
+def CarriesDependencyDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+The ``carries_dependency`` attribute specifies dependency propagation into and
+out of functions.
+
+When specified on a function or Objective-C method, the ``carries_depedency``
+attribute means that the return value carries a dependency out of the function, 
+so that the implementation need not constrain ordering upon return from that
+function. Implementations of the function and its caller may choose to preserve
+dependencies instead of emitting memory ordering instructions such as fences.
+
+Note, this attribute does not change the meaning of the program, but may result
+in generatation of more efficient code.
+  }];
+}
+
+def C11NoReturnDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+A function declared as ``_Noreturn`` shall not return to its caller. The
+compiler will generate a diagnostic for a function declared as ``_Noreturn``
+that appears to be capable of returning to its caller.
+  }];
+}
+
+def CXX11NoReturnDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+A function declared as ``[[noreturn]]`` shall not return to its caller. The
+compiler will generate a diagnostic for a function declared as ``[[noreturn]]``
+that appears to be capable of returning to its caller.
+  }];
+}
+
+def AssertCapabilityDocs : Documentation {
+  let Category = DocCatFunction;
+  let Heading = "assert_capability (assert_shared_capability, clang::assert_capability, clang::assert_shared_capability)";
+  let Content = [{
+Marks a function that dynamically tests whether a capability is held, and halts
+the program if it is not held.
+  }];
+}
+
+def AcquireCapabilityDocs : Documentation {
+  let Category = DocCatFunction;
+  let Heading = "acquire_capability (acquire_shared_capability, clang::acquire_capability, clang::acquire_shared_capability)";
+  let Content = [{
+Marks a function as acquiring a capability.
+  }];
+}
+
+def TryAcquireCapabilityDocs : Documentation {
+  let Category = DocCatFunction;
+  let Heading = "try_acquire_capability (try_acquire_shared_capability, clang::try_acquire_capability, clang::try_acquire_shared_capability)";
+  let Content = [{
+Marks a function that attempts to acquire a capability. This function may fail to
+actually acquire the capability; they accept a Boolean value determining
+whether acquiring the capability means success (true), or failing to acquire
+the capability means success (false).
+  }];
+}
+
+def ReleaseCapabilityDocs : Documentation {
+  let Category = DocCatFunction;
+  let Heading = "release_capability (release_shared_capability, clang::release_capability, clang::release_shared_capability)";
+  let Content = [{
+Marks a function as releasing a capability.
+  }];
+}
+def EnableIfDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+The ``enable_if`` attribute can be placed on function declarations to control
+which overload is selected based on the values of the function's arguments.
+When combined with the ``overloadable`` attribute, this feature is also
+available in C.
+
+.. code-block:: c++
+
+  int isdigit(int c);
+  int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF")));
+  
+  void foo(char c) {
+    isdigit(c);
+    isdigit(10);
+    isdigit(-10);  // results in a compile-time error.
+  }
+
+The enable_if attribute takes two arguments, the first is an expression written
+in terms of the function parameters, the second is a string explaining why this
+overload candidate could not be selected to be displayed in diagnostics. The
+expression is part of the function signature for the purposes of determining
+whether it is a redeclaration (following the rules used when determining
+whether a C++ template specialization is ODR-equivalent), but is not part of
+the type.
+
+The enable_if expression is evaluated as if it were the body of a
+bool-returning constexpr function declared with the arguments of the function
+it is being applied to, then called with the parameters at the callsite. If the
+result is false or could not be determined through constant expression
+evaluation, then this overload will not be chosen and the provided string may
+be used in a diagnostic if the compile fails as a result.
+
+Because the enable_if expression is an unevaluated context, there are no global
+state changes, nor the ability to pass information from the enable_if
+expression to the function body. For example, suppose we want calls to
+strnlen(strbuf, maxlen) to resolve to strnlen_chk(strbuf, maxlen, size of
+strbuf) only if the size of strbuf can be determined:
+
+.. code-block:: c++
+
+  __attribute__((always_inline))
+  static inline size_t strnlen(const char *s, size_t maxlen)
+    __attribute__((overloadable))
+    __attribute__((enable_if(__builtin_object_size(s, 0) != -1))),
+                             "chosen when the buffer size is known but 'maxlen' is not")))
+  {
+    return strnlen_chk(s, maxlen, __builtin_object_size(s, 0));
+  }
+
+Multiple enable_if attributes may be applied to a single declaration. In this
+case, the enable_if expressions are evaluated from left to right in the
+following manner. First, the candidates whose enable_if expressions evaluate to
+false or cannot be evaluated are discarded. If the remaining candidates do not
+share ODR-equivalent enable_if expressions, the overload resolution is
+ambiguous. Otherwise, enable_if overload resolution continues with the next
+enable_if attribute on the candidates that have not been discarded and have
+remaining enable_if attributes. In this way, we pick the most specific
+overload out of a number of viable overloads using enable_if.
+
+.. code-block:: c++
+
+  void f() __attribute__((enable_if(true, "")));  // #1
+  void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, "")));  // #2
+  
+  void g(int i, int j) __attribute__((enable_if(i, "")));  // #1
+  void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true)));  // #2
+
+In this example, a call to f() is always resolved to #2, as the first enable_if
+expression is ODR-equivalent for both declarations, but #1 does not have another
+enable_if expression to continue evaluating, so the next round of evaluation has
+only a single candidate. In a call to g(1, 1), the call is ambiguous even though
+#2 has more enable_if attributes, because the first enable_if expressions are
+not ODR-equivalent.
+
+Query for this feature with ``__has_attribute(enable_if)``.
+  }];
+}
+
+def OverloadableDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Clang provides support for C++ function overloading in C.  Function overloading
+in C is introduced using the ``overloadable`` attribute.  For example, one
+might provide several overloaded versions of a ``tgsin`` function that invokes
+the appropriate standard function computing the sine of a value with ``float``,
+``double``, or ``long double`` precision:
+
+.. code-block:: c
+
+  #include 
+  float __attribute__((overloadable)) tgsin(float x) { return sinf(x); }
+  double __attribute__((overloadable)) tgsin(double x) { return sin(x); }
+  long double __attribute__((overloadable)) tgsin(long double x) { return sinl(x); }
+
+Given these declarations, one can call ``tgsin`` with a ``float`` value to
+receive a ``float`` result, with a ``double`` to receive a ``double`` result,
+etc.  Function overloading in C follows the rules of C++ function overloading
+to pick the best overload given the call arguments, with a few C-specific
+semantics:
+
+* Conversion from ``float`` or ``double`` to ``long double`` is ranked as a
+  floating-point promotion (per C99) rather than as a floating-point conversion
+  (as in C++).
+
+* A conversion from a pointer of type ``T*`` to a pointer of type ``U*`` is
+  considered a pointer conversion (with conversion rank) if ``T`` and ``U`` are
+  compatible types.
+
+* A conversion from type ``T`` to a value of type ``U`` is permitted if ``T``
+  and ``U`` are compatible types.  This conversion is given "conversion" rank.
+
+The declaration of ``overloadable`` functions is restricted to function
+declarations and definitions.  Most importantly, if any function with a given
+name is given the ``overloadable`` attribute, then all function declarations
+and definitions with that name (and in that scope) must have the
+``overloadable`` attribute.  This rule even applies to redeclarations of
+functions whose original declaration had the ``overloadable`` attribute, e.g.,
+
+.. code-block:: c
+
+  int f(int) __attribute__((overloadable));
+  float f(float); // error: declaration of "f" must have the "overloadable" attribute
+
+  int g(int) __attribute__((overloadable));
+  int g(int) { } // error: redeclaration of "g" must also have the "overloadable" attribute
+
+Functions marked ``overloadable`` must have prototypes.  Therefore, the
+following code is ill-formed:
+
+.. code-block:: c
+
+  int h() __attribute__((overloadable)); // error: h does not have a prototype
+
+However, ``overloadable`` functions are allowed to use a ellipsis even if there
+are no named parameters (as is permitted in C++).  This feature is particularly
+useful when combined with the ``unavailable`` attribute:
+
+.. code-block:: c++
+
+  void honeypot(...) __attribute__((overloadable, unavailable)); // calling me is an error
+
+Functions declared with the ``overloadable`` attribute have their names mangled
+according to the same rules as C++ function names.  For example, the three
+``tgsin`` functions in our motivating example get the mangled names
+``_Z5tgsinf``, ``_Z5tgsind``, and ``_Z5tgsine``, respectively.  There are two
+caveats to this use of name mangling:
+
+* Future versions of Clang may change the name mangling of functions overloaded
+  in C, so you should not depend on an specific mangling.  To be completely
+  safe, we strongly urge the use of ``static inline`` with ``overloadable``
+  functions.
+
+* The ``overloadable`` attribute has almost no meaning when used in C++,
+  because names will already be mangled and functions are already overloadable.
+  However, when an ``overloadable`` function occurs within an ``extern "C"``
+  linkage specification, it's name *will* be mangled in the same way as it
+  would in C.
+
+Query for this feature with ``__has_extension(attribute_overloadable)``.
+  }];
+}
+
+def ObjCMethodFamilyDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Many methods in Objective-C have conventional meanings determined by their
+selectors. It is sometimes useful to be able to mark a method as having a
+particular conventional meaning despite not having the right selector, or as
+not having the conventional meaning that its selector would suggest. For these
+use cases, we provide an attribute to specifically describe the "method family"
+that a method belongs to.
+
+**Usage**: ``__attribute__((objc_method_family(X)))``, where ``X`` is one of
+``none``, ``alloc``, ``copy``, ``init``, ``mutableCopy``, or ``new``.  This
+attribute can only be placed at the end of a method declaration:
+
+.. code-block:: objc
+
+  - (NSString *)initMyStringValue __attribute__((objc_method_family(none)));
+
+Users who do not wish to change the conventional meaning of a method, and who
+merely want to document its non-standard retain and release semantics, should
+use the retaining behavior attributes (``ns_returns_retained``,
+``ns_returns_not_retained``, etc).
+
+Query for this feature with ``__has_attribute(objc_method_family)``.
+  }];
+}
+
+def NoDuplicateDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+The ``noduplicate`` attribute can be placed on function declarations to control
+whether function calls to this function can be duplicated or not as a result of
+optimizations. This is required for the implementation of functions with
+certain special requirements, like the OpenCL "barrier" function, that might
+need to be run concurrently by all the threads that are executing in lockstep
+on the hardware. For example this attribute applied on the function
+"nodupfunc" in the code below avoids that:
+
+.. code-block:: c
+
+  void nodupfunc() __attribute__((noduplicate));
+  // Setting it as a C++11 attribute is also valid
+  // void nodupfunc() [[clang::noduplicate]];
+  void foo();
+  void bar();
+
+  nodupfunc();
+  if (a > n) {
+    foo();
+  } else {
+    bar();
+  }
+
+gets possibly modified by some optimizations into code similar to this:
+
+.. code-block:: c
+
+  if (a > n) {
+    nodupfunc();
+    foo();
+  } else {
+    nodupfunc();
+    bar();
+  }
+
+where the call to "nodupfunc" is duplicated and sunk into the two branches
+of the condition.
+  }];
+}
+
+def ObjCRequiresSuperDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Some Objective-C classes allow a subclass to override a particular method in a
+parent class but expect that the overriding method also calls the overridden
+method in the parent class. For these cases, we provide an attribute to
+designate that a method requires a "call to ``super``" in the overriding
+method in the subclass.
+
+**Usage**: ``__attribute__((objc_requires_super))``.  This attribute can only
+be placed at the end of a method declaration:
+
+.. code-block:: objc
+
+  - (void)foo __attribute__((objc_requires_super));
+
+This attribute can only be applied the method declarations within a class, and
+not a protocol.  Currently this attribute does not enforce any placement of
+where the call occurs in the overriding method (such as in the case of
+``-dealloc`` where the call must appear at the end).  It checks only that it
+exists.
+
+Note that on both OS X and iOS that the Foundation framework provides a
+convenience macro ``NS_REQUIRES_SUPER`` that provides syntactic sugar for this
+attribute:
+
+.. code-block:: objc
+
+  - (void)foo NS_REQUIRES_SUPER;
+
+This macro is conditionally defined depending on the compiler's support for
+this attribute.  If the compiler does not support the attribute the macro
+expands to nothing.
+
+Operationally, when a method has this annotation the compiler will warn if the
+implementation of an override in a subclass does not call super.  For example:
+
+.. code-block:: objc
+
+   warning: method possibly missing a [super AnnotMeth] call
+   - (void) AnnotMeth{};
+                      ^
+  }];
+}
+
+def AvailabilityDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+The ``availability`` attribute can be placed on declarations to describe the
+lifecycle of that declaration relative to operating system versions.  Consider
+the function declaration for a hypothetical function ``f``:
+
+.. code-block:: c++
+
+  void f(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6,obsoleted=10.7)));
+
+The availability attribute states that ``f`` was introduced in Mac OS X 10.4,
+deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7.  This information
+is used by Clang to determine when it is safe to use ``f``: for example, if
+Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()``
+succeeds.  If Clang is instructed to compile code for Mac OS X 10.6, the call
+succeeds but Clang emits a warning specifying that the function is deprecated.
+Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call
+fails because ``f()`` is no longer available.
+
+The availability attribute is a comma-separated list starting with the
+platform name and then including clauses specifying important milestones in the
+declaration's lifetime (in any order) along with additional information.  Those
+clauses can be:
+
+introduced=\ *version*
+  The first version in which this declaration was introduced.
+
+deprecated=\ *version*
+  The first version in which this declaration was deprecated, meaning that
+  users should migrate away from this API.
+
+obsoleted=\ *version*
+  The first version in which this declaration was obsoleted, meaning that it
+  was removed completely and can no longer be used.
+
+unavailable
+  This declaration is never available on this platform.
+
+message=\ *string-literal*
+  Additional message text that Clang will provide when emitting a warning or
+  error about use of a deprecated or obsoleted declaration.  Useful to direct
+  users to replacement APIs.
+
+Multiple availability attributes can be placed on a declaration, which may
+correspond to different platforms.  Only the availability attribute with the
+platform corresponding to the target platform will be used; any others will be
+ignored.  If no availability attribute specifies availability for the current
+target platform, the availability attributes are ignored.  Supported platforms
+are:
+
+``ios``
+  Apple's iOS operating system.  The minimum deployment target is specified by
+  the ``-mios-version-min=*version*`` or ``-miphoneos-version-min=*version*``
+  command-line arguments.
+
+``macosx``
+  Apple's Mac OS X operating system.  The minimum deployment target is
+  specified by the ``-mmacosx-version-min=*version*`` command-line argument.
+
+A declaration can be used even when deploying back to a platform version prior
+to when the declaration was introduced.  When this happens, the declaration is
+`weakly linked
+`_,
+as if the ``weak_import`` attribute were added to the declaration.  A
+weakly-linked declaration may or may not be present a run-time, and a program
+can determine whether the declaration is present by checking whether the
+address of that declaration is non-NULL.
+
+If there are multiple declarations of the same entity, the availability
+attributes must either match on a per-platform basis or later
+declarations must not have availability attributes for that
+platform. For example:
+
+.. code-block:: c
+
+  void g(void) __attribute__((availability(macosx,introduced=10.4)));
+  void g(void) __attribute__((availability(macosx,introduced=10.4))); // okay, matches
+  void g(void) __attribute__((availability(ios,introduced=4.0))); // okay, adds a new platform
+  void g(void); // okay, inherits both macosx and ios availability from above.
+  void g(void) __attribute__((availability(macosx,introduced=10.5))); // error: mismatch
+
+When one method overrides another, the overriding method can be more widely available than the overridden method, e.g.,:
+
+.. code-block:: objc
+
+  @interface A
+  - (id)method __attribute__((availability(macosx,introduced=10.4)));
+  - (id)method2 __attribute__((availability(macosx,introduced=10.4)));
+  @end
+
+  @interface B : A
+  - (id)method __attribute__((availability(macosx,introduced=10.3))); // okay: method moved into base class later
+  - (id)method __attribute__((availability(macosx,introduced=10.5))); // error: this method was available via the base class in 10.4
+  @end
+  }];
+}
+
+def FallthroughDocs : Documentation {
+  let Category = DocCatStmt;
+  let Content = [{
+The ``clang::fallthrough`` attribute is used along with the
+``-Wimplicit-fallthrough`` argument to annotate intentional fall-through
+between switch labels.  It can only be applied to a null statement placed at a
+point of execution between any statement and the next switch label.  It is
+common to mark these places with a specific comment, but this attribute is
+meant to replace comments with a more strict annotation, which can be checked
+by the compiler.  This attribute doesn't change semantics of the code and can
+be used wherever an intended fall-through occurs.  It is designed to mimic
+control-flow statements like ``break;``, so it can be placed in most places
+where ``break;`` can, but only if there are no statements on the execution path
+between it and the next switch label.
+
+Here is an example:
+
+.. code-block:: c++
+
+  // compile with -Wimplicit-fallthrough
+  switch (n) {
+  case 22:
+  case 33:  // no warning: no statements between case labels
+    f();
+  case 44:  // warning: unannotated fall-through
+    g();
+    [[clang::fallthrough]];
+  case 55:  // no warning
+    if (x) {
+      h();
+      break;
+    }
+    else {
+      i();
+      [[clang::fallthrough]];
+    }
+  case 66:  // no warning
+    p();
+    [[clang::fallthrough]]; // warning: fallthrough annotation does not
+                            //          directly precede case label
+    q();
+  case 77:  // warning: unannotated fall-through
+    r();
+  }
+  }];
+}
+
+def ARMInterruptDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Clang supports the GNU style ``__attribute__((interrupt("TYPE")))`` attribute on
+ARM targets. This attribute may be attached to a function definition and
+instructs the backend to generate appropriate function entry/exit code so that
+it can be used directly as an interrupt service routine.
+
+The parameter passed to the interrupt attribute is optional, but if
+provided it must be a string literal with one of the following values: "IRQ",
+"FIQ", "SWI", "ABORT", "UNDEF".
+
+The semantics are as follows:
+
+- If the function is AAPCS, Clang instructs the backend to realign the stack to
+  8 bytes on entry. This is a general requirement of the AAPCS at public
+  interfaces, but may not hold when an exception is taken. Doing this allows
+  other AAPCS functions to be called.
+- If the CPU is M-class this is all that needs to be done since the architecture
+  itself is designed in such a way that functions obeying the normal AAPCS ABI
+  constraints are valid exception handlers.
+- If the CPU is not M-class, the prologue and epilogue are modified to save all
+  non-banked registers that are used, so that upon return the user-mode state
+  will not be corrupted. Note that to avoid unnecessary overhead, only
+  general-purpose (integer) registers are saved in this way. If VFP operations
+  are needed, that state must be saved manually.
+
+  Specifically, interrupt kinds other than "FIQ" will save all core registers
+  except "lr" and "sp". "FIQ" interrupts will save r0-r7.
+- If the CPU is not M-class, the return instruction is changed to one of the
+  canonical sequences permitted by the architecture for exception return. Where
+  possible the function itself will make the necessary "lr" adjustments so that
+  the "preferred return address" is selected.
+
+  Unfortunately the compiler is unable to make this guarantee for an "UNDEF"
+  handler, where the offset from "lr" to the preferred return address depends on
+  the execution state of the code which generated the exception. In this case
+  a sequence equivalent to "movs pc, lr" will be used.
+  }];
+}
+
+def DocCatConsumed : DocumentationCategory<"Consumed Annotation Checking"> {
+  let Content = [{
+Clang supports additional attributes for checking basic resource management
+properties, specifically for unique objects that have a single owning reference.
+The following attributes are currently supported, although **the implementation
+for these annotations is currently in development and are subject to change.**
+  }];
+}
+
+def SetTypestateDocs : Documentation {
+  let Category = DocCatConsumed;
+  let Content = [{
+Annotate methods that transition an object into a new state with
+``__attribute__((set_typestate(new_state)))``.  The new new state must be
+unconsumed, consumed, or unknown.
+  }];
+}
+
+def CallableWhenDocs : Documentation {
+  let Category = DocCatConsumed;
+  let Content = [{
+Use ``__attribute__((callable_when(...)))`` to indicate what states a method
+may be called in.  Valid states are unconsumed, consumed, or unknown.  Each
+argument to this attribute must be a quoted string.  E.g.:
+
+``__attribute__((callable_when("unconsumed", "unknown")))``
+  }];
+}
+
+def TestTypestateDocs : Documentation {
+  let Category = DocCatConsumed;
+  let Content = [{
+Use ``__attribute__((test_typestate(tested_state)))`` to indicate that a method
+returns true if the object is in the specified state..
+  }];
+}
+
+def ParamTypestateDocs : Documentation {
+  let Category = DocCatConsumed;
+  let Content = [{
+This attribute specifies expectations about function parameters.  Calls to an
+function with annotated parameters will issue a warning if the corresponding
+argument isn't in the expected state.  The attribute is also used to set the
+initial state of the parameter when analyzing the function's body.
+  }];
+}
+
+def ReturnTypestateDocs : Documentation {
+  let Category = DocCatConsumed;
+  let Content = [{
+The ``return_typestate`` attribute can be applied to functions or parameters.
+When applied to a function the attribute specifies the state of the returned
+value.  The function's body is checked to ensure that it always returns a value
+in the specified state.  On the caller side, values returned by the annotated
+function are initialized to the given state.
+
+When applied to a function parameter it modifies the state of an argument after
+a call to the function returns.  The function's body is checked to ensure that
+the parameter is in the expected state before returning.
+  }];
+}
+
+def ConsumableDocs : Documentation {
+  let Category = DocCatConsumed;
+  let Content = [{
+Each ``class`` that uses any of the typestate annotations must first be marked
+using the ``consumable`` attribute.  Failure to do so will result in a warning.
+
+This attribute accepts a single parameter that must be one of the following:
+``unknown``, ``consumed``, or ``unconsumed``.
+  }];
+}
+
+def NoSanitizeAddressDocs : Documentation {
+  let Category = DocCatFunction;
+  // This function has multiple distinct spellings, and so it requires a custom
+  // heading to be specified. The most common spelling is sufficient.
+  let Heading = "no_sanitize_address (no_address_safety_analysis, gnu::no_address_safety_analysis, gnu::no_sanitize_address)";
+  let Content = [{
+Use ``__attribute__((no_sanitize_address))`` on a function declaration to
+specify that address safety instrumentation (e.g. AddressSanitizer) should
+not be applied to that function.
+  }];
+}
+
+def NoSanitizeThreadDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Use ``__attribute__((no_sanitize_thread))`` on a function declaration to
+specify that checks for data races on plain (non-atomic) memory accesses should
+not be inserted by ThreadSanitizer. The function is still instrumented by the
+tool to avoid false positives and provide meaningful stack traces.
+  }];
+}
+
+def NoSanitizeMemoryDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+Use ``__attribute__((no_sanitize_memory))`` on a function declaration to
+specify that checks for uninitialized memory should not be inserted 
+(e.g. by MemorySanitizer). The function may still be instrumented by the tool
+to avoid false positives in other places.
+  }];
+}
+
+def DocCatTypeSafety : DocumentationCategory<"Type Safety Checking"> {
+  let Content = [{
+Clang supports additional attributes to enable checking type safety properties
+that can't be enforced by the C type system.  Use cases include:
+
+* MPI library implementations, where these attributes enable checking that
+  the buffer type matches the passed ``MPI_Datatype``;
+* for HDF5 library there is a similar use case to MPI;
+* checking types of variadic functions' arguments for functions like
+  ``fcntl()`` and ``ioctl()``.
+
+You can detect support for these attributes with ``__has_attribute()``.  For
+example:
+
+.. code-block:: c++
+
+  #if defined(__has_attribute)
+  #  if __has_attribute(argument_with_type_tag) && \
+        __has_attribute(pointer_with_type_tag) && \
+        __has_attribute(type_tag_for_datatype)
+  #    define ATTR_MPI_PWT(buffer_idx, type_idx) __attribute__((pointer_with_type_tag(mpi,buffer_idx,type_idx)))
+  /* ... other macros ...  */
+  #  endif
+  #endif
+
+  #if !defined(ATTR_MPI_PWT)
+  # define ATTR_MPI_PWT(buffer_idx, type_idx)
+  #endif
+
+  int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
+      ATTR_MPI_PWT(1,3);
+  }];
+}
+
+def ArgumentWithTypeTagDocs : Documentation {
+  let Category = DocCatTypeSafety;
+  let Heading = "argument_with_type_tag";
+  let Content = [{
+Use ``__attribute__((argument_with_type_tag(arg_kind, arg_idx,
+type_tag_idx)))`` on a function declaration to specify that the function
+accepts a type tag that determines the type of some other argument.
+``arg_kind`` is an identifier that should be used when annotating all
+applicable type tags.
+
+This attribute is primarily useful for checking arguments of variadic functions
+(``pointer_with_type_tag`` can be used in most non-variadic cases).
+
+For example:
+
+.. code-block:: c++
+
+  int fcntl(int fd, int cmd, ...)
+      __attribute__(( argument_with_type_tag(fcntl,3,2) ));
+  }];
+}
+
+def PointerWithTypeTagDocs : Documentation {
+  let Category = DocCatTypeSafety;
+  let Heading = "pointer_with_type_tag";
+  let Content = [{
+Use ``__attribute__((pointer_with_type_tag(ptr_kind, ptr_idx, type_tag_idx)))``
+on a function declaration to specify that the function accepts a type tag that
+determines the pointee type of some other pointer argument.
+
+For example:
+
+.. code-block:: c++
+
+  int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */)
+      __attribute__(( pointer_with_type_tag(mpi,1,3) ));
+  }];
+}
+
+def TypeTagForDatatypeDocs : Documentation {
+  let Category = DocCatTypeSafety;
+  let Content = [{
+Clang supports annotating type tags of two forms.
+
+* **Type tag that is an expression containing a reference to some declared
+  identifier.** Use ``__attribute__((type_tag_for_datatype(kind, type)))`` on a
+  declaration with that identifier:
+
+  .. code-block:: c++
+
+    extern struct mpi_datatype mpi_datatype_int
+        __attribute__(( type_tag_for_datatype(mpi,int) ));
+    #define MPI_INT ((MPI_Datatype) &mpi_datatype_int)
+
+* **Type tag that is an integral literal.** Introduce a ``static const``
+  variable with a corresponding initializer value and attach
+  ``__attribute__((type_tag_for_datatype(kind, type)))`` on that declaration,
+  for example:
+
+  .. code-block:: c++
+
+    #define MPI_INT ((MPI_Datatype) 42)
+    static const MPI_Datatype mpi_datatype_int
+        __attribute__(( type_tag_for_datatype(mpi,int) )) = 42
+
+The attribute also accepts an optional third argument that determines how the
+expression is compared to the type tag.  There are two supported flags:
+
+* ``layout_compatible`` will cause types to be compared according to
+  layout-compatibility rules (C++11 [class.mem] p 17, 18).  This is
+  implemented to support annotating types like ``MPI_DOUBLE_INT``.
+
+  For example:
+
+  .. code-block:: c++
+
+    /* In mpi.h */
+    struct internal_mpi_double_int { double d; int i; };
+    extern struct mpi_datatype mpi_datatype_double_int
+        __attribute__(( type_tag_for_datatype(mpi, struct internal_mpi_double_int, layout_compatible) ));
+
+    #define MPI_DOUBLE_INT ((MPI_Datatype) &mpi_datatype_double_int)
+
+    /* In user code */
+    struct my_pair { double a; int b; };
+    struct my_pair *buffer;
+    MPI_Send(buffer, 1, MPI_DOUBLE_INT /*, ...  */); // no warning
+
+    struct my_int_pair { int a; int b; }
+    struct my_int_pair *buffer2;
+    MPI_Send(buffer2, 1, MPI_DOUBLE_INT /*, ...  */); // warning: actual buffer element
+                                                      // type 'struct my_int_pair'
+                                                      // doesn't match specified MPI_Datatype
+
+* ``must_be_null`` specifies that the expression should be a null pointer
+  constant, for example:
+
+  .. code-block:: c++
+
+    /* In mpi.h */
+    extern struct mpi_datatype mpi_datatype_null
+        __attribute__(( type_tag_for_datatype(mpi, void, must_be_null) ));
+
+    #define MPI_DATATYPE_NULL ((MPI_Datatype) &mpi_datatype_null)
+
+    /* In user code */
+    MPI_Send(buffer, 1, MPI_DATATYPE_NULL /*, ...  */); // warning: MPI_DATATYPE_NULL
+                                                        // was specified but buffer
+                                                        // is not a null pointer
+  }];
+}
+
+def FormatDocs : Documentation {
+  let Category = DocCatFunction;
+  let Content = [{
+
+Clang supports the ``format`` attribute, which indicates that the function
+accepts a ``printf`` or ``scanf``-like format string and corresponding
+arguments or a ``va_list`` that contains these arguments.
+
+Please see `GCC documentation about format attribute
+`_ to find details
+about attribute syntax.
+
+Clang implements two kinds of checks with this attribute.
+
+#. Clang checks that the function with the ``format`` attribute is called with
+   a format string that uses format specifiers that are allowed, and that
+   arguments match the format string.  This is the ``-Wformat`` warning, it is
+   on by default.
+
+#. Clang checks that the format string argument is a literal string.  This is
+   the ``-Wformat-nonliteral`` warning, it is off by default.
+
+   Clang implements this mostly the same way as GCC, but there is a difference
+   for functions that accept a ``va_list`` argument (for example, ``vprintf``).
+   GCC does not emit ``-Wformat-nonliteral`` warning for calls to such
+   fuctions.  Clang does not warn if the format string comes from a function
+   parameter, where the function is annotated with a compatible attribute,
+   otherwise it warns.  For example:
+
+   .. code-block:: c
+
+     __attribute__((__format__ (__scanf__, 1, 3)))
+     void foo(const char* s, char *buf, ...) {
+       va_list ap;
+       va_start(ap, buf);
+
+       vprintf(s, ap); // warning: format string is not a string literal
+     }
+
+   In this case we warn because ``s`` contains a format string for a
+   ``scanf``-like function, but it is passed to a ``printf``-like function.
+
+   If the attribute is removed, clang still warns, because the format string is
+   not a string literal.
+
+   Another example:
+
+   .. code-block:: c
+
+     __attribute__((__format__ (__printf__, 1, 3)))
+     void foo(const char* s, char *buf, ...) {
+       va_list ap;
+       va_start(ap, buf);
+
+       vprintf(s, ap); // warning
+     }
+
+   In this case Clang does not warn because the format string ``s`` and
+   the corresponding arguments are annotated.  If the arguments are
+   incorrect, the caller of ``foo`` will receive a warning.
+  }];
+}
+
+def MSInheritanceDocs : Documentation {
+  let Category = DocCatType;
+  let Heading = "__single_inhertiance, __multiple_inheritance, __virtual_inheritance";
+  let Content = [{
+This collection of keywords is enabled under ``-fms-extensions`` and controls
+the pointer-to-member representation used on ``*-*-win32`` targets.
+
+The ``*-*-win32`` targets utilize a pointer-to-member representation which
+varies in size and alignment depending on the definition of the underlying
+class.
+
+However, this is problematic when a forward declaration is only available and
+no definition has been made yet.  In such cases, Clang is forced to utilize the
+most general representation that is available to it.
+
+These keywords make it possible to use a pointer-to-member representation other
+than the most general one regardless of whether or not the definition will ever
+be present in the current translation unit.
+
+This family of keywords belong between the ``class-key`` and ``class-name``:
+
+.. code-block:: c++
+
+  struct __single_inheritance S;
+  int S::*i;
+  struct S {};
+
+This keyword can be applied to class templates but only has an effect when used
+on full specializations:
+
+.. code-block:: c++
+
+  template  struct __single_inheritance A; // warning: inheritance model ignored on primary template
+  template  struct __multiple_inheritance A; // warning: inheritance model ignored on partial specialization
+  template <> struct __single_inheritance A;
+
+Note that choosing an inheritance model less general than strictly necessary is
+an error:
+
+.. code-block:: c++
+
+  struct __multiple_inheritance S; // error: inheritance model does not match definition
+  int S::*i;
+  struct S {};
+}];
+}
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/Builtins.def b/external/bsd/llvm/dist/clang/include/clang/Basic/Builtins.def
index af8a4dae7dfd..a44a7a2d21f1 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/Builtins.def
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/Builtins.def
@@ -50,6 +50,7 @@
 //  L   -> long (e.g. Li for 'long int')
 //  LL  -> long long
 //  LLL -> __int128_t (e.g. LLLi)
+//  W   -> int64_t
 //  S   -> signed
 //  U   -> unsigned
 //  I   -> Required to constant fold to an integer constant expression.
@@ -679,6 +680,10 @@ LANGBUILTIN(_alloca,      "v*z", "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(__assume,     "vb",  "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(__noop,       "v.",  "n", ALL_MS_LANGUAGES)
 LANGBUILTIN(__debugbreak, "v",   "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedCompareExchange, "LiLiD*LiLi", "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedIncrement, "LiLiD*", "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedDecrement, "LiLiD*", "n", ALL_MS_LANGUAGES)
+LANGBUILTIN(_InterlockedExchangeAdd, "LiLiD*Li", "n", ALL_MS_LANGUAGES)
 
 // C99 library functions
 // C99 stdlib.h
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/BuiltinsX86.def b/external/bsd/llvm/dist/clang/include/clang/Basic/BuiltinsX86.def
index 51397fa45df6..4a67fc1f5ff4 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/BuiltinsX86.def
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/BuiltinsX86.def
@@ -59,6 +59,7 @@ BUILTIN(__builtin_ia32_pswapdsi, "V2iV2i", "nc")
 // All MMX instructions will be generated via builtins. Any MMX vector
 // types (<1 x i64>, <2 x i32>, etc.) that aren't used by these builtins will be
 // expanded by the back-end.
+BUILTIN(_mm_prefetch, "vcC*i", "nc")
 BUILTIN(__builtin_ia32_emms, "v", "")
 BUILTIN(__builtin_ia32_paddb, "V8cV8cV8c", "")
 BUILTIN(__builtin_ia32_paddw, "V4sV4sV4s", "")
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/Diagnostic.h b/external/bsd/llvm/dist/clang/include/clang/Basic/Diagnostic.h
index 6782964df668..d83c4c0b9b40 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/Diagnostic.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/Diagnostic.h
@@ -142,6 +142,7 @@ public:
   enum Level {
     Ignored = DiagnosticIDs::Ignored,
     Note = DiagnosticIDs::Note,
+    Remark = DiagnosticIDs::Remark,
     Warning = DiagnosticIDs::Warning,
     Error = DiagnosticIDs::Error,
     Fatal = DiagnosticIDs::Fatal
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/Diagnostic.td b/external/bsd/llvm/dist/clang/include/clang/Basic/Diagnostic.td
index 2616548bc009..61a4508615e1 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/Diagnostic.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/Diagnostic.td
@@ -15,6 +15,7 @@
 // Define the diagnostic mappings.
 class DiagMapping;
 def MAP_IGNORE  : DiagMapping;
+def MAP_REMARK  : DiagMapping;
 def MAP_WARNING : DiagMapping;
 def MAP_ERROR   : DiagMapping;
 def MAP_FATAL   : DiagMapping;
@@ -22,6 +23,7 @@ def MAP_FATAL   : DiagMapping;
 // Define the diagnostic classes.
 class DiagClass;
 def CLASS_NOTE      : DiagClass;
+def CLASS_REMARK    : DiagClass;
 def CLASS_WARNING   : DiagClass;
 def CLASS_EXTENSION : DiagClass;
 def CLASS_ERROR     : DiagClass;
@@ -84,6 +86,7 @@ class AccessControl {
 // FIXME: ExtWarn and Extension should also be SFINAEFailure by default.
 class Error     : Diagnostic, SFINAEFailure;
 class Warning   : Diagnostic;
+class Remark    : Diagnostic;
 class Extension : Diagnostic;
 class ExtWarn   : Diagnostic;
 class Note      : Diagnostic;
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticDriverKinds.td b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticDriverKinds.td
index dbc5ce994c62..f100b57d07ab 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -166,4 +166,11 @@ def err_analyzer_config_no_value : Error<
   "analyzer-config option '%0' has a key but no value">;
 def err_analyzer_config_multiple_values : Error<
   "analyzer-config option '%0' should contain only one '='">;
+
+def err_drv_modules_validate_once_requires_timestamp : Error<
+  "option '-fmodules-validate-once-per-build-session' requires "
+  "'-fbuild-session-timestamp='">;
+
+def warn_drv_invoking_fallback : Warning<"falling back to %0">,
+  InGroup>;
 }
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticFrontendKinds.td b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticFrontendKinds.td
index 21809ad63ff1..41a83a0b8ed3 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -29,6 +29,7 @@ def note_fe_backend_frame_larger_than: Note<"%0">, CatBackend;
 
 def warn_fe_backend_plugin: Warning<"%0">, CatBackend, InGroup;
 def err_fe_backend_plugin: Error<"%0">, CatBackend;
+def remark_fe_backend_plugin: Remark<"%0">, CatBackend, InGroup;
 def note_fe_backend_plugin: Note<"%0">, CatBackend;
 
 def err_fe_invalid_code_complete_file : Error<
@@ -158,4 +159,9 @@ def warn_module_config_macro_undef : Warning<
   InGroup;
 def note_module_def_undef_here : Note<
   "macro was %select{defined|#undef'd}0 here">;
+
+def err_missing_vfs_overlay_file : Error<
+  "virtual filesystem overlay file '%0' not found">, DefaultFatal;
+def err_invalid_vfs_overlay : Error<
+  "invalid virtual filesystem overlay file '%0'">, DefaultFatal;
 }
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticGroups.td b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticGroups.td
index 01aad5610260..9ec2f421cda3 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticGroups.td
@@ -18,6 +18,7 @@ def Implicit : DiagGroup<"implicit", [
 
 // Empty DiagGroups are recognized by clang but ignored.
 def : DiagGroup<"abi">;
+def AbsoluteValue : DiagGroup<"absolute-value">;
 def : DiagGroup<"address">;
 def AddressOfTemporary : DiagGroup<"address-of-temporary">;
 def : DiagGroup<"aggregate-return">;
@@ -174,6 +175,7 @@ def InfiniteRecursion : DiagGroup<"infinite-recursion">;
 def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">;
 def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
 def : DiagGroup<"import">;
+def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">;
 def IncompatiblePointerTypesDiscardsQualifiers 
   : DiagGroup<"incompatible-pointer-types-discards-qualifiers">;
 def IncompatiblePointerTypes
@@ -217,6 +219,7 @@ def NullDereference : DiagGroup<"null-dereference">;
 def InitializerOverrides : DiagGroup<"initializer-overrides">;
 def NonNull : DiagGroup<"nonnull">;
 def NonPODVarargs : DiagGroup<"non-pod-varargs">;
+def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>;
 def : DiagGroup<"nonportable-cfstrings">;
 def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
 def OveralignedType : DiagGroup<"over-aligned">;
@@ -284,8 +287,10 @@ def StringPlusInt : DiagGroup<"string-plus-int">;
 def StringPlusChar : DiagGroup<"string-plus-char">;
 def StrncatSize : DiagGroup<"strncat-size">;
 def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
+def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">;
 def TautologicalCompare : DiagGroup<"tautological-compare",
-                                    [TautologicalOutOfRangeCompare]>;
+                                    [TautologicalOutOfRangeCompare,
+                                     TautologicalPointerCompare]>;
 def HeaderHygiene : DiagGroup<"header-hygiene">;
 def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">;
 def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">;
@@ -471,7 +476,7 @@ def Format : DiagGroup<"format",
                        [FormatExtraArgs, FormatZeroLength, NonNull,
                         FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
              DiagCategory<"Format String Issue">;
-def FormatNonLiteral : DiagGroup<"format-nonliteral", [FormatSecurity]>;
+def FormatNonLiteral : DiagGroup<"format-nonliteral">;
 def Format2 : DiagGroup<"format=2",
                         [FormatNonLiteral, FormatSecurity, FormatY2K]>;
 
@@ -632,3 +637,4 @@ def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">;
 def BackendInlineAsm : DiagGroup<"inline-asm">;
 def BackendFrameLargerThan : DiagGroup<"frame-larger-than">;
 def BackendPlugin : DiagGroup<"backend-plugin">;
+def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticIDs.h b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticIDs.h
index 0152f25fa669..f9b845606bc6 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticIDs.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticIDs.h
@@ -56,16 +56,17 @@ namespace clang {
     };
 
     /// Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs
-    /// to either MAP_IGNORE (nothing), MAP_WARNING (emit a warning), MAP_ERROR
-    /// (emit as an error).  It allows clients to map errors to
-    /// MAP_ERROR/MAP_DEFAULT or MAP_FATAL (stop emitting diagnostics after this
-    /// one).
+    /// to either MAP_IGNORE (nothing), MAP_REMARK (emit a remark), MAP_WARNING
+    /// (emit a warning), MAP_ERROR (emit as an error).  It allows clients to
+    /// map errors to MAP_ERROR/MAP_DEFAULT or MAP_FATAL (stop emitting
+    /// diagnostics after this one).
     enum Mapping {
       // NOTE: 0 means "uncomputed".
       MAP_IGNORE  = 1,     ///< Map this diagnostic to nothing, ignore it.
-      MAP_WARNING = 2,     ///< Map this diagnostic to a warning.
-      MAP_ERROR   = 3,     ///< Map this diagnostic to an error.
-      MAP_FATAL   = 4      ///< Map this diagnostic to a fatal error.
+      MAP_REMARK  = 2,     ///< Map this diagnostic to a remark.
+      MAP_WARNING = 3,     ///< Map this diagnostic to a warning.
+      MAP_ERROR   = 4,     ///< Map this diagnostic to an error.
+      MAP_FATAL   = 5      ///< Map this diagnostic to a fatal error.
     };
   }
 
@@ -113,7 +114,7 @@ class DiagnosticIDs : public RefCountedBase {
 public:
   /// \brief The level of the diagnostic, after it has been through mapping.
   enum Level {
-    Ignored, Note, Warning, Error, Fatal
+    Ignored, Note, Remark, Warning, Error, Fatal
   };
 
 private:
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticLexKinds.td b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticLexKinds.td
index 4607eb053258..16ac94f3d130 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticLexKinds.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticLexKinds.td
@@ -494,7 +494,7 @@ def err_too_few_args_in_macro_invoc : Error<
   "too few arguments provided to function-like macro invocation">;
 def err_pp_bad_paste : Error<
   "pasting formed '%0', an invalid preprocessing token">;
-def err_pp_bad_paste_ms : Warning<
+def ext_pp_bad_paste_ms : ExtWarn<
   "pasting formed '%0', an invalid preprocessing token">, DefaultError,
   InGroup>;
 def err_pp_operator_used_as_macro_name : Error<
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticParseKinds.td b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticParseKinds.td
index de07ee8d8fc9..d37cef8db2ea 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -770,6 +770,9 @@ def warn_pragma_expected_rparen : Warning<
   "missing ')' after '#pragma %0' - ignoring">, InGroup;
 def warn_pragma_expected_identifier : Warning<
   "expected identifier in '#pragma %0' - ignored">, InGroup;
+def warn_pragma_expected_integer : Warning<
+  "expected integer between %0 and %1 inclusive in '#pragma %2' - ignored">,
+  InGroup;
 def warn_pragma_ms_struct : Warning<
   "incorrect use of '#pragma ms_struct on|off' - ignored">,
   InGroup;
@@ -789,8 +792,8 @@ def warn_pragma_align_invalid_option : Warning<
   "invalid alignment option in '#pragma %select{align|options align}0' - ignored">,
   InGroup;
 // - #pragma pack
-def warn_pragma_pack_invalid_action : Warning<
-  "unknown action for '#pragma pack' - ignored">,
+def warn_pragma_invalid_action : Warning<
+  "unknown action for '#pragma %0' - ignored">,
   InGroup;
 def warn_pragma_pack_malformed : Warning<
   "expected integer or identifier in '#pragma pack' - ignored">,
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticSemaKinds.td b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 93d5948ce8ff..bf6f33c13e5a 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -30,6 +30,21 @@ def warn_duplicate_enum_values : Warning<
   "been assigned">, InGroup>, DefaultIgnore;
 def note_duplicate_element : Note<"element %0 also has value %1">;
 
+// Absolute value functions
+def warn_unsigned_abs : Warning<
+  "taking the absolute value of unsigned type %0 has no effect">,
+  InGroup;
+def note_remove_abs : Note<
+  "remove the call to %0 since unsigned values cannot be negative">;
+def warn_abs_too_small : Warning<
+  "absolute value function %0 given an argument of type %1 but has parameter "
+  "of type %2 which may cause truncation of value">, InGroup;
+def warn_wrong_absolute_value_type : Warning<
+  "using %select{integer|floating point|complex}1 absolute value function %0 "
+  "when argument is of %select{integer|floating point|complex}2 type">,
+  InGroup;
+def note_replace_abs_function : Note<"use function '%0' instead">;
+
 def warn_infinite_recursive_function : Warning<
   "all paths through this function will call itself">,
   InGroup, DefaultIgnore;
@@ -222,7 +237,10 @@ def note_function_suggestion : Note<"did you mean %0?">;
 def err_ellipsis_first_arg : Error<
   "ISO C requires a named argument before '...'">;
 def err_declarator_need_ident : Error<"declarator requires an identifier">;
-def err_bad_language : Error<"unknown linkage language">;
+def err_language_linkage_spec_unknown : Error<"unknown linkage language">;
+def err_language_linkage_spec_not_ascii : Error<
+  "string literal in language linkage specifier cannot have an "
+  "encoding-prefix">;
 def warn_use_out_of_scope_declaration : Warning<
   "use of out-of-scope declaration of %0">;
 def err_inline_non_function : Error<
@@ -480,10 +498,12 @@ def warn_pragma_pack_invalid_alignment : Warning<
 def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">;
 def warn_pragma_pack_pop_identifer_and_alignment : Warning<
   "specifying both a name and alignment to 'pop' is undefined">;
-def warn_pragma_pack_pop_failed : Warning<"#pragma pack(pop, ...) failed: %0">,
-  InGroup;
-def warn_pragma_ms_struct_failed : Warning<"#pramga ms_struct can not be used with dynamic classes or structures">,
+def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
   InGroup;
+def warn_cxx_ms_struct :
+  Warning<"ms_struct may not produce MSVC-compatible layouts for classes "
+          "with base classes or virtual functions">,
+  DefaultError, InGroup;
 
 def warn_pragma_unused_undeclared_var : Warning<
   "undeclared variable %0 used as an argument for '#pragma unused'">,
@@ -1527,7 +1547,10 @@ def err_auto_var_init_multiple_expressions : Error<
 def err_auto_new_ctor_multiple_expressions : Error<
   "new expression for type %0 contains multiple constructor arguments">;
 def err_auto_missing_trailing_return : Error<
-  "'auto' return without trailing return type">;
+  "'auto' return without trailing return type; deduced return types are a "
+  "C++1y extension">;
+def err_deduced_return_type : Error<
+  "deduced return types are a C++1y extension">;
 def err_trailing_return_without_auto : Error<
   "function with trailing return type must specify return type 'auto', not %0">;
 def err_trailing_return_in_parens : Error<
@@ -1982,8 +2005,8 @@ def error_cannot_find_suitable_accessor : Error<
 
 def err_attribute_aligned_not_power_of_two : Error<
   "requested alignment is not a power of 2">;
-def err_attribute_aligned_greater_than_8192 : Error<
-  "requested alignment must be 8192 bytes or smaller">;
+def err_attribute_aligned_too_great : Error<
+  "requested alignment must be %0 bytes or smaller">;
 def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
   "%0 redeclared without %1 attribute: previous %1 ignored">;
 def warn_attribute_ignored : Warning<"%0 attribute ignored">,
@@ -2034,6 +2057,8 @@ def err_attribute_selectany_non_extern_data : Error<
 def warn_attribute_invalid_on_definition : Warning<
   "'%0' attribute cannot be specified on a definition">,
   InGroup;
+def err_attribute_dllimport_data_definition : Error<
+  "definition of dllimport data">;
 def err_attribute_weakref_not_static : Error<
   "weakref declaration must have internal linkage">;
 def err_attribute_weakref_not_global_context : Error<
@@ -2133,7 +2158,7 @@ def warn_thread_attribute_ignored : Warning<
   InGroup, DefaultIgnore;
 def warn_thread_attribute_argument_not_lockable : Warning<
   "%0 attribute requires arguments whose type is annotated "
-  "with 'lockable' attribute; type here is %1">,
+  "with 'capability' attribute; type here is %1">,
   InGroup, DefaultIgnore;
 def warn_thread_attribute_argument_not_class : Warning<
   "%0 attribute requires arguments that are class type or point to"
@@ -2141,7 +2166,7 @@ def warn_thread_attribute_argument_not_class : Warning<
   InGroup, DefaultIgnore;  
 def warn_thread_attribute_decl_not_lockable : Warning<
   "%0 attribute can only be applied in a context annotated "
-  "with 'lockable' attribute">,
+  "with 'capability(\"mutex\")' attribute">,
   InGroup, DefaultIgnore;
 def warn_thread_attribute_decl_not_pointer : Warning<
   "%0 only applies to pointer types; type here is %1">,
@@ -2301,12 +2326,19 @@ def warn_impcast_null_pointer_to_integer : Warning<
 def warn_impcast_floating_point_to_bool : Warning<
     "implicit conversion turns floating-point number into bool: %0 to %1">,
     InGroup;
-def warn_impcast_function_to_bool : Warning<
-    "address of function %q0 will always evaluate to 'true'">,
+
+def warn_impcast_pointer_to_bool : Warning<
+    "address of%select{| function| array}0 '%1' will always evaluate to "
+    "'true'">,
     InGroup;
-def note_function_to_bool_silence : Note<
+def warn_null_pointer_compare : Warning<
+    "comparison of %select{address of|function|array}0 '%1' %select{not |}2"
+    "equal to a null pointer is always %select{true|false}2">,
+    InGroup;
+
+def note_function_warning_silence : Note<
     "prefix with the address-of operator to silence this warning">;
-def note_function_to_bool_call : Note<
+def note_function_to_function_call : Note<
     "suffix with parentheses to turn this into a function call">;
 def warn_impcast_objective_c_literal_to_bool : Warning<
     "implicit boolean conversion of Objective-C object literal always "
@@ -2493,7 +2525,10 @@ def err_objc_bridged_related_invalid_class_name : Error<
 def err_objc_bridged_related_known_method : Error<
  "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 "
  "method for this conversion">;
-  
+
+def err_objc_attr_protocol_requires_definition : Error<
+  "attribute %0 can only be applied to @protocol definitions, not forward declarations">;
+
 // Function Parameter Semantic Analysis.
 def err_param_with_void_type : Error<"argument may not have 'void' type">;
 def err_void_only_param : Error<
@@ -2504,8 +2539,6 @@ def err_ident_list_in_fn_declaration : Error<
   "a parameter list without types is only allowed in a function definition">;
 def ext_param_not_declared : Extension<
   "parameter %0 was not declared, defaulting to type 'int'">;
-def err_param_typedef_of_void : Error<
-  "empty parameter list defined with a %select{typedef|type alias}0 of 'void' not allowed%select{ in C++|}0">;
 def err_param_default_argument : Error<
   "C does not support default arguments">;
 def err_param_default_argument_redefinition : Error<
@@ -3213,8 +3246,6 @@ def note_dependent_non_type_default_arg_in_partial_spec : Note<
 def err_dependent_typed_non_type_arg_in_partial_spec : Error<
     "non-type template argument specializes a template parameter with "
     "dependent type %0">;
-def note_dependent_typed_non_type_default_arg_in_partial_spec : Note<
-    "template parameter is declared here">;
 def err_partial_spec_args_match_primary_template : Error<
     "%select{class|variable}0 template partial specialization does not "
     "specialize any template argument; to %select{declare|define}1 the "
@@ -3783,6 +3814,9 @@ def warn_typecheck_negative_array_new_size : Warning<"array size is negative">,
   InGroup;
 def warn_typecheck_function_qualifiers : Warning<
   "qualifier on function type %0 has unspecified behavior">;
+def warn_typecheck_reference_qualifiers : Warning<
+  "'%0' qualifier on reference type %1 has no effect">,
+  InGroup;
 def err_typecheck_invalid_restrict_not_pointer : Error<
   "restrict requires a pointer or reference (%0 is invalid)">;
 def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
@@ -5691,6 +5725,11 @@ def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning<
   "passing object of trivial but non-POD type %0 through variadic"
   " %select{function|block|method|constructor}1 is incompatible with C++98">,
   InGroup, DefaultIgnore;
+def warn_pass_class_arg_to_vararg : Warning<
+  "passing object of class type %0 through variadic "
+  "%select{function|block|method|constructor}1"
+  "%select{|; did you mean to call '%3'?}2">,
+  InGroup, DefaultIgnore;
 def err_cannot_pass_to_vararg : Error<
   "cannot pass %select{expression of type %1|initializer list}0 to variadic "
   "%select{function|block|method|constructor}2">;
@@ -5839,6 +5878,12 @@ def err_invalid_conversion_between_vector_and_integer : Error<
   "invalid conversion between vector type %0 and integer type %1 "
   "of different size">;
 
+def err_opencl_function_pointer_variable : Error<
+  "pointers to functions are not allowed">;
+
+def err_opencl_taking_function_address : Error<
+  "taking address of function is not allowed">;
+
 def err_invalid_conversion_between_vector_and_scalar : Error<
   "invalid conversion between vector type %0 and scalar type %1">;
 
@@ -6212,6 +6257,8 @@ def warn_format_string_is_wide_literal : Warning<
   "format string should not be a wide string">, InGroup;
 def warn_printf_format_string_contains_null_char : Warning<
   "format string contains '\\0' within the string body">, InGroup;
+def warn_printf_format_string_not_null_terminated : Warning<
+  "format string is not null-terminated">, InGroup;
 def warn_printf_asterisk_missing_arg : Warning<
   "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">,
   InGroup;
@@ -6795,24 +6842,26 @@ def err_omp_private_incomplete_type : Error<
   "a private variable with incomplete type %0">;
 def err_omp_firstprivate_incomplete_type : Error<
   "a firstprivate variable with incomplete type %0">;
-def err_omp_unexpected_clause_value : Error <
+def err_omp_unexpected_clause_value : Error<
   "expected %0 in OpenMP clause '%1'">;
-def err_omp_expected_var_name : Error <
+def err_omp_expected_var_name : Error<
   "expected variable name">;
-def err_omp_required_method : Error <
+def err_omp_required_method : Error<
   "%0 variable must have an accessible, unambiguous %select{default constructor|copy constructor|copy assignment operator|'%2'|destructor}1">;
 def err_omp_clause_ref_type_arg : Error<
   "arguments of OpenMP clause '%0' cannot be of reference type %1">;
 def err_omp_threadprivate_incomplete_type : Error<
   "threadprivate variable with incomplete type %0">;
-def err_omp_no_dsa_for_variable : Error <
+def err_omp_no_dsa_for_variable : Error<
   "variable %0 must have explicitly specified data sharing attributes">;
 def err_omp_wrong_dsa : Error<
   "%0 variable cannot be %1">;
-def note_omp_explicit_dsa : Note <
+def note_omp_explicit_dsa : Note<
   "defined as %0">;
-def note_omp_predetermined_dsa : Note <
+def note_omp_predetermined_dsa : Note<
   "predetermined as %0">;
+def err_omp_not_for : Error<
+  "statement after '#pragma omp %0' must be a for loop">;
 } // end of OpenMP category
 
 let CategoryName = "Related Result Type Issue" in {
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticSerializationKinds.td b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticSerializationKinds.td
index 2c58b61683e6..57ba0a4bcb47 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticSerializationKinds.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/DiagnosticSerializationKinds.td
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 let Component = "Serialization" in {
+let CategoryName = "AST Deserialization Issue" in {
 
 def err_fe_unable_to_read_pch_file : Error<
     "unable to read PCH file %0: '%1'">;
@@ -78,4 +79,6 @@ def note_module_odr_violation_no_possible_decls : Note<
 def note_module_odr_violation_possible_decl : Note<
   "declaration of %0 does not match">;
 
-}
+} // let CategoryName
+} // let Component
+
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/FileManager.h b/external/bsd/llvm/dist/clang/include/clang/Basic/FileManager.h
index 5f2248185561..1e13442770ee 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/FileManager.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/FileManager.h
@@ -17,6 +17,7 @@
 
 #include "clang/Basic/FileSystemOptions.h"
 #include "clang/Basic/LLVM.h"
+#include "clang/Basic/VirtualFileSystem.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/OwningPtr.h"
@@ -24,9 +25,9 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Allocator.h"
-#include "llvm/Support/FileSystem.h"
 // FIXME: Enhance libsystem to support inode and other fields in stat.
 #include 
+#include 
 
 #ifdef _MSC_VER
 typedef unsigned short mode_t;
@@ -55,10 +56,10 @@ public:
 /// \brief Cached information about one file (either on disk
 /// or in the virtual file system).
 ///
-/// If the 'FD' member is valid, then this FileEntry has an open file
+/// If the 'File' member is valid, then this FileEntry has an open file
 /// descriptor for the file.
 class FileEntry {
-  const char *Name;           // Name of the file.
+  std::string Name;           // Name of the file.
   off_t Size;                 // File size in bytes.
   time_t ModTime;             // Modification time of file.
   const DirectoryEntry *Dir;  // Directory file lives in.
@@ -66,33 +67,34 @@ class FileEntry {
   llvm::sys::fs::UniqueID UniqueID;
   bool IsNamedPipe;
   bool InPCH;
+  bool IsValid;               // Is this \c FileEntry initialized and valid?
 
-  /// FD - The file descriptor for the file entry if it is opened and owned
-  /// by the FileEntry.  If not, this is set to -1.
-  mutable int FD;
+  /// \brief The open file, if it is owned by the \p FileEntry.
+  mutable OwningPtr File;
   friend class FileManager;
 
+  void closeFile() const {
+    File.reset(0); // rely on destructor to close File
+  }
+
+  void operator=(const FileEntry &) LLVM_DELETED_FUNCTION;
+
 public:
-  FileEntry(llvm::sys::fs::UniqueID UniqueID, bool IsNamedPipe, bool InPCH)
-      : Name(0), UniqueID(UniqueID), IsNamedPipe(IsNamedPipe), InPCH(InPCH),
-        FD(-1) {}
-  // Add a default constructor for use with llvm::StringMap
   FileEntry()
-      : Name(0), UniqueID(0, 0), IsNamedPipe(false), InPCH(false), FD(-1) {}
+      : UniqueID(0, 0), IsNamedPipe(false), InPCH(false), IsValid(false)
+  {}
 
-  FileEntry(const FileEntry &FE) {
-    memcpy(this, &FE, sizeof(FE));
-    assert(FD == -1 && "Cannot copy a file-owning FileEntry");
+  // FIXME: this is here to allow putting FileEntry in std::map.  Once we have
+  // emplace, we shouldn't need a copy constructor anymore.
+  /// Intentionally does not copy fields that are not set in an uninitialized
+  /// \c FileEntry.
+  FileEntry(const FileEntry &FE) : UniqueID(FE.UniqueID),
+      IsNamedPipe(FE.IsNamedPipe), InPCH(FE.InPCH), IsValid(FE.IsValid) {
+    assert(!isValid() && "Cannot copy an initialized FileEntry");
   }
 
-  void operator=(const FileEntry &FE) {
-    memcpy(this, &FE, sizeof(FE));
-    assert(FD == -1 && "Cannot assign a file-owning FileEntry");
-  }
-
-  ~FileEntry();
-
-  const char *getName() const { return Name; }
+  const char *getName() const { return Name.c_str(); }
+  bool isValid() const { return IsValid; }
   off_t getSize() const { return Size; }
   unsigned getUID() const { return UID; }
   const llvm::sys::fs::UniqueID &getUniqueID() const { return UniqueID; }
@@ -119,16 +121,14 @@ struct FileData;
 /// as a single file.
 ///
 class FileManager : public RefCountedBase {
+  IntrusiveRefCntPtr FS;
   FileSystemOptions FileSystemOpts;
 
-  class UniqueDirContainer;
-  class UniqueFileContainer;
-
   /// \brief Cache for existing real directories.
-  UniqueDirContainer &UniqueRealDirs;
+  std::map UniqueRealDirs;
 
   /// \brief Cache for existing real files.
-  UniqueFileContainer &UniqueRealFiles;
+  std::map UniqueRealFiles;
 
   /// \brief The virtual directories that we have allocated.
   ///
@@ -172,14 +172,15 @@ class FileManager : public RefCountedBase {
   OwningPtr StatCache;
 
   bool getStatValue(const char *Path, FileData &Data, bool isFile,
-                    int *FileDescriptor);
+                    vfs::File **F);
 
   /// Add all ancestors of the given path (pointing to either a file
   /// or a directory) as virtual directories.
   void addAncestorsAsVirtualDirs(StringRef Path);
 
 public:
-  FileManager(const FileSystemOptions &FileSystemOpts);
+  FileManager(const FileSystemOptions &FileSystemOpts,
+              IntrusiveRefCntPtr FS = 0);
   ~FileManager();
 
   /// \brief Installs the provided FileSystemStatCache object within
@@ -226,6 +227,10 @@ public:
   /// \brief Returns the current file system options
   const FileSystemOptions &getFileSystemOptions() { return FileSystemOpts; }
 
+  IntrusiveRefCntPtr getVirtualFileSystem() const {
+    return FS;
+  }
+
   /// \brief Retrieve a file entry for a "virtual" file that acts as
   /// if there were a file with the given name on disk.
   ///
@@ -248,7 +253,7 @@ public:
   ///
   /// \returns false on success, true on error.
   bool getNoncachedStatValue(StringRef Path,
-                             llvm::sys::fs::file_status &Result);
+                             vfs::Status &Result);
 
   /// \brief Remove the real file \p Entry from the cache.
   void invalidateCache(const FileEntry *Entry);
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/FileSystemStatCache.h b/external/bsd/llvm/dist/clang/include/clang/Basic/FileSystemStatCache.h
index 23d82569437f..7ed0acc7a8c2 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/FileSystemStatCache.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/FileSystemStatCache.h
@@ -24,7 +24,14 @@
 
 namespace clang {
 
+namespace vfs {
+class File;
+class FileSystem;
+}
+
+// FIXME: should probably replace this with vfs::Status
 struct FileData {
+  std::string Name;
   uint64_t Size;
   time_t ModTime;
   llvm::sys::fs::UniqueID UniqueID;
@@ -57,10 +64,11 @@ public:
   /// If isFile is true, then this lookup should only return success for files
   /// (not directories).  If it is false this lookup should only return
   /// success for directories (not files).  On a successful file lookup, the
-  /// implementation can optionally fill in FileDescriptor with a valid
-  /// descriptor and the client guarantees that it will close it.
+  /// implementation can optionally fill in \p F with a valid \p File object and
+  /// the client guarantees that it will close it.
   static bool get(const char *Path, FileData &Data, bool isFile,
-                  int *FileDescriptor, FileSystemStatCache *Cache);
+                  vfs::File **F, FileSystemStatCache *Cache,
+                  vfs::FileSystem &FS);
 
   /// \brief Sets the next stat call cache in the chain of stat caches.
   /// Takes ownership of the given stat cache.
@@ -78,17 +86,16 @@ public:
   
 protected:
   virtual LookupResult getStat(const char *Path, FileData &Data, bool isFile,
-                               int *FileDescriptor) = 0;
+                               vfs::File **F, vfs::FileSystem &FS) = 0;
 
   LookupResult statChained(const char *Path, FileData &Data, bool isFile,
-                           int *FileDescriptor) {
+                           vfs::File **F, vfs::FileSystem &FS) {
     if (FileSystemStatCache *Next = getNextStatCache())
-      return Next->getStat(Path, Data, isFile, FileDescriptor);
+      return Next->getStat(Path, Data, isFile, F, FS);
 
     // If we hit the end of the list of stat caches to try, just compute and
     // return it without a cache.
-    return get(Path, Data, isFile, FileDescriptor, 0) ? CacheMissing
-                                                      : CacheExists;
+    return get(Path, Data, isFile, F, 0, FS) ? CacheMissing : CacheExists;
   }
 };
 
@@ -107,7 +114,7 @@ public:
   iterator end() const { return StatCalls.end(); }
 
   virtual LookupResult getStat(const char *Path, FileData &Data, bool isFile,
-                               int *FileDescriptor);
+                               vfs::File **F, vfs::FileSystem &FS);
 };
 
 } // end namespace clang
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/LangOptions.def b/external/bsd/llvm/dist/clang/include/clang/Basic/LangOptions.def
index 34dfea213f14..bb2f1e4ec20f 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/LangOptions.def
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/LangOptions.def
@@ -113,6 +113,7 @@ BENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __w
 BENIGN_LANGOPT(AccessControl     , 1, 1, "C++ access control")
 LANGOPT(CharIsSigned      , 1, 1, "signed char")
 LANGOPT(ShortWChar        , 1, 0, "unsigned short wchar_t")
+ENUM_LANGOPT(MSPointerToMemberRepresentationMethod, PragmaMSPointersToMembersKind, 2, PPTMK_BestCase, "member-pointer representation method")
 
 LANGOPT(ShortEnums        , 1, 0, "short enum types")
 
@@ -175,6 +176,7 @@ BENIGN_LANGOPT(NumLargeByValueCopy, 32, 0,
         "if non-zero, warn about parameter or return Warn if parameter/return value is larger in bytes than this setting. 0 is no check.")
 VALUE_LANGOPT(MSCVersion, 32, 0,
               "version of Microsoft Visual C/C++")
+VALUE_LANGOPT(VtorDispMode, 2, 1, "How many vtordisps to insert")
 
 LANGOPT(ApplePragmaPack, 1, 0, "Apple gcc-compatible #pragma pack handling")
 
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/LangOptions.h b/external/bsd/llvm/dist/clang/include/clang/Basic/LangOptions.h
index 7b2b18d57743..e969161b8ff4 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/LangOptions.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/LangOptions.h
@@ -66,6 +66,13 @@ public:
     SOB_Trapping    // -ftrapv
   };
 
+  enum PragmaMSPointersToMembersKind {
+    PPTMK_BestCase,
+    PPTMK_FullGeneralitySingleInheritance,
+    PPTMK_FullGeneralityMultipleInheritance,
+    PPTMK_FullGeneralityVirtualInheritance
+  };
+
   enum AddrSpaceMapMangling { ASMM_Target, ASMM_On, ASMM_Off };
 
 public:
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/Module.h b/external/bsd/llvm/dist/clang/include/clang/Basic/Module.h
index a57f21b5f252..a880671bdd2c 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/Module.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/Module.h
@@ -160,11 +160,14 @@ public:
     MacrosVisible,
     /// \brief All of the names in this module are visible.
     AllVisible
-  };  
-  
-  ///\ brief The visibility of names within this particular module.
+  };
+
+  /// \brief The visibility of names within this particular module.
   NameVisibilityKind NameVisibility;
 
+  /// \brief The location at which macros within this module became visible.
+  SourceLocation MacroVisibilityLoc;
+
   /// \brief The location of the inferred submodule.
   SourceLocation InferredSubmoduleLoc;
 
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/OpenMPKinds.def b/external/bsd/llvm/dist/clang/include/clang/Basic/OpenMPKinds.def
index 6d1a7b27b749..956a886e8a72 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/OpenMPKinds.def
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/OpenMPKinds.def
@@ -21,6 +21,9 @@
 #ifndef OPENMP_PARALLEL_CLAUSE
 #  define OPENMP_PARALLEL_CLAUSE(Name)
 #endif
+#ifndef OPENMP_SIMD_CLAUSE
+#  define OPENMP_SIMD_CLAUSE(Name)
+#endif
 #ifndef OPENMP_DEFAULT_KIND
 #  define OPENMP_DEFAULT_KIND(Name)
 #endif
@@ -29,19 +32,24 @@
 OPENMP_DIRECTIVE(threadprivate)
 OPENMP_DIRECTIVE(parallel)
 OPENMP_DIRECTIVE(task)
+OPENMP_DIRECTIVE(simd)
 
 // OpenMP clauses.
+OPENMP_CLAUSE(if, OMPIfClause)
 OPENMP_CLAUSE(default, OMPDefaultClause)
 OPENMP_CLAUSE(private, OMPPrivateClause)
 OPENMP_CLAUSE(firstprivate, OMPFirstprivateClause)
 OPENMP_CLAUSE(shared,  OMPSharedClause)
 
 // Clauses allowed for OpenMP directives.
+OPENMP_PARALLEL_CLAUSE(if)
 OPENMP_PARALLEL_CLAUSE(default)
 OPENMP_PARALLEL_CLAUSE(private)
 OPENMP_PARALLEL_CLAUSE(firstprivate)
 OPENMP_PARALLEL_CLAUSE(shared)
 
+// FIXME: clauses allowed for directive 'omp simd'.
+
 // Static attributes for 'default' clause.
 OPENMP_DEFAULT_KIND(none)
 OPENMP_DEFAULT_KIND(shared)
@@ -50,3 +58,5 @@ OPENMP_DEFAULT_KIND(shared)
 #undef OPENMP_DIRECTIVE
 #undef OPENMP_CLAUSE
 #undef OPENMP_PARALLEL_CLAUSE
+#undef OPENMP_SIMD_CLAUSE
+
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/SourceLocation.h b/external/bsd/llvm/dist/clang/include/clang/Basic/SourceLocation.h
index 1062c53128ba..0fecfb868b42 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/SourceLocation.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/SourceLocation.h
@@ -188,7 +188,7 @@ inline bool operator<(const SourceLocation &LHS, const SourceLocation &RHS) {
   return LHS.getRawEncoding() < RHS.getRawEncoding();
 }
 
-/// \brief A trival tuple used to represent a source range.
+/// \brief A trivial tuple used to represent a source range.
 class SourceRange {
   SourceLocation B;
   SourceLocation E;
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/StmtNodes.td b/external/bsd/llvm/dist/clang/include/clang/Basic/StmtNodes.td
index 57417d39f207..0f0f28447661 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/StmtNodes.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/StmtNodes.td
@@ -178,3 +178,4 @@ def AsTypeExpr : DStmt;
 // OpenMP Directives.
 def OMPExecutableDirective : Stmt<1>;
 def OMPParallelDirective : DStmt;
+def OMPSimdDirective : DStmt;
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/TokenKinds.def b/external/bsd/llvm/dist/clang/include/clang/Basic/TokenKinds.def
index 05c2fa2b27c7..b64ad05cd091 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/TokenKinds.def
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/TokenKinds.def
@@ -455,7 +455,7 @@ KEYWORD(__cdecl                     , KEYALL)
 KEYWORD(__stdcall                   , KEYALL)
 KEYWORD(__fastcall                  , KEYALL)
 KEYWORD(__thiscall                  , KEYALL)
-KEYWORD(__forceinline               , KEYALL)
+KEYWORD(__forceinline               , KEYMS)
 KEYWORD(__unaligned                 , KEYMS)
 
 // OpenCL address space qualifiers
@@ -678,6 +678,11 @@ ANNOTATION(pragma_fp_contract)
 // handles them.
 ANNOTATION(pragma_ms_pointers_to_members)
 
+// Annotation for #pragma vtordisp...
+// The lexer produces these so that they only take effect when the parser
+// handles them.
+ANNOTATION(pragma_ms_vtordisp)
+
 // Annotation for #pragma OPENCL EXTENSION...
 // The lexer produces these so that they only take effect when the parser
 // handles them.
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/VirtualFileSystem.h b/external/bsd/llvm/dist/clang/include/clang/Basic/VirtualFileSystem.h
new file mode 100644
index 000000000000..8f144da917f0
--- /dev/null
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/VirtualFileSystem.h
@@ -0,0 +1,170 @@
+//===- VirtualFileSystem.h - Virtual File System Layer ----------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+/// \file
+/// \brief Defines the virtual file system interface vfs::FileSystem.
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_BASIC_VIRTUAL_FILE_SYSTEM_H
+#define LLVM_CLANG_BASIC_VIRTUAL_FILE_SYSTEM_H
+
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/ErrorOr.h"
+#include "llvm/Support/SourceMgr.h"
+
+namespace llvm {
+class MemoryBuffer;
+}
+
+namespace clang {
+namespace vfs {
+
+/// \brief The result of a \p status operation.
+class Status {
+  std::string Name;
+  llvm::sys::fs::UniqueID UID;
+  llvm::sys::TimeValue MTime;
+  uint32_t User;
+  uint32_t Group;
+  uint64_t Size;
+  llvm::sys::fs::file_type Type;
+  llvm::sys::fs::perms Perms;
+
+public:
+  Status() : Type(llvm::sys::fs::file_type::status_error) {}
+  Status(const llvm::sys::fs::file_status &Status);
+  Status(StringRef Name, StringRef RealName, llvm::sys::fs::UniqueID UID,
+         llvm::sys::TimeValue MTime, uint32_t User, uint32_t Group,
+         uint64_t Size, llvm::sys::fs::file_type Type,
+         llvm::sys::fs::perms Perms);
+
+  /// \brief Returns the name that should be used for this file or directory.
+  StringRef getName() const { return Name; }
+  void setName(StringRef N) { Name = N; }
+
+  /// @name Status interface from llvm::sys::fs
+  /// @{
+  llvm::sys::fs::file_type getType() const { return Type; }
+  llvm::sys::fs::perms getPermissions() const { return Perms; }
+  llvm::sys::TimeValue getLastModificationTime() const { return MTime; }
+  llvm::sys::fs::UniqueID getUniqueID() const { return UID; }
+  uint32_t getUser() const { return User; }
+  uint32_t getGroup() const { return Group; }
+  uint64_t getSize() const { return Size; }
+  void setType(llvm::sys::fs::file_type v) { Type = v; }
+  void setPermissions(llvm::sys::fs::perms p) { Perms = p; }
+  /// @}
+  /// @name Status queries
+  /// These are static queries in llvm::sys::fs.
+  /// @{
+  bool equivalent(const Status &Other) const;
+  bool isDirectory() const;
+  bool isRegularFile() const;
+  bool isOther() const;
+  bool isSymlink() const;
+  bool isStatusKnown() const;
+  bool exists() const;
+  /// @}
+};
+
+/// \brief Represents an open file.
+class File {
+public:
+  /// \brief Destroy the file after closing it (if open).
+  /// Sub-classes should generally call close() inside their destructors.  We
+  /// cannot do that from the base class, since close is virtual.
+  virtual ~File();
+  /// \brief Get the status of the file.
+  virtual llvm::ErrorOr status() = 0;
+  /// \brief Get the contents of the file as a \p MemoryBuffer.
+  virtual llvm::error_code getBuffer(const Twine &Name,
+                                     OwningPtr &Result,
+                                     int64_t FileSize = -1,
+                                     bool RequiresNullTerminator = true) = 0;
+  /// \brief Closes the file.
+  virtual llvm::error_code close() = 0;
+  /// \brief Sets the name to use for this file.
+  virtual void setName(StringRef Name) = 0;
+};
+
+/// \brief The virtual file system interface.
+class FileSystem : public RefCountedBase {
+public:
+  virtual ~FileSystem();
+
+  /// \brief Get the status of the entry at \p Path, if one exists.
+  virtual llvm::ErrorOr status(const Twine &Path) = 0;
+  /// \brief Get a \p File object for the file at \p Path, if one exists.
+  virtual llvm::error_code openFileForRead(const Twine &Path,
+                                           OwningPtr &Result) = 0;
+
+  /// This is a convenience method that opens a file, gets its content and then
+  /// closes the file.
+  llvm::error_code getBufferForFile(const Twine &Name,
+                                    OwningPtr &Result,
+                                    int64_t FileSize = -1,
+                                    bool RequiresNullTerminator = true);
+};
+
+/// \brief Gets an \p vfs::FileSystem for the 'real' file system, as seen by
+/// the operating system.
+IntrusiveRefCntPtr getRealFileSystem();
+
+/// \brief A file system that allows overlaying one \p AbstractFileSystem on top
+/// of another.
+///
+/// Consists of a stack of >=1 \p FileSystem objects, which are treated as being
+/// one merged file system. When there is a directory that exists in more than
+/// one file system, the \p OverlayFileSystem contains a directory containing
+/// the union of their contents.  The attributes (permissions, etc.) of the
+/// top-most (most recently added) directory are used.  When there is a file
+/// that exists in more than one file system, the file in the top-most file
+/// system overrides the other(s).
+class OverlayFileSystem : public FileSystem {
+  typedef SmallVector, 1> FileSystemList;
+  typedef FileSystemList::reverse_iterator iterator;
+
+  /// \brief The stack of file systems, implemented as a list in order of
+  /// their addition.
+  FileSystemList FSList;
+
+  /// \brief Get an iterator pointing to the most recently added file system.
+  iterator overlays_begin() { return FSList.rbegin(); }
+
+  /// \brief Get an iterator pointing one-past the least recently added file
+  /// system.
+  iterator overlays_end() { return FSList.rend(); }
+
+public:
+  OverlayFileSystem(IntrusiveRefCntPtr Base);
+  /// \brief Pushes a file system on top of the stack.
+  void pushOverlay(IntrusiveRefCntPtr FS);
+
+  llvm::ErrorOr status(const Twine &Path) LLVM_OVERRIDE;
+  llvm::error_code openFileForRead(const Twine &Path,
+                                   OwningPtr &Result) LLVM_OVERRIDE;
+};
+
+/// \brief Get a globally unique ID for a virtual file or directory.
+llvm::sys::fs::UniqueID getNextVirtualUniqueID();
+
+/// \brief Gets a \p FileSystem for a virtual file system described in YAML
+/// format.
+///
+/// Takes ownership of \p Buffer.
+IntrusiveRefCntPtr
+getVFSFromYAML(llvm::MemoryBuffer *Buffer,
+               llvm::SourceMgr::DiagHandlerTy DiagHandler,
+               void *DiagContext = 0,
+               IntrusiveRefCntPtr ExternalFS = getRealFileSystem());
+
+} // end namespace vfs
+} // end namespace clang
+#endif // LLVM_CLANG_BASIC_VIRTUAL_FILE_SYSTEM_H
diff --git a/external/bsd/llvm/dist/clang/include/clang/Basic/arm_neon.td b/external/bsd/llvm/dist/clang/include/clang/Basic/arm_neon.td
index a1065d9f7205..8f7ae57f44a0 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Basic/arm_neon.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Basic/arm_neon.td
@@ -141,13 +141,17 @@ class Inst  {
   string Name = n;
   string Prototype = p;
   string Types = t;
+  string ArchGuard = "";
+
   Op Operand = o;
   bit isShift = 0;
   bit isScalarShift = 0;
   bit isScalarNarrowShift = 0;
   bit isVCVT_N = 0;
-  bit isA64 = 0;
-  bit isCrypto = 0;
+  // For immediate checks: the immediate will be assumed to specify the lane of
+  // a Q register. Only used for intrinsics which end up calling polymorphic
+  // builtins.
+  bit isLaneQ = 0;
 
   // Certain intrinsics have different names than their representative
   // instructions. This field allows us to handle this correctly when we
@@ -406,9 +410,11 @@ def VCREATE : NoTestOpInst<"vcreate", "dl", "csihfUcUsUiUlPcPsl", OP_CAST>;
 // E.3.19 Set all lanes to same value
 let InstName = "vmov" in {
 def VDUP_N   : WOpInst<"vdup_n", "ds",
-                       "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUl", OP_DUP>;
+                       "UcUsUicsiPcPshfQUcQUsQUiQcQsQiQPcQPsQhQflUlQlQUl",
+                       OP_DUP>;
 def VMOV_N   : WOpInst<"vmov_n", "ds",
-                       "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUl", OP_DUP>;
+                       "UcUsUicsiPcPshfQUcQUsQUiQcQsQiQPcQPsQhQflUlQlQUl",
+                       OP_DUP>;
 }
 let InstName = "" in
 def VDUP_LANE: WOpInst<"vdup_lane", "dgi",
@@ -542,90 +548,66 @@ def VFMA : SInst<"vfma", "dddd", "fQf">;
 ////////////////////////////////////////////////////////////////////////////////
 // AArch64 Intrinsics
 
-let isA64 = 1 in {
+let ArchGuard = "defined(__aarch64__)" in {
 
 ////////////////////////////////////////////////////////////////////////////////
 // Load/Store
-// With additional QUl, Ql, d, Qd, Pl, QPl type.
-def LD1 : WInst<"vld1", "dc",
-                "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsUcUsUiUlcsilhfdPcPsPlQPl">;
-def LD2 : WInst<"vld2", "2c",
-                "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsUcUsUiUlcsilhfdPcPsPlQPl">;
-def LD3 : WInst<"vld3", "3c",
-                "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsUcUsUiUlcsilhfdPcPsPlQPl">;
-def LD4 : WInst<"vld4", "4c",
-                "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsUcUsUiUlcsilhfdPcPsPlQPl">;
-def ST1 : WInst<"vst1", "vpd",
-                "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsUcUsUiUlcsilhfdPcPsPlQPl">;
-def ST2 : WInst<"vst2", "vp2",
-                "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsUcUsUiUlcsilhfdPcPsPlQPl">;
-def ST3 : WInst<"vst3", "vp3",
-                "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsUcUsUiUlcsilhfdPcPsPlQPl">;
-def ST4 : WInst<"vst4", "vp4",
-                "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsUcUsUiUlcsilhfdPcPsPlQPl">;
+def LD1 : WInst<"vld1", "dc", "dQdPlQPl">;
+def LD2 : WInst<"vld2", "2c", "QUlQldQdPlQPl">;
+def LD3 : WInst<"vld3", "3c", "QUlQldQdPlQPl">;
+def LD4 : WInst<"vld4", "4c", "QUlQldQdPlQPl">;
+def ST1 : WInst<"vst1", "vpd", "dQdPlQPl">;
+def ST2 : WInst<"vst2", "vp2", "QUlQldQdPlQPl">;
+def ST3 : WInst<"vst3", "vp3", "QUlQldQdPlQPl">;
+def ST4 : WInst<"vst4", "vp4", "QUlQldQdPlQPl">;
 
 def LD1_X2 : WInst<"vld1_x2", "2c",
-                   "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+                   "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">;
 def LD3_x3 : WInst<"vld1_x3", "3c",
-                   "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+                   "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">;
 def LD4_x4 : WInst<"vld1_x4", "4c",
-                   "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+                   "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">;
 
 def ST1_X2 : WInst<"vst1_x2", "vp2",
-                   "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+                   "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">;
 def ST1_X3 : WInst<"vst1_x3", "vp3",
-                   "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+                   "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">;
 def ST1_X4 : WInst<"vst1_x4", "vp4",
-                   "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+                   "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">;
 
-// With additional QUl, Ql, d, Qd, Pl, QPl type.
-def LD1_LANE : WInst<"vld1_lane", "dcdi",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
-def LD2_LANE : WInst<"vld2_lane", "2c2i",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
-def LD3_LANE : WInst<"vld3_lane", "3c3i",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
-def LD4_LANE : WInst<"vld4_lane", "4c4i",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
-def ST1_LANE : WInst<"vst1_lane", "vpdi",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
-def ST2_LANE : WInst<"vst2_lane", "vp2i",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
-def ST3_LANE : WInst<"vst3_lane", "vp3i",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
-def ST4_LANE : WInst<"vst4_lane", "vp4i",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+def LD1_LANE : WInst<"vld1_lane", "dcdi", "dQdPlQPl">;
+def LD2_LANE : WInst<"vld2_lane", "2c2i", "lUlQcQUcQPcQlQUldQdPlQPl">;
+def LD3_LANE : WInst<"vld3_lane", "3c3i", "lUlQcQUcQPcQlQUldQdPlQPl">;
+def LD4_LANE : WInst<"vld4_lane", "4c4i", "lUlQcQUcQPcQlQUldQdPlQPl">;
+def ST1_LANE : WInst<"vst1_lane", "vpdi", "dQdPlQPl">;
+def ST2_LANE : WInst<"vst2_lane", "vp2i", "lUlQcQUcQPcQlQUldQdPlQPl">;
+def ST3_LANE : WInst<"vst3_lane", "vp3i", "lUlQcQUcQPcQlQUldQdPlQPl">;
+def ST4_LANE : WInst<"vst4_lane", "vp4i", "lUlQcQUcQPcQlQUldQdPlQPl">;
 
-def LD1_DUP  : WInst<"vld1_dup", "dc",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+def LD1_DUP  : WInst<"vld1_dup", "dc", "dQdPlQPl">;
 def LD2_DUP  : WInst<"vld2_dup", "2c",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+                     "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPldPl">;
 def LD3_DUP  : WInst<"vld3_dup", "3c",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+                     "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPldPl">;
 def LD4_DUP  : WInst<"vld4_dup", "4c",
-                    "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPlUcUsUiUlcsilhfdPcPsPl">;
+                     "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPldPl">;
 
 def VLDRQ : WInst<"vldrq", "sc", "Pk">;
 def VSTRQ : WInst<"vstrq", "vps", "Pk">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Addition
-// With additional d, Qd type.
-def ADD : IOpInst<"vadd", "ddd", "csilfdUcUsUiUlQcQsQiQlQfQUcQUsQUiQUlQd",
-                  OP_ADD>;
+def ADD : IOpInst<"vadd", "ddd", "dQd", OP_ADD>;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Subtraction
-// With additional Qd type.
-def SUB : IOpInst<"vsub", "ddd", "csildfUcUsUiUlQcQsQiQlQfQUcQUsQUiQUlQd",
-                  OP_SUB>;
+def SUB : IOpInst<"vsub", "ddd", "dQd", OP_SUB>;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Multiplication
-// With additional Qd type.
-def MUL     : IOpInst<"vmul", "ddd", "csifdUcUsUiQcQsQiQfQUcQUsQUiQd", OP_MUL>;
-def MLA     : IOpInst<"vmla", "dddd", "csifdUcUsUiQcQsQiQfQUcQUsQUiQd", OP_MLA>;
-def MLS     : IOpInst<"vmls", "dddd", "csifdUcUsUiQcQsQiQfQUcQUsQUiQd", OP_MLS>;
+def MUL     : IOpInst<"vmul", "ddd", "dQd", OP_MUL>;
+def MLA     : IOpInst<"vmla", "dddd", "dQd", OP_MLA>;
+def MLS     : IOpInst<"vmls", "dddd", "dQd", OP_MLS>;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Multiplication Extended
@@ -637,34 +619,33 @@ def FDIV : IOpInst<"vdiv", "ddd",  "fdQfQd", OP_DIV>;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Vector fused multiply-add operations
-// With additional d, Qd type.
-def FMLA : SInst<"vfma", "dddd", "fdQfQd">;
+def FMLA : SInst<"vfma", "dddd", "dQd">;
 def FMLS : SInst<"vfms", "dddd", "fdQfQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
-// MUL, FMA, FMS definitions with scalar argument
+// MUL, MLA, MLS, FMA, FMS definitions with scalar argument
 def VMUL_N_A64 : IOpInst<"vmul_n", "dds", "Qd", OP_MUL_N>;
-def FMLA_N : SOpInst<"vfma_n", "ddds", "fQf", OP_FMLA_N>;
-def FMLS_N : SOpInst<"vfms_n", "ddds", "fQf", OP_FMLS_N>;
+
+def FMLA_N : SOpInst<"vfma_n", "ddds", "fQfQd", OP_FMLA_N>;
+def FMLS_N : SOpInst<"vfms_n", "ddds", "fQfQd", OP_FMLS_N>;
+
+def MLA_N : SOpInst<"vmla_n", "ddds", "Qd", OP_MLA_N>;
+def MLS_N : SOpInst<"vmls_n", "ddds", "Qd", OP_MLS_N>;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Logical operations
-// With additional Qd, Ql, QPl type.
-def BSL : SInst<"vbsl", "dudd",
-                "csilUcUsUiUlfdPcPsQcQsQiQlQUcQUsQUiQUlQfQPcQPsQdPlQPl">;
+def BSL : SInst<"vbsl", "dudd", "dPlQdQPl">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Absolute Difference
-// With additional Qd type.
-def ABD  : SInst<"vabd", "ddd",  "csiUcUsUifdQcQsQiQUcQUsQUiQfQd">;
+def ABD  : SInst<"vabd", "ddd",  "dQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // saturating absolute/negate
-// With additional Qd/Ql type.
-def ABS    : SInst<"vabs", "dd", "csilfdQcQsQiQfQlQd">;
-def QABS   : SInst<"vqabs", "dd", "csilQcQsQiQl">;
-def NEG    : SOpInst<"vneg", "dd", "csilfdQcQsQiQfQdQl", OP_NEG>;
-def QNEG   : SInst<"vqneg", "dd", "csilQcQsQiQl">;
+def ABS    : SInst<"vabs", "dd", "dQdlQl">;
+def QABS   : SInst<"vqabs", "dd", "lQl">;
+def NEG    : SOpInst<"vneg", "dd", "dlQdQl", OP_NEG>;
+def QNEG   : SInst<"vqneg", "dd", "lQl">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Signed Saturating Accumulated of Unsigned Value
@@ -676,9 +657,8 @@ def USQADD : SInst<"vsqadd", "ddd", "UcUsUiUlQUcQUsQUiQUl">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Reciprocal/Sqrt
-// With additional d, Qd type.
-def FRECPS  : IInst<"vrecps", "ddd", "fdQfQd">;
-def FRSQRTS : IInst<"vrsqrts", "ddd", "fdQfQd">;
+def FRECPS  : IInst<"vrecps", "ddd", "dQd">;
+def FRSQRTS : IInst<"vrsqrts", "ddd", "dQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // bitwise reverse
@@ -700,7 +680,7 @@ def QXTN2 : SOpInst<"vqmovn_high", "qhk", "silUsUiUl", OP_QXTN>;
 // Converting vectors
 def VCVT_HIGH_F16 : SOpInst<"vcvt_high_f16", "qhj", "f", OP_VCVT_NA_HI>;
 def VCVT_HIGH_F32_F16 : SOpInst<"vcvt_high_f32", "wk", "h", OP_VCVT_EX_HI>;
-def VCVT_F32_F64 : SInst<"vcvt_f32_f64", "fj", "d">;
+def VCVT_F32_F64 : SInst<"vcvt_f32_f64", "mj", "d">;
 def VCVT_HIGH_F32_F64 : SOpInst<"vcvt_high_f32", "qfj", "d", OP_VCVT_NA_HI>;
 def VCVT_F64_F32 : SInst<"vcvt_f64_f32", "wd", "f">;
 def VCVT_F64 : SInst<"vcvt_f64", "Fd",  "lUlQlQUl">;
@@ -716,47 +696,22 @@ def FRINTZ : SInst<"vrnd", "dd", "fdQfQd">;
 def FRINTI : SInst<"vrndi", "dd", "fdQfQd">;
 def VCVT_S64 : SInst<"vcvt_s64", "xd",  "dQd">;
 def VCVT_U64 : SInst<"vcvt_u64", "ud",  "dQd">;
-def FCVTNS_S32 : SInst<"vcvtn_s32", "xd", "fQf">;
-def FCVTNS_S64 : SInst<"vcvtn_s64", "xd", "dQd">;
-def FCVTNU_S32 : SInst<"vcvtn_u32", "ud", "fQf">;
-def FCVTNU_S64 : SInst<"vcvtn_u64", "ud", "dQd">;
-def FCVTPS_S32 : SInst<"vcvtp_s32", "xd", "fQf">;
-def FCVTPS_S64 : SInst<"vcvtp_s64", "xd", "dQd">;
-def FCVTPU_S32 : SInst<"vcvtp_u32", "ud", "fQf">;
-def FCVTPU_S64 : SInst<"vcvtp_u64", "ud", "dQd">;
-def FCVTMS_S32 : SInst<"vcvtm_s32", "xd", "fQf">;
-def FCVTMS_S64 : SInst<"vcvtm_s64", "xd", "dQd">;
-def FCVTMU_S32 : SInst<"vcvtm_u32", "ud", "fQf">;
-def FCVTMU_S64 : SInst<"vcvtm_u64", "ud", "dQd">;
-def FCVTAS_S32 : SInst<"vcvta_s32", "xd", "fQf">;
-def FCVTAS_S64 : SInst<"vcvta_s64", "xd", "dQd">;
-def FCVTAU_S32 : SInst<"vcvta_u32", "ud", "fQf">;
-def FCVTAU_S64 : SInst<"vcvta_u64", "ud", "dQd">;
-def FRECPE  : SInst<"vrecpe", "dd", "fdUiQfQUiQd">;
-def FRSQRTE : SInst<"vrsqrte", "dd", "fdUiQfQUiQd">;
+def FRECPE  : SInst<"vrecpe", "dd", "dQd">;
+def FRSQRTE : SInst<"vrsqrte", "dd", "dQd">;
 def FSQRT   : SInst<"vsqrt", "dd", "fdQfQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Comparison
-// With additional Qd, Ql, QPl type.
-def FCAGE : IInst<"vcage", "udd", "fdQfQd">;
-def FCAGT : IInst<"vcagt", "udd", "fdQfQd">;
-def FCALE : IInst<"vcale", "udd", "fdQfQd">;
-def FCALT : IInst<"vcalt", "udd", "fdQfQd">;
-// With additional Ql, QUl, Qd types.
-def CMTST  : WInst<"vtst", "udd",
-                   "csiUcUsUiPcPsQcQsQiQUcQUsQUiQPcQPslUlQlQUlPlQPl">;
-// With additional l, Ul,d, Qd, Ql, QUl, Qd types.
-def CFMEQ  : SOpInst<"vceq", "udd",
-                     "csilfUcUsUiUlPcQcdQdQsQiQfQUcQUsQUiQUlQlQPcPlQPl", OP_EQ>;
-def CFMGE  : SOpInst<"vcge", "udd",
-                     "csilfUcUsUiUlQcQsQiQlQfQUcQUsQUiQUldQd", OP_GE>;
-def CFMLE  : SOpInst<"vcle", "udd",
-                     "csilfUcUsUiUlQcQsQiQlQfQUcQUsQUiQUldQd", OP_LE>;
-def CFMGT  : SOpInst<"vcgt", "udd",
-                     "csilfUcUsUiUlQcQsQiQlQfQUcQUsQUiQUldQd", OP_GT>;
-def CFMLT  : SOpInst<"vclt", "udd",
-                     "csilfUcUsUiUlQcQsQiQlQfQUcQUsQUiQUldQd", OP_LT>;
+def FCAGE : IInst<"vcage", "udd", "dQd">;
+def FCAGT : IInst<"vcagt", "udd", "dQd">;
+def FCALE : IInst<"vcale", "udd", "dQd">;
+def FCALT : IInst<"vcalt", "udd", "dQd">;
+def CMTST  : WInst<"vtst", "udd", "lUlPlQlQUlQPl">;
+def CFMEQ  : SOpInst<"vceq", "udd", "lUldQdQlQUlPlQPl", OP_EQ>;
+def CFMGE  : SOpInst<"vcge", "udd", "lUldQdQlQUl", OP_GE>;
+def CFMLE  : SOpInst<"vcle", "udd", "lUldQdQlQUl", OP_LE>;
+def CFMGT  : SOpInst<"vcgt", "udd", "lUldQdQlQUl", OP_GT>;
+def CFMLT  : SOpInst<"vclt", "udd", "lUldQdQlQUl", OP_LT>;
 
 def CMEQ  : SInst<"vceqz", "ud",
                   "csilfUcUsUiUlPcPsPlQcQsQiQlQfQUcQUsQUiQUlQPcQPsdQdQPl">;
@@ -767,9 +722,8 @@ def CMLT  : SInst<"vcltz", "ud", "csilfdQcQsQiQlQfQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Max/Min Integer
-// With additional Qd type.
-def MAX : SInst<"vmax", "ddd", "csiUcUsUifdQcQsQiQUcQUsQUiQfQd">;
-def MIN : SInst<"vmin", "ddd", "csiUcUsUifdQcQsQiQUcQUsQUiQfQd">;
+def MAX : SInst<"vmax", "ddd", "dQd">;
+def MIN : SInst<"vmin", "ddd", "dQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // MaxNum/MinNum Floating Point
@@ -778,9 +732,8 @@ def FMINNM : SInst<"vminnm", "ddd", "fdQfQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Pairwise Max/Min
-// With additional Qc Qs Qi QUc QUs QUi Qf Qd types.
-def MAXP : SInst<"vpmax", "ddd", "csiUcUsUifQcQsQiQUcQUsQUiQfQd">;
-def MINP : SInst<"vpmin", "ddd", "csiUcUsUifQcQsQiQUcQUsQUiQfQd">;
+def MAXP : SInst<"vpmax", "ddd", "QcQsQiQUcQUsQUiQfQd">;
+def MINP : SInst<"vpmin", "ddd", "QcQsQiQUcQUsQUiQfQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Pairwise MaxNum/MinNum Floating Point
@@ -789,8 +742,7 @@ def FMINNMP : SInst<"vpminnm", "ddd", "fQfQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Pairwise Addition
-// With additional Qc Qs Qi QUc QUs QUi Qf Qd types.
-def ADDP  : IInst<"vpadd", "ddd", "csiUcUsUifQcQsQiQlQUcQUsQUiQUlQfQd">;
+def ADDP  : IInst<"vpadd", "ddd", "QcQsQiQlQUcQUsQUiQUlQfQd">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Shifts by constant
@@ -800,11 +752,8 @@ def SHLL_HIGH_N    : SOpInst<"vshll_high_n", "ndi", "HcHsHiHUcHUsHUi",
                              OP_LONG_HI>;
 
 ////////////////////////////////////////////////////////////////////////////////
-// Shifts with insert, with additional Ql, QPl type.
-def SRI_N : WInst<"vsri_n", "dddi",
-                  "csilUcUsUiUlPcPsQcQsQiQlQUcQUsQUiQUlQPcQPsPlQPl">;
-def SLI_N : WInst<"vsli_n", "dddi",
-                  "csilUcUsUiUlPcPsQcQsQiQlQUcQUsQUiQUlQPcQPsPlQPl">;
+def SRI_N : WInst<"vsri_n", "dddi", "PlQPl">;
+def SLI_N : WInst<"vsli_n", "dddi", "PlQPl">;
 
 // Right shift narrow high
 def SHRN_HIGH_N    : IOpInst<"vshrn_high_n", "hmdi",
@@ -865,12 +814,10 @@ def VMULL_HIGH_P64 : SOpInst<"vmull_high", "rdd", "HPl", OP_MULLHi_P64>;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Extract or insert element from vector
-def GET_LANE : IInst<"vget_lane", "sdi",
-                     "csilPcPsUcUsUiUlQcQsQiQlQUcQUsQUiQUlPcPsQPcQPsfdQfQdPlQPl">;
-def SET_LANE : IInst<"vset_lane", "dsdi",
-                     "csilPcPsUcUsUiUlQcQsQiQlQUcQUsQUiQUlPcPsQPcQPsfdQfQdPlQPl">;
+def GET_LANE : IInst<"vget_lane", "sdi", "dQdPlQPl">;
+def SET_LANE : IInst<"vset_lane", "dsdi", "dQdPlQPl">;
 def COPY_LANE : IOpInst<"vcopy_lane", "ddidi",
-                        "csilPcPsUcUsUiUlPcPsPlfd", OP_COPY_LN>;
+                        "csilUcUsUiUlPcPsPlfd", OP_COPY_LN>;
 def COPYQ_LANE : IOpInst<"vcopy_lane", "ddigi",
                         "QcQsQiQlQUcQUsQUiQUlQPcQPsQfQdQPl", OP_COPYQ_LN>;
 def COPY_LANEQ : IOpInst<"vcopy_laneq", "ddiki",
@@ -880,26 +827,19 @@ def COPYQ_LANEQ : IOpInst<"vcopy_laneq", "ddidi",
 
 ////////////////////////////////////////////////////////////////////////////////
 // Set all lanes to same value
-def VDUP_LANE1: WOpInst<"vdup_lane", "dgi",
-                  "csilPcPsUcUsUiUlhfdQcQsQiQlQPcQPsQUcQUsQUiQUlQhQfQdPlQPl",
-                        OP_DUP_LN>;
+def VDUP_LANE1: WOpInst<"vdup_lane", "dgi", "hdQhQdPlQPl", OP_DUP_LN>;
 def VDUP_LANE2: WOpInst<"vdup_laneq", "dki",
-                  "csilPcPsUcUsUiUlhfdQcQsQiQlQPcQPsQUcQUsQUiQUlQhQfQdPlQPl",
+                  "csilUcUsUiUlPcPshfdQcQsQiQlQPcQPsQUcQUsQUiQUlQhQfQdPlQPl",
                         OP_DUP_LN>;
-def DUP_N   : WOpInst<"vdup_n", "ds",
-                       "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUldQdPlQPl",
-                       OP_DUP>;
-def MOV_N   : WOpInst<"vmov_n", "ds",
-                       "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUldQd",
-                       OP_DUP>;
+def DUP_N   : WOpInst<"vdup_n", "ds", "dQdPlQPl", OP_DUP>;
+def MOV_N   : WOpInst<"vmov_n", "ds", "dQd", OP_DUP>;
 
 ////////////////////////////////////////////////////////////////////////////////
-// Combining vectors, with additional Pl
-def COMBINE : NoTestOpInst<"vcombine", "kdd", "csilhfdUcUsUiUlPcPsPl", OP_CONC>;
+def COMBINE : NoTestOpInst<"vcombine", "kdd", "dPl", OP_CONC>;
 
 ////////////////////////////////////////////////////////////////////////////////
-//Initialize a vector from bit pattern, with additional Pl
-def CREATE : NoTestOpInst<"vcreate", "dl", "csihfdUcUsUiUlPcPslPl", OP_CAST>;
+//Initialize a vector from bit pattern
+def CREATE : NoTestOpInst<"vcreate", "dl", "dPl", OP_CAST>;
 
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -909,7 +849,9 @@ def VMLS_LANEQ   : IOpInst<"vmls_laneq", "dddji",
                            "siUsUifQsQiQUsQUiQf", OP_MLS_LN>;
 
 def VFMA_LANE    : IInst<"vfma_lane", "dddgi", "fdQfQd">;
-def VFMA_LANEQ   : IInst<"vfma_laneq", "dddji", "fdQfQd">;
+def VFMA_LANEQ   : IInst<"vfma_laneq", "dddji", "fdQfQd"> {
+  let isLaneQ = 1;
+}
 def VFMS_LANE    : IOpInst<"vfms_lane", "dddgi", "fdQfQd", OP_FMS_LN>;
 def VFMS_LANEQ   : IOpInst<"vfms_laneq", "dddji", "fdQfQd", OP_FMS_LNQ>;
 
@@ -941,7 +883,7 @@ def VMUL_LANE_A64 : IOpInst<"vmul_lane", "ddgi", "Qd", OP_MUL_LN>;
 
 // Note: d type is handled by SCALAR_VMUL_LANEQ
 def VMUL_LANEQ   : IOpInst<"vmul_laneq", "ddji",
-                           "sifUsUiQsQiQfQUsQUiQfQd", OP_MUL_LN>;
+                           "sifUsUiQsQiQUsQUiQfQd", OP_MUL_LN>;
 def VMULL_LANEQ  : SOpInst<"vmull_laneq", "wdki", "siUsUi", OP_MULL_LN>;
 def VMULL_HIGH_LANE   : SOpInst<"vmull_high_lane", "wkdi", "siUsUi",
                                 OP_MULLHi_LN>;
@@ -973,12 +915,11 @@ def FMINNMV : SInst<"vminnmv", "sd", "fQfQd">;
  
 ////////////////////////////////////////////////////////////////////////////////
 // Newly added Vector Extract for f64
-def VEXT_A64 : WInst<"vext", "dddi",
-                     "cUcPcsUsPsiUilUlfdQcQUcQPcQsQUsQPsQiQUiQlQUlQfQdPlQPl">;
+def VEXT_A64 : WInst<"vext", "dddi", "dQdPlQPl">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Crypto
-let isCrypto = 1 in {
+let ArchGuard = "__ARM_FEATURE_CRYPTO" in {
 def AESE : SInst<"vaese", "ddd", "QUc">;
 def AESD : SInst<"vaesd", "ddd", "QUc">;
 def AESMC : SInst<"vaesmc", "dd", "QUc">;
@@ -997,6 +938,31 @@ def SHA256H2 : SInst<"vsha256h2", "dddd", "QUi">;
 def SHA256SU1 : SInst<"vsha256su1", "dddd", "QUi">;
 }
 
+////////////////////////////////////////////////////////////////////////////////
+// Float -> Int conversions with explicit rounding mode
+
+let ArchGuard = "__ARM_ARCH >= 8" in {
+def FCVTNS_S32 : SInst<"vcvtn_s32", "xd", "fQf">;
+def FCVTNU_S32 : SInst<"vcvtn_u32", "ud", "fQf">;
+def FCVTPS_S32 : SInst<"vcvtp_s32", "xd", "fQf">;
+def FCVTPU_S32 : SInst<"vcvtp_u32", "ud", "fQf">;
+def FCVTMS_S32 : SInst<"vcvtm_s32", "xd", "fQf">;
+def FCVTMU_S32 : SInst<"vcvtm_u32", "ud", "fQf">;
+def FCVTAS_S32 : SInst<"vcvta_s32", "xd", "fQf">;
+def FCVTAU_S32 : SInst<"vcvta_u32", "ud", "fQf">;
+}
+
+let ArchGuard = "__ARM_ARCH >= 8 && defined(__aarch64__)" in {
+def FCVTNS_S64 : SInst<"vcvtn_s64", "xd", "dQd">;
+def FCVTNU_S64 : SInst<"vcvtn_u64", "ud", "dQd">;
+def FCVTPS_S64 : SInst<"vcvtp_s64", "xd", "dQd">;
+def FCVTPU_S64 : SInst<"vcvtp_u64", "ud", "dQd">;
+def FCVTMS_S64 : SInst<"vcvtm_s64", "xd", "dQd">;
+def FCVTMU_S64 : SInst<"vcvtm_u64", "ud", "dQd">;
+def FCVTAS_S64 : SInst<"vcvta_s64", "xd", "dQd">;
+def FCVTAU_S64 : SInst<"vcvta_u64", "ud", "dQd">;
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // Permutation
 def VTRN1 : SOpInst<"vtrn1", "ddd",
@@ -1029,10 +995,17 @@ def VQTBX4_A64 : WInst<"vqtbx4", "ddDt", "UccPcQUcQcQPc">;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Vector reinterpret cast operations
-// With additional d, Qd, pl, Qpl types
-def REINTERPRET
+
+// NeonEmitter implicitly takes the cartesian product of the type string with
+// itself during generation so, unlike all other intrinsics, this one should
+// include *all* types, not just additional ones.
+//
+// We also rely on NeonEmitter handling the 32-bit vreinterpret before the
+// 64-bit one so that the common casts don't get guarded as AArch64-only
+// (FIXME).
+def VVREINTERPRET
   : NoTestOpInst<"vreinterpret", "dd",
-         "csilUcUsUiUlhfdPcPsPlQcQsQiQlQUcQUsQUiQUlQhQfQdQPcQPsQPlQPk", OP_REINT>;
+       "csilUcUsUiUlhfdPcPsPlQcQsQiQlQUcQUsQUiQUlQhQfQdQPcQPsQPlQPk", OP_REINT>;
 
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1050,10 +1023,8 @@ def SCALAR_SUB : SInst<"vsub", "sss",  "SlSUl">;
 def SCALAR_QSUB   : SInst<"vqsub", "sss", "ScSsSiSlSUcSUsSUiSUl">;
 
 let InstName = "vmov" in {
-def VGET_HIGH_A64 : NoTestOpInst<"vget_high", "dk", "csilhfdUcUsUiUlPcPsPl",
-                                 OP_HI>;
-def VGET_LOW_A64  : NoTestOpInst<"vget_low", "dk", "csilhfdUcUsUiUlPcPsPl",
-                                 OP_LO>;
+def VGET_HIGH_A64 : NoTestOpInst<"vget_high", "dk", "dPl", OP_HI>;
+def VGET_LOW_A64  : NoTestOpInst<"vget_low", "dk", "dPl", OP_LO>;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1302,7 +1273,9 @@ def SCALAR_VMUL_N : IInst<"vmul_n", "dds", "d">;
 def SCALAR_VMUL_LANE : IInst<"vmul_lane", "ddgi", "d">;
 
 // VMUL_LANEQ d type implemented using scalar mul lane
-def SCALAR_VMUL_LANEQ   : IInst<"vmul_laneq", "ddji", "d">;
+def SCALAR_VMUL_LANEQ   : IInst<"vmul_laneq", "ddji", "d"> {
+  let isLaneQ = 1;
+}
 
 // VMULX_LANE d type implemented using scalar vmulx_lane
 def SCALAR_VMULX_LANE : IOpInst<"vmulx_lane", "ddgi", "d", OP_SCALAR_VMULX_LN>;
diff --git a/external/bsd/llvm/dist/clang/include/clang/CodeGen/CGFunctionInfo.h b/external/bsd/llvm/dist/clang/include/clang/CodeGen/CGFunctionInfo.h
index cb8c5a01182b..ec41e8bdec25 100644
--- a/external/bsd/llvm/dist/clang/include/clang/CodeGen/CGFunctionInfo.h
+++ b/external/bsd/llvm/dist/clang/include/clang/CodeGen/CGFunctionInfo.h
@@ -191,6 +191,18 @@ public:
     return UIntData;
   }
 
+  /// \brief Return true if this field of an inalloca struct should be returned
+  /// to implement a struct return calling convention.
+  bool getInAllocaSRet() const {
+    assert(TheKind == InAlloca && "Invalid kind!");
+    return BoolData0;
+  }
+
+  void setInAllocaSRet(bool SRet) {
+    assert(TheKind == InAlloca && "Invalid kind!");
+    BoolData0 = SRet;
+  }
+
   void dump() const;
 };
 
diff --git a/external/bsd/llvm/dist/clang/include/clang/Driver/CC1Options.td b/external/bsd/llvm/dist/clang/include/clang/Driver/CC1Options.td
index a62e112d5b55..66674ab442e5 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Driver/CC1Options.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Driver/CC1Options.td
@@ -138,6 +138,8 @@ def split_dwarf : Flag<["-"], "split-dwarf">,
   HelpText<"Split out the dwarf .dwo sections">;
 def gnu_pubnames : Flag<["-"], "gnu-pubnames">,
   HelpText<"Emit newer GNU style pubnames">;
+def arange_sections : Flag<["-"], "arange_sections">,
+  HelpText<"Emit DWARF .debug_arange sections">;
 def fforbid_guard_variables : Flag<["-"], "fforbid-guard-variables">,
   HelpText<"Emit an error if a C++ static local initializer would need a guard variable">;
 def no_implicit_float : Flag<["-"], "no-implicit-float">,
@@ -474,6 +476,8 @@ def fsized_deallocation : Flag<["-"], "fsized-deallocation">,
   HelpText<"Enable C++1y sized global deallocation functions">;
 def fobjc_subscripting_legacy_runtime : Flag<["-"], "fobjc-subscripting-legacy-runtime">,
   HelpText<"Allow Objective-C array and dictionary subscripting in legacy runtime">;
+def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">,
+  HelpText<"Control vtordisp placement on win32 targets">;
 
 //===----------------------------------------------------------------------===//
 // Header Search Options
diff --git a/external/bsd/llvm/dist/clang/include/clang/Driver/CLCompatOptions.td b/external/bsd/llvm/dist/clang/include/clang/Driver/CLCompatOptions.td
index fa28a01b6749..edc932ca0c40 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Driver/CLCompatOptions.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Driver/CLCompatOptions.td
@@ -96,6 +96,16 @@ def _SLASH_showIncludes : CLFlag<"showIncludes">,
   Alias;
 def _SLASH_U : CLJoinedOrSeparate<"U">, HelpText<"Undefine macro">,
   MetaVarName<"">, Alias;
+def _SLASH_vmb : CLFlag<"vmb">,
+  HelpText<"Use a best-case representation method for member pointers">;
+def _SLASH_vmg : CLFlag<"vmg">,
+  HelpText<"Use a most-general representation for member pointers">;
+def _SLASH_vms : CLFlag<"vms">,
+  HelpText<"Set the default most-general representation to single inheritance">;
+def _SLASH_vmm : CLFlag<"vmm">,
+  HelpText<"Set the default most-general representation to multiple inheritance">;
+def _SLASH_vmv : CLFlag<"vmv">,
+  HelpText<"Set the default most-general representation to virtual inheritance">;
 def _SLASH_W0 : CLFlag<"W0">, HelpText<"Disable all warnings">, Alias;
 def _SLASH_W1 : CLFlag<"W1">, HelpText<"Enable -Wall">, Alias;
 def _SLASH_W2 : CLFlag<"W2">, HelpText<"Enable -Wall">, Alias;
@@ -107,6 +117,8 @@ def _SLASH_WX : CLFlag<"WX">, HelpText<"Treat warnings as errors">,
 def _SLASH_WX_ : CLFlag<"WX-">, HelpText<"Do not treat warnings as errors">,
   Alias, AliasArgs<["no-error"]>;
 def _SLASH_w_flag : CLFlag<"w">, HelpText<"Disable all warnings">, Alias;
+def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">,
+  Alias;
 def _SLASH_Z7 : CLFlag<"Z7">, Alias;
 def _SLASH_Zi : CLFlag<"Zi">, HelpText<"Enable debug information">,
   Alias;
@@ -168,7 +180,6 @@ def _SLASH_Ob2 : CLIgnoredFlag<"Ob2">;
 def _SLASH_RTC : CLIgnoredJoined<"RTC">;
 def _SLASH_sdl : CLIgnoredFlag<"sdl">;
 def _SLASH_sdl_ : CLIgnoredFlag<"sdl-">;
-def _SLASH_vmg : CLIgnoredFlag<"vmg">;
 def _SLASH_w : CLIgnoredJoined<"w">;
 def _SLASH_Zc_forScope : CLIgnoredFlag<"Zc:forScope">;
 def _SLASH_Zc_wchar_t : CLIgnoredFlag<"Zc:wchar_t">;
@@ -181,6 +192,7 @@ def _SLASH_AI : CLJoined<"AI">;
 def _SLASH_arch : CLJoined<"arch:">;
 def _SLASH_bigobj : CLFlag<"bigobj">;
 def _SLASH_clr : CLJoined<"clr">;
+def _SLASH_d2Zi_PLUS : CLFlag<"d2Zi+">;
 def _SLASH_doc : CLJoined<"doc">;
 def _SLASH_EH : CLJoined<"EH">;
 def _SLASH_EP : CLFlag<"EP">;
@@ -232,11 +244,6 @@ def _SLASH_Qpar : CLFlag<"Qpar">;
 def _SLASH_Qvec_report : CLJoined<"Qvec-report">;
 def _SLASH_u : CLFlag<"u">;
 def _SLASH_V : CLFlag<"V">;
-def _SLASH_vd : CLJoined<"vd">;
-def _SLASH_vmb : CLFlag<"vmb">;
-def _SLASH_vmm : CLFlag<"vmm">;
-def _SLASH_vms : CLFlag<"vms">;
-def _SLASH_vmv : CLFlag<"vmv">;
 def _SLASH_volatile : CLFlag<"volatile">;
 def _SLASH_WL : CLFlag<"WL">;
 def _SLASH_Wp64 : CLFlag<"Wp64">;
diff --git a/external/bsd/llvm/dist/clang/include/clang/Driver/Job.h b/external/bsd/llvm/dist/clang/include/clang/Driver/Job.h
index 1dd49a792356..d7e74a9ce83e 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Driver/Job.h
+++ b/external/bsd/llvm/dist/clang/include/clang/Driver/Job.h
@@ -88,6 +88,8 @@ public:
   /// getCreator - Return the Tool which caused the creation of this job.
   const Tool &getCreator() const { return Creator; }
 
+  const char *getExecutable() const { return Executable; }
+
   const llvm::opt::ArgStringList &getArguments() const { return Arguments; }
 
   static bool classof(const Job *J) {
diff --git a/external/bsd/llvm/dist/clang/include/clang/Driver/Multilib.h b/external/bsd/llvm/dist/clang/include/clang/Driver/Multilib.h
new file mode 100644
index 000000000000..6c3738a9cc03
--- /dev/null
+++ b/external/bsd/llvm/dist/clang/include/clang/Driver/Multilib.h
@@ -0,0 +1,167 @@
+//===--- Multilib.h ---------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_LIB_DRIVER_MULTILIB_H_
+#define CLANG_LIB_DRIVER_MULTILIB_H_
+
+#include "clang/Basic/LLVM.h"
+#include "llvm/ADT/Triple.h"
+#include "llvm/Option/Option.h"
+#include 
+#include 
+
+namespace clang {
+namespace driver {
+
+/// This corresponds to a single GCC Multilib, or a segment of one controlled
+/// by a command line flag
+class Multilib {
+public:
+  typedef std::vector flags_list;
+
+private:
+  std::string GCCSuffix;
+  std::string OSSuffix;
+  std::string IncludeSuffix;
+  flags_list Flags;
+
+public:
+  Multilib(StringRef GCCSuffix = "", StringRef OSSuffix = "",
+           StringRef IncludeSuffix = "");
+
+  /// \brief Get the detected GCC installation path suffix for the multi-arch
+  /// target variant. Always starts with a '/', unless empty
+  const std::string &gccSuffix() const {
+    assert(GCCSuffix.empty() ||
+           (StringRef(GCCSuffix).front() == '/' && GCCSuffix.size() > 1));
+    return GCCSuffix;
+  }
+  /// Set the GCC installation path suffix.
+  Multilib &gccSuffix(StringRef S);
+
+  /// \brief Get the detected os path suffix for the multi-arch
+  /// target variant. Always starts with a '/', unless empty
+  const std::string &osSuffix() const {
+    assert(OSSuffix.empty() ||
+           (StringRef(OSSuffix).front() == '/' && OSSuffix.size() > 1));
+    return OSSuffix;
+  }
+  /// Set the os path suffix.
+  Multilib &osSuffix(StringRef S);
+
+  /// \brief Get the include directory suffix. Always starts with a '/', unless
+  /// empty
+  const std::string &includeSuffix() const {
+    assert(IncludeSuffix.empty() ||
+           (StringRef(IncludeSuffix).front() == '/' && IncludeSuffix.size() > 1));
+    return IncludeSuffix;
+  }
+  /// Set the include directory suffix
+  Multilib &includeSuffix(StringRef S);
+
+  /// \brief Get the flags that indicate or contraindicate this multilib's use
+  /// All elements begin with either '+' or '-'
+  const flags_list &flags() const { return Flags; }
+  flags_list &flags() { return Flags; }
+  /// Add a flag to the flags list
+  Multilib &flag(StringRef F) {
+    assert(F.front() == '+' || F.front() == '-');
+    Flags.push_back(F);
+    return *this;
+  }
+
+  /// \brief print summary of the Multilib
+  void print(raw_ostream &OS) const;
+
+  /// Check whether any of the 'against' flags contradict the 'for' flags.
+  bool isValid() const;
+
+  /// Check whether the default is selected
+  bool isDefault() const
+  { return GCCSuffix.empty() && OSSuffix.empty() && IncludeSuffix.empty(); }
+
+  bool operator==(const Multilib &Other) const;
+};
+
+raw_ostream &operator<<(raw_ostream &OS, const Multilib &M);
+
+class MultilibSet {
+public:
+  typedef std::vector multilib_list;
+  typedef multilib_list::iterator iterator;
+  typedef multilib_list::const_iterator const_iterator;
+
+  struct FilterCallback {
+    virtual ~FilterCallback() {};
+    /// \return true iff the filter should remove the Multilib from the set
+    virtual bool operator()(const Multilib &M) const = 0;
+  };
+
+private:
+  multilib_list Multilibs;
+
+public:
+  MultilibSet() {}
+
+  /// Add an optional Multilib segment
+  MultilibSet &Maybe(const Multilib &M);
+
+  /// Add a set of mutually incompatible Multilib segments
+  MultilibSet &Either(const Multilib &M1, const Multilib &M2);
+  MultilibSet &Either(const Multilib &M1, const Multilib &M2,
+                      const Multilib &M3);
+  MultilibSet &Either(const Multilib &M1, const Multilib &M2,
+                      const Multilib &M3, const Multilib &M4);
+  MultilibSet &Either(const Multilib &M1, const Multilib &M2,
+                      const Multilib &M3, const Multilib &M4,
+                      const Multilib &M5);
+  MultilibSet &Either(const std::vector &Ms);
+
+  /// Filter out some subset of the Multilibs using a user defined callback
+  MultilibSet &FilterOut(const FilterCallback &F);
+  /// Filter out those Multilibs whose gccSuffix matches the given expression
+  MultilibSet &FilterOut(std::string Regex);
+
+  /// Add a completed Multilib to the set
+  void push_back(const Multilib &M);
+
+  /// Union this set of multilibs with another
+  void combineWith(const MultilibSet &MS);
+
+  /// Remove all of thie multilibs from the set
+  void clear() { Multilibs.clear(); }
+
+  iterator begin() { return Multilibs.begin(); }
+  const_iterator begin() const { return Multilibs.begin(); }
+
+  iterator end() { return Multilibs.end(); }
+  const_iterator end() const { return Multilibs.end(); }
+
+  /// Pick the best multilib in the set, \returns false if none are compatible
+  bool select(const Multilib::flags_list &Flags, Multilib &M) const;
+
+  unsigned size() const { return Multilibs.size(); }
+
+  void print(raw_ostream &OS) const;
+
+private:
+  /// Apply the filter to Multilibs and return the subset that remains
+  static multilib_list filterCopy(const FilterCallback &F,
+                                  const multilib_list &Ms);
+
+  /// Apply the filter to the multilib_list, removing those that don't match
+  static void filterInPlace(const FilterCallback &F, multilib_list &Ms);
+};
+
+raw_ostream &operator<<(raw_ostream &OS, const MultilibSet &MS);
+}
+}
+
+#endif
+
diff --git a/external/bsd/llvm/dist/clang/include/clang/Driver/Options.td b/external/bsd/llvm/dist/clang/include/clang/Driver/Options.td
index de31361b25e8..6b7bfe77f1a9 100644
--- a/external/bsd/llvm/dist/clang/include/clang/Driver/Options.td
+++ b/external/bsd/llvm/dist/clang/include/clang/Driver/Options.td
@@ -571,6 +571,7 @@ def fmsc_version : Joined<["-"], "fmsc-version=">, Group, Flags<[CC1Opt
 def fdelayed_template_parsing : Flag<["-"], "fdelayed-template-parsing">, Group,
   HelpText<"Parse templated function definitions at the end of the "
            "translation unit">,  Flags<[CC1Option]>;
+def fms_memptr_rep_EQ : Joined<["-"], "fms-memptr-rep=">, Group, Flags<[CC1Option]>;
 def fmodules_cache_path : Joined<["-"], "fmodules-cache-path=">, Group,
   Flags<[DriverOption, CC1Option]>, MetaVarName<"">,
   HelpText<"Specify the module cache path">;
@@ -580,6 +581,13 @@ def fmodules_prune_interval : Joined<["-"], "fmodules-prune-interval=">, Group">,
   HelpText<"Specify the interval (in seconds) after which a module file will be considered unused">;
+def fbuild_session_timestamp : Joined<["-"], "fbuild-session-timestamp=">,
+  Group, Flags<[CC1Option]>, MetaVarName<"