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

Ziqing Luo via All-commits all-commits at lists.llvm.org
Fri Sep 11 17:04:37 PDT 2026


  Branch: refs/heads/users/ziqingluo/PR-187125348-3
  Home:   https://github.com/llvm/llvm-project
  Commit: b7e0daffa3356b2a25a55fbcbedcb06540170ad4
      https://github.com/llvm/llvm-project/commit/b7e0daffa3356b2a25a55fbcbedcb06540170ad4
  Author: Ziqing Luo <ziqing_luo at apple.com>
  Date:   2026-09-11 (Fri, 11 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