[PATCH] D153695: [clang][Interp] Fix passing parameters of composite type

2023-07-04 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 3 inline comments as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeEmitter.h:71 - /// Parameter indices. - llvm::DenseMap Params; + /// Parameter indices. > + llvm::DenseMap Params; shafik wrote: > I don't

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

2023-07-04 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

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

2023-07-04 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/D153693/new/ https://reviews.llvm.org/D153693 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D154290: [WIP][Clang] Implement P2741R3 - user-generated static_assert messages

2023-07-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:16384 + Expr *SizeExpression, + Expr *PtrExpression, ASTContext , + EvalResult ) const {

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

2023-06-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fix a FIXME from an earlier commit. Repository:

[PATCH] D147888: Update declaration message of extern linkage

2023-06-30 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/D147888/new/ https://reviews.llvm.org/D147888 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2023-06-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:4003-4004 + // that are not referenced or used later. e.g.: if (int var = init()); + ConditionVar->setReferenced(false); + ConditionVar->setIsUsed(false); + shafik wrote: > That seem a

[PATCH] D153849: [clang][Diagnostics] Fix diagnostic line numbers

2023-06-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 rG8554a55d041f: [clang][Diagnostics] Fix diagnostic line numbers (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2023-06-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1115 + // all field and bases explicitly. + if (E->requiresZeroInitialization() && Ctor->isTrivial()) { +assert(E->getType()->isRecordType()); I briefly talked about this

[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-06-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. @cjdb I know this is kind of silly after @hazohelet has already added it to the release notes... but it seems like showing the difference is useless since the difference was only introduced during the clang 17 development.(?) For a 16 -> 17 transition, it probably

[PATCH] D153849: [clang][Diagnostics] Fix diagnostic line numbers

2023-06-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. @cor3ntin Thanks. You're very close to getting on my default reviewer list though, so be careful ;) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153849/new/ https://reviews.llvm.org/D153849

[PATCH] D153849: [clang][Diagnostics] Fix diagnostic line numbers

2023-06-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. That works as well as far as I know, but I changed it locally to just use the issue ID anyway. Could you set the status to accepted? Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153849/new/

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

2023-06-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Unify `CXXTemporaryObjectExpr` and

[PATCH] D153689: [clang][Interp] Handle CXXConstructExprs

2023-06-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. I think this makes https://reviews.llvm.org/D153653 unnecessary(?) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153689/new/ https://reviews.llvm.org/D153689 ___ cfe-commits

[PATCH] D153653: [clang][Interp] Make CXXTemporaryObjectExprs leave a value behind

2023-06-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1022 + +if (DiscardResult) + return this->emitPopPtr(E); shafik wrote: > Could you just pass `DiscardResult` to `visitLocalInitializer` Nope, the `visitInitializer`

[PATCH] D153969: [clang][ExprConstant] Fix crash on uninitialized base class subobject

2023-06-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2422 + << BS.getType(); + Info.Note(BS.getBeginLoc(), diag::note_constexpr_base_inherited_here); + return false; Can you pass `<< BS.getSourceRange()` here?

[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions

2023-06-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Analysis/ThreadSafety.cpp:2436 +CF.getVarDecl()->getLocation()); + break; +} aaronpuchert wrote: > aaronpuchert wrote: > > tbaeder wrote: > > > This handles

[PATCH] D153001: [clang][ThreadSafety] Add __builtin_instance_member (WIP)

2023-06-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Didn't remember and re-checked, using it that way makes the implementation harder I think: tsa2.c:7:54: error: incomplete definition of type 'struct Mutex' 7 | int counter GUARDED_BY(__builtin_instance_member(M)->M); |

[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions

2023-06-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 534982. tbaeder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152504/new/ https://reviews.llvm.org/D152504 Files: clang/include/clang/Analysis/CFG.h clang/lib/Analysis/CFG.cpp

[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions

2023-06-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 2 inline comments as done. tbaeder added inline comments. Comment at: clang/test/Sema/warn-thread-safety-analysis.c:76-77 +void cleanup_int(int *unused) __attribute__((release_capability(mu1))) { + (void)unused; + mutex_exclusive_unlock();

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

2023-06-27 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/D153241/new/ https://reviews.llvm.org/D153241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D153849: [clang][Diagnostics] Fix diagnostic line numbers

2023-06-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: cjdb, aaron.ballman. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The first line of the code snippet we print is potentially lower than the

[PATCH] D144164: [clang][Interp] Handle PtrMemOps

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

[PATCH] D153695: [clang][Interp] Fix passing parameters of composite type

2023-06-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. We pass these as pointers, so we need to be

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

2023-06-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. They might appear freestanding, not as part of

[PATCH] D153653: [clang][Interp] Make CXXTemporaryObjectExprs leave a value behind

2023-06-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 534174. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153653/new/ https://reviews.llvm.org/D153653 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/records.cpp Index: clang/test/AST/Interp/records.cpp

[PATCH] D153689: [clang][Interp] Handle CXXConstructExprs

2023-06-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes a so far broken Lambda test case.

[PATCH] D153653: [clang][Interp] Make CXXTemporaryObjectExprs leave a value behind

2023-06-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. visitLocalInitializer() pops the pointer from

[PATCH] D153649: [clang][Interp] Fix return statements with expresssion in void functions

2023-06-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 534021. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153649/new/ https://reviews.llvm.org/D153649 Files: clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/test/AST/Interp/functions.cpp Index: clang/test/AST/Interp/functions.cpp

[PATCH] D153649: [clang][Interp] Fix return statements with expresssion in void functions

2023-06-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. If the return type of a function is void,

[PATCH] D153536: [Clang] Implement P2169 A nice placeholder with no name

2023-06-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/Lexer/unicode.c:30 -int _; +int a; Are these changes only for the case where we compile as c++? I know lots of C (and c++?) projects use `_` as GNU gettext identifier to mark a translatable

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

2023-06-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. 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 initialization of a lambda

[PATCH] D153001: [clang][ThreadSafety] Add __builtin_instance_member (WIP)

2023-06-23 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/D153001/new/ https://reviews.llvm.org/D153001 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2023-06-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 533238. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153276/new/ https://reviews.llvm.org/D153276 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/Interp/Disasm.cpp

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

2023-06-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:1854 + S.FFDiag(Loc, diag::note_constexpr_invalid_cast) + << static_cast(Kind) << S.Current->getRange(OpPC); + return false; aaron.ballman wrote: > Should this be doing the cast? The

[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions

2023-06-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Added a new element for cleanup functions. Comment at: clang/lib/Analysis/ThreadSafety.cpp:2436 +CF.getVarDecl()->getLocation()); + break; +} This handles the function call, but

[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions

2023-06-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 533175. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152504/new/ https://reviews.llvm.org/D152504 Files: clang/include/clang/Analysis/CFG.h clang/lib/Analysis/CFG.cpp clang/lib/Analysis/ThreadSafety.cpp

[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-06-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Can you post a before/after comparison of the exact output for that example? Comment at: clang/lib/Sema/SemaOverload.cpp:10752 QualType ToTy = Conv.Bad.getToType(); + ParmVarDecl *ToPVD = !isObjectArgument ? Fn->getParamDecl(I) : nullptr;

[PATCH] D153267: [clang][Diagnostics] Provide parameter source range to arity-mismatch notes

2023-06-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. LGTM but let's wait for a second opinion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153267/new/ https://reviews.llvm.org/D153267 ___ cfe-commits mailing list

[PATCH] D152548: [Clang][Interp] Diagnose uninitialized ctor of global record arrays

2023-06-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder accepted this revision. tbaeder added a comment. This revision is now accepted and ready to land. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152548/new/ https://reviews.llvm.org/D152548 ___ cfe-commits mailing list

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

2023-06-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add a new `InvalidCast` op for this purpose and

[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions

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

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

2023-06-19 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

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

2023-06-18 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, shafik, hazohelet, cjdb. 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

[PATCH] D148689: [clang][Interp] Handle PredefinedExprs

2023-06-16 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 rG1e9ac717877b: [clang][Interp] Handle PredefinedExprs (authored by tbaeder). Changed prior to commit:

[PATCH] D149846: [clang][Interp] Check inc/dec family of ops for initialization

2023-06-16 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 rG459f495f49a1: [clang][Interp] Check inc/dec family of ops for initialization (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D146030: [clang][Interp] Handle LambdaExprs

2023-06-16 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG461f91b1e4ef: [clang][Interp] Handle LambdaExprs (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146030/new/

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

2023-06-16 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

[PATCH] D144164: [clang][Interp] Handle PtrMemOps

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

[PATCH] D152525: [clang][Diagnostics] Don't expand label fixit to the next line

2023-06-15 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb1aba4a10099: [clang][Diagnostics] Dont expand label fixit to the next line (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D152525?vs=529922=531737#toc Repository: rG LLVM

[PATCH] D152548: [Clang][Interp] Diagnose uninitialized ctor of global record arrays

2023-06-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/AST/Interp/cxx20.cpp:177 + // ref-note {{subobject 'f' is not initialized}} + We usually have a space after the `;` and keep the comments aligned on the `//`. Repository: rG LLVM

[PATCH] D142630: [clang][Interp] Implement virtual function calls

2023-06-15 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG976d8b40cccf: [clang][Interp] Virtual function calls (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D142630?vs=527336=531697#toc Repository: rG LLVM Github Monorepo

[PATCH] D153001: [clang][ThreadSafety] Add __builtin_instance_member (WIP)

2023-06-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaronpuchert, NoQ, aaron.ballman. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. As discussed in

[PATCH] D152818: [Clang] Fix assertion when pragma FENV_ACCESS is used with a throw function.

2023-06-13 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D152818#4417649 , @zahiraam wrote: > In D152818#4417644 , @tbaeder wrote: > >> Has the test case been obfuscated on purpose? > > This is a smaller reproducible from creduce. Didn't

[PATCH] D152818: [Clang] Fix assertion when pragma FENV_ACCESS is used with a throw function.

2023-06-13 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Has the test case been obfuscated on purpose? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152818/new/ https://reviews.llvm.org/D152818 ___ cfe-commits mailing list

[PATCH] D152796: [clang][Sema] Fix diagnostic message for unused constant varialbe templates

2023-06-13 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder accepted this revision. tbaeder added a comment. This revision is now accepted and ready to land. Makes sense. LGTM provided precommit CI comes back green. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152796/new/

[PATCH] D152707: [clang][Sema] Provide source range to several Wunused warnings

2023-06-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/Misc/diag-unused-source-ranges.h:1 +static void thing(void) {} Moving this file to `Inputs/` would make sense I think. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D152707: [clang][Sema] Provide source range to several Wunused warnings

2023-06-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Precommit-CI also found some problems on Windows Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152707/new/ https://reviews.llvm.org/D152707 ___ cfe-commits mailing list

[PATCH] D152707: [clang][Sema] Provide source range to several Wunused warnings

2023-06-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/Misc/diag-unused-source-ranges.cpp:1 +// RUN: %clang -fsyntax-only -Wunused -Wunused-template -Wunused-exception-parameter -Wunused-member-function -fdiagnostics-print-source-range-info %s 2>&1 | FileCheck %s

[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines= as a driver option

2023-06-12 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. tbaeder marked an inline comment as done. Closed by commit rG5cc721b3f96e: [clang][Driver] Add -fcaret-diagnostics-max-lines= as a driver option (authored by tbaeder).

[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines= as a driver option

2023-06-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/include/clang/Driver/Options.td:2303 + Group, Flags<[NoXarchOption, CC1Option, CoreOption]>, + HelpText<"Set the maximum number of source lines to show in a caret diagnostic">, +

[PATCH] D142630: [clang][Interp] Implement virtual function calls

2023-06-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/AST/Interp/records.cpp:650 +}; +#endif aaron.ballman wrote: > We should also have test cases for calling virtual functions from within a > constructor and a destructor, as that has special semantics. e.g.,

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-06-10 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 530177. tbaeder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152246/new/ https://reviews.llvm.org/D152246 Files: clang/lib/Analysis/ThreadSafety.cpp Index: clang/lib/Analysis/ThreadSafety.cpp

[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions

2023-06-10 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:1945 + auto DRE = + DeclRefExpr::Create(*Context, {}, {}, VD, false, SourceLocation(), + VD->getType(), VK_PRValue); NoQ wrote: > Is there a way to

[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions

2023-06-10 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 530175. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152504/new/ https://reviews.llvm.org/D152504 Files: clang/lib/Analysis/CFG.cpp clang/test/Sema/warn-thread-safety-analysis.c Index: clang/test/Sema/warn-thread-safety-analysis.c

[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines as a driver option

2023-06-10 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 530168. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152090/new/ https://reviews.llvm.org/D152090 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Driver/Options.td clang/lib/Driver/ToolChains/Clang.cpp

[PATCH] D150843: [clang][Diagnostics] Refactor printableTextForNextCharacter

2023-06-10 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6669dc09a441: [clang][NFC] Refactor printableTextForNextCharacter (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D150843?vs=529170=530160#toc Repository: rG LLVM Github

[PATCH] D150358: [clang][Interp] Remove args from called functions in more cases

2023-06-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a subscriber: MaskRay. tbaeder added inline comments. Comment at: clang/test/AST/Interp/functions.cpp:262 +namespace CallWithArgs { + /// This used to call problems during checkPotentialConstantExpression() runs. + constexpr void g(int a) {}

[PATCH] D152525: [clang][Diagnostics] Don't expand label fixit to the next line

2023-06-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. As far as the fixit goes, I guess the previous version was better, since it didn't leave an empty line behind? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152525/new/ https://reviews.llvm.org/D152525

[PATCH] D144943: [clang][Interp] Implement bitcasts (WIP)

2023-06-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Yes, FWIW I looked into this again last week and noticed a few unsolved problems as well. I'll post a comment once I consider it ready for actual review. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144943/new/ https://reviews.llvm.org/D144943

[PATCH] D152525: [clang][Diagnostics] Don't expand label fixit to the next line

2023-06-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, cjdb. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Now that we print >1 line of code snippet, we printed another line of

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

2023-06-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/CodeGen/CGExpr.cpp:2852 - "Should not use decl without marking it used!"); - if (ND->hasAttr()) { Question for other reviewers: If we want to keep this assertion, would it instead make sense to

[PATCH] D152504: [clang][ThreadSafety] Analyze cleanup functions

2023-06-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: NoQ, aaron.ballman, krememek, dergachev.a, MikeStump. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When a declaration has a cleanup function

[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines as a driver option

2023-06-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 529832. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152090/new/ https://reviews.llvm.org/D152090 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Driver/Options.td clang/lib/Driver/ToolChains/Clang.cpp

[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines as a driver option

2023-06-08 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/test/Driver/caret-diagnostics-max-lines.cpp:1 +//RUN: not %clang++ -fsyntax-only -fcaret-diagnostics-max-lines=2 %s 2>&1 | FileCheck %s -strict-whitespace + MaskRay

[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines as a driver option

2023-06-08 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 529818. tbaeder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152090/new/ https://reviews.llvm.org/D152090 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Driver/Options.td

[PATCH] D152093: [clang][Analysis] Handle && and || against variable and its negation as tautology

2023-06-08 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:1113-1114 + +const BinaryOperator *LHS = dyn_cast(LHSExpr); +const BinaryOperator *RHS = dyn_cast(RHSExpr); if (!LHS || !RHS) Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D150843: [clang][Diagnostics] Refactor printableTextForNextCharacter

2023-06-07 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 529170. tbaeder marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150843/new/ https://reviews.llvm.org/D150843 Files: clang/lib/Frontend/TextDiagnostic.cpp Index: clang/lib/Frontend/TextDiagnostic.cpp

[PATCH] D150843: [clang][Diagnostics] Refactor printableTextForNextCharacter

2023-06-07 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D150843#4401189 , @tahonermann wrote: > The summary states that the changes are not quite NFC. In that case, we would > ideally have a test that demonstrates the changed behavior. Would adding such > a test be challenging?

[PATCH] D152093: [clang][Analysis] Handle && and || against variable and its negation as tautology

2023-06-06 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Added some more reviewers based on lines owned in `CFG.cpp`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152093/new/ https://reviews.llvm.org/D152093 ___ cfe-commits mailing

[PATCH] D152246: [clang][ThreadSafety] Analyze known function pointer values

2023-06-06 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: delesley, aaronpuchert, Eugene.Zelenko, aaron.ballman. Herald added a reviewer: NoQ. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When we're

[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines as a driver option

2023-06-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D152090#4395827 , @MaskRay wrote: > `def fcaret_diagnostics_max_lines` in `Options.td` has the `NoDriverOption` > flag. Move it to other places with `BooleainFFlag` should work. > Then in `Clang.cpp` you can just write

[PATCH] D150843: [clang][Diagnostics] Refactor printableTextForNextCharacter

2023-06-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping @tahonermann CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150843/new/ https://reviews.llvm.org/D150843 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D151833: Respect "-fdiagnostics-absolute-paths" on emit include location

2023-06-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. @charmitro do you have commit rights or do you need someone to push on your behalf? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151833/new/ https://reviews.llvm.org/D151833 ___ cfe-commits mailing list

[PATCH] D151833: Respect "-fdiagnostics-absolute-paths" on emit include location

2023-06-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added subscribers: cjdb, aaron.ballman. tbaeder added a comment. LGTM, but maybe wait for a response from @aaron.ballman or @cjdb CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151833/new/ https://reviews.llvm.org/D151833 ___

[PATCH] D152140: [Clang] Limit FunctionTypeExtraBitfields::NumExceptionType to 16 bits.

2023-06-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/include/clang/AST/Type.h:3956 /// [implimits] 8 bits would be enough here. -unsigned NumExceptionType = 0; +unsigned NumExceptionType : 16; + Isn't using a `uint16_t` preferred over a bitfield?

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

2023-06-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This used to crash the interpreter, either

[PATCH] D151833: Respect "-fdiagnostics-absolute-paths" on emit include location

2023-06-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/Frontend/absolute-paths.c:6 +// NORMAL: In file included from [[ROOT_ABSOLUTE]]:4: +// ABSOLUTE: In file included from [[ROOT_ABSOLUTE]]:4: charmitro wrote: > tbaeder wrote: > > charmitro wrote: > > >

[PATCH] D147875: [clang][Diagnostics] Show line numbers when printing code snippets

2023-06-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. @hans @dyung I've opened https://reviews.llvm.org/D152090 which should fix both of your concerns. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875

[PATCH] D152090: [clang][Driver] Add -fcaret-diagnostics-max-lines as a driver option

2023-06-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, MaskRay. 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.llvm.org/D152090

[PATCH] D147875: [clang][Diagnostics] Show line numbers when printing code snippets

2023-06-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/docs/ReleaseNotes.rst:290 + number of code lines it prints has been increased from 1 to 16. This + can be controlled using ``-fcaret-diagnostics-max-lines=``. dyung wrote: > Is this correct? I notice that all

[PATCH] D151833: Respect "-fdiagnostics-absolute-paths" on emit include location

2023-06-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/Frontend/absolute-paths.c:6 +// NORMAL: In file included from [[ROOT_ABSOLUTE]]:4: +// ABSOLUTE: In file included from [[ROOT_ABSOLUTE]]:4: charmitro wrote: > tbaeder wrote: > > charmitro wrote: > > >

[PATCH] D151833: Respect "-fdiagnostics-absolute-paths" on emit include location

2023-06-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/Frontend/absolute-paths.c:6 +// NORMAL: In file included from [[ROOT_ABSOLUTE]]:4: +// ABSOLUTE: In file included from [[ROOT_ABSOLUTE]]:4: charmitro wrote: > tbaeder wrote: > > This checks the same thing

[PATCH] D147875: [clang][Diagnostics] Show line numbers when printing code snippets

2023-06-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/docs/UsersManual.rst:578 + +.. option:: -fcaret-diagnostics-max-lines: + hans wrote: > I think this is still a cc1-only option. Should it be made available as a > driver option now? No strong opinion from my

[PATCH] D151833: Respect "-fdiagnostics-absolute-paths" on emit include location

2023-06-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/Frontend/absolute-paths.c:6 +// NORMAL: In file included from [[ROOT_ABSOLUTE]]:4: +// ABSOLUTE: In file included from [[ROOT_ABSOLUTE]]:4: This checks the same thing in both cases, but in the `NORMAL`

[PATCH] D151215: [clang][Diagnostics] Split source ranges into line ranges before...

2023-06-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 527766. tbaeder added a comment. @cor3ntin I added changes to the two brackets tests in `test/Parser/`. They look like an improvement to me, but maybe there's something I'm missing, so please have a quick look. CHANGES SINCE LAST ACTION

[PATCH] D151215: [clang][Diagnostics] Split source ranges into line ranges before...

2023-06-02 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 rGfc1262bd58ac: [clang][Diagnostics] Split source ranges into line ranges before... (authored by tbaeder). Changed prior to commit:

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

2023-06-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Pointer.cpp:10 #include "Pointer.h" +#include "Boolean.h" +#include "Context.h" shafik wrote: > Are all these headers really needed for the change below? We access `.toAPValue()` on all of them in

[PATCH] D144164: [clang][Interp] Handle PtrMemOps

2023-06-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 527346. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144164/new/ https://reviews.llvm.org/D144164 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/Context.cpp clang/lib/AST/Interp/Interp.h

[PATCH] D144164: [clang][Interp] Handle PtrMemOps

2023-06-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Context.cpp:122 + T->isFunctionProtoType() || + T->isSpecificBuiltinType(BuiltinType::BoundMember)) +return PT_FnPtr; aaron.ballman wrote: > Do you have test coverage for the bound

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