[all-commits] [llvm/llvm-project] a640a2: [clang] Introduce `SemaRISCV` (#92682)

Vlad Serebrennikov via All-commits all-commits at lists.llvm.org
Wed May 22 01:54:42 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a640a2e0205fc23a27913d3e7c69c7cc60e4f7b9
      https://github.com/llvm/llvm-project/commit/a640a2e0205fc23a27913d3e7c69c7cc60e4f7b9
  Author: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
  Date:   2024-05-22 (Wed, 22 May 2024)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    A clang/include/clang/Sema/SemaRISCV.h
    M clang/lib/Parse/ParsePragma.cpp
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaCast.cpp
    M clang/lib/Sema/SemaChecking.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaLookup.cpp
    M clang/lib/Sema/SemaRISCV.cpp

  Log Message:
  -----------
  [clang] Introduce `SemaRISCV` (#92682)

This patch moves `Sema` functions that are specific for RISC-V into the
new `SemaRISCV` class. This continues previous efforts to split `Sema`
up. Additional context can be found in
https://github.com/llvm/llvm-project/pull/84184.

This PR is somewhat different from previous PRs on this topic:
1. Splitting out target-specific functions wasn't previously discussed.
It felt quite natural to do, though.
2. I had to make some static function in `SemaChecking.cpp` member
functions of `Sema` in order to use them in `SemaRISCV`.
3. I dropped "RISCV" from identifiers, but decided to leave "RVV"
(RISC-V "V" vector extensions) intact. I think it's an idiomatic
abbreviation at this point, but I'm open to input from contributors in
that area.
4. I repurposed `SemaRISCVVectorLookup.cpp` for `SemaRISCV`.

I think this was a successful experiment, which both helps the goal of
splitting `Sema` up, and shows a way to approach `SemaChecking.cpp`,
which I wasn't sure how to approach before. As we move more
target-specific function out of there, we'll gradually make the checking
"framework" inside `SemaChecking.cpp` public, which is currently a whole
bunch of static functions. This would enable us to move more functions
outside of `SemaChecking.cpp`.



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