[PATCH] D134859: [clang][Interp] Implement basic support for floating point values

2022-11-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. FYI, I noticed the way the floating values are serialized doesn't work if the `APFloat` heap-allocated anything; those values aren't preserved through (de)serialization of course. Reproducer: constexpr double foo() { return __LDBL_MIN__; } CHANGES SINCE LAST

[PATCH] D138289: [clang][Parse] Remove constant expression from if condition

2022-11-22 Thread Timm Bäder via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2a1c192bd6bf: [clang][Parse] Remove constant expression from if co

[PATCH] D134859: [clang][Interp] Implement basic support for floating point values

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D134859#3945709 , @sepavloff wrote: > In D134859#3943926 , @tbaeder wrote: > >> FYI, I noticed the way the floating values are serialized doesn't work if >> the `APFloat` heap-allocate

[PATCH] D137488: [clang][Interp] Array initialization via string literal

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1098-1099 + +unsigned N = SL->getLength(); +for (size_t I = 0; I != NumElems; ++I) { + uint32_t CodePoint = I < N ? SL->getCodeUnit(I) : 0; tbaeder wrote: > tahonerma

[PATCH] D137488: [clang][Interp] Array initialization via string literal

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 477409. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137488/new/ https://reviews.llvm.org/D137488 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/literals.cpp Index: clang/test/AST/Interp/literals.cpp

[PATCH] D136920: [clang][Interp] Array initialization via CXXConstructExpr

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 477418. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136920/new/ https://reviews.llvm.org/D136920 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/test/AST/Interp/arrays.cpp Index: clang/test/AST/Interp/arrays.cpp

[PATCH] D136920: [clang][Interp] Array initialization via CXXConstructExpr

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:962-963 + } else if (const auto *Ctor = dyn_cast(Initializer)) { +const ArrayType *AT = Ctor->getType()->getAsArrayTypeUnsafe(); +const auto *CAT = cast(AT); +size_t NumElems = CAT->g

[PATCH] D138554: [clang][Interp] Use placement new to construct opcode arguments into bytecode vector

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik, sepavloff. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This is split-out from https://reviews.

[PATCH] D137415: [clang][Interp] Implement switch statements

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

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 10 inline comments as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Descriptor.h:141-145 unsigned getAllocSize() const { return AllocSize; } /// returns the size of an element when the structure is viewed as an array. unsigned getEl

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 477437. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/Context.cpp clang/lib/AST/Interp/

[PATCH] D137386: [clang][Interp] Reject invalid declarations and expressions

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

[PATCH] D137399: [clang][Interp] Emit negated integers directly as constants

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder abandoned this revision. tbaeder added a comment. This was just to make the byte code a little more readable, but given the amount of pending patches I already have, I'll abandon this and maybe revisit at a later point, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D138554: [clang][Interp] Use placement new to construct opcode arguments into bytecode vector

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeEmitter.cpp:166 if constexpr (!std::is_pointer_v) { -const char *Data = reinterpret_cast(&Val); -Code.insert(Code.end(), Data, Data + Size); +if constexpr (std::is_trivially_copyable_v) { +

[PATCH] D138554: [clang][Interp] Use placement new to construct opcode arguments into bytecode vector

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeEmitter.cpp:166 if constexpr (!std::is_pointer_v) { -const char *Data = reinterpret_cast(&Val); -Code.insert(Code.end(), Data, Data + Size); +if constexpr (std::is_trivially_copyable_v) { +

[PATCH] D136815: [clang][Interp] Unify visiting variable declarations

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

[PATCH] D137235: [clang][Interp] Fix ImplicitValueInitExprs for pointer types

2022-11-24 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/D137235/new/ https://reviews.llvm.org/D137235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D136694: [clang][Interp] Check that constructor calls initialize all record fields

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

[PATCH] D134859: [clang][Interp] Implement basic support for floating point values

2022-11-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 477862. tbaeder marked 10 inline comments as done. tbaeder added a comment. Remove some questionable (but unused) `Floating` API that didn't take floating-point semantics into account. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134859/new/ https

[PATCH] D138802: [clang][Interp] Implement DecompositionDecls

2022-11-28 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. Factor out the actual variable allocation logic int

[PATCH] D137487: [clang][Interp] Start implementing builtin functions

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

[PATCH] D137487: [clang][Interp] Start implementing builtin functions

2022-11-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1374 const Decl *Callee = E->getCalleeDecl(); - if (const auto *FuncDecl = dyn_cast_or_null(Callee)) { + if (const auto *FuncDecl = dyn_cast_if_present(Callee)) { const Function *Func =

[PATCH] D137487: [clang][Interp] Start implementing builtin functions

2022-11-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:1357 +if (InterpretBuiltin(S, PC, BID)) { + NewFrame.release(); + return true; erichkeane wrote: > tbaeder wrote: > > erichkeane wrote: > > > What is going on here? Why is thi

[PATCH] D138270: [clang][Sema] Skip checking int expressions for overflow in constexpr functions

2022-11-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Output for that test case is: ./array.cpp:1:16: error: constexpr function never produces a constant expression [-Winvalid-constexpr] constexpr void f() { ^ ./array.cpp:3:23: note: value 1292785156096 is outside the range of representable values of

[PATCH] D137415: [clang][Interp] Implement switch statements

2022-11-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeStmtGen.cpp:423 + // Create labels and comparison ops for all case statements. + for (const SwitchCase *SC = S->getSwitchCaseList(); SC; + SC = SC->getNextSwitchCase()) { aaron.ballma

[PATCH] D138275: [clang][Interp] Avoid leaking init maps of local primitive arrays

2022-11-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 478598. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138275/new/ https://reviews.llvm.org/D138275 Files: clang/lib/AST/Interp/InterpFrame.cpp clang/lib/AST/Interp/InterpFrame.h clang/lib/AST/Interp/InterpState.cpp clang/lib/AST/Interp/Interp

[PATCH] D138964: Fixed a few spelling errors in clang/include/clang/StaticAnalyzer/Checkers/CheckerBase.td

2022-11-29 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/CheckerBase.td:102 +/// Note that a checker has a name (e.g.: 'NullDereference'), and a full name, +/// that is auto-generated with the help of the ParentPackage field, that also /// includes

[PATCH] D136457: [clang][Interp] Fix discarding non-primitive function call return values

2022-11-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 rGafa60d08a2d4: [clang][Interp] Fix discarding non-primitive function call return values (authored by tbaeder). Repository: rG LLVM Github Monorepo

[PATCH] D136920: [clang][Interp] Array initialization via CXXConstructExpr

2022-11-30 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8095b090db20: [clang][Interp] Array initialization via CXXConstructExpr (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136920/new/ htt

[PATCH] D136936: [clang][Interp] Handle undefined functions better

2022-11-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. tbaeder marked an inline comment as done. Closed by commit rGc3380c32f856: [clang][Interp] Handle undefined functions better (authored by tbaeder). Changed prior to co

[PATCH] D138554: [clang][Interp] Use placement new to construct opcode arguments into bytecode vector

2022-11-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 rGaaf73ae266db: [clang][Interp] Use placement new to construct opcode args into vector (authored by tbaeder). Changed prior to commit: https://revie

[PATCH] D137392: [clang][Interp] Explicitly handle RVO Pointer

2022-11-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 rG7c215a457178: [clang][Interp] Explicitly handle RVO Pointer (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D137415: [clang][Interp] Implement switch statements

2022-11-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 478895. tbaeder marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137415/new/ https://reviews.llvm.org/D137415 Files: clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.h clang/test/AST/I

[PATCH] D137415: [clang][Interp] Implement switch statements

2022-11-30 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added inline comments. Comment at: clang/test/AST/Interp/switch.cpp:46 +constexpr int withInit() { + switch(int a = 2; a) { +case 1: return -1; aaron.ballman wrote: > I think it would be good to add a non-tri

[PATCH] D137487: [clang][Interp] Start implementing builtin functions

2022-12-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 479201. tbaeder added a comment. Split `CallBI` out from `Call`, so we don't need special cases in `CheckCallable` etc. for builtin functions. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137487/new/ https://reviews.llvm.org/D137487 Files: clan

[PATCH] D136694: [clang][Interp] Check that constructor calls initialize all record fields

2022-12-01 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/Interp.cpp:447 + +if (FieldType->isRecordType()) { + Result &= CheckFieldsInitialized(S, OpPC, FieldPtr, FieldPtr.getRecord()); aaron.ballman wrote

[PATCH] D136694: [clang][Interp] Check that constructor calls initialize all record fields

2022-12-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 479209. tbaeder marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136694/new/ https://reviews.llvm.org/D136694 Files: clang/lib/AST/Interp/Descriptor.cpp clang/lib/AST/Interp/Interp.cpp clang/lib/AST/Interp/Interp.

[PATCH] D136815: [clang][Interp] Unify visiting variable declarations

2022-12-01 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/ByteCodeExprGen.cpp:1127 return false; - if (!this->emitInitGlobal(*T, *I, VD)) +} + } else { aaron.ballman wrote: > and if we have no `Gl

[PATCH] D136815: [clang][Interp] Unify visiting variable declarations

2022-12-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 479219. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136815/new/ https://reviews.llvm.org/D136815 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/I

[PATCH] D134859: [clang][Interp] Implement basic support for floating point values

2022-12-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:152 + case CK_FloatingToIntegral: { +llvm::RoundingMode RM = getRoundingMode(CE); +Optional ToT = classify(CE->getType()); sepavloff wrote: > According to C standard (6.3

[PATCH] D134859: [clang][Interp] Implement basic support for floating point values

2022-12-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:152 + case CK_FloatingToIntegral: { +llvm::RoundingMode RM = getRoundingMode(CE); +Optional ToT = classify(CE->getType()); sepavloff wrote: > tbaeder wrote: > > sepavloff

[PATCH] D134859: [clang][Interp] Implement basic support for floating point values

2022-12-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 479262. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134859/new/ https://reviews.llvm.org/D134859 Files: clang/lib/AST/CMakeLists.txt clang/lib/AST/Interp/Boolean.h clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGe

[PATCH] D136815: [clang][Interp] Unify visiting variable declarations

2022-12-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 4 inline comments as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:1127 return false; - if (!this->emitInitGlobal(*T, *I, VD)) +} + } else { aaron.ballman wrote: > tbaeder wrote: > > aa

[PATCH] D136815: [clang][Interp] Unify visiting variable declarations

2022-12-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 479294. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136815/new/ https://reviews.llvm.org/D136815 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/I

[PATCH] D136815: [clang][Interp] Unify visiting variable declarations

2022-12-01 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 479526. tbaeder added a comment. Meh, just use an assert :| CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136815/new/ https://reviews.llvm.org/D136815 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeExprGen.h clan

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/InterpBlock.h:97 void invokeCtor() { -std::memset(data(), 0, getSize()); +std::memset(rawData(), 0, Desc->getAllocSize()); if (Desc->CtorFn) aaron.ballman wrote: > tbaeder wrote: > >

[PATCH] D139185: [clang][Interp] Use placement new to construct opcode args into vector

2022-12-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: sepavloff, 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 last version of this patch created problems because it was using the

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 479582. tbaeder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Descriptor.h:73 + /// Flag indicating if the field is mutable (if in a record). + unsigned IsMutable : 1; + shafik wrote: > Maybe `IsFieldMutable` b/c we call `CreateDescriptor` it is a little > c

[PATCH] D136694: [clang][Interp] Check that constructor calls initialize all record fields

2022-12-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Oh I think this patch is doing too much. The checking should only occur for global variables. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136694/new/ https://reviews.llvm.org/D136694 ___ cfe-commits mailing list cf

[PATCH] D75844: [clang] Set begin loc on GNU attribute parsed attrs

2020-03-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked an inline comment as done. tbaeder added a comment. Thanks, I'll take a look at the tests. Comment at: clang/test/SemaCXX/switch-implicit-fallthrough.cpp:110-114 +case 26: + return 0; +__attribute__((fallthrough)); // expected-warning{{fallthrough an

[PATCH] D75844: [clang] Set begin loc on GNU attribute parsed attrs

2020-03-31 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Sorry for taking so long but it seems like I've went down a rabbit hole a bit. My previous patch sets the range in `parseGNUAttributes()` unconditionally, but that seems to trigger cases such as // FixItLoc = possible correct location for the attributes void Prohibi

[PATCH] D75461: Ignore macro expansions when scanning for fallthrough comments

2020-03-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added a reviewer: tstellar. Herald added a project: clang. Herald added a subscriber: cfe-commits. When scanning for fallthrough comments, it's not useful to go to the definition of a macro. We instead only want to search at the expanded source code locatio

[PATCH] D75461: Ignore macro expansions when scanning for fallthrough comments

2020-03-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder abandoned this revision. tbaeder added a comment. fallthrough comment detection has been reverted, so abandon this in the meantime. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75461/new/ https://reviews.llvm.org/D75461 ___

[PATCH] D73852: [clang] detect switch fallthrough marked by a comment (PR43465)

2020-03-04 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. I know this has been reverted, but for the record, the implementation has a few shortcomings that makes it hard to use it for projects that rely on fallthrough comments: - The comment is not recognized if it is on the same line as the last statement, e.g. case 2:

[PATCH] D75844: [clang] Set begin loc on GNU attribute parsed attrs

2020-03-09 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: tstellar, serge-sans-paille. tbaeder added a project: clang. Herald added a subscriber: cfe-commits. Otherwise the source range of the passed-in ParsedAttributesWithRange ends up being invalid and the resulting error messages rather useless.

[PATCH] D75844: [clang] Set begin loc on GNU attribute parsed attrs

2020-03-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 249574. tbaeder added a comment. Updated according to Aaron's comments. I'm not sure about changing the `DeclSpec` member and moving `ParsedAttributesWithRange` to ParsedAttr.h. Tests included. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75844/ne

[PATCH] D145545: [clang][Interp] Fix local variable (destructor) management in loop bodies

2023-03-14 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 505084. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145545/new/ https://reviews.llvm.org/D145545 Files: clang/lib/AST/Interp/ByteCodeExprGen.h clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.h Index: clang/lib/A

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

2023-03-14 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 505092. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145861/new/ https://reviews.llvm.org/D145861 Files: clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/test/AST/Interp/literals.cpp Index: clang/test/AST/Interp/literals.cpp

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

2023-03-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.cpp:390 - if (isa(ElemType.getTypePtr())) { + if (ElemType->isRecordType()) { const Record *R = BasePtr.getElemRecord(); shafik wrote: > aaron.ballman wrote: > > The difference betwee

[PATCH] D138275: [clang][Interp] Avoid leaking init maps of local primitive arrays

2023-03-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder abandoned this revision. tbaeder added a comment. Abandoning this since the approach is not feasible anymore with https://reviews.llvm.org/D145545 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138275/new/ https://reviews.llvm.org/D138275 ___

[PATCH] D145545: [clang][Interp] Fix local variable (destructor) management in loop bodies

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

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

2023-03-18 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. "subobject named 'foo'" sounds a bit weird to me, I'd expect just "subobject 'foo'", but that's just a suggestion and I'll wait for a native spearker to chime in on this. Comment at: clang/lib/AST/Interp/Interp.cpp:373 +

[PATCH] D146376: Update static_assert message for redundant cases

2023-03-18 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Looks like you're just removing the output altogether, so that won't work. Try running `ninja check-clang-semacxx` and see all the test failures you (should) get. For a proper patch, it would also be good if you add a test case for the case you're fixing. Repository:

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

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

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

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

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

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

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

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

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

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

[PATCH] D146408: [clang][Interp] Start supporting complex types

2023-03-20 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. Trying a different approach here where I split the

[PATCH] D146436: [clang][Interp][NFC] Add tests for __fp16

2023-03-20 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 should already work just fine since our `Float

[PATCH] D146436: [clang][Interp][NFC] Add tests for __fp16

2023-03-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 506701. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146436/new/ https://reviews.llvm.org/D146436 Files: clang/test/AST/Interp/floats.cpp Index: clang/test/AST/Interp/floats.cpp ===

[PATCH] D146436: [clang][Interp][NFC] Add tests for __fp16

2023-03-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/AST/Interp/floats.cpp:110-111 + + static_assert(~2.0f == 3, ""); // ref-error {{invalid argument type 'float' to unary expression}} \ + // expected-error {{invalid argument type 'float' to un

[PATCH] D146503: Fix highlighting issue with _complex and initialization list with more than 2 items

2023-03-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. I think the problem is that in https://github.com/llvm/llvm-project/blob/25ca26e0da2e1f80d62f71807828762691a049ac/clang/lib/Sema/SemaInit.cpp#L1532-L1541, the code checks for `Index != 2` and then handles it as a single scalar initializer. Repository: rG LLVM Github

[PATCH] D146582: [clang] Fix wrong highlight for _Complex

2023-03-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Sorry but this is already being worked on in https://reviews.llvm.org/D146503. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146582/new/ https://reviews.llvm.org/D146582 ___ cfe-

[PATCH] D146503: Fix highlighting issue with _complex and initialization list with more than 2 items

2023-03-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a subscriber: aaron.ballman. tbaeder added a comment. LGTM but I'll wait for @aaron.ballman to maybe comment on the diagnostic differences in C. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146503/new/ https://reviews.llvm.org/D1465

[PATCH] D146376: Update static_assert message for redundant cases

2023-03-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Since we only handle `BinaryOperator`s in the toplevel assertion expression, I think it should just be safe to never diagnose for them if it's an `BO_LOr` opcode, so you should be able to just check for that in `DiagnoseStaticAssertDetails()`. Repository: rG LLVM Gi

[PATCH] D146376: Update static_assert message for redundant cases

2023-03-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. I think just checking that the toplevel binary operator is a logical or should be enough? Since that only fails if both operands evaluate to false, so we don't need to print the "false or false" diagnostic. Comment at: clang/test/SemaCXX/static-assert

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

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

[PATCH] D145545: [clang][Interp] Fix local variable (destructor) management in loop bodies

2023-03-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145545/new/ https://reviews.llvm.org/D145545 ___ 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-03-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/D146030/new/ https://reviews.llvm.org/D146030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D146408: [clang][Interp] Start supporting complex types

2023-03-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 507646. tbaeder added a comment. Completely forgot to add the tests to the patch, oops. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146408/new/ https://reviews.llvm.org/D146408 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Int

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

2023-03-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 507648. tbaeder added a comment. Add some more tests for virtual destructors. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142630/new/ https://reviews.llvm.org/D142630 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/Contex

[PATCH] D146436: [clang][Interp][NFC] Add tests for __fp16

2023-03-23 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0691bcb18024: [clang][Interp][NFC] Add tests for __fp16 (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146436/new/ https://reviews.llv

[PATCH] D146436: [clang][Interp][NFC] Add tests for __fp16

2023-03-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Meh, is `__fp16` something I need to check support for? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146436/new/ https://reviews.llvm.org/D146436 ___ cfe-commits mailing list cf

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

2023-03-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D141472#4217479 , @aaron.ballman wrote: > In D141472#4112790 , @tbaeder wrote: > >> I'm not sure what to do about this right now. I was wondering about >> restructuring pointers so al

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

2023-03-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 507965. tbaeder set the repository for this revision to rG LLVM Github Monorepo. tbaeder added a comment. Okay, fixed this by using `visitZeroInitializer()` so now it's not dead code anymore. TODO: Test zero-initialization of floats. Repository: rG LLVM

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

2023-03-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 507966. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141472/new/ https://reviews.llvm.org/D141472 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/Context.cpp clang/lib/AST/Interp/Descriptor.cpp clang/lib/AST/Interp/Funct

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

2023-03-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. After the discussion in https://reviews.llvm.org/D1

[PATCH] D146408: [clang][Interp] Start supporting complex types

2023-03-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Context.cpp:84-85 + if (T->isAnyComplexType()) +return std::nullopt; + aaron.ballman wrote: > Hmmm, this seems surprising to me, I would have assumed that _Complex needed > to be a primitive

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

2023-03-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.h:182-183 + template + bool visitConditional(const AbstractConditionalOperator *E, VisitFn V); + aaron.ballman wrote: > The template definition isn't available within the header

[PATCH] D146376: Update static_assert message for redundant cases

2023-03-24 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/test/SemaCXX/static-assert.cpp:262 static_assert(invert(true) == invert(false), ""); // expected-error {{failed}} \ -// expected-note {{evaluates to 'false == true'}} -

[PATCH] D146867: [Diagnostic] printing name of uninitialized subobject instead of its type

2023-03-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Yeah I think https://reviews.llvm.org/D146358 was first and this patch doesn't add much over it, correct me if I'm wrong. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146867/new/ https://reviews.llvm.org/D146867

[PATCH] D146376: Update static_assert message for redundant cases

2023-03-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Remember to upload you patches with context. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:16732 +// Ignore BO_LOr operators at the toplevel. +if (Op->getOpcode() == BO_LOr) + return; You can just drop the comment and move thi

[PATCH] D145545: [clang][Interp] Fix local variable (destructor) management in loop bodies

2023-03-27 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping. Please prioritize this patch over the other interpreter patches since the others depend on it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145545/new/ https://reviews.llvm.org/D145545 ___ cfe-commits mailing

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

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

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

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

<    10   11   12   13   14   15   16   17   18   19   >