[PATCH] D150364: [clang][Interp] Add 'Unsupported' opcode and use it for throw stmts

2023-05-11 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. As discussed the other day. This fixes the diagnost

[PATCH] D150364: [clang][Interp] Add 'Unsupported' opcode and use it for throw stmts

2023-05-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D150364#4335221 , @aaron.ballman wrote: > "Unsupported" is a bit of a loaded term -- it could mean "this operation is > not supported, YET" or it could mean "this operation is not and will not be > supported, EVER". Perhaps

[PATCH] D150364: [clang][Interp] Add 'Unsupported' opcode and use it for throw stmts

2023-05-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 521346. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150364/new/ https://reviews.llvm.org/D150364 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/I

[PATCH] D149816: [clang][Interp] Implement __builtin_strcmp

2023-05-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/InterpBuiltin.cpp:22-23 + +static bool interp__builtin_strcmp(InterpState &S, CodePtr OpPC, + InterpFrame *Frame) { + const Pointer &A = getParam(Frame, 0); aaron.b

[PATCH] D150364: [clang][Interp] Add 'Unsupported' opcode and use it for throw stmts

2023-05-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D150364#4335282 , @aaron.ballman wrote: > In D150364#4335261 , @tbaeder wrote: > >> In D150364#4335221 , >> @aaron.ballman wrote: >> >>> "Uns

[PATCH] D150364: [clang][Interp] Add 'Unsupported' opcode and use it for throw stmts

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

[PATCH] D150364: [clang][Interp] Add 'Invalid' opcode and use it for throw/asm stmts

2023-05-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/AST/Interp/records.cpp:341 + +/// FIXME: Wrong source location below. +return 12; // expected-note {{in call to '&S{}->~S()'}} aaron.ballman wrote: > Oh interesting -- does the old constexpr interprete

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

2023-05-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 521574. tbaeder marked 3 inline comments as done. 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/Byt

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

2023-05-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:1560 + // is the furthest we might go up in the hierarchy. + ThisPtr = ThisPtr.getDeclPtr(); +} Just so I don't forget: The assignment to `ThisPtr` here is dead. Repository:

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-12 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:2187 else - SemaRef.Diag(TypoLoc, DiagnosticID) << Typo; + SemaRef.Diag(TypoRange.getEnd(), DiagnosticID) << Typo; return; aaron.ballman wrote: > tbaeder wrote: > > I'm not

[PATCH] D149133: [clang][Interp] BaseToDerived casts

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

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

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

[PATCH] D149550: [clang][Interp] Fix compound assign operator evaluation order

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

[PATCH] D150191: [clang][Diagnostics] Provide a source range for 'use of undeclared identifier' diagnostics

2023-05-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder abandoned this revision. tbaeder added a comment. Abandoning this. The code in question was dead before as far as I can tell, since the `Ranges` list was always empty. I can't add this without regressing any of the existing tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D150566: [clang] Provide source range to 'invalid subexpr in const expr' diags

2023-05-15 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D150566 Files

[PATCH] D137706: [clang][Interp] Implement IntegralToPointer casts

2023-05-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder abandoned this revision. tbaeder added a comment. I've already abandoned this locally, pretty sure I'll end up taking another approach. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137706/new/ https://reviews.llvm.org/D137706 ___ cf

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

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

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

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

[PATCH] D150040: [clang][Interp] Call invalid destructors

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

[PATCH] D150111: [clang][Interp] Implement lambda static invokers

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

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

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

[PATCH] D150654: [clang][Interp] ComplexFloatingToBoolean casts

2023-05-16 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] D150661: [clang][Interp] Allow evaluating standalone composite expressions

2023-05-16 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 reach visitExpr() when evaluating standalone e

[PATCH] D150661: [clang][Interp] Allow evaluating standalone composite expressions

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

[PATCH] D150661: [clang][Interp] Allow evaluating standalone composite expressions

2023-05-16 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:2287 +return true; } case UO_Imag: { // __imag x I added these changes to make the test work, but they are thematically different from the purpose of this patch. Howev

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

2023-05-16 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 522580. tbaeder marked 7 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp clang-tools

[PATCH] D150111: [clang][Interp] Implement lambda static invokers

2023-05-16 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeEmitter.cpp:100-103 + bool IsEligibleForCompilation = + FuncDecl->isConstexpr() || + (isa(FuncDecl) && + cast(FuncDecl)->isLambdaStaticInvoker()); aaron.ballman wrote: > I do

[PATCH] D150111: [clang][Interp] Implement lambda static invokers

2023-05-16 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 522587. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150111/new/ https://reviews.llvm.org/D150111 Files: clang/lib/AST/Interp/ByteCodeEmitter.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.h clang/lib/AST/I

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

2023-05-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 rGe2917311f026: [clang] Show line numbers in diagnostic code snippets (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D1478

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

2023-05-17 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. Rename parameters and local variables and reorder things a bit to be closer to the

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

2023-05-17 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, tahonermann. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Rename parameters and local variables to start with an uppercase charac

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

2023-05-17 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:120 - begin = reinterpret_cast(&*(SourceLine.begin() + *i)); - end = begin + (SourceLine.size() - *i); - I don't know what this computation of `end` means, but from the debug outpu

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

2023-05-18 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/TextDiagnostic.cpp:121 + unsigned CharSize = llvm::getNumBytesForUTF8(*Begin); + const unsigned char *End = Begin + CharSize; tahonermann wrote: > This could assign `End` to a location past the end

[PATCH] D150946: [clang][Interp] PointerToIntegral casts

2023-05-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 opcode doing the cast and emit a diagnost

[PATCH] D150946: [clang][Interp] PointerToIntegral casts

2023-05-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Hm, this works for pointers, but not for function pointers (which we map to `FunctionPointer`). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150946/new/ https://reviews.llvm.org/D150946 __

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

2023-04-18 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. There was already //some// form of this, but it was

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

2023-04-18 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 514572. 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] D148601: [Clang] Handle Error message to output proper Prefix

2023-04-18 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. I am not 100% sure about the semantics of passing multiple prefixes, i.e. if the error is emitted for all prefixes individually or if it's only emitted if no `expected` line for any of the prefixes is found. In the latter case we should probably add all the prefixes to

[PATCH] D148601: [Clang] Handle Error message to output proper Prefix

2023-04-18 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Frontend/VerifyDiagnosticConsumer.cpp:1097 // source file(s) processed. +const auto &Prefixes = Diags.getDiagnosticOptions().VerifyPrefixes; if (Status == HasNoDirectives) { Can move this line ins

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

2023-04-18 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 514826. tbaeder added a comment. Move things around a bit and add some `+ 1`s to get matching diagnostic output with the current interpreter. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148614/new/ https://reviews.llvm.org/D148614 Files: clang

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

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

[PATCH] D148690: [clang][Interp] Handle __extension__ unary operators

2023-04-19 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. AFAIK this is just used to suppress warnings, so ig

[PATCH] D148690: [clang][Interp] Handle __extension__ unary operators

2023-04-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/AST/Interp/literals.cpp:791 +#endif return __FUNCTION__[index]; } It's weird that the above two statements warn about using `__FUNCTION__` and the return statement doesn't. Repository: rG LLVM Git

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

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

[PATCH] D148696: [clang][Sema][NFC] Sprinkle some const around in Sema

2023-04-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. NFC but uploading for review for the pre-commit CI and maybe some actual rev

[PATCH] D148696: [clang][Sema][NFC] Sprinkle some const around in Sema

2023-04-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 514878. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148696/new/ https://reviews.llvm.org/D148696 Files: clang/include/clang/AST/DeclarationName.h clang/include/clang/Sema/Sema.h clang/lib/AST/DeclarationName.cpp clang/lib/Sema/Sema.cpp cl

[PATCH] D148696: [clang][Sema][NFC] Sprinkle some const around in Sema

2023-04-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 514933. Herald added a reviewer: jdoerfert. Herald added subscribers: jplehr, sstefan1. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148696/new/ https://reviews.llvm.org/D148696 Files: clang/include/clang/AST/DeclarationName.h clang/include/clan

[PATCH] D148690: [clang][Interp] Handle __extension__ unary operators

2023-04-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/AST/Interp/literals.cpp:791 +#endif return __FUNCTION__[index]; } erichkeane wrote: > tbaeder wrote: > > It's weird that the above two statements warn about using `__FUNCTION__` > > and the return sta

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

2023-04-19 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 514954. 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] D148696: [clang][Sema][NFC] Sprinkle some const around in Sema

2023-04-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 5 inline comments as done. tbaeder added inline comments. Comment at: clang/lib/Sema/SemaLookup.cpp:1337 if (S->isClassScope()) -if (CXXRecordDecl *Record = -dyn_cast_or_null(S->getEntity())) +if (auto *Record = dyn_cast_if_pr

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

2023-04-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 515242. tbaeder added a comment. Fix all existing tests 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/DiagnosticOption

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

2023-04-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. CCing @njames93 since I have no idea how to properly fix the clang-tidy test failures. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 ___ cfe-commits mailing list cfe-commi

[PATCH] D148696: [clang][Sema][NFC] Sprinkle some const around in Sema

2023-04-20 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 rG80fda7a34663: [clang][Sema][NFC] Make a bunch of things const if possible (authored by tbaeder). Changed p

[PATCH] D148901: [clang][Interp] Fix post-inc/dec operator result

2023-04-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, taramana, erichkeane, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. We pushed the wrong value on the stack, always leavi

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

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

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

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

2023-04-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 515659. 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-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 515660. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147840/new/ https://reviews.llvm.org/D147840 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/literals.cpp Index: clang/test/AST/Interp/literals.cpp

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

2023-04-21 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-21 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-21 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] D142630: [clang][Interp] Implement virtual function calls

2023-04-21 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] D148925: Fix discarding void-typed comma expressions

2023-04-21 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. First, we need to handle void types in `visitExpr`,

[PATCH] D148925: Fix discarding void-typed comma expressions

2023-04-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 515762. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148925/new/ https://reviews.llvm.org/D148925 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/literals.cpp Index: clang/test/AST/Interp/literals.cpp

[PATCH] D148925: Fix discarding void-typed comma expressions

2023-04-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D148925#4287218 , @erichkeane wrote: > So things cast to 'void' can have side effects, right? Does the call to > discard still evaluate them? > > https://godbolt.org/z/a3ej9bxKe Yes. `discard(E)` is just `visit(E)`, except

[PATCH] D148925: [clang][Interp] Fix discarding void-typed comma expressions

2023-04-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 515800. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148925/new/ https://reviews.llvm.org/D148925 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/literals.cpp Index: clang/test/AST/Interp/literals.cpp

[PATCH] D148925: [clang][Interp] Fix discarding void-typed comma expressions

2023-04-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D148925#4287502 , @erichkeane wrote: > Cool! Mind adding the tests I proposed? it would be nice to ensure/show > side-effects are guaranteed. Sure, thanks for the test case! CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D148981: [clang][Interp] PointerToBoolean casts

2023-04-21 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. Just emit `p != nullptr` for this. Repository:

[PATCH] D148982: [clang][Interp] Fix ignoring conditional operators

2023-04-22 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] D148987: [clang][Interp] Check Neg ops for errors

2023-04-22 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. I'm not sure what to do with the float case here, m

[PATCH] D149000: Update with warning message for comparison to NULL pointer

2023-04-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Both test failures look like you just need to add the additional new diagnostic. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149000/new/ https://reviews.llvm.org/D149000 ___ cf

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

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

[PATCH] D149059: [clang][Interp] Fix zero-init of float and pointer arrays

2023-04-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. Our Zero opcode only exists for integer types. Us

[PATCH] D148981: [clang][Interp] PointerToBoolean casts

2023-04-24 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7766648c3aff: [clang][Interp] PointerToBoolean casts (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148981/new/ https://reviews.llvm.o

[PATCH] D149059: [clang][Interp] Fix zero-init of float and pointer arrays

2023-04-25 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 rGc9e403d1992b: [clang][Interp] Fix zero-init of float and pointer arrays (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D149133: [clang][Interp] BaseToDerived casts

2023-04-25 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 can implement these similarly to DerivedToBase

[PATCH] D149133: [clang][Interp] BaseToDerived casts

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

[PATCH] D149149: [clang][Interp] Check one-past-the-end pointers in GetPtrField

2023-04-25 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. Rename CheckBaseDerived to something more general

[PATCH] D149154: [clang][Interp] Emit diagnostic when comparing function pointers

2023-04-25 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. Function pointers can be compared for (in)equalit

[PATCH] D148601: [Clang] Handle Error message to output proper Prefix

2023-04-25 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D148601#4279604 , @Unique_Usman wrote: > In D148601#4279334 , @tbaeder wrote: > >> I am not 100% sure about the semantics of passing multiple prefixes, i.e. if >> the error is emitted

[PATCH] D148987: [clang][Interp] Check Neg ops for errors

2023-04-25 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:438-441 + // FIXME: This code Just Works[tm] for floats, but it's probably not doing + // the right thing. At least the diagnostic could be better without + // the conversion to an APInt. + --

[PATCH] D149154: [clang][Interp] Emit diagnostic when comparing function pointers

2023-04-25 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:652-653 + const SourceInfo &Loc = S.Current->getSource(OpPC); + S.FFDiag(Loc, diag::note_constexpr_pointer_comparison_unspecified) + << LS << RS; + return false; aaron.ballman wrote:

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

2023-04-25 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. Also adds `toDiagnosticString()` to `Pointer` so we

[PATCH] D149154: [clang][Interp] Emit diagnostic when comparing function pointers

2023-04-25 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:652-653 + const SourceInfo &Loc = S.Current->getSource(OpPC); + S.FFDiag(Loc, diag::note_constexpr_pointer_comparison_unspecified) + << LS << RS; + return false; aaron.ballman wrote:

[PATCH] D148987: [clang][Interp] Check Neg ops for errors

2023-04-25 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 517054. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148987/new/ https://reviews.llvm.org/D148987 Files: clang/lib/AST/Interp/Integral.h clang/lib/AST/Interp/Interp.h clang/lib/AST/Interp/PrimType.h clang/test/AST/Interp/literals.cpp Index

[PATCH] D148901: [clang][Interp] Fix post-inc/dec operator result

2023-04-26 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 rG3185e47b5a84: [clang][Interp] Fix post-inc/dec operator result (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

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

2023-04-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. @aaron.ballman Are you OK with the approach taken here? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146358/new/ https://reviews.llvm.org/D146358 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[PATCH] D148601: [Clang] Handle Error message to output proper Prefix

2023-04-26 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. When I run with `-verify=foo,bar`I only get the output for `bar-no-diagnostics`. Adding `bar-no-diagnostics`, I get no output at all and the test succeeds. I didn't know how passing multipl

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

2023-04-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 517450. Herald added a subscriber: carlosgalvezp. Herald added a project: clang-tools-extra. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang-tools-extra/test/clang-tidy/checkers/cert/uppercas

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

2023-04-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 517463. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147875/new/ https://reviews.llvm.org/D147875 Files: clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp clang-tools-extra/test/clang-tidy/checkers/readabilit

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

2023-04-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cert/uppercase-literal-suffix-integer.cpp:34 // CHECK-MESSAGES-NEXT: ^~ - // CHECK-MESSAGES-NEXT: {{^ *}}L{{$}} + // CHECK-MESSAGES-NEXT: {{^ *| *}}L{{$}} // CHECK-FIXES: static constex

[PATCH] D149276: [Clang] Fix parsing of `(auto(x))`.

2023-04-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/Parse/ParseTentative.cpp:1067 +bool mayHaveDirectInit, +bool mayHaveTrailingReturnType) { // declarator: Not part of th

[PATCH] D148987: [clang][Interp] Check Neg ops for errors

2023-04-27 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 rG6cf14a72390f: [clang][Interp] Check Neg ops for errors (authored by tbaeder). Changed prior to commit: https://reviews.llvm.org/D148987?vs=517054&

[PATCH] D149154: [clang][Interp] Emit diagnostic when comparing function pointers

2023-04-27 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 rGf8a9c55bef38: [clang][Interp] Emit diagnostic when comparing function pointers (authored by tbaeder). Changed prior to commit: https://reviews.llv

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

2023-04-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Meh, turns out `(void*)&s.a;` is a bitcast, so can't push this yet. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149172/new/ https://reviews.llvm.org/D149172 ___ cfe-commits mai

[PATCH] D149550: [clang][Interp] Fix compound assign operator evaluation order

2023-04-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. We need to evaluated the RHS before the LHS. Re

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

2023-05-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142630/new/ https://reviews.llvm.org/D142630 ___ 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-05-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143334/new/ https://reviews.llvm.org/D143334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

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

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

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

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

<    14   15   16   17   18   19   20   21   22   >