[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 mail

[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 `CXXConstructExp

[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/ https://reviews.llvm.or

[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] 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 caus

[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 wi

[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 ACTI

[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] 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 https://lists.llvm.org/cg

[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] D145545: [clang][Interp] Fix local variable (destructor) management in loop bodies

2023-03-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 rG243b355ee0f0: [clang][Interp] Support destructors (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D145545?vs=509281&id=50

[PATCH] D141472: [clang][Interp] Add function pointers

2023-03-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 rG3ad167329aaf: [clang][Interp] Implement function pointers (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D141472?vs=5079

[PATCH] D146376: Update static_assert message for redundant cases

2023-03-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:16718 void Sema::DiagnoseStaticAssertDetails(const Expr *E) { - if (const auto *Op = dyn_cast(E)) { + if (const auto *Op = dyn_cast(E);Op && Op->getOpcode() != BO_LOr) { const Expr *LHS = Op->getLH

[PATCH] D141591: [clang][Interp] Properly identify not-yet-defined functions

2023-03-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 rG30f96a8fb451: [clang][Interp] Properly identify not-yet-defined functions (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D141681: [clang][Interp] Fix parameter map when re-visiting function

2023-03-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 rGfce093ccb1c5: [clang][Interp] Fix parameter map when re-visiting function (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org

[PATCH] D141772: [clang][Interp] Fix record initialization via CallExpr subclasses

2023-03-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 rGcef69ce7791f: [clang][Interp] Fix record initialization via CallExpr subclasses (authored by tbaeder). Changed prior to commit: https://reviews.ll

[PATCH] D141784: [clang][Interp] Fix binary comma operators

2023-03-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 rGd29f70670db8: [clang][Interp] Fix binary comma operators (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D141831: [clang][Interp] Fix double-printing in InterpFrame::describe()

2023-03-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 rGd472c55fa28a: [clang][Interp] Fix double-printing InterpFrame::describe() (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org

[PATCH] D142448: [clang][Interp] Handle TypeTraitExprs

2023-03-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 rG8d2899acbcf1: [clang][Interp] Handle TypeTraitExprs (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:

[PATCH] D142617: [clang][Interp] Check This pointer without creating InterpFrame

2023-03-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 rG943ef0642010: [clang][Interp] Check This pointer without creating InterpFrame (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D146376: Update static_assert message for redundant cases

2023-03-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Does `git clang-format HEAD~1` not work on your system? It should only format the changed parts, not everything. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146376/new/ https://reviews.llvm.org/D146376 _

[PATCH] D141497: [clang][Interp] Record initialization via conditional operator

2023-03-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 510180. tbaeder added a comment. Screw it, just use a `llvm::function_ref`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141497/new/ https://reviews.llvm.org/D141497 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCode

[PATCH] D147369: [clang][Interp] Support empty initlist initializers for complex types

2023-03-31 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. Repository: rG LLVM Github Monorepo https://revi

[PATCH] D143480: [clang][Interp] Fix derived-to-base casts for >1 levels

2023-04-03 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 rG968b4172f6a9: [clang][Interp] Fix derived-to-base casts for >1 levels (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D14

[PATCH] D143466: [clang][Interp] Fix initializing base class members

2023-04-03 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 rGdb3dcdc08ce0: [clang][Interp] Fix initializing base class members (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D145841: [clang][Interp] Fix diagnostics for calling non-constexpr constructors

2023-04-03 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG58cf70b2cdc1: [clang][Interp] Fix diagnostics for calling non-constexpr constructors (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D145841?vs=504406&id=510485#toc Repository:

[PATCH] D145860: [clang][Interp] Fix initializing fields after base class members

2023-04-03 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 rG056042d21b72: [clang][Interp] Fix initializing fields after base class members (authored by tbaeder). Changed prior to commit: https://reviews.llv

[PATCH] D144272: [clang][Interp] Ignore StaticAssertDecls

2023-04-03 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 rG192c2c5c8947: [clang][Interp] Ignore StaticAssertDecls (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

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

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

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

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

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

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

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

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

[PATCH] D143334: [clang][Interp] Fix diagnosing uninitialized ctor record arrays

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

[PATCH] D145861: [clang][Interp] Ignore more non-VarDecl declarations

2023-04-04 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 rGee71cbddb77f: [clang][Interp] Ignore more non-VarDecl declarations (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D14586

[PATCH] D147534: [clang][Interp] Make sure we have a variable scope for initializers

2023-04-04 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. Otherwise, we run into an assertion when trying t

[PATCH] D147535: [clang][Interp] Don't create global variables more than once

2023-04-04 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, tahonermann, shafik, erichkeane. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. just because we're being told to evaluate it twic

[PATCH] D147534: [clang][Interp] Make sure we have a variable scope for initializers

2023-04-04 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 510998. tbaeder added a comment. Move the scope and add a test that ensures destruction order of the temporaries. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147534/new/ https://reviews.llvm.org/D147534 Files: clang/lib/AST/Interp/ByteCodeStmtG

[PATCH] D147591: [clang][Interp] Handle CXXTemporaryObjectExprs

2023-04-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 is a CXXConstructExpr, so create a local tem

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-04-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2357-2361 +if (SubobjectDecl) { + Info.FFDiag(DiagLoc, diag::note_constexpr_uninitialized) << SubobjectDecl; + Info.Note(SubobjectDecl->getLocation(), +diag::note_constexpr_su

[PATCH] D147615: [clang][Sema][NFC] Save token name instead of the full token

2023-04-05 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added a reviewer: aaron.ballman. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This makes it a bit clearer why we're saving the token (so no need for the later c

[PATCH] D147621: [clang][Interp] Start handling mutable record members

2023-04-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. Repository: rG LLVM Github Monorepo https://revi

[PATCH] D141497: [clang][Interp] Record initialization via conditional operator

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

[PATCH] D146788: [clang][Interp] Fix zero-initializing of floating types

2023-04-06 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 rG70e5a2a94354: [clang][Interp] Fix zero-initializing of floating types (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LA

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

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

[PATCH] D147840: [clang][Interp] Handle DiscardResult for DeclRef- and ParenExprs

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

[PATCH] D147840: [clang][Interp] Handle DiscardResult for DeclRef- and ParenExprs

2023-04-07 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:240 +return this->emitPop(*T, PE); + } + Next time this pattern shows up, I need to add a convenience function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D147534: [clang][Interp] Make sure we have a variable scope for initializers

2023-04-08 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/AST/Interp/records.cpp:315 + auto T = Test(Arr, Pos); + // End of scope, should destroy Test. +} aaron.ballman wrote: > Would it make sense to give `Test` a constexpr destructor so that we can >

[PATCH] D147615: [clang][Sema][NFC] Save token name instead of the full token

2023-04-08 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG11ad7d2935af: [clang][Sema][NFC] Save token name instead of the full token (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147615/new/

[PATCH] D147845: [clang][Interp] Fix a crash when calling invalid constexpr functions

2023-04-08 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, shafik, erichkeane, tahonermann. 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://revi

[PATCH] D147845: [clang][Interp] Fix a crash when calling invalid constexpr functions

2023-04-08 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 rG1c818b0a4f92: [clang][Interp] Fix a crash when calling invalid constexpr functions (authored by tbaeder). Repository: rG LLVM Github Monorepo CHA

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

2023-04-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. Just putting this here because it's a pretty simple patch as it turns out. Ca

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

2023-04-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:1141 +} + /// Emit a code snippet and caret line. Wrote this just to get things going but I hope there's something better than this...? Repository: rG LLVM Github Monorepo CHA

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

2023-04-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 512024. tbaeder edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Frontend/TextDiagnostic.h clang/lib/Frontend/TextDiagnostic.cpp Index: cla

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

2023-04-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added a comment. Wow, in `FixIt/fixits-function-call`, this output: ./array.cpp:123:3: error: no matching function for call to 'f1' f1(a + 1); ^~ ./array.cpp:114:6: note: candidate function not viable: no known conversion from 'intTy2

[PATCH] D147989: [clang] Fix Attribute Placement

2023-04-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:3424 "attribute %0 is ignored, place it after " - "\"%select{class|struct|interface|union|enum}1\" to apply attribute to " + "\"%select{class|struct|interface|union|enum|enum class}1\

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

2023-04-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 512784. tbaeder set the repository for this revision to rG LLVM Github Monorepo. Herald added a subscriber: MaskRay. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Fil

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

2023-04-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 512785. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Basic/DiagnosticOptions.def clang/include/clang/Basic/DiagnosticOptions.h clang/include/clang/Driver/Options.td clan

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

2023-04-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 512795. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Basic/DiagnosticOptions.def clang/include/clang/Basic/DiagnosticOptions.h clang/include/clang/Driver/Options.td clan

[PATCH] D147888: Update declaration message of extern linkage

2023-04-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/SemaCXX/extern_static.cpp:1 +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -Wabstract-vbase-init +void f(void) That's unnecessary, isn't it? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2023-04-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Since basically nobody has seen multiple snippet lines being printed, we probably need to fix up a bunch of diagnostics afterwards to be more useful, e.g. ./array.cpp:111:5: error: no matching function for call to 'func' 111 | func(1, 2, 3, 4), "hah, reason!")

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

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

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

2023-04-13 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 513144. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang/include/clang/Basic/DiagnosticOptions.def clang/include/clang/Basic/DiagnosticOptions.h clang/include/clang/Driver/Options.td clan

[PATCH] D147534: [clang][Interp] Make sure we have a variable scope for initializers

2023-04-13 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 rG25d6123854d1: [clang][Interp] Make sure we have a variable scope for initializers (authored by tbaeder). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D147535: [clang][Interp] Don't create global variables more than once

2023-04-13 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf508d9b1d4fa: [clang][Interp] Don't create global variables more than once (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147535/new/

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

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

[PATCH] D143334: [clang][Interp] Fix diagnosing uninitialized ctor record arrays

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

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

2023-04-13 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] D144943: [clang][Interp] Implement bitcasts (WIP)

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

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

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

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-04-14 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. So, if I understand the code correctly, we call `CheckEvaluationResult` with `SubObjectDecl=nullptr` when we're not checking an actual field but just an array/record, so we can't run into this problem anyway, so the assert seems fine. I don't fully understand the probl

[PATCH] D148426: [clang][Interp] IntegralComplexToBoolean casts

2023-04-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, tahonermann, erichkeane, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. I wanted to avoid adding too many opcodes for bitin

[PATCH] D148426: [clang][Interp] IntegralComplexToBoolean casts

2023-04-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1165 +return visit(LV); + return false; Since complex types are arrays with two elements, we can't dereference them like normal. This change just ignore the dereference.

[PATCH] D151033: [clang][AST] TextNodeDumper should not evaluate the initializer of constexpr variable template definition

2023-05-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Can you briefly explain why the `FieldDecl` we see is null in that case? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151033/new/ https://reviews.llvm.org/D151033 ___ cfe-commit

[PATCH] D150840: [clang][NFC] Refactor emitSnippet()

2023-05-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Side-note: The `ToPrint` stuff here is just useful to "cache" the output string, isn't it? Is that really useful? I'd expect the output stream to be cached anyway? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150840/new/

[PATCH] D151075: [clang][Diagnostics] Simplify emitSnippet()

2023-05-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added a reviewer: aaron.ballman. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Don't try to minimize the times we invoke operator<< on the output stream by ke

[PATCH] D151075: [clang][Diagnostics] Simplify emitSnippet()

2023-05-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 524216. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151075/new/ https://reviews.llvm.org/D151075 Files: clang/lib/Frontend/TextDiagnostic.cpp Index: clang/lib/Frontend/TextDiagnostic.cpp =

[PATCH] D151078: [clang][Diagnostics] Use llvm::raw_ostream::indent()

2023-05-22 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. TIL that this exists. Repository: rG LLVM Github Monorepo https://reviews

[PATCH] D151078: [clang][Diagnostics] Use llvm::raw_ostream::indent()

2023-05-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:1195-1197 auto indentForLineNumbers = [&] { -if (MaxLineNoDisplayWidth > 0) { - OS << ' '; - for (unsigned I = 0; I != MaxLineNoDisplayWidth; ++I) -OS << ' '; - OS << "

[PATCH] D151078: [clang][Diagnostics] Use llvm::raw_ostream::indent()

2023-05-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 524253. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151078/new/ https://reviews.llvm.org/D151078 Files: clang/lib/Frontend/TextDiagnostic.cpp Index: clang/lib/Frontend/TextDiagnostic.cpp =

[PATCH] D151078: [clang][Diagnostics] Use llvm::raw_ostream::indent()

2023-05-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 524271. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151078/new/ https://reviews.llvm.org/D151078 Files: clang/lib/Frontend/TextDiagnostic.cpp Index: clang/lib/Frontend/TextDiagnostic.cpp =

[PATCH] D151093: [clang][Diagnostic] Simplify emitDiagnosticLoc

2023-05-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, cjdb, clang. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. We don't use the offset returned from SourceManager::getDecomposedLoc

[PATCH] D151094: [clang][wip] Implement P2564 "consteval must propagate up"

2023-05-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/include/clang/AST/Decl.h:2391 + + bool isImmediateFunction() const; + Some documentation on the new API would be useful; seems like most calls to `isConsteval()` should be using `isImmediateFunction()` instead?

[PATCH] D151100: [clang][Diagnostics] Merge byte/column mapping functions into one.

2023-05-22 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. They were both only called from one place and did very similar things. Mer

[PATCH] D151214: [clang][Sema] `-Wshadow` warns about shadowings by static local variables

2023-05-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/docs/ReleaseNotes.rst:295 +- Clang's `-Wshadow` warning now warns about shadowings by static local variables + (`#62850: `_, Repository: rG LLVM Github Mo

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

2023-05-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, cjdb, clang. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. ... emitting them. This makes later code easier to understand, s

[PATCH] D151286: [clang][Diagnostics][NFC] Don't create oversized CaretLine

2023-05-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: clang, 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. Instead of creating a CaretLine the size of the SourceLine, just leav

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

2023-05-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 525010. 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-05-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:124-128 + if (CharSize == 1 && llvm::isLegalUTF8Sequence(Begin, End) && + llvm::sys::locale::isPrint(*Begin)) { +++(*I); +return std::make_pair(SmallString<16>(Begin, End), true); + }

[PATCH] D151300: [clang][Diagnostics][NFC] Remove unnecessary StringRef

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: clang, 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. Seems unnecessary to create a `StringRef` here just so we can drop the

[PATCH] D151300: [clang][Diagnostics][NFC] Remove unnecessary StringRef

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 525031. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151300/new/ https://reviews.llvm.org/D151300 Files: clang/lib/Frontend/TextDiagnostic.cpp Index: clang/lib/Frontend/TextDiagnostic.cpp =

[PATCH] D151301: [clang][Diagnostics] Print empty lines in multiline snippets

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: clang, 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. We should preserve empty lines in output snippets. Repository: rG L

[PATCH] D151301: [clang][Diagnostics] Print empty lines in multiline snippets

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/Misc/diag-style.cpp:10 +// CHECK-NEXT: {{^}} | ^~~~{{$}} +// CHECK-NEXT: {{^}}5 | {{$}} +// CHECK-NEXT: {{^}}6 | true, "");{{$}} Questionable whether the space afte

[PATCH] D151301: [clang][Diagnostics] Print empty lines in multiline snippets

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 525050. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151301/new/ https://reviews.llvm.org/D151301 Files: clang/lib/Frontend/TextDiagnostic.cpp clang/test/Misc/diag-style.cpp Index: clang/test/Misc/diag-style.cpp ===

[PATCH] D151301: [clang][Diagnostics] Print empty lines in multiline snippets

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:1246 // line from what the user is intended to see. -if (DiagOpts->ShowSourceRanges) { +if (DiagOpts->ShowSourceRanges && !SourceLine.empty()) { SourceLine = ' ' + SourceLine; ---

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

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:124-128 + if (CharSize == 1 && llvm::isLegalUTF8Sequence(Begin, End) && + llvm::sys::locale::isPrint(*Begin)) { +++(*I); +return std::make_pair(SmallString<16>(Begin, End), true); + }

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

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:124-128 + if (CharSize == 1 && llvm::isLegalUTF8Sequence(Begin, End) && + llvm::sys::locale::isPrint(*Begin)) { +++(*I); +return std::make_pair(SmallString<16>(Begin, End), true); + }

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

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 525094. 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] D151300: [clang][Diagnostics][NFC] Remove unnecessary StringRef

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D151300#4367884 , @aaron.ballman wrote: > LGTM, but it's worth noting that `std::string::pop_back()` calls `erase()` > and there's no guarantee that there's not an extra allocation involved as a > result. However, I've not s

[PATCH] D151300: [clang][Diagnostics][NFC] Remove unnecessary StringRef

2023-05-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D151300#4367943 , @aaron.ballman wrote: > In D151300#4367939 , @tbaeder wrote: > >> In D151300#4367884 , >> @aaron.ballman wrote: >> >>> LGTM

[PATCH] D148614: [clang][Interp] Add frame depth checking

2023-05-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.cpp:345-352 + if ((S.Current->getDepth() + 1) > S.getLangOpts().ConstexprCallDepth) { +S.FFDiag(S.Current->getSource(OpPC), + diag::note_constexpr_depth_limit_exceeded) +<< S.getLangOp

<    12   13   14   15   16   17   18   19   20   21   >