[all-commits] [llvm/llvm-project] d28844: [clang][NFC] Introduce `SemaBase` (#87634)

Vlad Serebrennikov via All-commits all-commits at lists.llvm.org
Sat Apr 6 04:11:10 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d2884444472e92a8282f4d215a27128ac83a26b9
      https://github.com/llvm/llvm-project/commit/d2884444472e92a8282f4d215a27128ac83a26b9
  Author: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
  Date:   2024-04-06 (Sat, 06 Apr 2024)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    A clang/include/clang/Sema/SemaBase.h
    M clang/include/clang/Sema/SemaOpenACC.h
    M clang/lib/Sema/CMakeLists.txt
    M clang/lib/Sema/Sema.cpp
    A clang/lib/Sema/SemaBase.cpp
    M clang/lib/Sema/SemaOpenACC.cpp

  Log Message:
  -----------
  [clang][NFC] Introduce `SemaBase` (#87634)

This is a follow-up to #84184. Multiple reviewers there pointed out to
me that we should have a common base class for `Sema` and `SemaOpenACC`
to avoid code duplication for common helpers like `getLangOpts()`. On
top of that, `Diag()` function was requested for `SemaOpenACC`. This
patch delivers both.

The intent is to keep `SemaBase` as small as possible, as things there
are globally available across `Sema` and its parts without any
additional effort from usage side. Overused, this can undermine the
whole endeavor of splitting `Sema` apart.

Apart of shuffling code around, this patch introduces a helper private
function `SemaDiagnosticBuilder::getDeviceDeferredDiags()`, the sole
purpose of which is to encapsulate member access into (incomplete)
`Sema` for function templates defined in the header, where `Sema` can't
be complete.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list