[PATCH] D152713: [clang-tidy] Correct sizeof/alignas handling in misc-redundant-expression

2023-07-01 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron accepted this revision. Izaron added a comment. This revision is now accepted and ready to land. LGTM! Thank you for the fix! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152713/new/ https://reviews.llvm.org/D152713

[PATCH] D146393: [Clang] Support free positioning of labels inside compound statements in C

2023-03-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. A big TODO: rename `ext_c_label_end_of_compound_statement` to something like `ext_c_label_free_positioning`. Since we found out it is more complete than just the end of statements. Comment at: clang/lib/Parse/ParseStmt.cpp:695-697 - // The

[PATCH] D146393: [Clang] Support free positioning of labels inside compound statements in C

2023-03-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: aaron.ballman, cor3ntin. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Implements part of paper P2324R2

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron marked an inline comment as done. Izaron added a comment. In D144334#4142490 , @erichkeane wrote: > Just deliberately not support a part of C++2b. Implementers have veto'ed > features in the past exactly that way. That's sad. Let's at least

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D144334#4141646 , @erichkeane wrote: > I'm on the fence as to whether we want to implement this feature at all. As > was discussed extensively during the EWG meetings on this: multiple > implementers are against this

[PATCH] D118743: [clang-tidy] Add `modernize-use-inline-const-variables-in-headers` check

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron marked 2 inline comments as done. Izaron added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize/use-inline-const-variables-in-headers.hpp:1 +// RUN: %check_clang_tidy %s -std=c++17 modernize-use-inline-const-variables-in-headers %t +

[PATCH] D118743: [clang-tidy] Add `modernize-use-inline-const-variables-in-headers` check

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 498637. Izaron added a comment. Use the common `isInAnonymousNamespace` matcher. Split the test into two files. Thanks to @carlosgalvezp for advices! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118743/new/

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. If you are not familiar with the `[[assume(expr]]` concept and want to know more, I wrote a small article about it recently, with a lot of additional links (including to the author of the proposal) - https://izaron.github.io/posts/assume/ Repository: rG LLVM Github

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 498625. Izaron added a comment. More thorough AST test. Set the right macros number - thanks to @philnik! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144334/new/ https://reviews.llvm.org/D144334 Files:

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1448 +def Assume : StmtAttr { + let Spellings = [CXX11<"", "assume", 202302>]; + let Documentation = [AssumeDocs]; Honestly I don't have a clue what these numbers `202302` (apparently

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 498622. Izaron added a comment. A small fix for `def FutureAttrs` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144334/new/ https://reviews.llvm.org/D144334 Files: clang/docs/ReleaseNotes.rst

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: clang-language-wg, aaron.ballman, rsmith, nikic. Herald added a subscriber: StephenFan. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Clang already

[PATCH] D118743: [clang-tidy] Add `modernize-use-inline-const-variables-in-headers` check

2023-01-01 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D118743#3965423 , @Lounarok wrote: > I tried this patch and it's really helpful! You're welcome! > According to this , "A > `constexpr` specifier used in a function or

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-27 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:12452 +int Ilogb; +if (APFloat::opStatus St = ilogb(F, Ilogb); !isConstantOpStatus(St)) + return false; hubert.reinterpretcast wrote: > hubert.reinterpretcast wrote: > >

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-27 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:12452 +int Ilogb; +if (APFloat::opStatus St = ilogb(F, Ilogb); !isConstantOpStatus(St)) + return false; majnemer wrote: > Izaron wrote: > > jcranmer-intel wrote: > > > Izaron

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-27 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 471101. Izaron added a comment. Deal with MSVC where sizeof(long double) == sizeof(double) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136568/new/ https://reviews.llvm.org/D136568 Files:

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-26 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron marked 2 inline comments as done. Izaron added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:12452 +int Ilogb; +if (APFloat::opStatus St = ilogb(F, Ilogb); !isConstantOpStatus(St)) + return false; jcranmer-intel wrote: > Izaron

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-26 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 470962. Izaron added a comment. Add test for min/max value. Fix comment for ilog. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136568/new/ https://reviews.llvm.org/D136568 Files:

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-26 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:12452 +int Ilogb; +if (APFloat::opStatus St = ilogb(F, Ilogb); !isConstantOpStatus(St)) + return false; aaron.ballman wrote: > jcranmer-intel wrote: > > `long double` is

[PATCH] D118743: [clang-tidy] Add `modernize-use-inline-const-variables-in-headers` check

2022-10-24 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. A friendly ping  Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118743/new/ https://reviews.llvm.org/D118743 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D136549: [clang] Fix time profile in "isIntegerConstantExpr"

2022-10-23 Thread Evgeny Shulgin via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2bb50a55b0f5: [clang] Fix time profile in isIntegerConstantExpr (authored by Izaron). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136549/new/

[PATCH] D136549: [clang] Fix time profile in "isIntegerConstantExpr"

2022-10-23 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron marked 2 inline comments as done. Izaron added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:15908 - llvm::TimeTraceScope TimeScope("isIntegerConstantExpr", [&] { -return Loc->printToString(Ctx.getSourceManager()); - }); + ExprTimeTraceScope

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-23 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. This patch is similar to `__bultin_fmax`: https://reviews.llvm.org/D134369 The constexpr version of ilogb matches the libc realization, this is verified with the same tests: https://github.com/llvm/llvm-project/blob/main/libc/test/src/math/ILogbTest.h

[PATCH] D136568: [Clang] Support constexpr builtin ilogb

2022-10-23 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: jcranmer-intel, aaron.ballman, cor3ntin, efriedma. Herald added a subscriber: hiraditya. Herald added a project: All. Izaron requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits,

[PATCH] D136549: [clang] Fix time profile in "isIntegerConstantExpr"

2022-10-23 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: dyung, aaron.ballman, jloser. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The time profiler in `Expr::isIntegerConstantExpr` used to call

[PATCH] D136546: [clang][unittest] Resolve ClangSupportTest link time errors

2022-10-23 Thread Evgeny Shulgin via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe5032d89e44a: [clang][unittest] Resolve ClangSupportTest link time errors (authored by jmciver, committed by Izaron). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D136546: [clang][unittest] Resolve ClangSupportTest link time errors

2022-10-23 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. LGTM! I'm sorry that you had to fix CMakeLists.txt. It really "worked on my machine", I was running these commands: cmake --build build --target ClangSupportTests # build and link the binary ./build/tools/clang/unittests/Support/ClangSupportTests # run the binary

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-22 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D136022#3877399 , @dyung wrote: > Hi @Izaron, several of our internal tests that run tests using `-ftime-trace` > started crashing when run which I bisected back to your change. I have filed > issue #58551

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/unittests/Support/TimeProfilerTest.cpp:11 +#include "clang/Frontend/FrontendActions.h" +#include "clang/Lex/PreprocessorOptions.h" + thakis wrote: > Why is this in clang/unittests/Support (a new binary to boot)?

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-21 Thread Evgeny Shulgin 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 rG27d8eedd5a3c: [clang] Add time profile for constant evaluation (authored by Izaron). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 469771. Izaron added a comment. Mention this in the release notes. Thanks to Aaron for reviewing! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136022/new/ https://reviews.llvm.org/D136022 Files:

[PATCH] D136036: [Clang] Add __has_constexpr_builtin support

2022-10-21 Thread Evgeny Shulgin 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 rG5b567637e22b: [Clang] Add __has_constexpr_builtin support (authored by Izaron). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-20 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/unittests/Support/TimeProfilerTest.cpp:197-198 + + // NOTE: If this test is failing, run this test with + // `llvm::errs() << TraceGraph;` and change the assert above. +} aaron.ballman wrote: > This bit worries

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-20 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 469159. Izaron added a comment. Fix optionals with `value_or` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136022/new/ https://reviews.llvm.org/D136022 Files: clang/lib/AST/ExprConstant.cpp

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 469098. Izaron added a comment. Fix CMakeLists.txt Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136022/new/ https://reviews.llvm.org/D136022 Files: clang/lib/AST/ExprConstant.cpp

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. The test doesn't cover exactly all new traces though. For example I couldn't write a code that runs into the `EvaluateAsInt` method 樂 If you have an idea for some funky constexpr code that can be tested, please write here =) Repository: rG LLVM Github Monorepo

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D136022#3861245 , @jloser wrote: > I'd like to see some tests through before I approve. Thanks for the greenlight! I added a test that compiles a chunk of code and then checks the time trace graph in a human-readable form.

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 469096. Izaron marked 4 inline comments as done. Izaron added a comment. Add time profiler test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136022/new/ https://reviews.llvm.org/D136022 Files:

[PATCH] D136036: [Clang] Add __has_constexpr_builtin support

2022-10-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. > It looks like unrelated formatting changes snuck in to this file. @aaron.ballman JFYI after I reverted what `git clang-format HEAD~1` did to the code, the build has failed ERROR git-clang-format returned an non-zero exit code 1 Build completed with failures

[PATCH] D136036: [Clang] Add __has_constexpr_builtin support

2022-10-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/docs/LanguageExtensions.rst:96 +the constant evaluation of the corresponding builtin (for example, +``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. + Izaron wrote: > Just to be clear: this isn't a

[PATCH] D136036: [Clang] Add __has_constexpr_builtin support

2022-10-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/docs/LanguageExtensions.rst:96 +the constant evaluation of the corresponding builtin (for example, +``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. + Just to be clear: this isn't a true statement now

[PATCH] D136036: [Clang] Add __has_constexpr_builtin support

2022-10-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D136036#3862065 , @aaron.ballman wrote: > Can you also add documentation and a release note for the new feature testing > macro? In D136036#3862649 , @shafik wrote: > Please add

[PATCH] D136036: [Clang] Add __has_constexpr_builtin support

2022-10-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/lib/Lex/PPMacroExpansion.cpp:370 // Clang Extensions. - Ident__FILE_NAME__ = RegisterBuiltinMacro(*this, "__FILE_NAME__"); - Ident__has_feature = RegisterBuiltinMacro(*this, "__has_feature"); - Ident__has_extension

[PATCH] D136036: [Clang] Add __has_constexpr_builtin support

2022-10-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 468314. Izaron marked 2 inline comments as done. Izaron added a comment. Add more parsing tests. Fix unrelated formatting changes. Add release notes and docs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D136036: [Clang] Add __has_constexpr_builtin support

2022-10-16 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 468068. Izaron added a comment. Changed `llvm_unreachable` to just `return false`. I thought it is more secure. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136036/new/ https://reviews.llvm.org/D136036 Files:

[PATCH] D136036: [Clang] Add __has_builtin_constexpr support

2022-10-16 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 468063. Izaron added a comment. Slightly changed the test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136036/new/ https://reviews.llvm.org/D136036 Files: clang/include/clang/Basic/Builtins.def

[PATCH] D136036: [Clang] Add __has_builtin_constexpr support

2022-10-16 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. A builtin is considered "constexpr" if it has `E` in its attributes in `Builtins.def`. The list of constexpr builtins is consistent, the code in `ExprConstant.cpp` (where the actual constant evaluation of builtins is being done) guards it. If builtin is not marked with

[PATCH] D136036: [Clang] Add __has_builtin_constexpr support

2022-10-16 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: rsmith, aaron.ballman, cor3ntin, philnik, yaxunl, tra, cjdb. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The `__has_builtin_constexpr` macro can

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-15 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. We can use this file as an example: `ConstProfiler.cpp` https://reviews.llvm.org/P8296 The code does a really big constant evaluation. This is the generated json **before** the patch: `before.json` https://reviews.llvm.org/P8294 Giving this json to

[PATCH] D136022: [clang] Add time profile for constant evaluation

2022-10-15 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: aaron.ballman, cor3ntin, anton-afanasyev, mbs-modular, jloser. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add time profiler for various

[PATCH] D135822: [clang-tidy] Add option `IgnoreVoidReturnType` to `modernize-use-trailing-return-type`

2022-10-13 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 467590. Izaron added a comment. Change `IgnoreVoidReturnType` to `RewriteVoidReturn` type. Check the cheaper condition first. A big thank to @bernhardmgruber for nice comments! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D135822: [clang-tidy] Add option `IgnoreVoidReturnType` to `modernize-use-trailing-return-type`

2022-10-12 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/UseTrailingReturnTypeCheck.cpp:398-400 + auto F = functionDecl(unless(anyOf(hasTrailingReturn(), cxxConstructorDecl(), + cxxDestructorDecl(),

[PATCH] D135822: [clang-tidy] Add option `IgnoreVoidReturnType` to `modernize-use-trailing-return-type`

2022-10-12 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: salman-javed-nz, aaron.ballman, bernhardmgruber, bkramer, kbobyrev. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang-tools-extra. Herald

[PATCH] D118743: [clang-tidy] Add `modernize-use-inline-const-variables-in-headers` check

2022-10-10 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 41. Izaron added a comment. Removed excessive newline. Thanks to @Eugene.Zelenko! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118743/new/ https://reviews.llvm.org/D118743 Files:

[PATCH] D118743: [clang-tidy] Add `modernize-use-inline-const-variables-in-headers` check

2022-10-10 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 40. Izaron added a comment. Rebased onto main (after a long long time). Thanks to @LegalizeAdulthood for instructions! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118743/new/

[PATCH] D135493: [Clang] Support constexpr builtin fmin

2022-10-10 Thread Evgeny Shulgin via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGec3238640440: [Clang] Support constexpr builtin fmin (authored by Izaron). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135493/new/

[PATCH] D122078: [clang-tidy] Ignore concepts in `misc-redundant-expression`

2022-10-08 Thread Evgeny Shulgin via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa8fbd1157deb: [clang-tidy] Ignore concepts in `misc-redundant-expression` (authored by Izaron). Changed prior to commit: https://reviews.llvm.org/D122078?vs=466271=466273#toc Repository: rG LLVM

[PATCH] D122078: [clang-tidy] Ignore concepts in `misc-redundant-expression`

2022-10-08 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 466271. Izaron added a comment. Removed redundant comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122078/new/ https://reviews.llvm.org/D122078 Files:

[PATCH] D122078: [clang-tidy] Ignore concepts in `misc-redundant-expression`

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. Hi! A friendly ping =) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122078/new/ https://reviews.llvm.org/D122078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D135493: [Clang] Support constexpr builtin fmin

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 466193. Izaron added a comment. Aligned slashes in defines Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135493/new/ https://reviews.llvm.org/D135493 Files: clang/docs/LanguageExtensions.rst

[PATCH] D135493: [Clang] Support constexpr builtin fmin

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. This is a mirror of my previous patch about builtin **max**. I promised to make the patch for builtin **min** =) Here: https://reviews.llvm.org/D134369#3806131 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135493/new/

[PATCH] D135493: [Clang] Support constexpr builtin fmin

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: efriedma, jcranmer-intel, aaron.ballman, cor3ntin. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Support constexpr version of __builtin_fmin and

[PATCH] D135486: [Clang] Use C++17 in constant-builtins-fmax.cpp test

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc585a44651f4: [Clang] Use C++17 in constant-builtins-fmax.cpp test (authored by Izaron). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135486/new/

[PATCH] D135486: [Clang] Use C++17 in constant-builtins-fmax.cpp test

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. Thanks, will land the patch after `Build 288902: pre-merge checks` is passed =) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135486/new/ https://reviews.llvm.org/D135486 ___

[PATCH] D135476: [clang-tidy] Support concepts in `bugprone-forwarding-reference-overload`

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron marked an inline comment as done. Izaron added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone/forwarding-reference-overload.rst:54 constructor could hide in this case. We also suppress warnings for constructors -like C3 and C4 that are

[PATCH] D135476: [clang-tidy] Support concepts in `bugprone-forwarding-reference-overload`

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 466175. Izaron added a comment. Follow 80 characters limit. Thanks to @Eugene.Zelenko! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135476/new/ https://reviews.llvm.org/D135476 Files:

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D134369#3843824 , @efriedma wrote: > You might need to explicitly specify -std=c++17 in the RUN line. (That bot > has a different target triple, and I think with that triple the default C++ > standard isn't C++17?) Thanks

[PATCH] D135486: [Clang] Use C++17 in constant-builtins-fmax.cpp test

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. ASAP fix from previous review request, see comment: https://reviews.llvm.org/D134369#3843824 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135486/new/ https://reviews.llvm.org/D135486

[PATCH] D135486: [Clang] Use C++17 in constant-builtins-fmax.cpp test

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: efriedma, jcranmer-intel, aaron.ballman, cor3ntin. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add `-std=c++17` to the test so that buildbot

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. I've got an email about "Buildbot failure" with this link: https://lab.llvm.org/buildbot/#/builders/216/builds/10955 Line 51: 'static_assert' with no message is a C++17 extension Why is it failing if pre-merge checks has been passed? =( Repository: rG LLVM Github

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0edff6faa266: [Clang] Support constexpr builtin fmax (authored by Izaron). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134369/new/

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 466151. Izaron added a comment. Add TODO comment about sNaN. Thanks to @jcranmer-intel! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134369/new/ https://reviews.llvm.org/D134369 Files:

[PATCH] D135476: [clang-tidy] Support concepts in `bugprone-forwarding-reference-overload`

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 466147. Izaron added a comment. Fixes https://github.com/llvm/llvm-project/issues/58230 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135476/new/ https://reviews.llvm.org/D135476 Files:

[PATCH] D135476: [clang-tidy] Support concepts in `bugprone-forwarding-reference-overload`

2022-10-07 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: hokein, aaron.ballman, LegalizeAdulthood, njames93. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber:

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-10-04 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 465106. Izaron added a comment. Fix comment wording. Thanks to @aaron.ballman! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134369/new/ https://reviews.llvm.org/D134369 Files:

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-10-04 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 464990. Izaron added a comment. Fix corner case with pos/neg zeroes Fix tests for pos/neg zeroes with __builtin_copysign Thanks to @efriedma and @jcranmer-intel! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-09-28 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 463715. Izaron added a comment. Rebase and fix windows __float128 failure Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134369/new/ https://reviews.llvm.org/D134369 Files: clang/docs/LanguageExtensions.rst

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-09-28 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:14033-14034 +!EvaluateFloat(E->getArg(1), RHS, Info)) + return false; +if (Result.isNaN() || RHS > Result) + Result = RHS; jcranmer-intel wrote: > If I'm reading

[PATCH] D134207: [Clang] Support case and default labels at end of compound statement

2022-09-21 Thread Evgeny Shulgin 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 rG3285f9a2392f: [Clang] Support case and default labels at end of compound statement (authored by Izaron). Repository: rG LLVM Github Monorepo

[PATCH] D134207: [Clang] Support case and default labels at end of compound statement

2022-09-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 461942. Izaron added a comment. Add helper method `DiagnoseLabelAtEndOfCompoundStatement` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134207/new/ https://reviews.llvm.org/D134207 Files:

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-09-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. This patch is derived from https://reviews.llvm.org/D134136 (which was abandoned due to poor tests and overcomplication) The constexpr version of `fmax` matches the libc realization: the libc realization is here

[PATCH] D134369: [Clang] Support constexpr builtin fmax

2022-09-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: efriedma, cor3ntin, aaron.ballman. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Support constexpr version of __builtin_fmax and its variations.

[PATCH] D134136: [Clang] Support constexpr for builtin fmax, fmin, ilogb, logb, scalbn

2022-09-20 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron abandoned this revision. Izaron added a comment. In D134136#3801495 , @efriedma wrote: > These patches are hard to review, yes; the reviewer has to go through and > verify for each function that the substitutes you've written actually match >

[PATCH] D134207: [Clang] Support case and default labels at end of compound statement

2022-09-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 461347. Izaron added a comment. Fix corresponding FixIt clang test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134207/new/ https://reviews.llvm.org/D134207 Files:

[PATCH] D134136: [Clang] Support constexpr for builtin fmax, fmin, ilogb, logb, scalbn

2022-09-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 461312. Izaron added a comment. Removed whitespaces in comments. P.S. I wonder if smaller review requests will make things better? Say a review request for `fmax`+`fmin`, then a new one for `ilogb`+`logb`, then for `scalbn`. This may lead to a more

[PATCH] D134207: [Clang] Support case and default labels at end of compound statement

2022-09-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:298-299 "and have an empty entry in the selector">; -def err_switch_label_end_of_compound_statement : Error< - "label at end of switch compound statement: expected statement">; def

[PATCH] D134207: [Clang] Support case and default labels at end of compound statement

2022-09-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: clang-language-wg, aaron.ballman, cor3ntin. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Direct continuation of https://reviews.llvm.org/D133887

[PATCH] D133887: [Clang] Support label at end of compound statement

2022-09-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D133887#3799399 , @aaron.ballman wrote: > I can fix up the C++ status page as well if you'd like, or I can hold off if > you're already working on this, it's up to you! Thank you! I'll support empty labels in switch

[PATCH] D133887: [Clang] Support label at end of compound statement

2022-09-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D133887#3799310 , @aaron.ballman wrote: > Thank you for working on this! I spotted an issue where we're not quite > complete with this implementation work. I pushed up a new test case in >

[PATCH] D134136: [Clang] Support constexpr for builtin fmax, fmin, ilogb, logb, scalbn

2022-09-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/test/Sema/constant-builtins-math.cpp:16-17 + +// TODO: investigate why this is `INT_MIN + 1` instead of `INT_MIN` +static_assert(__builtin_ilogb(0.0) == -2147483647); +static_assert(__builtin_ilogb(__builtin_inf()) == 2147483647);

[PATCH] D134136: [Clang] Support constexpr for builtin fmax, fmin, ilogb, logb, scalbn

2022-09-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/test/Sema/constant-builtins-math.cpp:16-17 + +// TODO: investigate why this is `INT_MIN + 1` instead of `INT_MIN` +static_assert(__builtin_ilogb(0.0) == -2147483647); +static_assert(__builtin_ilogb(__builtin_inf()) == 2147483647);

[PATCH] D134136: [Clang] Support constexpr for builtin fmax, fmin, ilogb, logb, scalbn

2022-09-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. libc++ doesn't support constexpr-related patches from C++20 in ``: see issue https://github.com/llvm/llvm-project/issues/55370 I reviewed the code in `` and found out that since we use a dozen of math functions, we need to support more constexpr builtin math function.

[PATCH] D134136: [Clang] Support constexpr for builtin fmax, fmin, ilogb, logb, scalbn

2022-09-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: cor3ntin, aaron.ballman. Herald added a subscriber: hiraditya. Herald added a project: All. Izaron requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. Support constexpr

[PATCH] D133887: [Clang] Support label at end of compound statement

2022-09-17 Thread Evgeny Shulgin 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 rG510383626fe1: [Clang] Support label at end of compound statement (authored by Izaron). Changed prior to commit:

[PATCH] D133887: [Clang] Support label at end of compound statement

2022-09-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 461006. Izaron added a comment. Fix diagnostics for C. Thanks to @cor3ntin and @aaron.ballman! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133887/new/ https://reviews.llvm.org/D133887 Files:

[PATCH] D133887: [Clang] Support label at end of compound statement

2022-09-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. > Why checking getLangOpts().C99 instead of just C There is no `getLangOpts().C`. Here are possible C/C++ opt flags: https://github.com/llvm/llvm-project/blob/7914e53e312074828293356f569d190ac6eae3bd/clang/include/clang/Basic/LangOptions.def#L86-L100 I have no

[PATCH] D122078: [clang-tidy] Ignore concepts in `misc-redundant-expression`

2022-09-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 461003. Izaron added a comment. Fix test with `count 0`, thanks to @njames93 ! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122078/new/ https://reviews.llvm.org/D122078 Files:

[PATCH] D133887: [Clang] Support label at end of compound statement

2022-09-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 461002. Izaron added a comment. Add diagnostics for C language Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133887/new/ https://reviews.llvm.org/D133887 Files: clang/docs/ReleaseNotes.rst

[PATCH] D122078: [clang-tidy] Ignore concepts in `misc-redundant-expression`

2022-09-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 460990. Izaron added a comment. The new file was failing with message CHECK-FIXES, CHECK-MESSAGES or CHECK-NOTES not found in the input So I had to add an additional urrelevant check. I added a check for consteval function (there were no such tests

[PATCH] D133887: [Clang] Support label at end of compound statement

2022-09-17 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. > It should definitely be without warning in C23 mode and give an extension > warning in earlier modes. @aaron.ballman we have this extension warning for pre-C++23: def ext_label_end_of_compound_statement : ExtWarn< "label at end of compound statement is a C++2b

  1   2   >