[PATCH] D153001: [clang][ThreadSafety] Add __builtin_instance_member (WIP)

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 15 01:24:24 PDT 2023


tbaeder created this revision.
tbaeder added reviewers: aaronpuchert, NoQ, aaron.ballman.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

As discussed in https://github.com/llvm/llvm-project/issues/20777, this adds `__builtin_instance_member(membername)`, which acts like `this->membername`, but in C.

This is obviously very much WIP and the patch contains several placeholders, but I wonder if this is the right approach to take here and if I should continue on this path, so I'm opening this for review.

As you can see from the test case, this works for the (one) use case it was created for.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153001

Files:
  clang/include/clang/AST/EvaluatedExprVisitor.h
  clang/include/clang/AST/Expr.h
  clang/include/clang/AST/RecursiveASTVisitor.h
  clang/include/clang/Basic/StmtNodes.td
  clang/include/clang/Basic/TokenKinds.def
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/Expr.cpp
  clang/lib/AST/StmtPrinter.cpp
  clang/lib/AST/StmtProfile.cpp
  clang/lib/Analysis/ThreadSafetyCommon.cpp
  clang/lib/Parse/ParseExpr.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/TreeTransform.h
  clang/lib/Serialization/ASTReaderStmt.cpp
  clang/lib/Serialization/ASTWriterStmt.cpp
  clang/test/Sema/warn-thread-safety-analysis.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153001.531640.patch
Type: text/x-patch
Size: 13195 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230615/a07ac336/attachment-0001.bin>


More information about the cfe-commits mailing list