[all-commits] [llvm/llvm-project] 0fd6e6: [CIR] Add pass_object_size hidden parameter suppor...

adams381 via All-commits all-commits at lists.llvm.org
Tue May 5 15:43:58 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0fd6e658288ace1df74c71c1f168579a9fbf6f79
      https://github.com/llvm/llvm-project/commit/0fd6e658288ace1df74c71c1f168579a9fbf6f79
  Author: adams381 <adams at nvidia.com>
  Date:   2026-05-05 (Tue, 05 May 2026)

  Changed paths:
    M clang/include/clang/CIR/MissingFeatures.h
    M clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
    M clang/lib/CIR/CodeGen/CIRGenCall.cpp
    M clang/lib/CIR/CodeGen/CIRGenFunction.cpp
    M clang/lib/CIR/CodeGen/CIRGenFunction.h
    M clang/lib/CIR/CodeGen/CIRGenFunctionInfo.h
    A clang/test/CIR/CodeGen/pass-object-size.c

  Log Message:
  -----------
  [CIR] Add pass_object_size hidden parameter support (#191482)

Emit the hidden `i64` parameter that
`__attribute__((pass_object_size(N)))` requires. At call sites the size
is constant-folded when possible (e.g. `&a` → 4) and falls back to
`cir.objsize` / `@llvm.objectsize` otherwise (e.g. VLAs).

On the callee side, `buildFunctionArgList` now creates an
`ImplicitParamDecl` for each annotated parameter so that
`emitBuiltinObjectSize` can load the passed size instead of re-computing
it.

This also fixes the `llvm_unreachable("NYI")` in
`RequiredArgs::getFromProtoWithExtraSlots` and the `errorNYI` in
`appendParameterTypes` / `arrangeFreeFunctionLikeCall` that fired
whenever `hasExtParameterInfos()` was true.

New test: `clang/test/CIR/CodeGen/pass-object-size.c` (CIR / LLVM /
OGCG).

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Cursor <cursoragent at cursor.com>



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