[clang] [clang] Introduce `SemaAccess` (PR #92674)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Mon May 20 08:06:24 PDT 2024


================
@@ -1459,11 +1460,11 @@ static AccessResult CheckEffectiveAccess(Sema &S,
   llvm_unreachable("invalid access result");
 }
 
-static Sema::AccessResult CheckAccess(Sema &S, SourceLocation Loc,
-                                      AccessTarget &Entity) {
+static SemaAccess::AccessResult CheckAccess(Sema &S, SourceLocation Loc,
----------------
Endilll wrote:

I remember bringing this up early on in discussions with @AaronBallman. I agree with you that static functions should take reference to their own part of Sema instead of reference to big `Sema`. I found it rather awkward that a static function takes `Sema&` only to get it's part of Sema out of it. Back then we decided that static functions will continue to take `Sema&`.

Now that we moved a lot of code out of `Sema`, I can say that applying this kind of transformation immediately would significantly increase amount of changes in already big PRs that are splitting Sema up. So I'll continue as is, but that's definitely a point to revisit.

https://github.com/llvm/llvm-project/pull/92674


More information about the cfe-commits mailing list