Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jan 2018 20:25:37 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r328364 - in vendor/clang/dist-release_60: docs include/clang/Basic include/clang/StaticAnalyzer/Core/BugReporter lib/AST lib/CodeGen lib/Frontend lib/Lex lib/Sema lib/StaticAnalyzer/Ch...
Message-ID:  <201801242025.w0OKPbbH042776@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Wed Jan 24 20:25:37 2018
New Revision: 328364
URL: https://svnweb.freebsd.org/changeset/base/328364

Log:
  Vendor import of clang release_60 branch r323338:
  https://llvm.org/svn/llvm-project/cfe/branches/release_60@323338

Added:
  vendor/clang/dist-release_60/docs/OpenMPSupport.rst
  vendor/clang/dist-release_60/test/CodeCompletion/Inputs/comments.h   (contents, props changed)
  vendor/clang/dist-release_60/test/CodeCompletion/comments.cpp   (contents, props changed)
  vendor/clang/dist-release_60/test/Lexer/null-character-in-literal.c   (contents, props changed)
  vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/
  vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/Box.h   (contents, props changed)
  vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/M1.h   (contents, props changed)
  vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/M2.h   (contents, props changed)
  vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/M3.h   (contents, props changed)
  vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/module.modulemap
  vendor/clang/dist-release_60/test/Modules/odr_hash-Friend.cpp   (contents, props changed)
  vendor/clang/dist-release_60/test/Modules/odr_hash-blocks.cpp   (contents, props changed)
Deleted:
  vendor/clang/dist-release_60/test/Sema/_Float128.c
Modified:
  vendor/clang/dist-release_60/docs/ReleaseNotes.rst
  vendor/clang/dist-release_60/docs/index.rst
  vendor/clang/dist-release_60/include/clang/Basic/Attr.td
  vendor/clang/dist-release_60/include/clang/Basic/BuiltinsX86.def
  vendor/clang/dist-release_60/include/clang/Basic/DiagnosticGroups.td
  vendor/clang/dist-release_60/include/clang/Basic/TokenKinds.def
  vendor/clang/dist-release_60/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h
  vendor/clang/dist-release_60/lib/AST/DeclBase.cpp
  vendor/clang/dist-release_60/lib/AST/ODRHash.cpp
  vendor/clang/dist-release_60/lib/CodeGen/CGBuiltin.cpp
  vendor/clang/dist-release_60/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
  vendor/clang/dist-release_60/lib/Frontend/InitPreprocessor.cpp
  vendor/clang/dist-release_60/lib/Lex/Lexer.cpp
  vendor/clang/dist-release_60/lib/Lex/PPCaching.cpp
  vendor/clang/dist-release_60/lib/Lex/PPLexerChange.cpp
  vendor/clang/dist-release_60/lib/Sema/Scope.cpp
  vendor/clang/dist-release_60/lib/Sema/SemaTemplateDeduction.cpp
  vendor/clang/dist-release_60/lib/Sema/SemaTemplateInstantiateDecl.cpp
  vendor/clang/dist-release_60/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
  vendor/clang/dist-release_60/lib/StaticAnalyzer/Checkers/ValistChecker.cpp
  vendor/clang/dist-release_60/test/Analysis/malloc.c
  vendor/clang/dist-release_60/test/CodeGen/builtins-overflow.c
  vendor/clang/dist-release_60/test/CodeGenCXX/cxx1z-inline-variables.cpp
  vendor/clang/dist-release_60/test/Modules/ExtDebugInfo.cpp
  vendor/clang/dist-release_60/test/Modules/Inputs/DebugCXX.h
  vendor/clang/dist-release_60/test/Modules/ModuleDebugInfo.cpp
  vendor/clang/dist-release_60/test/Preprocessor/cuda-types.cu
  vendor/clang/dist-release_60/test/Sema/tautological-constant-compare.c
  vendor/clang/dist-release_60/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp
  vendor/clang/dist-release_60/test/SemaTemplate/alignas.cpp
  vendor/clang/dist-release_60/test/SemaTemplate/cxx17-inline-variables.cpp
  vendor/clang/dist-release_60/unittests/Lex/LexerTest.cpp

Added: vendor/clang/dist-release_60/docs/OpenMPSupport.rst
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/docs/OpenMPSupport.rst	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,68 @@
+.. raw:: html
+
+  <style type="text/css">
+    .none { background-color: #FFCCCC }
+    .partial { background-color: #FFFF99 }
+    .good { background-color: #CCFF99 }
+  </style>
+
+.. role:: none
+.. role:: partial
+.. role:: good
+
+==================
+OpenMP Support
+==================
+
+Clang fully supports OpenMP 3.1 + some elements of OpenMP 4.5. Clang supports offloading to X86_64, AArch64 and PPC64[LE] devices.
+Support for Cuda devices is not ready yet.
+The status of major OpenMP 4.5 features support in Clang.
+
+Standalone directives
+=====================
+
+* #pragma omp [for] simd: :good:`Complete`.
+
+* #pragma omp declare simd: :partial:`Partial`.  We support parsing/semantic
+  analysis + generation of special attributes for X86 target, but still
+  missing the LLVM pass for vectorization.
+
+* #pragma omp taskloop [simd]: :good:`Complete`.
+
+* #pragma omp target [enter|exit] data: :good:`Complete`.
+
+* #pragma omp target update: :good:`Complete`.
+
+* #pragma omp target: :partial:`Partial`.  No support for the `depend` clauses.
+
+* #pragma omp declare target: :partial:`Partial`.  No full codegen support.
+
+* #pragma omp teams: :good:`Complete`.
+
+* #pragma omp distribute [simd]: :good:`Complete`.
+
+* #pragma omp distribute parallel for [simd]: :good:`Complete`.
+
+Combined directives
+===================
+
+* #pragma omp parallel for simd: :good:`Complete`.
+
+* #pragma omp target parallel: :partial:`Partial`.  No support for the `depend` clauses.
+
+* #pragma omp target parallel for [simd]: :partial:`Partial`.  No support for the `depend` clauses.
+
+* #pragma omp target simd: :partial:`Partial`.  No support for the `depend` clauses.
+
+* #pragma omp target teams: :partial:`Partial`.  No support for the `depend` clauses.
+
+* #pragma omp teams distribute [simd]: :good:`Complete`.
+
+* #pragma omp target teams distribute [simd]: :partial:`Partial`.  No support for the and `depend` clauses.
+
+* #pragma omp teams distribute parallel for [simd]: :good:`Complete`.
+
+* #pragma omp target teams distribute parallel for [simd]: :partial:`Partial`.  No full codegen support.
+
+Clang does not support any constructs/updates from upcoming OpenMP 5.0 except for `reduction`-based clauses in the `task` and `target`-based directives.
+In addition, the LLVM OpenMP runtime `libomp` supports the OpenMP Tools Interface (OMPT) on x86, x86_64, AArch64, and PPC64 on Linux, Windows, and mac OS.

Modified: vendor/clang/dist-release_60/docs/ReleaseNotes.rst
==============================================================================
--- vendor/clang/dist-release_60/docs/ReleaseNotes.rst	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/docs/ReleaseNotes.rst	Wed Jan 24 20:25:37 2018	(r328364)
@@ -163,6 +163,15 @@ Attribute Changes in Clang
 - The presence of __attribute__((availability(...))) on a declaration no longer
   implies default visibility for that declaration on macOS.
 
+- Clang now supports configuration files. These are collections of driver
+  options, which can be applied by specifying the configuration file, either
+  using command line option `--config foo.cfg` or encoding it into executable
+  name `foo-clang`. Clang behaves as if the options from this file were inserted
+  before the options specified in command line. This feature is primary intended
+  to facilitate cross compilation. Details can be found in
+  `Clang Compiler User's Manual
+  <http://clang.llvm.org/docs/UsersManual.html#configuration-files>`.
+
 - ...
 
 Windows Support
@@ -209,7 +218,7 @@ OpenCL C Language Changes in Clang
 OpenMP Support in Clang
 ----------------------------------
 
-- Added options `-f[no]-openmp-simd` that support code emission only foe OpenMP
+- Added options `-f[no]-openmp-simd` that support code emission only for OpenMP
   SIMD-based directives, like `#pragma omp simd`, `#pragma omp parallel for simd`
   etc. The code is emitted only for simd-based part of the combined directives
   and clauses.
@@ -221,6 +230,13 @@ OpenMP Support in Clang
 
 - Added support for `reduction`-based clauses on `task`-based directives from
   upcoming OpenMP 5.0.
+
+- The LLVM OpenMP runtime `libomp` now supports the OpenMP Tools Interface (OMPT)
+  on x86, x86_64, AArch64, and PPC64 on Linux, Windows, and macOS. If you observe
+  a measurable performance impact on one of your applications without a tool
+  attached, please rebuild the runtime library with `-DLIBOMP_OMPT_SUPPORT=OFF` and
+  file a bug at `LLVM's Bugzilla <https://bugs.llvm.org/>`_ or send a message to the
+  `OpenMP development list <http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev>`_.
 
 Internal API Changes
 --------------------

Modified: vendor/clang/dist-release_60/docs/index.rst
==============================================================================
--- vendor/clang/dist-release_60/docs/index.rst	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/docs/index.rst	Wed Jan 24 20:25:37 2018	(r328364)
@@ -39,6 +39,7 @@ Using Clang as a Compiler
    SourceBasedCodeCoverage
    Modules
    MSVCCompatibility
+   OpenMPSupport
    ThinLTO
    CommandGuide/index
    FAQ

Modified: vendor/clang/dist-release_60/include/clang/Basic/Attr.td
==============================================================================
--- vendor/clang/dist-release_60/include/clang/Basic/Attr.td	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/include/clang/Basic/Attr.td	Wed Jan 24 20:25:37 2018	(r328364)
@@ -549,6 +549,7 @@ def Aligned : InheritableAttr {
                                           Keyword<"_Alignas">]>,
                    Accessor<"isDeclspec",[Declspec<"align">]>];
   let Documentation = [Undocumented];
+  let DuplicatesAllowedWhileMerging = 1;
 }
 
 def AlignValue : Attr {

Modified: vendor/clang/dist-release_60/include/clang/Basic/BuiltinsX86.def
==============================================================================
--- vendor/clang/dist-release_60/include/clang/Basic/BuiltinsX86.def	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/include/clang/Basic/BuiltinsX86.def	Wed Jan 24 20:25:37 2018	(r328364)
@@ -1357,15 +1357,15 @@ TARGET_BUILTIN(__builtin_ia32_vpshrdvw128_maskz, "V8sV
 TARGET_BUILTIN(__builtin_ia32_vpshrdvw256_maskz, "V16sV16sV16sV16sUs", "", "avx512vl,avx512vbmi2")
 TARGET_BUILTIN(__builtin_ia32_vpshrdvw512_maskz, "V32sV32sV32sV32sUi", "", "avx512vbmi2")
 
-TARGET_BUILTIN(__builtin_ia32_vpshrdd128_mask, "V4iV4iV4iiV4iUc", "", "avx512vl,avx512vbmi2")
-TARGET_BUILTIN(__builtin_ia32_vpshrdd256_mask, "V8iV8iV8iiV8iUc", "", "avx512vl,avx512vbmi2")
-TARGET_BUILTIN(__builtin_ia32_vpshrdd512_mask, "V16iV16iV16iiV16iUs", "", "avx512vbmi2")
-TARGET_BUILTIN(__builtin_ia32_vpshrdq128_mask, "V2LLiV2LLiV2LLiiV2LLiUc", "", "avx512vl,avx512vbmi2")
-TARGET_BUILTIN(__builtin_ia32_vpshrdq256_mask, "V4LLiV4LLiV4LLiiV4LLiUc", "", "avx512vl,avx512vbmi2")
-TARGET_BUILTIN(__builtin_ia32_vpshrdq512_mask, "V8LLiV8LLiV8LLiiV8LLiUc", "", "avx512vbmi2")
-TARGET_BUILTIN(__builtin_ia32_vpshrdw128_mask, "V8sV8sV8siV8sUc", "", "avx512vl,avx512vbmi2")
-TARGET_BUILTIN(__builtin_ia32_vpshrdw256_mask, "V16sV16sV16siV16sUs", "", "avx512vl,avx512vbmi2")
-TARGET_BUILTIN(__builtin_ia32_vpshrdw512_mask, "V32sV32sV32siV32sUi", "", "avx512vbmi2")
+TARGET_BUILTIN(__builtin_ia32_vpshrdd128_mask, "V4iV4iV4iIiV4iUc", "", "avx512vl,avx512vbmi2")
+TARGET_BUILTIN(__builtin_ia32_vpshrdd256_mask, "V8iV8iV8iIiV8iUc", "", "avx512vl,avx512vbmi2")
+TARGET_BUILTIN(__builtin_ia32_vpshrdd512_mask, "V16iV16iV16iIiV16iUs", "", "avx512vbmi2")
+TARGET_BUILTIN(__builtin_ia32_vpshrdq128_mask, "V2LLiV2LLiV2LLiIiV2LLiUc", "", "avx512vl,avx512vbmi2")
+TARGET_BUILTIN(__builtin_ia32_vpshrdq256_mask, "V4LLiV4LLiV4LLiIiV4LLiUc", "", "avx512vl,avx512vbmi2")
+TARGET_BUILTIN(__builtin_ia32_vpshrdq512_mask, "V8LLiV8LLiV8LLiIiV8LLiUc", "", "avx512vbmi2")
+TARGET_BUILTIN(__builtin_ia32_vpshrdw128_mask, "V8sV8sV8sIiV8sUc", "", "avx512vl,avx512vbmi2")
+TARGET_BUILTIN(__builtin_ia32_vpshrdw256_mask, "V16sV16sV16sIiV16sUs", "", "avx512vl,avx512vbmi2")
+TARGET_BUILTIN(__builtin_ia32_vpshrdw512_mask, "V32sV32sV32sIiV32sUi", "", "avx512vbmi2")
 
 TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "", "avx512bw")
 TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "", "avx512bw")

Modified: vendor/clang/dist-release_60/include/clang/Basic/DiagnosticGroups.td
==============================================================================
--- vendor/clang/dist-release_60/include/clang/Basic/DiagnosticGroups.td	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/include/clang/Basic/DiagnosticGroups.td	Wed Jan 24 20:25:37 2018	(r328364)
@@ -444,8 +444,7 @@ def TautologicalInRangeCompare : DiagGroup<"tautologic
                                             TautologicalUnsignedEnumZeroCompare]>;
 def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
 def TautologicalConstantCompare : DiagGroup<"tautological-constant-compare",
-                                            [TautologicalInRangeCompare,
-                                             TautologicalOutOfRangeCompare]>;
+                                            [TautologicalOutOfRangeCompare]>;
 def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">;
 def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">;
 def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">;
@@ -719,7 +718,6 @@ def IntToPointerCast : DiagGroup<"int-to-pointer-cast"
 def Move : DiagGroup<"move", [PessimizingMove, RedundantMove, SelfMove]>;
 
 def Extra : DiagGroup<"extra", [
-    TautologicalInRangeCompare,
     MissingFieldInitializers,
     IgnoredQualifiers,
     InitializerOverrides,

Modified: vendor/clang/dist-release_60/include/clang/Basic/TokenKinds.def
==============================================================================
--- vendor/clang/dist-release_60/include/clang/Basic/TokenKinds.def	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/include/clang/Basic/TokenKinds.def	Wed Jan 24 20:25:37 2018	(r328364)
@@ -398,7 +398,6 @@ TYPE_TRAIT_2(__builtin_types_compatible_p, TypeCompati
 KEYWORD(__builtin_va_arg            , KEYALL)
 KEYWORD(__extension__               , KEYALL)
 KEYWORD(__float128                  , KEYALL)
-ALIAS("_Float128", __float128       , KEYNOCXX)
 KEYWORD(__imag                      , KEYALL)
 KEYWORD(__int128                    , KEYALL)
 KEYWORD(__label__                   , KEYALL)

Modified: vendor/clang/dist-release_60/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h
==============================================================================
--- vendor/clang/dist-release_60/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h	Wed Jan 24 20:25:37 2018	(r328364)
@@ -32,27 +32,39 @@ class BugType { (private)
   const CheckName Check;
   const std::string Name;
   const std::string Category;
-  bool SuppressonSink;
+  const CheckerBase *Checker;
+  bool SuppressOnSink;
 
   virtual void anchor();
+
 public:
-  BugType(class CheckName check, StringRef name, StringRef cat)
-      : Check(check), Name(name), Category(cat), SuppressonSink(false) {}
-  BugType(const CheckerBase *checker, StringRef name, StringRef cat)
-      : Check(checker->getCheckName()), Name(name), Category(cat),
-        SuppressonSink(false) {}
-  virtual ~BugType() {}
+  BugType(CheckName Check, StringRef Name, StringRef Cat)
+      : Check(Check), Name(Name), Category(Cat), Checker(nullptr),
+        SuppressOnSink(false) {}
+  BugType(const CheckerBase *Checker, StringRef Name, StringRef Cat)
+      : Check(Checker->getCheckName()), Name(Name), Category(Cat),
+        Checker(Checker), SuppressOnSink(false) {}
+  virtual ~BugType() = default;
 
-  // FIXME: Should these be made strings as well?
   StringRef getName() const { return Name; }
   StringRef getCategory() const { return Category; }
-  StringRef getCheckName() const { return Check.getName(); }
+  StringRef getCheckName() const {
+    // FIXME: This is a workaround to ensure that the correct check name is used
+    // The check names are set after the constructors are run.
+    // In case the BugType object is initialized in the checker's ctor
+    // the Check field will be empty. To circumvent this problem we use 
+    // CheckerBase whenever it is possible.
+    StringRef CheckName =
+        Checker ? Checker->getCheckName().getName() : Check.getName();
+    assert(!CheckName.empty() && "Check name is not set properly.");
+    return CheckName;
+  }
 
   /// isSuppressOnSink - Returns true if bug reports associated with this bug
   ///  type should be suppressed if the end node of the report is post-dominated
   ///  by a sink node.
-  bool isSuppressOnSink() const { return SuppressonSink; }
-  void setSuppressOnSink(bool x) { SuppressonSink = x; }
+  bool isSuppressOnSink() const { return SuppressOnSink; }
+  void setSuppressOnSink(bool x) { SuppressOnSink = x; }
 
   virtual void FlushReports(BugReporter& BR);
 };
@@ -74,7 +86,7 @@ class BuiltinBug : public BugType { (public)
   StringRef getDescription() const { return desc; }
 };
 
-} // end GR namespace
+} // end ento namespace
 
 } // end clang namespace
 #endif

Modified: vendor/clang/dist-release_60/lib/AST/DeclBase.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/AST/DeclBase.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/AST/DeclBase.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -891,12 +891,14 @@ bool Decl::AccessDeclContextSanity() const {
   // 4. the context is not a record
   // 5. it's invalid
   // 6. it's a C++0x static_assert.
+  // 7. it's a block literal declaration
   if (isa<TranslationUnitDecl>(this) ||
       isa<TemplateTypeParmDecl>(this) ||
       isa<NonTypeTemplateParmDecl>(this) ||
       !isa<CXXRecordDecl>(getDeclContext()) ||
       isInvalidDecl() ||
       isa<StaticAssertDecl>(this) ||
+      isa<BlockDecl>(this) ||
       // FIXME: a ParmVarDecl can have ClassTemplateSpecialization
       // as DeclContext (?).
       isa<ParmVarDecl>(this) ||

Modified: vendor/clang/dist-release_60/lib/AST/ODRHash.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/AST/ODRHash.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/AST/ODRHash.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -478,6 +478,8 @@ void ODRHash::AddFunctionDecl(const FunctionDecl *Func
 
   // TODO: Fix hashing for class methods.
   if (isa<CXXMethodDecl>(Function)) return;
+  // And friend functions.
+  if (Function->getFriendObjectKind()) return;
 
   // Skip functions that are specializations or in specialization context.
   const DeclContext *DC = Function;

Modified: vendor/clang/dist-release_60/lib/CodeGen/CGBuiltin.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/CodeGen/CGBuiltin.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/CodeGen/CGBuiltin.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -915,7 +915,11 @@ EmitCheckedMixedSignMultiply(CodeGenFunction &CGF, con
       Overflow = CGF.Builder.CreateOr(Overflow, TruncOverflow);
     }
 
-    Result = CGF.Builder.CreateTrunc(UnsignedResult, ResTy);
+    // Negate the product if it would be negative in infinite precision.
+    Result = CGF.Builder.CreateSelect(
+        IsNegative, CGF.Builder.CreateNeg(UnsignedResult), UnsignedResult);
+
+    Result = CGF.Builder.CreateTrunc(Result, ResTy);
   }
   assert(Overflow && Result && "Missing overflow or result");
 

Modified: vendor/clang/dist-release_60/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/CodeGen/ObjectFilePCHContainerOperations.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/CodeGen/ObjectFilePCHContainerOperations.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -229,6 +229,11 @@ class PCHContainerGenerator : public ASTConsumer { (pu
       Builder->getModuleDebugInfo()->completeRequiredType(RD);
   }
 
+  void HandleImplicitImportDecl(ImportDecl *D) override {
+    if (!D->getImportedOwningModule())
+      Builder->getModuleDebugInfo()->EmitImportDecl(*D);
+  }
+
   /// Emit a container holding the serialized AST.
   void HandleTranslationUnit(ASTContext &Ctx) override {
     assert(M && VMContext && Builder);

Modified: vendor/clang/dist-release_60/lib/Frontend/InitPreprocessor.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/Frontend/InitPreprocessor.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/Frontend/InitPreprocessor.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -817,10 +817,6 @@ static void InitializePredefinedMacros(const TargetInf
   DefineFloatMacros(Builder, "FLT", &TI.getFloatFormat(), "F");
   DefineFloatMacros(Builder, "DBL", &TI.getDoubleFormat(), "");
   DefineFloatMacros(Builder, "LDBL", &TI.getLongDoubleFormat(), "L");
-  if (TI.hasFloat128Type())
-    // FIXME: Switch away from the non-standard "Q" when we can
-    DefineFloatMacros(Builder, "FLT128", &TI.getFloat128Format(), "Q");
-
 
   // Define a __POINTER_WIDTH__ macro for stdint.h.
   Builder.defineMacro("__POINTER_WIDTH__",

Modified: vendor/clang/dist-release_60/lib/Lex/Lexer.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/Lex/Lexer.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/Lex/Lexer.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -2009,18 +2009,21 @@ bool Lexer::LexAngledStringLiteral(Token &Result, cons
   const char *AfterLessPos = CurPtr;
   char C = getAndAdvanceChar(CurPtr, Result);
   while (C != '>') {
-    // Skip escaped characters.
-    if (C == '\\' && CurPtr < BufferEnd) {
-      // Skip the escaped character.
-      getAndAdvanceChar(CurPtr, Result);
-    } else if (C == '\n' || C == '\r' ||             // Newline.
-               (C == 0 && (CurPtr-1 == BufferEnd ||  // End of file.
-                           isCodeCompletionPoint(CurPtr-1)))) {
+    // Skip escaped characters.  Escaped newlines will already be processed by
+    // getAndAdvanceChar.
+    if (C == '\\')
+      C = getAndAdvanceChar(CurPtr, Result);
+
+    if (C == '\n' || C == '\r' ||             // Newline.
+        (C == 0 && (CurPtr-1 == BufferEnd ||  // End of file.
+                    isCodeCompletionPoint(CurPtr-1)))) {
       // If the filename is unterminated, then it must just be a lone <
       // character.  Return this as such.
       FormTokenWithChars(Result, AfterLessPos, tok::less);
       return true;
-    } else if (C == 0) {
+    }
+
+    if (C == 0) {
       NulCharacter = CurPtr-1;
     }
     C = getAndAdvanceChar(CurPtr, Result);

Modified: vendor/clang/dist-release_60/lib/Lex/PPCaching.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/Lex/PPCaching.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/Lex/PPCaching.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -105,8 +105,10 @@ void Preprocessor::CachingLex(Token &Result) {
 }
 
 void Preprocessor::EnterCachingLexMode() {
-  if (InCachingLexMode())
+  if (InCachingLexMode()) {
+    assert(CurLexerKind == CLK_CachingLexer && "Unexpected lexer kind");
     return;
+  }
 
   PushIncludeMacroStack();
   CurLexerKind = CLK_CachingLexer;

Modified: vendor/clang/dist-release_60/lib/Lex/PPLexerChange.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/Lex/PPLexerChange.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/Lex/PPLexerChange.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -444,6 +444,7 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool
       }
 
       CurPPLexer = nullptr;
+      recomputeCurLexerKind();
       return true;
     }
 

Modified: vendor/clang/dist-release_60/lib/Sema/Scope.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/Sema/Scope.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/Sema/Scope.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -143,72 +143,43 @@ void Scope::dumpImpl(raw_ostream &OS) const {
   if (HasFlags)
     OS << "Flags: ";
 
-  while (Flags) {
-    if (Flags & FnScope) {
-      OS << "FnScope";
-      Flags &= ~FnScope;
-    } else if (Flags & BreakScope) {
-      OS << "BreakScope";
-      Flags &= ~BreakScope;
-    } else if (Flags & ContinueScope) {
-      OS << "ContinueScope";
-      Flags &= ~ContinueScope;
-    } else if (Flags & DeclScope) {
-      OS << "DeclScope";
-      Flags &= ~DeclScope;
-    } else if (Flags & ControlScope) {
-      OS << "ControlScope";
-      Flags &= ~ControlScope;
-    } else if (Flags & ClassScope) {
-      OS << "ClassScope";
-      Flags &= ~ClassScope;
-    } else if (Flags & BlockScope) {
-      OS << "BlockScope";
-      Flags &= ~BlockScope;
-    } else if (Flags & TemplateParamScope) {
-      OS << "TemplateParamScope";
-      Flags &= ~TemplateParamScope;
-    } else if (Flags & FunctionPrototypeScope) {
-      OS << "FunctionPrototypeScope";
-      Flags &= ~FunctionPrototypeScope;
-    } else if (Flags & FunctionDeclarationScope) {
-      OS << "FunctionDeclarationScope";
-      Flags &= ~FunctionDeclarationScope;
-    } else if (Flags & AtCatchScope) {
-      OS << "AtCatchScope";
-      Flags &= ~AtCatchScope;
-    } else if (Flags & ObjCMethodScope) {
-      OS << "ObjCMethodScope";
-      Flags &= ~ObjCMethodScope;
-    } else if (Flags & SwitchScope) {
-      OS << "SwitchScope";
-      Flags &= ~SwitchScope;
-    } else if (Flags & TryScope) {
-      OS << "TryScope";
-      Flags &= ~TryScope;
-    } else if (Flags & FnTryCatchScope) {
-      OS << "FnTryCatchScope";
-      Flags &= ~FnTryCatchScope;
-    } else if (Flags & SEHTryScope) {
-      OS << "SEHTryScope";
-      Flags &= ~SEHTryScope;
-    } else if (Flags & SEHExceptScope) {
-      OS << "SEHExceptScope";
-      Flags &= ~SEHExceptScope;
-    } else if (Flags & OpenMPDirectiveScope) {
-      OS << "OpenMPDirectiveScope";
-      Flags &= ~OpenMPDirectiveScope;
-    } else if (Flags & OpenMPLoopDirectiveScope) {
-      OS << "OpenMPLoopDirectiveScope";
-      Flags &= ~OpenMPLoopDirectiveScope;
-    } else if (Flags & OpenMPSimdDirectiveScope) {
-      OS << "OpenMPSimdDirectiveScope";
-      Flags &= ~OpenMPSimdDirectiveScope;
-    }
+  std::pair<unsigned, const char *> FlagInfo[] = {
+      {FnScope, "FnScope"},
+      {BreakScope, "BreakScope"},
+      {ContinueScope, "ContinueScope"},
+      {DeclScope, "DeclScope"},
+      {ControlScope, "ControlScope"},
+      {ClassScope, "ClassScope"},
+      {BlockScope, "BlockScope"},
+      {TemplateParamScope, "TemplateParamScope"},
+      {FunctionPrototypeScope, "FunctionPrototypeScope"},
+      {FunctionDeclarationScope, "FunctionDeclarationScope"},
+      {AtCatchScope, "AtCatchScope"},
+      {ObjCMethodScope, "ObjCMethodScope"},
+      {SwitchScope, "SwitchScope"},
+      {TryScope, "TryScope"},
+      {FnTryCatchScope, "FnTryCatchScope"},
+      {OpenMPDirectiveScope, "OpenMPDirectiveScope"},
+      {OpenMPLoopDirectiveScope, "OpenMPLoopDirectiveScope"},
+      {OpenMPSimdDirectiveScope, "OpenMPSimdDirectiveScope"},
+      {EnumScope, "EnumScope"},
+      {SEHTryScope, "SEHTryScope"},
+      {SEHExceptScope, "SEHExceptScope"},
+      {SEHFilterScope, "SEHFilterScope"},
+      {CompoundStmtScope, "CompoundStmtScope"},
+      {ClassInheritanceScope, "ClassInheritanceScope"}};
 
-    if (Flags)
-      OS << " | ";
+  for (auto Info : FlagInfo) {
+    if (Flags & Info.first) {
+      OS << Info.second;
+      Flags &= ~Info.first;
+      if (Flags)
+        OS << " | ";
+    }
   }
+
+  assert(Flags == 0 && "Unknown scope flags");
+
   if (HasFlags)
     OS << '\n';
 

Modified: vendor/clang/dist-release_60/lib/Sema/SemaTemplateDeduction.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/Sema/SemaTemplateDeduction.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/Sema/SemaTemplateDeduction.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -502,6 +502,10 @@ DeduceTemplateArguments(Sema &S,
                         SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
   assert(Arg.isCanonical() && "Argument type must be canonical");
 
+  // Treat an injected-class-name as its underlying template-id.
+  if (auto *Injected = dyn_cast<InjectedClassNameType>(Arg))
+    Arg = Injected->getInjectedSpecializationType();
+
   // Check whether the template argument is a dependent template-id.
   if (const TemplateSpecializationType *SpecArg
         = dyn_cast<TemplateSpecializationType>(Arg)) {

Modified: vendor/clang/dist-release_60/lib/Sema/SemaTemplateInstantiateDecl.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/Sema/SemaTemplateInstantiateDecl.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/Sema/SemaTemplateInstantiateDecl.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -4160,7 +4160,8 @@ void Sema::BuildVariableInstantiation(
   // it right away if the type contains 'auto'.
   if ((!isa<VarTemplateSpecializationDecl>(NewVar) &&
        !InstantiatingVarTemplate &&
-       !(OldVar->isInline() && OldVar->isThisDeclarationADefinition())) ||
+       !(OldVar->isInline() && OldVar->isThisDeclarationADefinition() &&
+         !NewVar->isThisDeclarationADefinition())) ||
       NewVar->getType()->isUndeducedType())
     InstantiateVariableInitializer(NewVar, OldVar, TemplateArgs);
 

Modified: vendor/clang/dist-release_60/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/StaticAnalyzer/Checkers/MallocChecker.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/StaticAnalyzer/Checkers/MallocChecker.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -2900,8 +2900,13 @@ void ento::registerNewDeleteLeaksChecker(CheckerManage
       mgr.getCurrentCheckName();
   // We currently treat NewDeleteLeaks checker as a subchecker of NewDelete
   // checker.
-  if (!checker->ChecksEnabled[MallocChecker::CK_NewDeleteChecker])
+  if (!checker->ChecksEnabled[MallocChecker::CK_NewDeleteChecker]) {
     checker->ChecksEnabled[MallocChecker::CK_NewDeleteChecker] = true;
+    // FIXME: This does not set the correct name, but without this workaround
+    //        no name will be set at all.
+    checker->CheckNames[MallocChecker::CK_NewDeleteChecker] =
+        mgr.getCurrentCheckName();
+  }
 }
 
 #define REGISTER_CHECKER(name)                                                 \

Modified: vendor/clang/dist-release_60/lib/StaticAnalyzer/Checkers/ValistChecker.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/StaticAnalyzer/Checkers/ValistChecker.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/lib/StaticAnalyzer/Checkers/ValistChecker.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -64,7 +64,7 @@ class ValistChecker : public Checker<check::PreCall, c
                                  CheckerContext &C) const;
   void reportLeakedVALists(const RegionVector &LeakedVALists, StringRef Msg1,
                            StringRef Msg2, CheckerContext &C, ExplodedNode *N,
-                           bool ForceReport = false) const;
+                           bool ReportUninit = false) const;
 
   void checkVAListStartCall(const CallEvent &Call, CheckerContext &C,
                             bool IsCopy) const;
@@ -267,15 +267,19 @@ void ValistChecker::reportUninitializedAccess(const Me
 void ValistChecker::reportLeakedVALists(const RegionVector &LeakedVALists,
                                         StringRef Msg1, StringRef Msg2,
                                         CheckerContext &C, ExplodedNode *N,
-                                        bool ForceReport) const {
+                                        bool ReportUninit) const {
   if (!(ChecksEnabled[CK_Unterminated] ||
-        (ChecksEnabled[CK_Uninitialized] && ForceReport)))
+        (ChecksEnabled[CK_Uninitialized] && ReportUninit)))
     return;
   for (auto Reg : LeakedVALists) {
     if (!BT_leakedvalist) {
-      BT_leakedvalist.reset(new BugType(CheckNames[CK_Unterminated],
-                                        "Leaked va_list",
-                                        categories::MemoryError));
+      // FIXME: maybe creating a new check name for this type of bug is a better
+      // solution.
+      BT_leakedvalist.reset(
+          new BugType(CheckNames[CK_Unterminated].getName().empty()
+                          ? CheckNames[CK_Uninitialized]
+                          : CheckNames[CK_Unterminated],
+                      "Leaked va_list", categories::MemoryError));
       BT_leakedvalist->setSuppressOnSink(true);
     }
 
@@ -375,7 +379,7 @@ void ValistChecker::checkVAListEndCall(const CallEvent
 
 std::shared_ptr<PathDiagnosticPiece> ValistChecker::ValistBugVisitor::VisitNode(
     const ExplodedNode *N, const ExplodedNode *PrevN, BugReporterContext &BRC,
-    BugReport &BR) {
+    BugReport &) {
   ProgramStateRef State = N->getState();
   ProgramStateRef StatePrev = PrevN->getState();
 

Modified: vendor/clang/dist-release_60/test/Analysis/malloc.c
==============================================================================
--- vendor/clang/dist-release_60/test/Analysis/malloc.c	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/test/Analysis/malloc.c	Wed Jan 24 20:25:37 2018	(r328364)
@@ -1720,13 +1720,6 @@ void *smallocWarn(size_t size) {
   }
 }
 
-char *dupstrWarn(const char *s) {
-  const int len = strlen(s);
-  char *p = (char*) smallocWarn(len + 1);
-  strcpy(p, s); // expected-warning{{String copy function overflows destination buffer}}
-  return p;
-}
-
 int *radar15580979() {
   int *data = (int *)malloc(32);
   int *p = data ?: (int*)malloc(32); // no warning

Added: vendor/clang/dist-release_60/test/CodeCompletion/Inputs/comments.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/test/CodeCompletion/Inputs/comments.h	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,4 @@
+// PR32732
+struct B {
+  // <- code completion
+};

Added: vendor/clang/dist-release_60/test/CodeCompletion/comments.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/test/CodeCompletion/comments.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,13 @@
+// Note: the run lines follow their respective tests, since line/column
+// matter in this test.
+
+#include "comments.h"
+
+struct A {
+  // <- code completion
+  /* <- code completion */
+};
+
+// RUN: %clang_cc1 -I %S/Inputs -fsyntax-only -code-completion-at=%s:7:6 %s
+// RUN: %clang_cc1 -I %S/Inputs -fsyntax-only -code-completion-at=%s:8:6 %s
+// RUN: %clang_cc1 -I %S/Inputs -fsyntax-only -code-completion-at=%S/Inputs/comments.h:3:6 %s

Modified: vendor/clang/dist-release_60/test/CodeGen/builtins-overflow.c
==============================================================================
--- vendor/clang/dist-release_60/test/CodeGen/builtins-overflow.c	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/test/CodeGen/builtins-overflow.c	Wed Jan 24 20:25:37 2018	(r328364)
@@ -373,7 +373,9 @@ int test_mixed_sign_mull_overflow_unsigned(int x, unsi
 // CHECK-NEXT:  [[NotNull:%.*]] = icmp ne i32 [[UnsignedResult]], 0
 // CHECK-NEXT:  [[Underflow:%.*]] = and i1 [[IsNeg]], [[NotNull]]
 // CHECK-NEXT:  [[OFlow:%.*]] = or i1 [[UnsignedOFlow]], [[Underflow]]
-// CHECK-NEXT:  store i32 [[UnsignedResult]], i32* %{{.*}}, align 4
+// CHECK-NEXT:  [[NegatedResult:%.*]] = sub i32 0, [[UnsignedResult]]
+// CHECK-NEXT:  [[Result:%.*]] = select i1 [[IsNeg]], i32 [[NegatedResult]], i32 [[UnsignedResult]]
+// CHECK-NEXT:  store i32 [[Result]], i32* %{{.*}}, align 4
 // CHECK:       br i1 [[OFlow]]
 
   unsigned result;
@@ -432,7 +434,9 @@ long long test_mixed_sign_mulll_overflow_trunc_unsigne
 // CHECK-NEXT:  [[OVERFLOW_PRE_TRUNC:%.*]] = or i1 {{.*}}, [[UNDERFLOW]]
 // CHECK-NEXT:  [[TRUNC_OVERFLOW:%.*]] = icmp ugt i64 [[UNSIGNED_RESULT]], 4294967295
 // CHECK-NEXT:  [[OVERFLOW:%.*]] = or i1 [[OVERFLOW_PRE_TRUNC]], [[TRUNC_OVERFLOW]]
-// CHECK-NEXT:  trunc i64 [[UNSIGNED_RESULT]] to i32
+// CHECK-NEXT:  [[NEGATED:%.*]] = sub i64 0, [[UNSIGNED_RESULT]]
+// CHECK-NEXT:  [[RESULT:%.*]] = select i1 {{.*}}, i64 [[NEGATED]], i64 [[UNSIGNED_RESULT]]
+// CHECK-NEXT:  trunc i64 [[RESULT]] to i32
 // CHECK-NEXT:  store
   unsigned result;
   if (__builtin_mul_overflow(y, x, &result))

Modified: vendor/clang/dist-release_60/test/CodeGenCXX/cxx1z-inline-variables.cpp
==============================================================================
--- vendor/clang/dist-release_60/test/CodeGenCXX/cxx1z-inline-variables.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/test/CodeGenCXX/cxx1z-inline-variables.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -58,14 +58,22 @@ template<typename T> struct X {
   static int a;
   static inline int b;
   static int c;
+  static const int d;
+  static int e;
 };
 // CHECK: @_ZN1XIiE1aE = linkonce_odr global i32 10
 // CHECK: @_ZN1XIiE1bE = global i32 20
 // CHECK-NOT: @_ZN1XIiE1cE
+// CHECK: @_ZN1XIiE1dE = linkonce_odr constant i32 40
+// CHECK: @_ZN1XIiE1eE = linkonce_odr global i32 50
 template<> inline int X<int>::a = 10;
 int &use3 = X<int>::a;
 template<> int X<int>::b = 20;
 template<> inline int X<int>::c = 30;
+template<typename T> constexpr int X<T>::d = 40;
+template<typename T> inline int X<T>::e = 50;
+const int *use_x_int_d = &X<int>::d;
+const int *use_x_int_e = &X<int>::e;
 
 template<typename T> struct Y;
 template<> struct Y<int> {

Added: vendor/clang/dist-release_60/test/Lexer/null-character-in-literal.c
==============================================================================
Binary file. No diff available.

Modified: vendor/clang/dist-release_60/test/Modules/ExtDebugInfo.cpp
==============================================================================
--- vendor/clang/dist-release_60/test/Modules/ExtDebugInfo.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/test/Modules/ExtDebugInfo.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -187,7 +187,7 @@ void foo() {
 
 // CHECK: !DIGlobalVariable(name: "anon_enum", {{.*}}, type: ![[ANON_ENUM:[0-9]+]]
 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, scope: ![[NS]],
-// CHECK-SAME:             line: 16
+// CHECK-SAME:             line: 19
 
 // CHECK: !DIGlobalVariable(name: "GlobalUnion",
 // CHECK-SAME:              type: ![[GLOBAL_UNION:[0-9]+]]

Modified: vendor/clang/dist-release_60/test/Modules/Inputs/DebugCXX.h
==============================================================================
--- vendor/clang/dist-release_60/test/Modules/Inputs/DebugCXX.h	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/test/Modules/Inputs/DebugCXX.h	Wed Jan 24 20:25:37 2018	(r328364)
@@ -1,4 +1,7 @@
 /* -*- C++ -*- */
+
+#include "dummy.h"
+
 namespace DebugCXX {
   // Records.
   struct Struct {

Added: vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/Box.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/Box.h	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,14 @@
+template <class T>
+struct iterator {
+  void Compare(const iterator &x) { }
+  friend void Check(iterator) {}
+};
+
+template <class T = int> struct Box {
+  iterator<T> I;
+
+  void test() {
+    Check(I);
+    I.Compare(I);
+  }
+};

Added: vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/M1.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/M1.h	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,6 @@
+#include "Box.h"
+
+void Peek() {
+  Box<> Gift;
+  Gift.test();
+}

Added: vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/M2.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/M2.h	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,5 @@
+#include "Box.h"
+void x() {
+  Box<> Unused;
+  //Unused.test();
+}

Added: vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/M3.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/M3.h	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,7 @@
+#include "Box.h"
+#include "M2.h"
+
+void Party() {
+  Box<> Present;
+  Present.test();
+}

Added: vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/module.modulemap
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/test/Modules/Inputs/odr_hash-Friend/module.modulemap	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,15 @@
+module Box {
+  header "Box.h"
+}
+
+module Module1 {
+  header "M1.h"
+}
+
+module Module2 {
+  header "M2.h"
+}
+
+module Module3 {
+  header "M3.h"
+}

Modified: vendor/clang/dist-release_60/test/Modules/ModuleDebugInfo.cpp
==============================================================================
--- vendor/clang/dist-release_60/test/Modules/ModuleDebugInfo.cpp	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/test/Modules/ModuleDebugInfo.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -5,12 +5,13 @@
 
 // Modules:
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debug-info-kind=limited -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll
+// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -debug-info-kind=limited -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll
 // RUN: cat %t-mod.ll | FileCheck %s
 // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s
+// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-MOD %s
 
 // PCH:
-// RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll
+// RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11  -debugger-tuning=lldb -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll
 // RUN: cat %t-pch.ll | FileCheck %s
 // RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-NEG %s
 
@@ -18,6 +19,9 @@
 @import DebugCXX;
 #endif
 
+// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
+// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
+
 // CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
 // CHECK-SAME:                    isOptimized: false,
 // CHECK-NOT:                     splitDebugFilename:
@@ -27,6 +31,8 @@
 // CHECK-SAME:             identifier: "_ZTSN8DebugCXX4EnumE")
 // CHECK: !DINamespace(name: "DebugCXX"
 
+// CHECK-MOD: ![[DEBUGCXX:.*]] = !DIModule(scope: null, name: "DebugCXX
+
 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
 // CHECK-NOT:              name:
 // CHECK-SAME:             )
@@ -149,5 +155,12 @@
 // CHECK: ![[SPECIALIZEDBASE]] = !DICompositeType(tag: DW_TAG_class_type,
 // CHECK-SAME:                             name: "WithSpecializedBase<float>",
 // CHECK-SAME:                             flags: DIFlagFwdDecl,
+
+// CHECK-MOD: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: ![[DEBUGCXX]],
+// CHECK-MOD-SAME:              entity: ![[DUMMY:[0-9]+]],
+// CHECK-MOD-SAME:              line: 3)
+// CHECK-MOD: ![[DUMMY]] = !DIModule(scope: null, name: "dummy",
+// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_ObjC_plus_plus,
+// CHECK-MOD-SAME:  splitDebugFilename: "{{.*}}dummy{{.*}}.pcm",
 
 // CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl"

Added: vendor/clang/dist-release_60/test/Modules/odr_hash-Friend.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/test/Modules/odr_hash-Friend.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,22 @@
+// RUN: rm -rf %t
+
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/modules.cache \
+// RUN:  -I %S/Inputs/odr_hash-Friend \
+// RUN:  -emit-obj -o /dev/null \
+// RUN:  -fmodules \
+// RUN:  -fimplicit-module-maps \
+// RUN:  -fmodules-cache-path=%t/modules.cache \
+// RUN:  -std=c++11 -x c++ %s -verify
+
+// PR35939: MicrosoftMangle.cpp triggers an assertion failure on this test.
+// UNSUPPORTED: system-windows
+
+// expected-no-diagnostics
+
+#include "Box.h"
+#include "M1.h"
+#include "M3.h"
+
+void Run() {
+  Box<> Present;
+}

Added: vendor/clang/dist-release_60/test/Modules/odr_hash-blocks.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/clang/dist-release_60/test/Modules/odr_hash-blocks.cpp	Wed Jan 24 20:25:37 2018	(r328364)
@@ -0,0 +1,119 @@
+// Clear and create directories
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: mkdir %t/cache
+// RUN: mkdir %t/Inputs
+
+// Build first header file
+// RUN: echo "#define FIRST" >> %t/Inputs/first.h
+// RUN: cat %s               >> %t/Inputs/first.h
+
+// Build second header file
+// RUN: echo "#define SECOND" >> %t/Inputs/second.h
+// RUN: cat %s                >> %t/Inputs/second.h
+
+// Test that each header can compile
+// RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 -fblocks %t/Inputs/first.h
+// RUN: %clang_cc1 -fsyntax-only -x c++ -std=c++11 -fblocks %t/Inputs/second.h
+
+// Build module map file
+// RUN: echo "module FirstModule {"     >> %t/Inputs/module.map
+// RUN: echo "    header \"first.h\""   >> %t/Inputs/module.map
+// RUN: echo "}"                        >> %t/Inputs/module.map
+// RUN: echo "module SecondModule {"    >> %t/Inputs/module.map
+// RUN: echo "    header \"second.h\""  >> %t/Inputs/module.map
+// RUN: echo "}"                        >> %t/Inputs/module.map
+
+// Run test
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps \
+// RUN:            -fmodules-cache-path=%t/cache -x c++ -I%t/Inputs \
+// RUN:            -verify %s -std=c++11 -fblocks
+
+#if !defined(FIRST) && !defined(SECOND)
+#include "first.h"
+#include "second.h"
+#endif
+
+// Used for testing
+#if defined(FIRST)
+#define ACCESS public:
+#elif defined(SECOND)
+#define ACCESS private:
+#endif
+
+// TODO: S1, S2, and S3 should generate errors.
+namespace Blocks {
+#if defined(FIRST)
+struct S1 {
+  void (^block)(int x) = ^(int x) { };
+};
+#elif defined(SECOND)
+struct S1 {
+  void (^block)(int x) = ^(int y) { };
+};
+#else
+S1 s1;
+#endif
+
+#if defined(FIRST)
+struct S2 {
+  int (^block)(int x) = ^(int x) { return x + 1; };
+};
+#elif defined(SECOND)
+struct S2 {
+  int (^block)(int x) = ^(int x) { return x; };
+};
+#else
+S2 s2;
+#endif
+
+#if defined(FIRST)
+struct S3 {
+  void run(int (^block)(int x));
+};
+#elif defined(SECOND)
+struct S3 {
+  void run(int (^block)(int x, int y));
+};
+#else
+S3 s3;
+#endif
+
+#define DECLS                                       \
+  int (^block)(int x) = ^(int x) { return x + x; }; \
+  void run(int (^block)(int x, int y));
+
+#if defined(FIRST) || defined(SECOND)
+struct Valid1 {
+  DECLS
+};
+#else
+Valid1 v1;
+#endif
+
+#if defined(FIRST) || defined(SECOND)
+struct Invalid1 {
+  DECLS
+  ACCESS
+};
+#else
+Invalid1 i1;
+// expected-error@second.h:* {{'Blocks::Invalid1' has different definitions in different modules; first difference is definition in module 'SecondModule' found private access specifier}}
+// expected-note@first.h:* {{but in 'FirstModule' found public access specifier}}
+#endif
+
+#undef DECLS
+}
+
+// Keep macros contained to one file.
+#ifdef FIRST
+#undef FIRST
+#endif
+
+#ifdef SECOND
+#undef SECOND
+#endif
+
+#ifdef ACCESS
+#undef ACCESS
+#endif

Modified: vendor/clang/dist-release_60/test/Preprocessor/cuda-types.cu
==============================================================================
--- vendor/clang/dist-release_60/test/Preprocessor/cuda-types.cu	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/test/Preprocessor/cuda-types.cu	Wed Jan 24 20:25:37 2018	(r328364)
@@ -9,40 +9,40 @@
 
 // RUN: %clang --cuda-host-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/i386-host-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/i386-host-defines-filtered
 // RUN: %clang --cuda-device-only -nocudainc -nocudalib -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/i386-device-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/i386-device-defines-filtered
 // RUN: diff %t/i386-host-defines-filtered %t/i386-device-defines-filtered
 
 // RUN: %clang --cuda-host-only -nocudainc -target x86_64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/x86_64-host-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/x86_64-host-defines-filtered
 // RUN: %clang --cuda-device-only -nocudainc -nocudalib -target x86_64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/x86_64-device-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/x86_64-device-defines-filtered
 // RUN: diff %t/x86_64-host-defines-filtered %t/x86_64-device-defines-filtered
 
 // RUN: %clang --cuda-host-only -nocudainc -target powerpc64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/powerpc64-host-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/powerpc64-host-defines-filtered
 // RUN: %clang --cuda-device-only -nocudainc -nocudalib -target powerpc64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/powerpc64-device-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/powerpc64-device-defines-filtered
 // RUN: diff %t/powerpc64-host-defines-filtered %t/powerpc64-device-defines-filtered
 
 // RUN: %clang --cuda-host-only -nocudainc -target i386-windows-msvc -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/i386-msvc-host-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/i386-msvc-host-defines-filtered
 // RUN: %clang --cuda-device-only -nocudainc -nocudalib -target i386-windows-msvc -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/i386-msvc-device-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/i386-msvc-device-defines-filtered
 // RUN: diff %t/i386-msvc-host-defines-filtered %t/i386-msvc-device-defines-filtered
 
 // RUN: %clang --cuda-host-only -nocudainc -target x86_64-windows-msvc -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/x86_64-msvc-host-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/x86_64-msvc-host-defines-filtered
 // RUN: %clang --cuda-device-only -nocudainc -nocudalib -target x86_64-windows-msvc -x cuda -E -dM -o - /dev/null \
 // RUN:   | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \
-// RUN:   | grep -v '__FLT128\|__LDBL\|_LONG_DOUBLE' > %t/x86_64-msvc-device-defines-filtered
+// RUN:   | grep -v '__LDBL\|_LONG_DOUBLE' > %t/x86_64-msvc-device-defines-filtered
 // RUN: diff %t/x86_64-msvc-host-defines-filtered %t/x86_64-msvc-device-defines-filtered

Modified: vendor/clang/dist-release_60/test/Sema/tautological-constant-compare.c
==============================================================================
--- vendor/clang/dist-release_60/test/Sema/tautological-constant-compare.c	Wed Jan 24 20:23:54 2018	(r328363)
+++ vendor/clang/dist-release_60/test/Sema/tautological-constant-compare.c	Wed Jan 24 20:25:37 2018	(r328364)
@@ -2,8 +2,8 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -Wtautological-constant-in-range-compare -DTEST -verify -x c++ %s
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -Wtautological-type-limit-compare -DTEST -verify %s

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



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