[all-commits] [llvm/llvm-project] 0b53cc: [SSAF][clang-reforge] Retrofit expressions after C...

Ziqing Luo via All-commits all-commits at lists.llvm.org
Sat Sep 12 15:15:18 PDT 2026


  Branch: refs/heads/users/ziqingluo/PR-187125348-3
  Home:   https://github.com/llvm/llvm-project
  Commit: 0b53ccb2fa2b684bfa6d7f1171e2bf8b220a6da8
      https://github.com/llvm/llvm-project/commit/0b53ccb2fa2b684bfa6d7f1171e2bf8b220a6da8
  Author: Ziqing Luo <ziqing_luo at apple.com>
  Date:   2026-09-12 (Sat, 12 Sep 2026)

  Changed paths:
    M clang/lib/ScalableStaticAnalysis/SourceTransformation/CMakeLists.txt
    M clang/lib/ScalableStaticAnalysis/SourceTransformation/Transformations/CppBoundedBuffers.cpp
    M clang/unittests/ScalableStaticAnalysis/SourceTransformation/CppBoundedBuffersTest.cpp
    M llvm/utils/gn/secondary/clang/lib/ScalableStaticAnalysis/SourceTransformation/BUILD.gn

  Log Message:
  -----------
  [SSAF][clang-reforge] Retrofit expressions after CppBoundedBuffers decl rewrites

PR #210457 introduces declaration rewriting.  When CppBoundedBuffers
rewrites a declaration or return type to a bounded_ptr/bounded_array,
some of the existing uses of that entity needs retrofit.

This commit creates expression rewrites for the following patterns:

- Append '.data()' to call arguments when necessary parameter is not
  transformed but argument is transformed.
- Append '.as_bounded<T>()' to call arguments when both parameter and
  argument are transformed but element types are not identical.
- Rewrite '&e[i]' to '(e + i)' and '&*e'/'&(*e)' to 'e', if 'e' is
  transformed.
- Rewrite '(T*)e', 'static_cast<T*>(e)', and 'reinterpret_cast<T*>(e)'
  to 'e.as_bounded<T>()', if 'e' is transformed.

The 3rd step of
rdar://187125348



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