[all-commits] [llvm/llvm-project] 8f0aa3: [OpenMP] Try to find an existing base for `omp beg...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Tue Apr 7 21:41:44 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f0aa3f3a407994314371ee042854a8c79cea462
      https://github.com/llvm/llvm-project/commit/8f0aa3f3a407994314371ee042854a8c79cea462
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    A clang/test/AST/ast-dump-openmp-begin-declare-variant_10.c
    A clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c
    A clang/test/AST/ast-dump-openmp-begin-declare-variant_12.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_2.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_3.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_5.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_6.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_7.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_8.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_9.c
    M clang/test/AST/ast-dump-openmp-begin-declare-variant_addr_1.c
    A clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp

  Log Message:
  -----------
  [OpenMP] Try to find an existing base for `omp begin/end declare variant`

If we have a function definition in `omp begin/end declare variant` it
is a specialization of a base function with the same name and
"compatible" type. Before, we just created a declaration for the base.
With this patch we try to find an existing declaration first and only
create a new one if we did not find any with a compatible type. This is
preferable as we can tolerate slight mismatches, especially if the
specialized version is "more constrained", e.g., constexpr.

Reviewed By: mikerice

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




More information about the All-commits mailing list