[all-commits] [llvm/llvm-project] 127091: [CUDA] Normalize handling of defauled dtor.

Artem Belevich via All-commits all-commits at lists.llvm.org
Thu Jan 21 10:49:25 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 127091bfd5edf10495fee4724fd21c666e5d79c1
      https://github.com/llvm/llvm-project/commit/127091bfd5edf10495fee4724fd21c666e5d79c1
  Author: Artem Belevich <tra at google.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M clang/lib/Sema/SemaCUDA.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/test/CodeGenCUDA/usual-deallocators.cu
    M clang/test/SemaCUDA/usual-deallocators.cu

  Log Message:
  -----------
  [CUDA] Normalize handling of defauled dtor.

Defaulted destructor was treated inconsistently, compared to other
compiler-generated functions.

When Sema::IdentifyCUDATarget() got called on just-created dtor which didn't
have implicit __host__ __device__ attributes applied yet, it would treat it as a
host function.  That happened to (sometimes) hide the error when dtor referred
to a host-only functions.

Even when we had identified defaulted dtor as a HD function, we still treated it
inconsistently during selection of usual deallocators, where we did not allow
referring to wrong-side functions, while it is allowed for other HD functions.

This change brings handling of defaulted dtors in line with other HD functions.

Differential Revision: https://reviews.llvm.org/D94732




More information about the All-commits mailing list