Author: Timm Baeder Date: 2026-02-05T07:12:55+01:00 New Revision: 9d944c0ed2c09d528875a546b4d348f044e95dc4
URL: https://github.com/llvm/llvm-project/commit/9d944c0ed2c09d528875a546b4d348f044e95dc4 DIFF: https://github.com/llvm/llvm-project/commit/9d944c0ed2c09d528875a546b4d348f044e95dc4.diff LOG: [clang][bytecode] Visit 2nd atomic_is_lock_free arg as lvalue (#179673) Added: Modified: clang/lib/AST/ByteCode/Compiler.cpp clang/test/Sema/sizeless-1.c Removed: ################################################################################ diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index 8ae6bf8ed18dc..eb52112f16b82 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -5175,6 +5175,15 @@ bool Compiler<Emitter>::VisitBuiltinCallExpr(const CallExpr *E, case Builtin::BI__builtin_assume: // Argument is not evaluated. break; + case Builtin::BI__atomic_is_lock_free: + case Builtin::BI__atomic_always_lock_free: { + assert(E->getNumArgs() == 2); + if (!this->visit(E->getArg(0))) + return false; + if (!this->visitAsLValue(E->getArg(1))) + return false; + } break; + default: if (!Context::isUnevaluatedBuiltin(BuiltinID)) { // Put arguments on the stack. diff --git a/clang/test/Sema/sizeless-1.c b/clang/test/Sema/sizeless-1.c index b6b92e7a68c19..7c8eed994a6a1 100644 --- a/clang/test/Sema/sizeless-1.c +++ b/clang/test/Sema/sizeless-1.c @@ -2,6 +2,10 @@ // RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=c11 %s // RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=gnu11 %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-comment -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=c90 %s -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=c11 %s -fexperimental-new-constant-interpreter +// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=gnu11 %s -fexperimental-new-constant-interpreter + typedef __SVInt8_t svint8_t; typedef __SVInt16_t svint16_t; _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
