[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -5028,3 +5050,376 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::Kind Func

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -3649,6 +3649,25 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef params, auto &EllipsisLoc = *getTrailingObjects(); EllipsisLoc = epi.EllipsisLoc; } + + if (!epi.FunctionEffects.empty()) { +auto &ExtraBits = *getTrailingObjects(); +// TO

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -4639,6 +4644,312 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +class Decl; +class CXXMethodDecl; +struct FunctionEffectDiff; +class FunctionEf

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, FromFn = QT->getAs(); Changed = true; } + +// For C, when called from checkPointerTypesForAssignment, +// we need not to alter FromFn, or else even an innocuous c

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -5028,3 +5050,376 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::Kind Func

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -4639,6 +4644,312 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +class Decl; +class CXXMethodDecl; +struct FunctionEffectDiff; +class FunctionEf

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -4639,6 +4644,312 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +class Decl; +class CXXMethodDecl; +struct FunctionEffectDiff; +class FunctionEf

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -3649,6 +3649,25 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef params, auto &EllipsisLoc = *getTrailingObjects(); EllipsisLoc = epi.EllipsisLoc; } + + if (!epi.FunctionEffects.empty()) { +auto &ExtraBits = *getTrailingObjects(); +// TO

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -10510,6 +10512,8 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, if (lproto->getMethodQuals() != rproto->getMethodQuals()) return {}; +// TODO: (nonblocking) Does anything need to be done with FunctionEffects? + Sirrai

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -18347,7 +18347,7 @@ void Sema::SetFunctionBodyKind(Decl *D, SourceLocation Loc, FnBodyKind BodyKind, } } -bool Sema::CheckOverridingFunctionAttributes(const CXXMethodDecl *New, +bool Sema::CheckOverridingFunctionAttributes(CXXMethodDecl *New, dougsonos

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang-tools-extra] [clang-tidy] Improve modernize-use-std-print diagnostic (PR #91071)

2024-05-04 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/91071 Include the source range of the printf function in the diagnostic so it gets underlined in the output. >From d0ccc6ade357155161977446b64c50cafa100edb Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sat, 4 May

[clang-tools-extra] [clang-tidy] Improve modernize-use-std-print diagnostic (PR #91071)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Mike Crowe (mikecrowe) Changes Include the source range of the printf function in the diagnostic so it gets underlined in the output. --- Full diff: https://github.com/llvm/llvm-project/pull/91071.diff 1 Files Affected: - (modifie

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Improve modernize-use-std-print diagnostic (PR #91071)

2024-05-04 Thread Mike Crowe via cfe-commits
mikecrowe wrote: As suggested by @5chmidti in https://github.com/llvm/llvm-project/pull/90397/files/54c325d7a5e24441adbe8036800a2f50e2ff5fa0#r1589445886 . https://github.com/llvm/llvm-project/pull/91071 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [Clang] Allow raw string literals in C as an extension (PR #88265)

2024-05-04 Thread via cfe-commits
@@ -3850,6 +3850,7 @@ LangOptions getFormattingLangOpts(const FormatStyle &Style) { // the sequence "<::" will be unconditionally treated as "[:". // Cf. Lexer::LexTokenInternal. LangOpts.Digraphs = LexingStd >= FormatStyle::LS_Cpp11; + LangOpts.RawStringLiterals = Lexi

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -5028,3 +5050,376 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::Kind Func

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, FromFn = QT->getAs(); Changed = true; } + +// For C, when called from checkPointerTypesForAssignment, +// we need not to alter FromFn, or else even an innocuous c

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, FromFn = QT->getAs(); Changed = true; } + +// For C, when called from checkPointerTypesForAssignment, +// we need not to alter FromFn, or else even an innocuous c

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, FromFn = QT->getAs(); Changed = true; } + +// For C, when called from checkPointerTypesForAssignment, +// we need not to alter FromFn, or else even an innocuous c

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -768,6 +776,18 @@ class Sema final : public SemaBase { /// Warn when implicitly casting 0 to nullptr. void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E); + // - function effects --- + + /// Warn when implicitly changing function effects. + void di

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -4639,6 +4644,312 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +class Decl; +class CXXMethodDecl; +struct FunctionEffectDiff; +class FunctionEf

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread via cfe-commits
@@ -4639,6 +4644,312 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +class Decl; +class CXXMethodDecl; +struct FunctionEffectDiff; +class FunctionEf

[clang] a98a6e9 - Add clarifying parenthesis around non-trivial conditions in ternary expressions. (#90391)

2024-05-04 Thread via cfe-commits
Author: luolent Date: 2024-05-04T18:38:45+01:00 New Revision: a98a6e95be1be9a5c28da15b4d19a6f39872461d URL: https://github.com/llvm/llvm-project/commit/a98a6e95be1be9a5c28da15b4d19a6f39872461d DIFF: https://github.com/llvm/llvm-project/commit/a98a6e95be1be9a5c28da15b4d19a6f39872461d.diff LOG:

[libclc] a98a6e9 - Add clarifying parenthesis around non-trivial conditions in ternary expressions. (#90391)

2024-05-04 Thread via cfe-commits
Author: luolent Date: 2024-05-04T18:38:45+01:00 New Revision: a98a6e95be1be9a5c28da15b4d19a6f39872461d URL: https://github.com/llvm/llvm-project/commit/a98a6e95be1be9a5c28da15b4d19a6f39872461d DIFF: https://github.com/llvm/llvm-project/commit/a98a6e95be1be9a5c28da15b4d19a6f39872461d.diff LOG:

[clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] Add clarifying parenthesis around non-trivial conditions in ternary expressions. (PR #90391)

2024-05-04 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon closed https://github.com/llvm/llvm-project/pull/90391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] Add clarifying parenthesis around non-trivial conditions in ternary expressions. (PR #90391)

2024-05-04 Thread via cfe-commits
github-actions[bot] wrote: @luolent Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build,

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-04 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/8] [clang] Use constant rounding mode for floating literals Conv

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91070 >From 11ad517cede0902945c0b7eba0e7f1ff93f08ea0 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 4 May 2024 17:31:31 +0100 Subject: [PATCH] [Clang] No longer require complete types with __builtin_launder

[clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] Add clarifying parenthesis around non-trivial conditions in ternary expressions. (PR #90391)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -3802,7 +3802,7 @@ bool X86AsmParser::validateInstruction(MCInst &Inst, const OperandVector &Ops) { //VFMULCPHZrr Dest, Src1, Src2 //VFMULCPHZrrk Dest, Dest, Mask, Src1, Src2 //VFMULCPHZrrkz Dest, Mask, Src1, Src2 -for (unsigned i = TSFlags &

[clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] Add clarifying parenthesis around non-trivial conditions in ternary expressions. (PR #90391)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -801,7 +801,7 @@ static OutputDesc *addInputSec(StringMap> &map, auto *firstIsec = cast( cast(sec->commands[0])->sectionBases[0]); OutputSection *firstIsecOut = - firstIsec->flags & SHF_LINK_ORDER MaskRay wrote: Why is random

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang] [clang][NFC] Remove class layout scissor (PR #89055)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -950,18 +948,20 @@ void CGRecordLowering::calculateZeroInit() { } // Verify accumulateBitfields computed the correct storage representations. -void CGRecordLowering::checkBitfieldClipping() const { +void CGRecordLowering::checkBitfieldClipping( +bool IsNonVirtualBaseTyp

[clang] [clang][NFC] Remove class layout scissor (PR #89055)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. Might be useful to mention #87090 in the commit message (first comment). https://github.com/llvm/llvm-project/pull/89055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [clang][NFC] Remove class layout scissor (PR #89055)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/89055 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2024-05-04 Thread via cfe-commits
no92 wrote: Ping https://github.com/llvm/llvm-project/pull/87845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-05-04 Thread Yupei Liu via cfe-commits
LYP951018 wrote: @philnik777 It seems that clang crashes on the test SemaCXX/cxx2a-template-lambdas.cpp https://godbolt.org/z/nnjzKr7n4 Is this expected? https://github.com/llvm/llvm-project/pull/73376 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [compiler-rt] [libc] [libclc] [libcxxabi] [lld] [lldb] [llvm] [mlir] Add clarifying parenthesis around non-trivial conditions in ternary expressions. (PR #90391)

2024-05-04 Thread Jessica Clarke via cfe-commits
@@ -3802,7 +3802,7 @@ bool X86AsmParser::validateInstruction(MCInst &Inst, const OperandVector &Ops) { //VFMULCPHZrr Dest, Src1, Src2 //VFMULCPHZrrk Dest, Dest, Mask, Src1, Src2 //VFMULCPHZrrkz Dest, Mask, Src1, Src2 -for (unsigned i = TSFlags &

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
@@ -18347,7 +18347,7 @@ void Sema::SetFunctionBodyKind(Decl *D, SourceLocation Loc, FnBodyKind BodyKind, } } -bool Sema::CheckOverridingFunctionAttributes(const CXXMethodDecl *New, +bool Sema::CheckOverridingFunctionAttributes(CXXMethodDecl *New, cjappl wro

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -10510,6 +10512,8 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, if (lproto->getMethodQuals() != rproto->getMethodQuals()) return {}; +// TODO: (nonblocking) Does anything need to be done with FunctionEffects? + dougso

[clang] [clang][CodeGen] Fix MSVC ABI for classes with a deleted copy assignment operator (PR #90547)

2024-05-04 Thread Max Winkler via cfe-commits
https://github.com/MaxEW707 updated https://github.com/llvm/llvm-project/pull/90547 >From f404db44d3770cdb8ac5123c16c0b04314eda698 Mon Sep 17 00:00:00 2001 From: MaxEW707 Date: Mon, 29 Apr 2024 22:09:52 -0400 Subject: [PATCH 1/6] [clang][CodeGen] Fix MS ABI for classes with non static data mem

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-05-04 Thread Eli Friedman via cfe-commits
@@ -908,6 +908,69 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) { incrementProfileCounter(&S); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool HasEmptyBody) { + if (CGM.getCode

[clang] [llvm] [MC] Remove UseAssemblerInfoForParsing (PR #91082)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/91082 Commit 6c0665e22174d474050e85ca367424f6e02476be (https://reviews.llvm.org/D45164) enabled certain constant expression evaluation for `MCObjectStreamer` at parse time (e.g. `.if` directives, see llvm/test/MC/AsmPar

[clang] [llvm] [MC] Remove UseAssemblerInfoForParsing (PR #91082)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-spir-v Author: Fangrui Song (MaskRay) Changes Commit 6c0665e22174d474050e85ca367424f6e02476be (https://reviews.llvm.org/D45164) enabled certain constant expression evaluation for `MCObjectStreamer` at parse time (e.g. `.if` directives, see llvm/t

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -5028,3 +5050,376 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::Kind Func

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, FromFn = QT->getAs(); Changed = true; } + +// For C, when called from checkPointerTypesForAssignment, +// we need not to alter FromFn, or else even an innocuous c

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -3649,6 +3649,25 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef params, auto &EllipsisLoc = *getTrailingObjects(); EllipsisLoc = epi.EllipsisLoc; } + + if (!epi.FunctionEffects.empty()) { +auto &ExtraBits = *getTrailingObjects(); +// TO

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos deleted https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [flang] [libc] [libclc] [libcxx] [libcxxabi] [lld] [lldb] [llvm] [mlir] [libc++] implement ranges::find_last (PR #91081)

2024-05-04 Thread Andrew Sukach via cfe-commits
https://github.com/soukatch closed https://github.com/llvm/llvm-project/pull/91081 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
@@ -5028,3 +5050,376 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::Kind Func

[clang] [clang] Enable FPContract with optnone (PR #91061)

2024-05-04 Thread via cfe-commits
@@ -968,10 +968,7 @@ class FPOptionsOverride { setAllowFPContractAcrossStatement(); } - void setDisallowOptimizations() { -setFPPreciseEnabled(true); -setDisallowFPContract(); - } + void setDisallowOptimizations() { setFPPreciseEnabled(true); } -

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Doug Wyatt via cfe-commits
https://github.com/dougsonos edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][flang][windows] Prefer user-provided library paths (-L) (PR #90758)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. 。 https://github.com/llvm/llvm-project/pull/90758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][flang][windows] Prefer user-provided library paths (-L) (PR #90758)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,7 @@ +// REQUIRES: system-windows MaskRay wrote: Add tests to existing msvc-link.c instead of a new file. Specify `--target=` to avoid reliance on the default target triple and avoid the need of REQUIRES. https://github.com/llvm/llvm-project/pull/907

[clang] [clang][flang][windows] Prefer user-provided library paths (-L) (PR #90758)

2024-05-04 Thread Fangrui Song via cfe-commits
MaskRay wrote: The code checks whether the directory is present `auto CRTPath = TC.getCompilerRTPath();` and only adds the libpath when it is present. This is related to the `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=off` file hierarchy we are migrating way from. With `LLVM_ENABLE_PER_TARGET_RUNTIME

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek updated https://github.com/llvm/llvm-project/pull/91028 >From 78193f68a149e378fbb180a1a5fa1f4551f2af66 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 3 May 2024 15:48:31 -0700 Subject: [PATCH 1/2] [Clang] -fseparate-named-sections option When set, the compile

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Petr Hosek (petrhosek) Changes When set, the compiler will use separate unique sections for global symbols in named special sections (e.g. symbols that are annotated with __attribute__((section(.... Doing so enables linker GC to colle

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek updated https://github.com/llvm/llvm-project/pull/91028 >From 78193f68a149e378fbb180a1a5fa1f4551f2af66 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 3 May 2024 15:48:31 -0700 Subject: [PATCH 1/3] [Clang] -fseparate-named-sections option When set, the compile

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
@@ -75,6 +75,10 @@ static cl::opt JumpTableInFunctionSection( "jumptable-in-function-section", cl::Hidden, cl::init(false), cl::desc("Putting Jump Table in function section")); +static cl::opt UniqueExplicitSections( +"unique-explicit-sections", cl::Hidden, cl::ini

[clang] 1b90095 - [Driver,test] Improve msvc-link.c

2024-05-04 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-05-04T15:15:12-07:00 New Revision: 1b90095b7db40c835c6de172d7a31100e461 URL: https://github.com/llvm/llvm-project/commit/1b90095b7db40c835c6de172d7a31100e461 DIFF: https://github.com/llvm/llvm-project/commit/1b90095b7db40c835c6de172d7a31100e461.diff

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/91028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,36 @@ +; Test that global values with explicit sections are placed into unique sections. + +; RUN: llc < %s 2>&1 | FileCheck %s MaskRay wrote: Drop unused `2>&1` https://github.com/llvm/llvm-project/pull/91028

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -733,16 +733,22 @@ calcUniqueIDUpdateFlagsAndSize(const GlobalObject *GO, StringRef SectionName, Ctx.isELFGenericMergeableSection(SectionName); // If this is the first ocurrence of this section name, treat it as the // generic section - if (!SymbolMergeable && !S

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
petrhosek wrote: > > This is an alternative approach to address the issue described in > > [discourse.llvm.org/t/rfc-support-for-memory-regions-in-elf/78570](https://discourse.llvm.org/t/rfc-support-for-memory-regions-in-elf/78570) > > which doesn't require a custom section type. > > This RFC

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/91028 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek updated https://github.com/llvm/llvm-project/pull/91028 >From 78193f68a149e378fbb180a1a5fa1f4551f2af66 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Fri, 3 May 2024 15:48:31 -0700 Subject: [PATCH 1/4] [Clang] -fseparate-named-sections option When set, the compile

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
@@ -733,16 +733,22 @@ calcUniqueIDUpdateFlagsAndSize(const GlobalObject *GO, StringRef SectionName, Ctx.isELFGenericMergeableSection(SectionName); // If this is the first ocurrence of this section name, treat it as the // generic section - if (!SymbolMergeable && !S

[clang] [llvm] [Clang] -fseparate-named-sections option (PR #91028)

2024-05-04 Thread Petr Hosek via cfe-commits
@@ -0,0 +1,36 @@ +; Test that global values with explicit sections are placed into unique sections. + +; RUN: llc < %s 2>&1 | FileCheck %s petrhosek wrote: Done. https://github.com/llvm/llvm-project/pull/91028 ___ cfe

[clang] 4dede5e - [Sema] Remove redundant check in an else branch. NFC

2024-05-04 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-05-04T15:27:52-07:00 New Revision: 4dede5ef5ca7e538351975130b1c1d863a84e4ca URL: https://github.com/llvm/llvm-project/commit/4dede5ef5ca7e538351975130b1c1d863a84e4ca DIFF: https://github.com/llvm/llvm-project/commit/4dede5ef5ca7e538351975130b1c1d863a84e4ca.diff

[clang-tools-extra] [clang-tidy][docs] Fix modernize-use-std-print docs (PR #91069)

2024-05-04 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/91069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve modernize-use-std-print diagnostic (PR #91071)

2024-05-04 Thread Julian Schmidt via cfe-commits
https://github.com/5chmidti approved this pull request. LGTM, thanks https://github.com/llvm/llvm-project/pull/91071 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver] Add option to select compiler-rt arch suffix (PR #89775)

2024-05-04 Thread Fangrui Song via cfe-commits
MaskRay wrote: I want to hear about opinions why the old compiler-rt file hierarchy is preferred by some users. Ideally, all operating systems would eventually migrate to `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on` and adopt a consistent hierarchy similar to libc++/libc++abi/libunwind (without th

[clang] [llvm] [arm] Support reserving r4 and r5 alongside r9 (PR #89849)

2024-05-04 Thread via cfe-commits
benisxdxd wrote: Ping https://github.com/llvm/llvm-project/pull/89849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Support preserve_none calling convention (PR #91046)

2024-05-04 Thread Brandt Bucher via cfe-commits
brandtbucher wrote: Aw, but that means we only have *twenty-six* registers for argument-passing... ;) https://github.com/llvm/llvm-project/pull/91046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI core info (PR #85235)

2024-05-04 Thread Fangrui Song via cfe-commits
@@ -1,5 +1,37 @@ +// RUN: %clang -### -c --target=aarch64 %s 2>&1 | FileCheck %s --check-prefix NONE +// NONE: "-cc1" +// NONE-NOT: "-fptrauth- + // RUN: %clang -### -c --target=aarch64 -fno-ptrauth-intrinsics -fptrauth-intrinsics %s 2>&1 | FileCheck %s --check-prefix=INTRIN /

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI core info (PR #85235)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/85235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AArch64][PAC][clang][ELF] Support PAuth ABI core info (PR #85235)

2024-05-04 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/85235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Teach .option arch to support experimental extensions. (PR #89727)

2024-05-04 Thread Yeting Kuo via cfe-commits
https://github.com/yetingk updated https://github.com/llvm/llvm-project/pull/89727 >From a43014cf3daa1b0fd9092bfe41da979205ba64aa Mon Sep 17 00:00:00 2001 From: Yeting Kuo Date: Tue, 23 Apr 2024 02:16:04 -0700 Subject: [PATCH 1/6] [RISCV] Teach .option arch to support experimental extensions.

[clang] c4c3efa - [test] %clang_cc1 -emit-llvm: remove redundant -S

2024-05-04 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-05-04T17:31:08-07:00 New Revision: c4c3efa161edf7313d1aeda07cd82fab90c3717c URL: https://github.com/llvm/llvm-project/commit/c4c3efa161edf7313d1aeda07cd82fab90c3717c DIFF: https://github.com/llvm/llvm-project/commit/c4c3efa161edf7313d1aeda07cd82fab90c3717c.diff

[clang] a312dd6 - [BPF, test] %clang_cc1 -emit-llvm: remove redundant -S

2024-05-04 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-05-04T17:37:36-07:00 New Revision: a312dd68c0ce368313164eb92cbdd95192afa3f8 URL: https://github.com/llvm/llvm-project/commit/a312dd68c0ce368313164eb92cbdd95192afa3f8 DIFF: https://github.com/llvm/llvm-project/commit/a312dd68c0ce368313164eb92cbdd95192afa3f8.diff

[clang] [alpha.webkit.UncountedCallArgsChecker] Treat (foo())->bar() like foo()->bar(). (PR #91052)

2024-05-04 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91052 >From 357b8bfa0cef2632930e3f037ed66360b0fa3615 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Sat, 4 May 2024 00:38:08 -0700 Subject: [PATCH 1/2] [alpha.webkit.UncountedCallArgsChecker] Treat (foo())->bar() like

[clang] [alpha.webkit.UncountedCallArgsChecker] Treat (foo())->bar() like foo()->bar(). (PR #91052)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ryosuke Niwa (rniwa) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/91052.diff 2 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp (+4) - (modified) clang/test/Analysis/Checkers/WebKi

[clang] [llvm] [RISCV] Teach .option arch to support experimental extensions. (PR #89727)

2024-05-04 Thread Yeting Kuo via cfe-commits
yetingk wrote: @topperc Sorry, there was a quick fix after the approve. `getTargetFeatureForExtension` could approve the extension with version. It may be better to allow them, but I am not sure the error message could be enough readable if we use wrong version number and is the format of out

[clang] [webkit.RefCntblBaseVirtualDtor] Ignore WTF::RefCounted and its variants missing virtual destructor (PR #91009)

2024-05-04 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/91009 >From 3301340a5532183252365c536572fc98e4941c8b Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Fri, 3 May 2024 13:35:29 -0700 Subject: [PATCH 1/3] [webkit.RefCntblBaseVirtualDtor] Ignore WTF::RefCounted and its v

[clang] [webkit.RefCntblBaseVirtualDtor] Ignore WTF::RefCounted and its variants missing virtual destructor (PR #91009)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-static-analyzer-1 Author: Ryosuke Niwa (rniwa) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/91009.diff 2 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualD

[clang] 3c311b0 - [test] %clang_cc1 -S: remove overridden -emit-llvm

2024-05-04 Thread Fangrui Song via cfe-commits
Author: Fangrui Song Date: 2024-05-04T17:49:32-07:00 New Revision: 3c311b022283450acbdd6af22862e913649a5452 URL: https://github.com/llvm/llvm-project/commit/3c311b022283450acbdd6af22862e913649a5452 DIFF: https://github.com/llvm/llvm-project/commit/3c311b022283450acbdd6af22862e913649a5452.diff

[clang] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin and frexp. (PR #88978)

2024-05-04 Thread Hubert Tong via cfe-commits
@@ -14547,6 +14547,20 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { default: return false; + case Builtin::BI__builtin_frexp: + case Builtin::BI__builtin_frexpf: + case Builtin::BI__builtin_frexpl: { +LValue Pointer; +if (!EvaluateFloat(E->ge

[clang] [Clang][Comments] Support for parsing headers in Doxygen \par commands (PR #91100)

2024-05-04 Thread via cfe-commits
https://github.com/hdoc created https://github.com/llvm/llvm-project/pull/91100 ### Background Doxygen's `\par` command ([link](https://www.doxygen.nl/manual/commands.html#cmdpar)) has an optional argument, which denotes the header of the paragraph started by a given `\par` command. In short

[clang] [Clang][Comments] Support for parsing headers in Doxygen \par commands (PR #91100)

2024-05-04 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [Clang][Comments] Support for parsing headers in Doxygen \par commands (PR #91100)

2024-05-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: hdoc (hdoc) Changes ### Background Doxygen's `\par` command ([link](https://www.doxygen.nl/manual/commands.html#cmdpar)) has an optional argument, which denotes the header of the paragraph started by a given `\par` command. In short, t

[clang] [Clang][Comments] Attach comments to decl even if preproc directives are in between (PR #88367)

2024-05-04 Thread via cfe-commits
https://github.com/hdoc updated https://github.com/llvm/llvm-project/pull/88367 >From 61612c5f340e25198deaf68e6904323955efe489 Mon Sep 17 00:00:00 2001 From: hdoc Date: Thu, 11 Apr 2024 01:54:18 -0700 Subject: [PATCH 1/2] Attach comments to decl even if preproc directives are in between --- c

<    1   2   3   >