[PATCH] D157252: [clang][ExprConst] Handle 0 type size in builtin_memcpy etc.

2023-08-07 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added a reviewer: clang. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes https://github.com/llvm/llvm-project/issues/44176 Repository: rG LLVM Github Mono

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-08-06 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. The fuzzer timeouts fail all the time; I usually just assume it's unrelated. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152495/new/ https://reviews.llvm.org/D152495 ___ cfe-co

[PATCH] D157201: [Clang] Support qualified name as member designator in offsetof

2023-08-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. You're missing tests. Comment at: clang/lib/Sema/SemaExpr.cpp:16696-16697 + + IdentifierInfo *II = RD->getIdentifier(); + if (II == OC.U.IdentInfo && OC.isQualifier) +continue; Repository: rG LLVM Github Monorepo

[PATCH] D157200: [clang][Interp] Visit Logical-not operand as bool

2023-08-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The `invBool` op here expects a bool operand, but in C

[PATCH] D157174: [clang][Interp] Convert logical binop operands to bool

2023-08-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 547495. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157174/new/ https://reviews.llvm.org/D157174 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/c.c Index: clang/test/AST/Interp/c.c ===

[PATCH] D157174: [clang][Interp] Convert logical binop operands to bool

2023-08-04 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Move the logic for this into `visitBool`, where it bel

[PATCH] D154951: [clang][Interp] __builtin_bit_cast, Take 2

2023-08-04 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/InterpBitcast.cpp:71 +/// All offsets are in bytes. +struct ByteTracker { + std::vector Initialized; aaron.ballman wrote: > Don't we need to track this at the *bit* level instead of the *byte* level

[PATCH] D157074: [clang][ExprConst] Add RHS source range to div by zero diags

2023-08-04 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2835 if (RHS == 0) { - Info.FFDiag(E, diag::note_expr_divide_by_zero); + Info.FFDiag(E, diag::note_expr_divide_by_zero) << RHSRange; return fa

[PATCH] D157074: [clang][ExprConst] Add RHS source range to div by zero diags

2023-08-04 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 547145. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157074/new/ https://reviews.llvm.org/D157074 Files: clang/lib/AST/ExprConstant.cpp clang/lib/AST/Interp/Interp.h clang/test/Misc/constexpr-source-ranges.cpp Index: clang/test/Misc/constexp

[PATCH] D157074: [clang][ExprConst] Add RHS source range to div by zero diags

2023-08-04 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin, hazohelet. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo http

[PATCH] D157072: [clang][ExprConst] Check float operation input for signaling NaNs

2023-08-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: jcranmer-intel, clang. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Split out from https://reviews.llvm.org/D156506. Before adding this behavio

[PATCH] D156506: [clang][Interp] Check floating results for NaNs

2023-08-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.cpp:503 + // If during the evaluation of an expression, the result is not + // mathematically defined [...], the behavior is undefined. + // FIXME: C++ rules require us to not conform to IEEE 754 here.

[PATCH] D156794: [clang][Interp] Lazily visit unknown global declarations

2023-08-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 546882. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156794/new/ https://reviews.llvm.org/D156794 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/c.c Index: clang/test/AST/Interp/c.c ==

[PATCH] D144457: [clang][Interp] Handle global composite temporaries

2023-08-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144457/new/ https://reviews.llvm.org/D144457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D156453: [clang][Interp] Create only globals when initializing a global variable

2023-08-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156453/new/ https://reviews.llvm.org/D156453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D154262: [clang][Interp] LambdaThisCaptures

2023-08-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154262/new/ https://reviews.llvm.org/D154262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D154581: [clang][Interp] Track existing InitMaps in InterpState

2023-08-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 546872. tbaeder added a comment. 1. Use a `shared_ptr` for the initmaps. 2. However, we allocate them into the `Block`, therefore can't forget to call the Block's dtor. 3. To distinguish between Blocks we've already deallocated (via a `destroy` op), add an

[PATCH] D156794: [clang][Interp] Lazily visit unknown global declarations

2023-08-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:2172-2173 + // Lazily visit global declarations we haven't seen yet. + // This happens in C. + if (const auto *VD = dyn_cast(D); aaron.ballman wrote: > Do we want to assert/l

[PATCH] D153276: [clang][Interp] Reject reinterpret_cast expressions

2023-08-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:1761 + S.FFDiag(Loc, diag::note_constexpr_invalid_cast) + << static_cast(Kind) << S.Current->getRange(OpPC); + return false; probinson wrote: > Would you mind changing this cast from

[PATCH] D155393: [clang][Interp] Implement __builtin_isfpclass

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder closed this revision. tbaeder marked an inline comment as done. tbaeder added a comment. Also forgot the link in the commit message here. This is closed by https://github.com/llvm/llvm-project/commit/6ba4b213346fad36634a5571feda4f4481097c3a Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D156794: [clang][Interp] Lazily visit unknown global declarations

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 546090. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156794/new/ https://reviews.llvm.org/D156794 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/c.c Index: clang/test/AST/Interp/c.c ==

[PATCH] D155401: [clang][Interp] Implement __builtin_fmax

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG89e44e33edec: [clang][Interp] Implement __builtin_fmax (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D155270: [clang][Interp] Basic support for bit fields

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D155270#4550466 , @aaron.ballman wrote: > Precommit CI is currently crashing on the newly introduced test case. It's missing https://reviews.llvm.org/D155548 :) That's of course just a workaround. At the beginning of the `ev

[PATCH] D155400: [clang][Interp] Implement __builtin_fabs()

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1684406e63b7: [clang][Interp] Implement __builtin_fabs() (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D155400?vs=54078

[PATCH] D155394: [clang][Interp] Implement __builtin_fpclassify

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder closed this revision. tbaeder added a comment. Dang, forgot to add the link to the commit message. This has been closed via https://github.com/llvm/llvm-project/commit/6ba4b213346fad36634a5571feda4f4481097c3a CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155394/new/ https://rev

[PATCH] D156794: [clang][Interp] Lazily visit unknown global declarations

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. In C, we don't get a evaluateAsInitializer() call fo

[PATCH] D156786: [clang][Interp] Fix converting function pointers to bool

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG015ffba811c4: [clang][Interp] Fix converting function pointers to bool (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D154474: [clang][Interp] Fix ignoring Integral- and IntegralToBoolean casts

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG21aa8a220c01: [clang][Interp] Fix ignoring Integral- and IntegralToBoolean casts (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D156786: [clang][Interp] Fix converting function pointers to bool

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 546015. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156786/new/ https://reviews.llvm.org/D156786 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/functions.cpp Index: clang/test/AST/Interp/functions.cpp ==

[PATCH] D149965: [clang][Interp] Fix tests for ignored expressions

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG65dca4cbcbfc: [clang][Interp] Fix tests for ignored expressions (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D156786: [clang][Interp] Fix converting function pointers to bool

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Emit the proper `PT_FnPtr` instructions if we're handl

[PATCH] D149960: [clang][Interp] Fix ignoring String- and CharacterLiterals

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGeec6931d7787: [clang][Interp] Fix ignoring String- and CharacterLiterals (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D149837: [clang][Interp] Fix ignoring CompoundLiteralExprs

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc0a36a157d97: [clang][Interp] Fix ignoring CompoundLiteralExprs (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D149837?v

[PATCH] D156604: [clang][ExprConst] Use call source range for 'in call to' diags

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545980. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156604/new/ https://reviews.llvm.org/D156604 Files: clang/lib/AST/ExprConstant.cpp clang/lib/AST/Interp/Frame.h clang/lib/AST/Interp/InterpFrame.cpp clang/lib/AST/Interp/InterpFrame.h cl

[PATCH] D149834: [clang][Interp] Fix ignoring TypeTraitExprs

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb864592915ae: [clang][Interp] Fix ignoring TypeTraitExprs (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D149834?vs=5203

[PATCH] D149831: [clang][Interp] Fix ignoring SubstNonTypeTemplateParmExpr

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc7b400f4a8d6: [clang][Interp] Fix ignoring SubstNonTypeTemplateParmExpr (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D

[PATCH] D149828: [clang][Interp] Evaluate Base when discarding a MemberExpr

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6aac11bad976: [clang][Interp] Evaluate Base when discarding a MemberExpr (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/

[PATCH] D154475: [clang][Interp] Fix ignoring MaterializeTemporaryExprs

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG97cddb78502e: [clang][Interp] Fix ignoring MaterializeTemporaryExprs (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D154

[PATCH] D144457: [clang][Interp] Handle global composite temporaries

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144457/new/ https://reviews.llvm.org/D144457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D152132: [clang][Inter] Fix lifetime diagnostics for dead records

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152132/new/ https://reviews.llvm.org/D152132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D154581: [clang][Interp] Track existing InitMaps in InterpState

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154581/new/ https://reviews.llvm.org/D154581 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D154951: [clang][Interp] __builtin_bit_cast, Take 2

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154951/new/ https://reviews.llvm.org/D154951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D155270: [clang][Interp] Basic support for bit fields

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155270/new/ https://reviews.llvm.org/D155270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D156604: [clang][ExprConst] Use call source range for 'in call to' diags

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. @hazohelet I changed this to just return `CallExpr->getSourceRange()` and to not save a source range separately. Can you give this a look please? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156604/new/ https://reviews.llvm.org/D156604 ___

[PATCH] D156604: [clang][ExprConst] Use call source range for 'in call to' diags

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D156604#4546650 , @aaron.ballman wrote: >> As you can see I have a test case, but I didn't attach it in >> test/Misc/constexpr-source-ranges.cpp because I can't get >> -fdiagnostics-print-source-range-info to actually print

[PATCH] D156604: [clang][ExprConst] Use call source range for 'in call to' diags

2023-08-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545934. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156604/new/ https://reviews.llvm.org/D156604 Files: clang/lib/AST/ExprConstant.cpp clang/lib/AST/Interp/Frame.h clang/lib/AST/Interp/InterpFrame.cpp clang/lib/AST/Interp/InterpFrame.h cl

[PATCH] D156027: [clang][Interp] Rework how initializers work

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545929. tbaeder added a comment. merge `visitConditional()` into its only caller, `VisitAbstractConditionalOperator()`. This works now sine the initializer and non-initializer code paths are the same. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D156027: [clang][Interp] Rework how initializers work

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545928. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156027/new/ https://reviews.llvm.org/D156027 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/Interp/Context.cpp clang/test/AST/Interp/l

[PATCH] D156027: [clang][Interp] Rework how initializers work

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545926. tbaeder added a comment. Add `::delegate(const Expr *E)` and squash previous commits into this one. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156027/new/ https://reviews.llvm.org/D156027 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp

[PATCH] D155393: [clang][Interp] Implement __builtin_isfpclass

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/InterpBuiltin.cpp:232 + static_cast((F.classify() & FPClassArg).getZExtValue()); + S.Stk.push>(Integral<32, true>::from(Result)); + aaron.ballman wrote

[PATCH] D154475: [clang][Interp] Fix ignoring MaterializeTemporaryExprs

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154475/new/ https://reviews.llvm.org/D154475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D155430: [clang][Interp] Implement __arithmethic_fence for floating types

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155430/new/ https://reviews.llvm.org/D155430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D155393: [clang][Interp] Implement __builtin_isfpclass

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155393/new/ https://reviews.llvm.org/D155393 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D154688: [clang] Show verify prefix in error messages

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154688/new/ https://reviews.llvm.org/D154688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D149013: [clang][Interp] Check pointers when accessing base class

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149013/new/ https://reviews.llvm.org/D149013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D155374: [clang][Interp] Implement __builtin_isnormal

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd37f1e9965bd: [clang][Interp] Implement __builtin_isnormal (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D155374?vs=540

[PATCH] D155372: [clang][Interp] Implement __builtin_isfinite

2023-07-31 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf444f396863c: [clang][Interp] Implement __builtin_isfinite (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D155371: [clang][Interp] Implement __builtin_isinf

2023-07-30 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG72450a77937c: [clang][Interp] Implement __builtin_isinf (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D155371?vs=540693

[PATCH] D156604: [clang][ExprConst] Use call source range for 'in call to' diags

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: cjdb, aaron.ballman, hazohelet. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Before: array.cpp:74:15: error: static assertion expression is n

[PATCH] D156597: [Clang] Handle static_assert messages with an expression started by a literal

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Parse/ParseDeclCXX.cpp:1019 -if (isTokenStringLiteral()) - AssertMessage = ParseUnevaluatedStringLiteralExpression(); -else if (getLangOpts().CPlusPlus26) +bool ParseAsExression = false; +if(getLangOpts()

[PATCH] D156027: [clang][Interp] Rework how initializers work

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Do you want me to squash the patches I abandoned into this one? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156027/new/ https://reviews.llvm.org/D156027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[PATCH] D155165: [clang][Interp] Fully serialize Floatings to bytes

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Source.h:63-64 /// Pointer into the code owned by a function. +public: const std::byte *Ptr; }; aaron.ballman wrote: > Any chance we can use friendship here as well, rather than exposing the d

[PATCH] D154189: [clang][Interp] Implement zero-init of record types

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545367. tbaeder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154189/new/ https://reviews.llvm.org/D154189 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/In

[PATCH] D156027: [clang][Interp] Rework how initializers work

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Context.cpp:131 if (T->isFunctionPointerType() || T->isFunctionReferenceType() || - T->isFunctionType()) + T->isFunctionType() || T->isSpecificBuiltinType(BuiltinType::BoundMember)) return PT_FnPtr

[PATCH] D156027: [clang][Interp] Rework how initializers work

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:240 +return Initializing ? this->visitInitializer(SubExpr) +: this->visit(SubExpr); aaron.ballman wrote: > tbaeder wrote: > > This pattern shows up a

[PATCH] D155165: [clang][Interp] Fully serialize Floatings to bytes

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545353. tbaeder marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155165/new/ https://reviews.llvm.org/D155165 Files: clang/lib/AST/Interp/ByteCodeEmitter.cpp clang/lib/AST/Interp/Disasm.cpp clang/lib/AST/Interp/Fl

[PATCH] D155568: [clang][Interp] Make sure we push integers of the correct size

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D155568#4542764 , @aaron.ballman wrote: > In D155568#4525488 , @tbaeder wrote: > >> This patch is missing the `Ret` part in `InterpBuiltin()` in the >> same file. That needs to change

[PATCH] D155568: [clang][Interp] Make sure we push integers of the correct size

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545349. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155568/new/ https://reviews.llvm.org/D155568 Files: clang/lib/AST/Interp/Integral.h clang/lib/AST/Interp/InterpBuiltin.cpp clang/test/AST/Interp/builtin-functions.cpp Index: clang/test/AST/

[PATCH] D155710: [clang][Interp] Create a new local variable in VisitCXXDefaultArgExpr

2023-07-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder abandoned this revision. tbaeder added a comment. Abandoning in favor of https://reviews.llvm.org/D156027 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155710/new/ https://reviews.llvm.org/D155710 __

[PATCH] D156588: feat: Add support for Rocky Linux to LLVM Distro

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Herald added a subscriber: ormris. @MaskRay Isn't this something we should be doing with config files now? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156588/new/ https://reviews.llvm.org/D156588

[PATCH] D156027: [clang][Interp] Rework how initializers work

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545336. tbaeder marked 3 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156027/new/ https://reviews.llvm.org/D156027 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/In

[PATCH] D156027: [clang][Interp] Rework how initializers work

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:2090 + assert(Initializing); + if (!isa(E)) { +if (!this->emitDupPtr(E)) aaron.ballman wrote: > And if it is a member c

[PATCH] D155369: [clang][Interp] Implement __builtin_isnan()

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8ad9dcb38693: [clang][Interp] Implement __builtin_isnan() (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D155546: [clang][Interp] Implement __builtin_fmin

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc14c34de4571: [clang][Interp] Implement __builtin_fmin (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D155546?vs=544691&

[PATCH] D156509: [clang][Interp] Diagnose unknown parameter values

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.cpp:550-554 + if (isa(D)) { +S.FFDiag(E, diag::note_constexpr_function_param_value_unknown) << D; +S.Note(D->getLocation(), diag::note_declared_at) << D->getS

[PATCH] D156509: [clang][Interp] Diagnose unknown parameter values

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545193. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156509/new/ https://reviews.llvm.org/D156509 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/Interp.cpp clang/lib/AST/Interp/Interp.h clang/lib/AST/Interp/Opcodes.td

[PATCH] D153693: [clang][Interp] Handle InitListExprs of composite type

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder abandoned this revision. tbaeder added a comment. Abandoning in favor of https://reviews.llvm.org/D156027 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153693/new/ https://reviews.llvm.org/D153693 __

[PATCH] D154189: [clang][Interp] Implement zero-init of record types

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545146. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154189/new/ https://reviews.llvm.org/D154189 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/Interp/Descriptor.cpp clang/lib/AST/Interp

[PATCH] D154189: [clang][Interp] Implement zero-init of record types

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/AST/Interp/records.cpp:939 + }; +#endif + aaron.ballman wrote: > I think we should have more test coverage. I mentioned a few above, but other > things to test would be inner classes (and anonymous members),

[PATCH] D154189: [clang][Interp] Implement zero-init of record types

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1240 + // Fields + for (const Record::Field &Field : R->fields()) { +const Descriptor *D = Field.Desc; aaron.ballman wrote: > It looks like you're not initializing base clas

[PATCH] D154189: [clang][Interp] Implement zero-init of record types

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545131. tbaeder marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154189/new/ https://reviews.llvm.org/D154189 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/In

[PATCH] D149172: [clang][Interp] Emit proper diagnostic when comparing unrelated pointers

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG9092acc51010: [clang][Interp] Emit proper diagnostic when comparing unrelated pointers (authored by tbaeder). Changed prior to commit: https://rev

[PATCH] D156503: [clang][Interp] Don't assume throw stmts have a subexpr

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7010a4f14e0b: [clang][Interp] Don't assume throw stmts have a subexpr (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D153241: [clang][Diagnostics] Provide source range to invalid casts in const expr

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG81fb21624578: [clang][Diagnostics] Provide source range to invalid casts in const expr (authored by tbaeder). Repository: rG LLVM Github Monorepo

[PATCH] D156518: Fix handling of medial hyphens in Unicode Names.

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: llvm/lib/Support/UnicodeNameToCodepoint.cpp:350 bool DoesStartWith = startsWith(Name, Item.Prefix, Strict, Consummed, -NameStart, NeedleStart, /*isPrefix*/ true); +

[PATCH] D155410: [clang][Interp] Fix comparing nan/inf floating point values

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG9a0164a0c66c: [clang][Interp] Fix comparing nan/inf floating point values (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org

[PATCH] D155368: [clang][Interp] __builtin_copysign

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG57ca62d5d35a: [clang][Interp] Implement __builtin_copysign (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D155368?vs=541

[PATCH] D155367: [clang][Interp] Implement __builtin_inf() etc.

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb395e91f2ef4: [clang][Interp] Implement __builtin_inf() etc. (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D155356: [clang][Interp] Implement __builtin_nan family of functions

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc2273e33bd13: [clang][Interp] Implement __builtin_nan family (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D155356?vs=5

[PATCH] D154262: [clang][Interp] LambdaThisCaptures

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154262/new/ https://reviews.llvm.org/D154262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D155572: [clang][Interp] Start implementing binary operators for complex types

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D155572#4539457 , @aaron.ballman wrote: > Is this intended to not handle all the binary operators in this patch? Yes, just a subset for now. > And also, is this intended to only impact initializers? Yes, due to problems wit

[PATCH] D156511: [clang][Interp] Diagnose more unkonwn DeclRefExprs

2023-07-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Diagnose used non-const and/or extern globals. Rep

[PATCH] D156509: [clang][Interp] Diagnose unknown parameter values

2023-07-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 545028. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156509/new/ https://reviews.llvm.org/D156509 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/Interp.cpp clang/lib/AST/Interp/Interp.h clang/lib/AST/Interp/Opcodes.td

[PATCH] D156509: [clang][Interp] Diagnose unknown parameter values

2023-07-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews

[PATCH] D156506: [clang][Interp] Check floating results for NaNs

2023-07-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This does not handle the builtin functions yet, since

[PATCH] D155546: [clang][Interp] Implement __builtin_fmin

2023-07-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. As for signaling vs. quiet NaNs, it seems like both GCC and Clang only check for NaNs, and don't care if it's signaling or not. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155546/new/ https://reviews.llvm.org/D155546 _

[PATCH] D153616: [clang][Interp] Create a new local variable in visitLambdaExpr()

2023-07-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder abandoned this revision. tbaeder added a comment. Abandoning this in favor of https://reviews.llvm.org/D156027 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153616/new/ https://reviews.llvm.org/D153616 _

[PATCH] D156503: [clang][Interp] Don't assume throw stmts have a subexpr

2023-07-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, shafik, cor3ntin. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews

[PATCH] D155546: [clang][Interp] Implement __builtin_fmin

2023-07-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Thanks for the info @jcranmer-intel. I see that the current intepreter doesn't check this for `__builtin_fmin`(GCC does) either, but it does error out for e.g. `__builtin_nan("") + 1` (GCC doesn't). @aaron.ballman I'd like to handle that in a separate patch where I als

[PATCH] D155546: [clang][Interp] Implement __builtin_fmin

2023-07-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/AST/Interp/builtin-functions.cpp:65-73 + constexpr float f1 = __builtin_fmin(1.0, 2.0f); + static_assert(f1 == 1.0f, ""); + + constexpr float min = __builtin_fmin(__builtin_nan(""), 1); + static_assert(min == 1, ""); + co

<    1   2   3   4   5   6   7   8   9   10   >