[PATCH] D148381: [Clang] Implement the 'counted_by' attribute
Bill Wendling via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 8 16:19:22 PDT 2023
void added inline comments.
================
Comment at: clang/test/CodeGen/attr-counted-by.c:2
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 3
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -O2 -Wall -fsanitize=array-bounds,object-size,local-bounds -fstrict-flex-arrays=3 -emit-llvm -o - %s | FileCheck %s
+
----------------
void wrote:
> nickdesaulniers wrote:
> > void wrote:
> > > nickdesaulniers wrote:
> > > > Can you add another run line without the `-fsanitize` flags set, and use 2 different `--check-prefixes` for the two RUN lines? I'd be curious to see the differences in codegen between those set or not. I assume this attribute should affect codegen even with all of those disabled (maybe trapping instead of libcalling into ubsan runtime). I think update_cc_test_checks should be able to handle that.
> > > Done.
> > I guess that's what I was curious about; how come the attribute doesn't affect codegen unless the sanitizers are enabled?
> I don't think we would want the bounds checking unless explicitly told so. I could be wrong?
To clarify. It does generate the code for the `__bdos` calculation. It just doesn't generate a trap.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148381/new/
https://reviews.llvm.org/D148381
More information about the cfe-commits
mailing list