[all-commits] [llvm/llvm-project] cb66bf: Replace 'magic static' with a member variable for ...

Erich Keane via All-commits all-commits at lists.llvm.org
Thu May 27 13:46:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb66bf2c6d20da01ab57cb78ec5e5c0978b873be
      https://github.com/llvm/llvm-project/commit/cb66bf2c6d20da01ab57cb78ec5e5c0978b873be
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2021-05-27 (Thu, 27 May 2021)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/lib/AST/ASTContext.cpp
    A clang/test/SemaSYCL/unique-stable-name-multiple-target-crash.cpp

  Log Message:
  -----------
  Replace 'magic static' with a member variable for SCYL kernel names

I discovered when merging the __builtin_sycl_unique_stable_name into my
downstream that it is actually possible for the cc1 invocation to have
more than 1 Sema instance, if you pass it multiple input files, each
gets its own Sema instance and thus ASTContext instance.  The result was
that the call to Filter the SYCL kernels was using an
ItaniumMangleContext stored via a 'magic static', so it had an invalid
reference to ASTContext when processing the 2nd failure.

The failure is unfortunately flakey/transient, but the test that fails
was added anyway.

The magic-static was switched to a unique_ptr member variable in
ASTContext that is initialized when needed.




More information about the All-commits mailing list