Merge 6f10573 for LLVM update to 353983

Change-Id: If23612bcc67a98ba4b0328fa26444f522cc8d577
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0eeb4b3..eb643dc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,7 @@
   project(libcxxabi CXX C)
 
   set(PACKAGE_NAME libcxxabi)
-  set(PACKAGE_VERSION 8.0.0svn)
+  set(PACKAGE_VERSION 9.0.0svn)
   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org")
 
@@ -155,6 +155,9 @@
 set(LIBCXXABI_LIBCXX_PATH "${LIBCXXABI_LIBCXX_PATH}" CACHE PATH
     "Specify path to libc++ source." FORCE)
 
+option(LIBCXXABI_HERMETIC_STATIC_LIBRARY
+  "Do not export any symbols from the static library." OFF)
+
 #===============================================================================
 # Configure System
 #===============================================================================
@@ -228,12 +231,22 @@
 
 # Configure target flags
 add_target_flags_if(LIBCXXABI_BUILD_32_BITS "-m32")
-add_target_flags_if(LIBCXXABI_TARGET_TRIPLE
-          "--target=${LIBCXXABI_TARGET_TRIPLE}")
-add_target_flags_if(LIBCXXABI_GCC_TOOLCHAIN
-         "--gcc-toolchain=${LIBCXXABI_GCC_TOOLCHAIN}")
-add_target_flags_if(LIBCXXABI_SYSROOT
-          "--sysroot=${LIBCXXABI_SYSROOT}")
+
+if(LIBCXXABI_TARGET_TRIPLE)
+  add_target_flags("--target=${LIBCXXABI_TARGET_TRIPLE}")
+elseif(CMAKE_CXX_COMPILER_TARGET)
+  set(LIBCXXABI_TARGET_TRIPLE "${CMAKE_CXX_COMPILER_TARGET}")
+endif()
+if(LIBCXX_GCC_TOOLCHAIN)
+  add_target_flags("--gcc-toolchain=${LIBCXXABI_GCC_TOOLCHAIN}")
+elseif(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN)
+  set(LIBCXXABI_GCC_TOOLCHAIN "${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}")
+endif()
+if(LIBCXXABI_SYSROOT)
+  add_target_flags("--sysroot=${LIBCXXABI_SYSROOT}")
+elseif(CMAKE_SYSROOT)
+  set(LIBCXXABI_SYSROOT "${CMAKE_SYSROOT}")
+endif()
 
 if (LIBCXXABI_TARGET_TRIPLE)
   set(TARGET_TRIPLE "${LIBCXXABI_TARGET_TRIPLE}")
@@ -249,10 +262,6 @@
   string(REPLACE "-stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 endif()
 
-if (LIBCXXABI_USE_COMPILER_RT)
-  list(APPEND LIBCXXABI_LINK_FLAGS "-rtlib=compiler-rt")
-endif()
-
 # Let the library headers know they are currently being used to build the
 # library.
 add_definitions(-D_LIBCXXABI_BUILDING_LIBRARY)
diff --git a/LICENSE.TXT b/LICENSE.TXT
index f1f163f..b75c044 100644
--- a/LICENSE.TXT
+++ b/LICENSE.TXT
@@ -1,5 +1,240 @@
 ==============================================================================
-libc++abi License
+The LLVM Project is under the Apache License v2.0 with LLVM Exceptions:
+==============================================================================
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+    TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+    1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+    2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+    3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+    4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+    5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+    6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+    7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+    8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+    9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+    END OF TERMS AND CONDITIONS
+
+    APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+    Copyright [yyyy] [name of copyright owner]
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+
+---- LLVM Exceptions to the Apache 2.0 License ----
+
+As an exception, if, as a result of your compiling your source code, portions
+of this Software are embedded into an Object form of such source code, you
+may redistribute such embedded portions in such Object form without complying
+with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
+
+In addition, if you combine or link compiled forms of this Software with
+software that is licensed under the GPLv2 ("Combined Software") and if a
+court of competent jurisdiction determines that the patent provision (Section
+3), the indemnity provision (Section 9) or other Section of the License
+conflicts with the conditions of the GPLv2, you may retroactively and
+prospectively choose to deem waived or otherwise exclude such Section(s) of
+the License, but only in their entirety and only with respect to the Combined
+Software.
+
+==============================================================================
+Software from third parties included in the LLVM Project:
+==============================================================================
+The LLVM Project contains third party software which is under different license
+terms. All such code will be identified clearly using at least one of two
+mechanisms:
+1) It will be in a separate directory tree with its own `LICENSE.txt` or
+   `LICENSE` file at the top containing the specific license and restrictions
+   which apply to that software, or
+2) It will contain specific license and restriction terms at the top of every
+   file.
+
+==============================================================================
+Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
 ==============================================================================
 
 The libc++abi library is dual licensed under both the University of Illinois
@@ -14,7 +249,7 @@
 University of Illinois/NCSA
 Open Source License
 
-Copyright (c) 2009-2018 by the contributors listed in CREDITS.TXT
+Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT
 
 All rights reserved.
 
diff --git a/cmake/Modules/HandleLibcxxabiFlags.cmake b/cmake/Modules/HandleLibcxxabiFlags.cmake
index 3eddd7b..19d6e93 100644
--- a/cmake/Modules/HandleLibcxxabiFlags.cmake
+++ b/cmake/Modules/HandleLibcxxabiFlags.cmake
@@ -44,6 +44,29 @@
     check_cxx_compiler_flag("${flag}" "LIBCXXABI_SUPPORTS_${flagname}_FLAG")
 endmacro()
 
+macro(append_flags DEST)
+  foreach(value ${ARGN})
+    list(APPEND ${DEST} ${value})
+    list(APPEND ${DEST} ${value})
+  endforeach()
+endmacro()
+
+# If the specified 'condition' is true then append the specified list of flags to DEST
+macro(append_flags_if condition DEST)
+  if (${condition})
+    list(APPEND ${DEST} ${ARGN})
+  endif()
+endmacro()
+
+# Add each flag in the list specified by DEST if that flag is supported by the current compiler.
+macro(append_flags_if_supported DEST)
+  foreach(flag ${ARGN})
+    mangle_name("${flag}" flagname)
+    check_cxx_compiler_flag("${flag}" "LIBCXXABI_SUPPORTS_${flagname}_FLAG")
+    append_flags_if(LIBCXXABI_SUPPORTS_${flagname}_FLAG ${DEST} ${flag})
+  endforeach()
+endmacro()
+
 # Add a macro definition if condition is true.
 macro(define_if condition def)
   if (${condition})
diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake
index e50d026..3296c0c 100644
--- a/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -93,6 +93,8 @@
     endif()
   endif()
   if (LLVM_FOUND)
+    # Enable warnings, otherwise -w gets added to the cflags by HandleLLVMOptions.
+    set(LLVM_ENABLE_WARNINGS ON)
     include(AddLLVM OPTIONAL)
     include(HandleLLVMOptions OPTIONAL)
   endif()
@@ -117,7 +119,7 @@
     # Required LIT Configuration ------------------------------------------------
     # Define the default arguments to use with 'lit', and an option for the user
     # to override.
-    set(LLVM_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
+    set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
     set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
     if (MSVC OR XCODE)
       set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
diff --git a/include/__cxxabi_config.h b/include/__cxxabi_config.h
index 46f5914..c5e6e89 100644
--- a/include/__cxxabi_config.h
+++ b/include/__cxxabi_config.h
@@ -1,9 +1,8 @@
 //===-------------------------- __cxxabi_config.h -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/include/cxxabi.h b/include/cxxabi.h
index c6724ad..2c2d073 100644
--- a/include/cxxabi.h
+++ b/include/cxxabi.h
@@ -1,9 +1,8 @@
 //===--------------------------- cxxabi.h ---------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7e21fb2..66151b1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -139,28 +139,57 @@
   string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
 endif()
 
-# Add a object library that contains the compiled source files.
-add_library(cxxabi_objects OBJECT ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
-set_target_properties(cxxabi_objects
-                      PROPERTIES
-                        CXX_EXTENSIONS
-                          OFF
-                        CXX_STANDARD
-                          11
-                        CXX_STANDARD_REQUIRED
-                          ON
-                        COMPILE_FLAGS
-                          "${LIBCXXABI_COMPILE_FLAGS}"
-                        POSITION_INDEPENDENT_CODE
-                          ON)
+macro(cxxabi_object_library name)
+  cmake_parse_arguments(ARGS "" "" "DEFINES;FLAGS" ${ARGN})
+
+  # Add a object library that contains the compiled source files.
+  add_library(${name} OBJECT ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
+  set_target_properties(${name}
+                        PROPERTIES
+                          CXX_EXTENSIONS
+                            OFF
+                          CXX_STANDARD
+                            11
+                          CXX_STANDARD_REQUIRED
+                            ON
+                          COMPILE_FLAGS
+                            "${LIBCXXABI_COMPILE_FLAGS}"
+                          POSITION_INDEPENDENT_CODE
+                            ON)
+
+  if(ARGS_DEFINES)
+    target_compile_definitions(${name} PRIVATE ${ARGS_DEFINES})
+  endif()
+
+  if(ARGS_FLAGS)
+    target_compile_options(${name} PRIVATE ${ARGS_FLAGS})
+  endif()
+endmacro()
+
+if(LIBCXXABI_HERMETIC_STATIC_LIBRARY)
+  append_flags_if_supported(CXXABI_STATIC_OBJECTS_FLAGS -fvisibility=hidden)
+  append_flags_if_supported(CXXABI_STATIC_OBJECTS_FLAGS -fvisibility-global-new-delete-hidden)
+  cxxabi_object_library(cxxabi_static_objects
+    DEFINES
+      _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS
+      _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
+    FLAGS ${CXXABI_STATIC_OBJECTS_FLAGS})
+  cxxabi_object_library(cxxabi_shared_objects)
+  set(cxxabi_static_sources $<TARGET_OBJECTS:cxxabi_static_objects>)
+  set(cxxabi_shared_sources $<TARGET_OBJECTS:cxxabi_shared_objects>)
+else()
+  cxxabi_object_library(cxxabi_objects)
+  set(cxxabi_static_sources $<TARGET_OBJECTS:cxxabi_objects>)
+  set(cxxabi_shared_sources $<TARGET_OBJECTS:cxxabi_objects>)
+endif()
 
 # Build the shared library.
 if (LIBCXXABI_ENABLE_SHARED)
-  add_library(cxxabi_shared SHARED $<TARGET_OBJECTS:cxxabi_objects>)
+  add_library(cxxabi_shared SHARED ${cxxabi_shared_sources})
   if(COMMAND llvm_setup_rpath)
     llvm_setup_rpath(cxxabi_shared)
   endif()
-  target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES} ${LIBCXXABI_SHARED_LIBRARIES})
+  target_link_libraries(cxxabi_shared PRIVATE ${LIBCXXABI_LIBRARIES} ${LIBCXXABI_SHARED_LIBRARIES})
   set_target_properties(cxxabi_shared
                         PROPERTIES
                           CXX_EXTENSIONS
@@ -187,14 +216,17 @@
 
 # Build the static library.
 if (LIBCXXABI_ENABLE_STATIC)
-  set(cxxabi_static_sources $<TARGET_OBJECTS:cxxabi_objects>)
   if (LIBCXXABI_USE_LLVM_UNWINDER AND LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY)
     if (TARGET unwind_static OR HAVE_LIBUNWIND)
-      list(APPEND cxxabi_static_sources $<TARGET_OBJECTS:unwind_objects>)
+      if(LIBUNWIND_HERMETIC_STATIC_LIBRARY)
+        list(APPEND cxxabi_static_sources $<TARGET_OBJECTS:unwind_static_objects>)
+      else()
+        list(APPEND cxxabi_static_sources $<TARGET_OBJECTS:unwind_objects>)
+      endif()
     endif()
   endif()
   add_library(cxxabi_static STATIC ${cxxabi_static_sources})
-  target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES} ${LIBCXXABI_STATIC_LIBRARIES})
+  target_link_libraries(cxxabi_static PRIVATE ${LIBCXXABI_LIBRARIES} ${LIBCXXABI_STATIC_LIBRARIES})
   set_target_properties(cxxabi_static
                         PROPERTIES
                           CXX_EXTENSIONS
diff --git a/src/abort_message.cpp b/src/abort_message.cpp
index 7a2a9f8..d556af1 100644
--- a/src/abort_message.cpp
+++ b/src/abort_message.cpp
@@ -1,9 +1,8 @@
 //===------------------------- abort_message.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/abort_message.h b/src/abort_message.h
index e8f9571..7cb11f4 100644
--- a/src/abort_message.h
+++ b/src/abort_message.h
@@ -1,9 +1,8 @@
 //===-------------------------- abort_message.h-----------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/cxa_aux_runtime.cpp b/src/cxa_aux_runtime.cpp
index 878d3bd..8c3751f 100644
--- a/src/cxa_aux_runtime.cpp
+++ b/src/cxa_aux_runtime.cpp
@@ -1,9 +1,8 @@
 //===------------------------ cxa_aux_runtime.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //
 // This file implements the "Auxiliary Runtime APIs"
diff --git a/src/cxa_default_handlers.cpp b/src/cxa_default_handlers.cpp
index f00e959..8110f6c 100644
--- a/src/cxa_default_handlers.cpp
+++ b/src/cxa_default_handlers.cpp
@@ -1,9 +1,8 @@
 //===------------------------- cxa_default_handlers.cpp -------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //
 // This file implements the default terminate_handler and unexpected_handler.
diff --git a/src/cxa_demangle.cpp b/src/cxa_demangle.cpp
index f227add..7912b1c 100644
--- a/src/cxa_demangle.cpp
+++ b/src/cxa_demangle.cpp
@@ -1,9 +1,8 @@
 //===-------------------------- cxa_demangle.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
@@ -11,12 +10,8 @@
 // file does not yet support:
 //   - C++ modules TS
 
-#define _LIBCPP_NO_EXCEPTIONS
-
-#include "__cxxabi_config.h"
-
 #include "demangle/ItaniumDemangle.h"
-
+#include "__cxxabi_config.h"
 #include <cassert>
 #include <cctype>
 #include <cstdio>
@@ -25,7 +20,6 @@
 #include <functional>
 #include <numeric>
 #include <utility>
-#include <vector>
 
 using namespace itanium_demangle;
 
diff --git a/src/cxa_exception.cpp b/src/cxa_exception.cpp
index 8d30e5c..ed2d7d1 100644
--- a/src/cxa_exception.cpp
+++ b/src/cxa_exception.cpp
@@ -1,9 +1,8 @@
 //===------------------------- cxa_exception.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //  
 //  This file implements the "Exception Handling APIs"
diff --git a/src/cxa_exception.hpp b/src/cxa_exception.hpp
index 6d98e11..801eeb3 100644
--- a/src/cxa_exception.hpp
+++ b/src/cxa_exception.hpp
@@ -1,9 +1,8 @@
 //===------------------------- cxa_exception.hpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //  
 //  This file implements the "Exception Handling APIs"
diff --git a/src/cxa_exception_storage.cpp b/src/cxa_exception_storage.cpp
index c641e02..7beda95 100644
--- a/src/cxa_exception_storage.cpp
+++ b/src/cxa_exception_storage.cpp
@@ -1,9 +1,8 @@
 //===--------------------- cxa_exception_storage.cpp ----------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //  
 //  This file implements the storage for the "Caught Exception Stack"
diff --git a/src/cxa_guard.cpp b/src/cxa_guard.cpp
index f4c2a18..a991b8d 100644
--- a/src/cxa_guard.cpp
+++ b/src/cxa_guard.cpp
@@ -1,9 +1,8 @@
 //===---------------------------- cxa_guard.cpp ---------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/cxa_handlers.cpp b/src/cxa_handlers.cpp
index 8c26bd0..390bc65 100644
--- a/src/cxa_handlers.cpp
+++ b/src/cxa_handlers.cpp
@@ -1,9 +1,8 @@
 //===------------------------- cxa_handlers.cpp ---------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //
 // This file implements the functionality associated with the terminate_handler,
diff --git a/src/cxa_handlers.hpp b/src/cxa_handlers.hpp
index 14c0e10..f87f49d 100644
--- a/src/cxa_handlers.hpp
+++ b/src/cxa_handlers.hpp
@@ -1,9 +1,8 @@
 //===------------------------- cxa_handlers.cpp ---------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //
 // This file implements the functionality associated with the terminate_handler,
diff --git a/src/cxa_noexception.cpp b/src/cxa_noexception.cpp
index 8d5b5f2..2467277 100644
--- a/src/cxa_noexception.cpp
+++ b/src/cxa_noexception.cpp
@@ -1,9 +1,8 @@
 //===------------------------- cxa_exception.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //  
 //  This file implements the "Exception Handling APIs"
diff --git a/src/cxa_personality.cpp b/src/cxa_personality.cpp
index 468461d..bf35671 100644
--- a/src/cxa_personality.cpp
+++ b/src/cxa_personality.cpp
@@ -1,9 +1,8 @@
 //===------------------------- cxa_exception.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //  
 //  This file implements the "Exception Handling APIs"
diff --git a/src/cxa_thread_atexit.cpp b/src/cxa_thread_atexit.cpp
index 49d15d6..da1df86 100644
--- a/src/cxa_thread_atexit.cpp
+++ b/src/cxa_thread_atexit.cpp
@@ -1,9 +1,8 @@
 //===----------------------- cxa_thread_atexit.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/cxa_unexpected.cpp b/src/cxa_unexpected.cpp
index 7d4ef80..ee0845b 100644
--- a/src/cxa_unexpected.cpp
+++ b/src/cxa_unexpected.cpp
@@ -1,9 +1,8 @@
 //===------------------------- cxa_unexpected.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/cxa_vector.cpp b/src/cxa_vector.cpp
index c32a211..2d89787 100644
--- a/src/cxa_vector.cpp
+++ b/src/cxa_vector.cpp
@@ -1,9 +1,8 @@
 //===-------------------------- cxa_vector.cpp ---------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //  
 //  This file implements the "Array Construction and Destruction APIs"
diff --git a/src/cxa_virtual.cpp b/src/cxa_virtual.cpp
index f59fa7e..9214c1f 100644
--- a/src/cxa_virtual.cpp
+++ b/src/cxa_virtual.cpp
@@ -1,9 +1,8 @@
 //===-------------------------- cxa_virtual.cpp ---------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/demangle/Compiler.h b/src/demangle/Compiler.h
deleted file mode 100644
index e5f3c72..0000000
--- a/src/demangle/Compiler.h
+++ /dev/null
@@ -1,34 +0,0 @@
-//===--- Compiler.h ---------------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// This file is contains a subset of macros copied from
-// llvm/lib/Demangle/Compiler.h.
-//===----------------------------------------------------------------------===//
-
-#ifndef LIBCXX_DEMANGLE_COMPILER_H
-#define LIBCXX_DEMANGLE_COMPILER_H
-
-#ifdef _MSC_VER
-// snprintf is implemented in VS 2015
-#if _MSC_VER < 1900
-#define snprintf _snprintf_s
-#endif
-#endif
-
-#ifndef __has_attribute
-#define __has_attribute(x) 0
-#endif
-
-#ifndef NDEBUG
-#if __has_attribute(noinline) && __has_attribute(used)
-#define DUMP_METHOD __attribute__((noinline, used))
-#else
-#define DUMP_METHOD
-#endif
-#endif
-
-#endif
diff --git a/src/demangle/DemangleConfig.h b/src/demangle/DemangleConfig.h
new file mode 100644
index 0000000..be3ea59
--- /dev/null
+++ b/src/demangle/DemangleConfig.h
@@ -0,0 +1,41 @@
+//===--- Compiler.h ---------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// This file is contains a subset of macros copied from
+// llvm/lib/Demangle/Compiler.h.
+//===----------------------------------------------------------------------===//
+
+#ifndef LIBCXX_DEMANGLE_COMPILER_H
+#define LIBCXX_DEMANGLE_COMPILER_H
+
+#include "__config"
+
+#ifdef _MSC_VER
+// snprintf is implemented in VS 2015
+#if _MSC_VER < 1900
+#define snprintf _snprintf_s
+#endif
+#endif
+
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
+#ifndef NDEBUG
+#if __has_attribute(noinline) && __has_attribute(used)
+#define DEMANGLE_DUMP_METHOD __attribute__((noinline, used))
+#else
+#define DEMANGLE_DUMP_METHOD
+#endif
+#endif
+
+#define DEMANGLE_FALLTHROUGH _LIBCPP_FALLTHROUGH()
+#define DEMANGLE_UNREACHABLE _LIBCPP_UNREACHABLE()
+
+#define DEMANGLE_NAMESPACE_BEGIN namespace { namespace itanium_demangle {
+#define DEMANGLE_NAMESPACE_END } }
+
+#endif
diff --git a/src/demangle/ItaniumDemangle.h b/src/demangle/ItaniumDemangle.h
index 9e9d183..df06aa6 100644
--- a/src/demangle/ItaniumDemangle.h
+++ b/src/demangle/ItaniumDemangle.h
@@ -1,28 +1,26 @@
 //===------------------------- ItaniumDemangle.h ----------------*- C++ -*-===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 //
-// WARNING: This file defines its contents within an anonymous namespace. It
-// should not be included anywhere other than cxa_demangle.h.
+// Generic itanium demangler library. This file has two byte-per-byte identical
+// copies in the source tree, one in libcxxabi, and the other in llvm.
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LIBCXX_DEMANGLE_ITANIUMDEMANGLE_H
-#define LIBCXX_DEMANGLE_ITANIUMDEMANGLE_H
+#ifndef DEMANGLE_ITANIUMDEMANGLE_H
+#define DEMANGLE_ITANIUMDEMANGLE_H
 
 // FIXME: (possibly) incomplete list of features that clang mangles that this
 // file does not yet support:
 //   - C++ modules TS
 
-#include "Compiler.h"
+#include "DemangleConfig.h"
 #include "StringView.h"
 #include "Utility.h"
-
 #include <cassert>
 #include <cctype>
 #include <cstdio>
@@ -100,8 +98,8 @@
     X(BracedExpr) \
     X(BracedRangeExpr)
 
-namespace {
-namespace itanium_demangle {
+DEMANGLE_NAMESPACE_BEGIN
+
 // Base class of all AST nodes. The AST is built by the parser, then is
 // traversed by the printLeft/Right functions to produce a demangled string.
 class Node {
@@ -199,7 +197,7 @@
   virtual ~Node() = default;
 
 #ifndef NDEBUG
-  DUMP_METHOD void dump() const;
+  DEMANGLE_DUMP_METHOD void dump() const;
 #endif
 };
 
@@ -1283,7 +1281,7 @@
     case SpecialSubKind::iostream:
       return StringView("basic_iostream");
     }
-    _LIBCPP_UNREACHABLE();
+    DEMANGLE_UNREACHABLE;
   }
 
   void printLeft(OutputStream &S) const override {
@@ -1335,7 +1333,7 @@
     case SpecialSubKind::iostream:
       return StringView("iostream");
     }
-    _LIBCPP_UNREACHABLE();
+    DEMANGLE_UNREACHABLE;
   }
 
   void printLeft(OutputStream &S) const override {
@@ -2481,6 +2479,12 @@
       return nullptr;
     return make<ClosureTypeName>(Params, Count);
   }
+  if (consumeIf("Ub")) {
+    (void)parseNumber();
+    if (!consumeIf('_'))
+      return nullptr;
+    return make<NameType>("'block-literal'");
+  }
   return nullptr;
 }
 
@@ -3472,7 +3476,7 @@
       Result = getDerived().parseFunctionType();
       break;
     }
-    _LIBCPP_FALLTHROUGH();
+    DEMANGLE_FALLTHROUGH;
   }
   case 'U': {
     Result = getDerived().parseQualifiedType();
@@ -3759,7 +3763,7 @@
       // substitution table.
       return Sub;
     }
-    _LIBCPP_FALLTHROUGH();
+    DEMANGLE_FALLTHROUGH;
   }
   //        ::= <class-enum-type>
   default: {
@@ -5144,7 +5148,7 @@
 // extension      ::= ___Z <encoding> _block_invoke_<decimal-digit>+
 template <typename Derived, typename Alloc>
 Node *AbstractManglingParser<Derived, Alloc>::parse() {
-  if (consumeIf("_Z")) {
+  if (consumeIf("_Z") || consumeIf("__Z")) {
     Node *Encoding = getDerived().parseEncoding();
     if (Encoding == nullptr)
       return nullptr;
@@ -5157,7 +5161,7 @@
     return Encoding;
   }
 
-  if (consumeIf("___Z")) {
+  if (consumeIf("___Z") || consumeIf("____Z")) {
     Node *Encoding = getDerived().parseEncoding();
     if (Encoding == nullptr || !consumeIf("_block_invoke"))
       return nullptr;
@@ -5183,7 +5187,6 @@
                                Alloc>::AbstractManglingParser;
 };
 
-}  // namespace itanium_demangle
-}  // namespace
+DEMANGLE_NAMESPACE_END
 
-#endif // LIBCXX_DEMANGLE_ITANIUMDEMANGLE_H
+#endif // DEMANGLE_ITANIUMDEMANGLE_H
diff --git a/src/demangle/README.txt b/src/demangle/README.txt
new file mode 100644
index 0000000..514ff6d
--- /dev/null
+++ b/src/demangle/README.txt
@@ -0,0 +1,52 @@
+Itanium Name Demangler Library
+==============================
+
+Introduction
+------------
+
+This directory contains the generic itanium name demangler library. The main
+purpose of the library is to demangle C++ symbols, i.e. convert the string
+"_Z1fv" into "f()". You can also use the CRTP base ManglingParser to perform
+some simple analysis on the mangled name, or (in LLVM) use the opaque
+ItaniumPartialDemangler to query the demangled AST.
+
+Why are there multiple copies of the this library in the source tree?
+---------------------------------------------------------------------
+
+This directory is mirrored between libcxxabi/demangle and
+llvm/include/llvm/Demangle. The simple reason for this is that both projects
+need to demangle symbols, but neither can depend on each other. libcxxabi needs
+the demangler to implement __cxa_demangle, which is part of the itanium ABI
+spec. LLVM needs a copy for a bunch of places, but doesn't want to use the
+system's __cxa_demangle because it a) might not be available (i.e., on Windows),
+and b) probably isn't that up-to-date on the latest language features.
+
+The copy of the demangler in LLVM has some extra stuff that aren't needed in
+libcxxabi (ie, the MSVC demangler, ItaniumPartialDemangler), which depend on the
+shared generic components. Despite these differences, we want to keep the "core"
+generic demangling library identical between both copies to simplify development
+and testing.
+
+If you're working on the generic library, then do the work first in libcxxabi,
+then run the cp-to-llvm.sh script in src/demangle. This script takes as an
+argument the path to llvm, and re-copies the changes you made to libcxxabi over.
+Note that this script just blindly overwrites all changes to the generic library
+in llvm, so be careful.
+
+Because the core demangler needs to work in libcxxabi, everything needs to be
+declared in an anonymous namespace (see DEMANGLE_NAMESPACE_BEGIN), and you can't
+introduce any code that depends on the libcxx dylib.
+
+Hopefully, when LLVM becomes a monorepo, we can de-duplicate this code, and have
+both LLVM and libcxxabi depend on a shared demangler library.
+
+Testing
+-------
+
+The tests are split up between libcxxabi/test/{unit,}test_demangle.cpp, and
+llvm/unittest/Demangle. The llvm directory should only get tests for stuff not
+included in the core library. In the future though, we should probably move all
+the tests to LLVM.
+
+It is also a really good idea to run libFuzzer after non-trivial changes, see
+libcxxabi/fuzz/cxa_demangle_fuzzer.cpp and https://llvm.org/docs/LibFuzzer.html.
diff --git a/src/demangle/StringView.h b/src/demangle/StringView.h
index 986f2de..ceb6c79 100644
--- a/src/demangle/StringView.h
+++ b/src/demangle/StringView.h
@@ -1,27 +1,32 @@
 //===--- StringView.h -------------------------------------------*- C++ -*-===//
 //
-//                     The LLVM Compiler Infrastructure
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+//===----------------------------------------------------------------------===//
 //
+// FIXME: Use std::string_view instead when we support C++17.
 //
-// This file is copied from llvm/lib/Demangle/StringView.h.
 //===----------------------------------------------------------------------===//
 
-#ifndef LIBCXX_DEMANGLE_STRINGVIEW_H
-#define LIBCXX_DEMANGLE_STRINGVIEW_H
+#ifndef DEMANGLE_STRINGVIEW_H
+#define DEMANGLE_STRINGVIEW_H
 
+#include "DemangleConfig.h"
 #include <algorithm>
 #include <cassert>
 #include <cstring>
 
-namespace {
+DEMANGLE_NAMESPACE_BEGIN
+
 class StringView {
   const char *First;
   const char *Last;
 
 public:
+  static const size_t npos = ~size_t(0);
+
   template <size_t N>
   StringView(const char (&Str)[N]) : First(Str), Last(Str + N - 1) {}
   StringView(const char *First_, const char *Last_)
@@ -35,6 +40,17 @@
     return StringView(begin() + From, size() - From);
   }
 
+  size_t find(char C, size_t From = 0) const {
+    size_t FindBegin = std::min(From, size());
+    // Avoid calling memchr with nullptr.
+    if (FindBegin < size()) {
+      // Just forward to memchr, which is faster than a hand-rolled loop.
+      if (const void *P = ::memchr(First + FindBegin, C, size() - FindBegin))
+        return size_t(static_cast<const char *>(P) - First);
+    }
+    return npos;
+  }
+
   StringView substr(size_t From, size_t To) const {
     if (To >= size())
       To = size() - 1;
@@ -45,15 +61,26 @@
 
   StringView dropFront(size_t N = 1) const {
     if (N >= size())
-      N = size() - 1;
+      N = size();
     return StringView(First + N, Last);
   }
 
+  StringView dropBack(size_t N = 1) const {
+    if (N >= size())
+      N = size();
+    return StringView(First, Last - N);
+  }
+
   char front() const {
     assert(!empty());
     return *begin();
   }
 
+  char back() const {
+    assert(!empty());
+    return *(end() - 1);
+  }
+
   char popFront() {
     assert(!empty());
     return *First++;
@@ -93,6 +120,7 @@
   return LHS.size() == RHS.size() &&
          std::equal(LHS.begin(), LHS.end(), RHS.begin());
 }
-} // namespace
+
+DEMANGLE_NAMESPACE_END
 
 #endif
diff --git a/src/demangle/Utility.h b/src/demangle/Utility.h
index b5e9b5e..ec23859 100644
--- a/src/demangle/Utility.h
+++ b/src/demangle/Utility.h
@@ -1,26 +1,27 @@
 //===--- Utility.h ----------------------------------------------*- C++ -*-===//
 //
-//                     The LLVM Compiler Infrastructure
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+//===----------------------------------------------------------------------===//
 //
+// Provide some utility classes for use in the demangler(s).
 //
-// This file is copied from llvm/lib/Demangle/Utility.h.
 //===----------------------------------------------------------------------===//
 
-#ifndef LIBCXX_DEMANGLE_UTILITY_H
-#define LIBCXX_DEMANGLE_UTILITY_H
+#ifndef DEMANGLE_UTILITY_H
+#define DEMANGLE_UTILITY_H
 
 #include "StringView.h"
-
 #include <cstdint>
 #include <cstdlib>
 #include <cstring>
 #include <iterator>
 #include <limits>
 
-namespace {
+DEMANGLE_NAMESPACE_BEGIN
+
 // Stream that AST nodes write their string representation into after the AST
 // has been parsed.
 class OutputStream {
@@ -185,6 +186,6 @@
   return true;
 }
 
-} // namespace
+DEMANGLE_NAMESPACE_END
 
 #endif
diff --git a/src/demangle/cp-to-llvm.sh b/src/demangle/cp-to-llvm.sh
new file mode 100755
index 0000000..808abbc
--- /dev/null
+++ b/src/demangle/cp-to-llvm.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Copies the 'demangle' library, excluding 'DemangleConfig.h', to llvm. If no
+# llvm directory is specified, then assume a monorepo layout.
+
+set -e
+
+FILES="ItaniumDemangle.h StringView.h Utility.h README.txt"
+LLVM_DEMANGLE_DIR=$1
+
+if [[ -z "$LLVM_DEMANGLE_DIR" ]]; then
+    LLVM_DEMANGLE_DIR="../../../llvm/include/llvm/Demangle"
+fi
+
+if [[ ! -d "$LLVM_DEMANGLE_DIR" ]]; then
+    echo "No such directory: $LLVM_DEMANGLE_DIR" >&2
+    exit 1
+fi
+
+read -p "This will overwrite the copies of $FILES in $LLVM_DEMANGLE_DIR; are you sure? [y/N]" -n 1 -r ANSWER
+echo
+
+if [[ $ANSWER =~ ^[Yy]$ ]]; then
+    for I in $FILES ; do
+        cp $I $LLVM_DEMANGLE_DIR/$I
+    done
+fi
diff --git a/src/fallback_malloc.cpp b/src/fallback_malloc.cpp
index 202a467..8ec1eee 100644
--- a/src/fallback_malloc.cpp
+++ b/src/fallback_malloc.cpp
@@ -1,9 +1,8 @@
 //===------------------------ fallback_malloc.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/fallback_malloc.h b/src/fallback_malloc.h
index d6f4714..033ecd6 100644
--- a/src/fallback_malloc.h
+++ b/src/fallback_malloc.h
@@ -1,9 +1,8 @@
 //===------------------------- fallback_malloc.h --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/include/atomic_support.h b/src/include/atomic_support.h
index 96dbd2c..fca6659 100644
--- a/src/include/atomic_support.h
+++ b/src/include/atomic_support.h
@@ -1,9 +1,8 @@
 //===----------------------------------------------------------------------===////
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===////
 
diff --git a/src/include/refstring.h b/src/include/refstring.h
index 69f6747..5905b5c 100644
--- a/src/include/refstring.h
+++ b/src/include/refstring.h
@@ -1,9 +1,8 @@
 //===------------------------ __refstring ---------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/private_typeinfo.cpp b/src/private_typeinfo.cpp
index 30340a1..2d83dc0 100644
--- a/src/private_typeinfo.cpp
+++ b/src/private_typeinfo.cpp
@@ -1,9 +1,8 @@
 //===----------------------- private_typeinfo.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/private_typeinfo.h b/src/private_typeinfo.h
index 3922ae6..d7f3f83 100644
--- a/src/private_typeinfo.h
+++ b/src/private_typeinfo.h
@@ -1,9 +1,8 @@
 //===------------------------ private_typeinfo.h --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/stdlib_exception.cpp b/src/stdlib_exception.cpp
index 0308e16..88d911d 100644
--- a/src/stdlib_exception.cpp
+++ b/src/stdlib_exception.cpp
@@ -1,9 +1,8 @@
 //===---------------------------- exception.cpp ---------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/stdlib_new_delete.cpp b/src/stdlib_new_delete.cpp
index bbd90a5..698c5f7 100644
--- a/src/stdlib_new_delete.cpp
+++ b/src/stdlib_new_delete.cpp
@@ -1,9 +1,8 @@
 //===--------------------- stdlib_new_delete.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //
 // This file implements the new and delete operators.
diff --git a/src/stdlib_stdexcept.cpp b/src/stdlib_stdexcept.cpp
index e3b7cd4..2cff8ee 100644
--- a/src/stdlib_stdexcept.cpp
+++ b/src/stdlib_stdexcept.cpp
@@ -1,9 +1,8 @@
 //===------------------------ stdexcept.cpp -------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/src/stdlib_typeinfo.cpp b/src/stdlib_typeinfo.cpp
index 9313be0..dbb9623 100644
--- a/src/stdlib_typeinfo.cpp
+++ b/src/stdlib_typeinfo.cpp
@@ -1,9 +1,8 @@
 //===----------------------------- typeinfo.cpp ---------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 5e51c44..01fae13 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -17,6 +17,7 @@
 pythonize_bool(LIBCXXABI_ENABLE_THREADS)
 pythonize_bool(LIBCXXABI_ENABLE_EXCEPTIONS)
 pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
+pythonize_bool(LIBCXXABI_USE_COMPILER_RT)
 pythonize_bool(LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
 set(LIBCXXABI_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
     "TargetInfo to use when setting up test environment.")
diff --git a/test/backtrace_test.pass.cpp b/test/backtrace_test.pass.cpp
index b9388ff..b6ed9b2 100644
--- a/test/backtrace_test.pass.cpp
+++ b/test/backtrace_test.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- backtrace_test.cpp ----------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_array_01.pass.cpp b/test/catch_array_01.pass.cpp
index a927e8f..03288e7 100644
--- a/test/catch_array_01.pass.cpp
+++ b/test/catch_array_01.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_array_01.cpp ----------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_array_02.pass.cpp b/test/catch_array_02.pass.cpp
index 65cf8cd..f6228a0 100644
--- a/test/catch_array_02.pass.cpp
+++ b/test/catch_array_02.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_array_02.cpp ----------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_class_01.pass.cpp b/test/catch_class_01.pass.cpp
index bc46b4e..0a7b5ea 100644
--- a/test/catch_class_01.pass.cpp
+++ b/test/catch_class_01.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_class_01.cpp ----------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_class_02.pass.cpp b/test/catch_class_02.pass.cpp
index 2249602..c415721 100644
--- a/test/catch_class_02.pass.cpp
+++ b/test/catch_class_02.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_class_02.cpp ----------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_class_03.pass.cpp b/test/catch_class_03.pass.cpp
index 72bc492..cbc3c32 100644
--- a/test/catch_class_03.pass.cpp
+++ b/test/catch_class_03.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_class_03.cpp ----------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_class_04.pass.cpp b/test/catch_class_04.pass.cpp
index 3a595ba..c439f79 100644
--- a/test/catch_class_04.pass.cpp
+++ b/test/catch_class_04.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_class_04.cpp ----------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_const_pointer_nullptr.pass.cpp b/test/catch_const_pointer_nullptr.pass.cpp
index ccf4405..44caef5 100644
--- a/test/catch_const_pointer_nullptr.pass.cpp
+++ b/test/catch_const_pointer_nullptr.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------------- catch_const_pointer_nullptr.cpp ----------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_function_01.pass.cpp b/test/catch_function_01.pass.cpp
index 4eb6914..bf962a9 100644
--- a/test/catch_function_01.pass.cpp
+++ b/test/catch_function_01.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------- catch_function_01.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_function_02.pass.cpp b/test/catch_function_02.pass.cpp
index adef92c..f746d92 100644
--- a/test/catch_function_02.pass.cpp
+++ b/test/catch_function_02.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_function_02.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_function_03.pass.cpp b/test/catch_function_03.pass.cpp
index bf817a9..dbc72c7 100644
--- a/test/catch_function_03.pass.cpp
+++ b/test/catch_function_03.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_function_03.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_in_noexcept.pass.cpp b/test/catch_in_noexcept.pass.cpp
index d7b9c48..94af4df 100644
--- a/test/catch_in_noexcept.pass.cpp
+++ b/test/catch_in_noexcept.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_in_noexcept.cpp--------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_member_data_pointer_01.pass.cpp b/test/catch_member_data_pointer_01.pass.cpp
index e7a2ea2..6536515 100644
--- a/test/catch_member_data_pointer_01.pass.cpp
+++ b/test/catch_member_data_pointer_01.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------- catch_member_data_pointer_01.cpp -------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_member_function_pointer_01.pass.cpp b/test/catch_member_function_pointer_01.pass.cpp
index b7bdcb6..3dc21df 100644
--- a/test/catch_member_function_pointer_01.pass.cpp
+++ b/test/catch_member_function_pointer_01.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------- catch_member_function_pointer_01.cpp -----------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_member_function_pointer_02.pass.cpp b/test/catch_member_function_pointer_02.pass.cpp
index 29f02bd..09770cb 100644
--- a/test/catch_member_function_pointer_02.pass.cpp
+++ b/test/catch_member_function_pointer_02.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------- catch_member_function_pointer_02.cpp -----------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_member_pointer_nullptr.pass.cpp b/test/catch_member_pointer_nullptr.pass.cpp
index 01888af..a6e7468 100644
--- a/test/catch_member_pointer_nullptr.pass.cpp
+++ b/test/catch_member_pointer_nullptr.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------- catch_member_pointer_nullptr.cpp -------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_multi_level_pointer.pass.cpp b/test/catch_multi_level_pointer.pass.cpp
index 770cf6b..fcd6ecd 100644
--- a/test/catch_multi_level_pointer.pass.cpp
+++ b/test/catch_multi_level_pointer.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------------- catch_pointer_nullptr.cpp ----------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_pointer_nullptr.pass.cpp b/test/catch_pointer_nullptr.pass.cpp
index 58fd827..bd1db8c 100644
--- a/test/catch_pointer_nullptr.pass.cpp
+++ b/test/catch_pointer_nullptr.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------------- catch_pointer_nullptr.cpp ----------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_pointer_reference.pass.cpp b/test/catch_pointer_reference.pass.cpp
index b1b7535..eff950f 100644
--- a/test/catch_pointer_reference.pass.cpp
+++ b/test/catch_pointer_reference.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_pointer_referece.cpp --------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 //
diff --git a/test/catch_ptr.pass.cpp b/test/catch_ptr.pass.cpp
index db734f4..0255b7f 100644
--- a/test/catch_ptr.pass.cpp
+++ b/test/catch_ptr.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------- catch_class_04.cpp ----------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_ptr_02.pass.cpp b/test/catch_ptr_02.pass.cpp
index 44bf2e2..9c24e11 100644
--- a/test/catch_ptr_02.pass.cpp
+++ b/test/catch_ptr_02.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- catch_ptr_02.cpp ---------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/catch_reference_nullptr.pass.cpp b/test/catch_reference_nullptr.pass.cpp
index 82a49df..0d7ac96 100644
--- a/test/catch_reference_nullptr.pass.cpp
+++ b/test/catch_reference_nullptr.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------------- catch_pointer_nullptr.cpp ----------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/cxa_bad_cast.pass.cpp b/test/cxa_bad_cast.pass.cpp
index 9b6bff4..ad38882 100644
--- a/test/cxa_bad_cast.pass.cpp
+++ b/test/cxa_bad_cast.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------- cxa_bad_cast.pass.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/cxa_bad_typeid.pass.cpp b/test/cxa_bad_typeid.pass.cpp
index 5018573..62a3c27 100644
--- a/test/cxa_bad_typeid.pass.cpp
+++ b/test/cxa_bad_typeid.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------- cxa_bad_typeid.pass.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===------------------------------------------------------------------------===//
 
diff --git a/test/cxa_thread_atexit_test.pass.cpp b/test/cxa_thread_atexit_test.pass.cpp
index 56984f0..f167e3d 100644
--- a/test/cxa_thread_atexit_test.pass.cpp
+++ b/test/cxa_thread_atexit_test.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------------- cxa_thread_atexit_test.cpp ---------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/dynamic_cast.pass.cpp b/test/dynamic_cast.pass.cpp
index 5288f7c..429f3da 100644
--- a/test/dynamic_cast.pass.cpp
+++ b/test/dynamic_cast.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- dynamic_cast.pass.cpp ----------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/dynamic_cast14.pass.cpp b/test/dynamic_cast14.pass.cpp
index 8bf0ba5..d72fa7f 100644
--- a/test/dynamic_cast14.pass.cpp
+++ b/test/dynamic_cast14.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- dynamic_cast14.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/dynamic_cast3.pass.cpp b/test/dynamic_cast3.pass.cpp
index 375b467..b2187d3 100644
--- a/test/dynamic_cast3.pass.cpp
+++ b/test/dynamic_cast3.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- dynamic_cast3.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/dynamic_cast5.pass.cpp b/test/dynamic_cast5.pass.cpp
index 51e5e92..b6a4c40 100644
--- a/test/dynamic_cast5.pass.cpp
+++ b/test/dynamic_cast5.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- dynamic_cast5.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/dynamic_cast_stress.pass.cpp b/test/dynamic_cast_stress.pass.cpp
index 133670a..9f56a78 100644
--- a/test/dynamic_cast_stress.pass.cpp
+++ b/test/dynamic_cast_stress.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- dynamic_cast_stress.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/exception_object_alignment.pass.cpp b/test/exception_object_alignment.pass.cpp
index 960751b..a22523d 100644
--- a/test/exception_object_alignment.pass.cpp
+++ b/test/exception_object_alignment.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------- exception_object_alignment.pass.cpp -----------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/incomplete_type.sh.cpp b/test/incomplete_type.sh.cpp
index 6062dc6..5cf18a3 100644
--- a/test/incomplete_type.sh.cpp
+++ b/test/incomplete_type.sh.cpp
@@ -1,9 +1,8 @@
 //===------------------------- incomplete_type.cpp --------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 // http://mentorembedded.github.io/cxx-abi/abi.html#rtti-layout
diff --git a/test/inherited_exception.pass.cpp b/test/inherited_exception.pass.cpp
index 993c83c..7846376 100644
--- a/test/inherited_exception.pass.cpp
+++ b/test/inherited_exception.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------------- inherited_exception.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 //
diff --git a/test/libcxxabi/test/config.py b/test/libcxxabi/test/config.py
index abec67f..32b2f74 100644
--- a/test/libcxxabi/test/config.py
+++ b/test/libcxxabi/test/config.py
@@ -1,9 +1,8 @@
 #===----------------------------------------------------------------------===##
 #
-#                     The LLVM Compiler Infrastructure
-#
-# This file is dual licensed under the MIT and the University of Illinois Open
-# Source Licenses. See LICENSE.TXT for details.
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 #
 #===----------------------------------------------------------------------===##
 import os
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 75cb76e..4abb8ed 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -8,22 +8,23 @@
 config.cxx_headers              = "@LIBCXXABI_LIBCXX_INCLUDES@"
 config.libunwind_headers        = "@LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL@"
 config.cxx_library_root         = "@LIBCXXABI_LIBCXX_LIBRARY_PATH@"
-config.llvm_unwinder            = "@LIBCXXABI_USE_LLVM_UNWINDER@"
-config.enable_threads           = "@LIBCXXABI_ENABLE_THREADS@"
+config.llvm_unwinder            = @LIBCXXABI_USE_LLVM_UNWINDER@
+config.builtins_library         = "@LIBCXXABI_BUILTINS_LIBRARY@"
+config.enable_threads           = @LIBCXXABI_ENABLE_THREADS@
 config.use_sanitizer            = "@LLVM_USE_SANITIZER@"
 config.sanitizer_library        = "@LIBCXXABI_SANITIZER_LIBRARY@"
-config.enable_32bit             = "@LIBCXXABI_BUILD_32_BITS@"
+config.enable_32bit             = @LIBCXXABI_BUILD_32_BITS@
 config.target_info              = "@LIBCXXABI_TARGET_INFO@"
 config.executor                 = "@LIBCXXABI_EXECUTOR@"
-config.libcxxabi_shared         = "@LIBCXXABI_ENABLE_SHARED@"
-config.enable_shared            = "@LIBCXX_ENABLE_SHARED@"
-config.enable_exceptions        = "@LIBCXXABI_ENABLE_EXCEPTIONS@"
+config.libcxxabi_shared         = @LIBCXXABI_ENABLE_SHARED@
+config.enable_shared            = @LIBCXX_ENABLE_SHARED@
+config.enable_exceptions        = @LIBCXXABI_ENABLE_EXCEPTIONS@
 config.host_triple              = "@LLVM_HOST_TRIPLE@"
 config.target_triple            = "@TARGET_TRIPLE@"
-config.use_target               = len("@LIBCXXABI_TARGET_TRIPLE@") > 0
+config.use_target               = bool("@LIBCXXABI_TARGET_TRIPLE@")
 config.sysroot                  = "@LIBCXXABI_SYSROOT@"
 config.gcc_toolchain            = "@LIBCXXABI_GCC_TOOLCHAIN@"
-config.cxx_ext_threads          = "@LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY@"
+config.cxx_ext_threads          = @LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY@
 
 # Let the main config do the real work.
 lit_config.load_config(config, "@LIBCXXABI_SOURCE_DIR@/test/lit.cfg")
diff --git a/test/noexception1.pass.cpp b/test/noexception1.pass.cpp
index 59d59a7..b3471dd 100644
--- a/test/noexception1.pass.cpp
+++ b/test/noexception1.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------- noexception1.pass.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/noexception2.pass.cpp b/test/noexception2.pass.cpp
index d9d10d5..b377d9e 100644
--- a/test/noexception2.pass.cpp
+++ b/test/noexception2.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------- noexception2.pass.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/noexception3.pass.cpp b/test/noexception3.pass.cpp
index 081c2d0..42d02a6 100644
--- a/test/noexception3.pass.cpp
+++ b/test/noexception3.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------- noexception3.pass.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/noexception4.pass.cpp b/test/noexception4.pass.cpp
index dbf6012..00c7162 100644
--- a/test/noexception4.pass.cpp
+++ b/test/noexception4.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------- noexception4.pass.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/support/timer.hpp b/test/support/timer.hpp
index c90f51b..f8cd3b8 100644
--- a/test/support/timer.hpp
+++ b/test/support/timer.hpp
@@ -1,9 +1,8 @@
 //===----------------------------------------------------------------------===////
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===////
 
diff --git a/test/test_aux_runtime.pass.cpp b/test/test_aux_runtime.pass.cpp
index 0c9a8f2..ddc2630 100644
--- a/test/test_aux_runtime.pass.cpp
+++ b/test/test_aux_runtime.pass.cpp
@@ -1,9 +1,8 @@
 //===-------------------------- test_aux_runtime.cpp ----------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/test_aux_runtime_op_array_new.pass.cpp b/test/test_aux_runtime_op_array_new.pass.cpp
index d4a63d7..3e77d99 100644
--- a/test/test_aux_runtime_op_array_new.pass.cpp
+++ b/test/test_aux_runtime_op_array_new.pass.cpp
@@ -1,9 +1,8 @@
 //===-------------------------- test_aux_runtime_op_array_new.cpp ---------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/test_demangle.pass.cpp b/test/test_demangle.pass.cpp
index 7c1fd2d..ddc1961 100644
--- a/test/test_demangle.pass.cpp
+++ b/test/test_demangle.pass.cpp
@@ -1,9 +1,8 @@
 //===-------------------------- test_demangle.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
@@ -29755,6 +29754,12 @@
     {"_Z1fIJR1SS0_EEiDpOT_", "int f<S&, S>(S&, S&&)"},
 
     {"___Z3foo_block_invoke.25", "invocation function for block in foo"},
+
+    // Darwin adds leading underscores to symbols, just demangle them anyways.
+    {"____Z3foo_block_invoke.25", "invocation function for block in foo"},
+    {"__Z1fv", "f()"},
+
+    {"_Z2tfIZUb_E1SEiv", "int tf<'block-literal'::S>()"}
 };
 
 const unsigned N = sizeof(cases) / sizeof(cases[0]);
diff --git a/test/test_exception_address_alignment.pass.cpp b/test/test_exception_address_alignment.pass.cpp
index 5d36659..16a896f 100644
--- a/test/test_exception_address_alignment.pass.cpp
+++ b/test/test_exception_address_alignment.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------------------------------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/test_exception_storage.pass.cpp b/test/test_exception_storage.pass.cpp
index ef2524f..1fee680 100644
--- a/test/test_exception_storage.pass.cpp
+++ b/test/test_exception_storage.pass.cpp
@@ -1,9 +1,8 @@
 //===-------------------- test_exception_storage.cpp ----------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/test_fallback_malloc.pass.cpp b/test/test_fallback_malloc.pass.cpp
index e29e128..3b3fd9b 100644
--- a/test/test_fallback_malloc.pass.cpp
+++ b/test/test_fallback_malloc.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------------- test_fallback_malloc.cpp -----------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/test_guard.pass.cpp b/test/test_guard.pass.cpp
index dc200cf..73f3559 100644
--- a/test/test_guard.pass.cpp
+++ b/test/test_guard.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------------- test_guard.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/test_vector1.pass.cpp b/test/test_vector1.pass.cpp
index 0f3acd2..841d1ab 100644
--- a/test/test_vector1.pass.cpp
+++ b/test/test_vector1.pass.cpp
@@ -1,9 +1,8 @@
 //===---------------------------- test_vector.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/test_vector2.pass.cpp b/test/test_vector2.pass.cpp
index 5a5ff06..e08abbb 100644
--- a/test/test_vector2.pass.cpp
+++ b/test/test_vector2.pass.cpp
@@ -1,9 +1,8 @@
 //===--------------------------- test_vector2.cpp -------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/test_vector3.pass.cpp b/test/test_vector3.pass.cpp
index 2f983ef..4068b7f 100644
--- a/test/test_vector3.pass.cpp
+++ b/test/test_vector3.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- test_vector3.cpp ---------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/testit b/test/testit
index ac52f05..eca0b37 100755
--- a/test/testit
+++ b/test/testit
@@ -1,12 +1,11 @@
 #!/bin/sh
-# //===--------------------------- testit ---------------------------------===//
-# //
-# //                     The LLVM Compiler Infrastructure
-# //
-# // This file is distributed under the University of Illinois Open Source
-# // License. See LICENSE.TXT for details.
-# //
-# //===--------------------------------------------------------------------===//
+#===------------------------------ testit ----------------------------------===#
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+#===------------------------------------------------------------------------===#
 
 if [ -z "$CC" ]
 then
diff --git a/test/thread_local_destruction_order.pass.cpp b/test/thread_local_destruction_order.pass.cpp
index 0bb359e..388cdc4 100644
--- a/test/thread_local_destruction_order.pass.cpp
+++ b/test/thread_local_destruction_order.pass.cpp
@@ -1,9 +1,8 @@
 //===-------------- thread_local_destruction_order.pass.cpp ---------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/uncaught_exceptions.pass.cpp b/test/uncaught_exceptions.pass.cpp
index fe7374d..2a19ca3 100644
--- a/test/uncaught_exceptions.pass.cpp
+++ b/test/uncaught_exceptions.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------- uncaught_exceptions.pass.cpp ---------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/unittest_demangle.pass.cpp b/test/unittest_demangle.pass.cpp
index 3ec869c..0e7ff5c 100644
--- a/test/unittest_demangle.pass.cpp
+++ b/test/unittest_demangle.pass.cpp
@@ -1,9 +1,8 @@
 //===----------------------- unittest_demangle.cpp ------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/unwind_01.pass.cpp b/test/unwind_01.pass.cpp
index 2730fdd..97e10eb 100644
--- a/test/unwind_01.pass.cpp
+++ b/test/unwind_01.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- unwind_01.cpp ------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/unwind_02.pass.cpp b/test/unwind_02.pass.cpp
index 2c6e1d6..e7a8479 100644
--- a/test/unwind_02.pass.cpp
+++ b/test/unwind_02.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- unwind_02.cpp ------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/unwind_03.pass.cpp b/test/unwind_03.pass.cpp
index 6bc16bd..38962c6 100644
--- a/test/unwind_03.pass.cpp
+++ b/test/unwind_03.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- unwind_03.cpp ------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/unwind_04.pass.cpp b/test/unwind_04.pass.cpp
index 1b75994..45669c3 100644
--- a/test/unwind_04.pass.cpp
+++ b/test/unwind_04.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- unwind_04.cpp ------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/unwind_05.pass.cpp b/test/unwind_05.pass.cpp
index d1f5fcd..efd724a 100644
--- a/test/unwind_05.pass.cpp
+++ b/test/unwind_05.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- unwind_05.cpp ------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/test/unwind_06.pass.cpp b/test/unwind_06.pass.cpp
index e712566..e4c04e8 100644
--- a/test/unwind_06.pass.cpp
+++ b/test/unwind_06.pass.cpp
@@ -1,9 +1,8 @@
 //===------------------------- unwind_06.cpp ------------------------------===//
 //
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/www/index.html b/www/index.html
index e71e55c..d178198 100644
--- a/www/index.html
+++ b/www/index.html
@@ -26,8 +26,7 @@
     <a href="http://lists.llvm.org/mailman/listinfo/libcxx-dev">libcxx-dev</a>
     <a href="http://lists.llvm.org/mailman/listinfo/libcxx-commits">libcxx-commits</a>
     <a href="http://llvm.org/bugs/">Bug Reports</a>
-    <a href="http://llvm.org/svn/llvm-project/libcxxabi/trunk/">Browse SVN</a>
-    <a href="http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/">Browse ViewVC</a>
+    <a href="https://github.com/llvm/llvm-project/tree/master/libcxxabi/">Browse Sources</a>
   </div>
 </div>
 
@@ -74,29 +73,28 @@
   <h2>Get it and get involved!</h2>
   <!--=====================================================================-->
 
-  <p>To check out the code, use:</p>
+  <p>To check out the code (including llvm and others), use:</p>
 
   <ul>
-  <li><code>svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi</code></li>
+  <li><code>git clone https://github.com/llvm/llvm-project.git</code></li>
   </ul>
 
   <p>To build:</p>
   <ul>
-  <li>Check out libcxxabi into <code>llvm/projects</code></li>
-  <li><code>cd llvm</code></li>
+  <li><code>cd llvm-project</code></li>
   <li><code>mkdir build &amp;&amp; cd build</code></li>
-  <li><code>cmake .. # on linux you may need to prefix with CC=clang CXX=clang++</code></li>
+  <li><code>cmake -DLLVM_ENABLE_PROJECTS=libcxxabi ../llvm # on linux you may need to specify -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++</code></li>
   <li><code>make</code></li>
   </ul>
 
   <p>To do a standalone build:</p>
   <ul>
   <li>
-    Check out the <a href="http://libcxx.llvm.org">libcxx source</a> tree.
+    Check out the source tree. This includes the other subprojects, but you'll only use the libcxxabi part.
   </li>
-  <li><code>cd libcxxabi</code></li>
-  <li><code>mkdir build &amp;&amp; cd build</code></li>
-  <li><code>cmake -DLIBCXXABI_LIBCXX_PATH=path/to/libcxx .. # on
+  <li><code>cd llvm-project</code></li>
+  <li><code>mkdir build-libcxxabi &amp;&amp; cd build-libcxxabi</code></li>
+  <li><code>cmake -DLIBCXXABI_LIBCXX_PATH=path/to/libcxx ../libcxxabi # on
     linux you may need -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++</code></li>
   <li><code>make</code></li>
   </ul>