diff options
author | Bill Wendling <morbo@google.com> | 2025-08-01 17:28:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-01 17:28:08 -0700 |
commit | 49a24b3116236d65cc2541e8d176ecf9dcb152db (patch) | |
tree | 965c9af91cf808c4512627a56c708e4cc5fd6996 /clang/lib | |
parent | 99cd1d8aef2e1be8a0571eec47b4527ca5ad59d4 (diff) | |
download | llvm-49a24b3116236d65cc2541e8d176ecf9dcb152db.zip llvm-49a24b3116236d65cc2541e8d176ecf9dcb152db.tar.gz llvm-49a24b3116236d65cc2541e8d176ecf9dcb152db.tar.bz2 |
[CodeGen][counted_by] Support use of the comma operator (#151776)
Writing something like this:
__builtin_dynamic_object_size((0, p->array), 0)
is equivalent to writing this:
__builtin_dynamic_object_size(p->array, 0)
though the former will give a warning about the first value being
unused.
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index e1f7ea0..a648bde 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -973,6 +973,9 @@ public: AddrOfSeen = false; return Visit(E->getSubExpr()); } + const Expr *VisitBinaryOperator(const clang::BinaryOperator *Op) { + return Op->isCommaOp() ? Visit(Op->getRHS()) : nullptr; + } }; } // end anonymous namespace |