[clang] [clang-tools-extra] [flang] [lld] [lldb] [llvm] [NFC] Rename Option parsing related files from OptXYZ -> OptionXYZ (PR #110692)

2024-10-08 Thread David Blaikie via cfe-commits
dwblaikie wrote: Yeah, I think given how wide the change is and the speculative nature of the harm - probably best to abandon this for now. We can pick it up again if more folks speak up/more evidence is presented that it's problematic. https://github.com/llvm/llvm-project/pull/110692

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread David Blaikie via cfe-commits
@@ -211,6 +211,16 @@ New Compiler Flags only for thread-local variables, and none (which corresponds to the existing ``-fno-c++-static-destructors`` flag) skips all static destructors registration. +- The ``-fextend-lifetimes`` and ``-fextend-this-ptr`` flags have been ad

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread David Blaikie via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 %s -emit-llvm -O2 -fextend-lifetimes -o - | FileCheck --check-prefixes=CHECK-ALL,CHECK-O2 %s +// RUN: %clang_cc1 %s -emit-llvm -O0 -fextend-lifetimes -o - | FileCheck --check-prefixes=CHECK-ALL,CHECK-O0 %s + +// Checks that we emit the functi

[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)

2024-10-03 Thread David Blaikie via cfe-commits
@@ -2217,6 +2217,11 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Args.getAllArgValues(OPT_fsanitize_trap_EQ), Diags, Opts.SanitizeTrap); + Opts.ExtendThisPtr = + Opts.OptimizationLevel > 0

[clang] [clang][DebugInfo] Revert to printing canonical typenames for template aliases (PR #110767)

2024-10-02 Thread David Blaikie via cfe-commits
dwblaikie wrote: Thanks @jimingham - yeah, that makes sense. My original argument for being OK with the de-canonicalization of typedefs was that they aren't load bearing anyway. But if lldb puts load on them, that assumption doesn't hold. Yeah, could check for angles or template parameter DIEs

[clang] [clang][DebugInfo] Revert to printing canonical typenames for template aliases (PR #110767)

2024-10-02 Thread David Blaikie via cfe-commits
dwblaikie wrote: Not quite sure how we get to caching and template specializations and pretty printers. If we're still producing the typedef-style DWARF for these alias template specializations - perhaps lldb could not cache pretty printers for typedefs? (I guess the pretty printers shouldn't

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-19 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Fair enough https://github.com/llvm/llvm-project/pull/108300 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-12 Thread David Blaikie via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gno-column-info -triple=x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s + +// The important thing is that the compare and the conditional branch have +// locs with the same scope (the lexical block for the 'if'). B

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-12 Thread David Blaikie via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gno-column-info -triple=x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s + +// The important thing is that the compare and the conditional branch have +// locs with the same scope (the lexical block for the 'if'). B

[clang] [DebugInfo] Correct the line attribution for IF branches (PR #108300)

2024-09-12 Thread David Blaikie via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gno-column-info -triple=x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s + +// The important thing is that the compare and the conditional branch have +// locs with the same scope (the lexical block for the 'if'). B

[clang] [clang][Sema] Fix diagnostic for function overloading in extern "C" (PR #106033)

2024-08-30 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. https://github.com/llvm/llvm-project/pull/106033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix diagnostic for function overloading in extern "C" (PR #106033)

2024-08-30 Thread David Blaikie via cfe-commits
dwblaikie wrote: > This make sense to me, @dwblaikie wdyt? Seems OK to me https://github.com/llvm/llvm-project/pull/106033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Assert non-null enum definition in CGDebugInfo::CreateTypeDefinition(const EnumType*) (PR #105556)

2024-08-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: What static analysis tool flagged this? Any idea why this particular null dereference, when LLVM/Clang have loads of assumed-non-null pointers that are dereferenced in a great many places? https://github.com/llvm/llvm-project/pull/105556 ___

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-08-20 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Looking forward to trying this out! > > Should the new flag have some docs and maybe be mentioned in the release > notes, or do we think it's not ready for prime time yet for some reason? I'm /pretty/ neutral on that - it's got pretty clear behavior, etc (& in fact some cla

[clang] [lld] [llvm] [mlir] [NFC][IWYU] Update Support library with IWYU. (PR #102707)

2024-08-12 Thread David Blaikie via cfe-commits
dwblaikie wrote: > > The motivation is as usual IWYU and similar refactoring - to reduce build > > time and probablility of non-related source(s) recompile. > > I'm confused: as far as I know IWYU achieves the opposite of what you're > describing actually: it adds more includes than strictly n

[clang] [llvm] [Clang] Protect ObjCMethodList assignment operator against self-assignment (PR #97933)

2024-08-04 Thread David Blaikie via cfe-commits
dwblaikie wrote: Is there existing test coverage (like, if you add an assertion, instead of an if/return - do any tests hit the assertion)? or could you add some? https://github.com/llvm/llvm-project/pull/97933 ___ cfe-commits mailing list cfe-commits

[clang] [clang][CGDebugInfo] Don't generate an implicit 'this' parameter if one was specified explicitly (PR #100767)

2024-07-26 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/100767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 8dd5742 - Fix aarch64-ptrauth.c to avoid writing to cwd which might not be writeable

2024-07-25 Thread David Blaikie via cfe-commits
Author: David Blaikie Date: 2024-07-25T21:52:14Z New Revision: 8dd574236ccaa0a183278396cfec3068b832651a URL: https://github.com/llvm/llvm-project/commit/8dd574236ccaa0a183278396cfec3068b832651a DIFF: https://github.com/llvm/llvm-project/commit/8dd574236ccaa0a183278396cfec3068b832651a.diff LOG:

[clang] [Clang] Fix null pointer dereference in enum debug info generation (PR #97105)

2024-07-24 Thread David Blaikie via cfe-commits
@@ -98,3 +98,6 @@ enum E8 { A8 = -128, B8 = 127 } x8; // CHECK-NOT: DIFlagEnumClass // CHECK: !DIEnumerator(name: "A8", value: -128) +// Forward declaration of an enum class. +enum class Color : int; +// CHECK-NOT: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Color" -

[clang] [llvm] Revert "[PS4/PS5][Driver][DWARF] Always emit .debug_aranges for SCE t… (PR #99711)

2024-07-22 Thread David Blaikie via cfe-commits
dwblaikie wrote: also, if you're sending a pull request just because it's convenient (via the web UI "revert" button) or to run presubmits but not for review, please include the skip-presubmit-approval label so it's clear something isn't getting committed without needed review https://github.

[clang] [llvm] Revert "Add source file name for template instantiations in -ftime-trace" (PR #99534)

2024-07-21 Thread David Blaikie via cfe-commits
dwblaikie wrote: (if you don't need a code review for a change, you can commit it directly without a pull request - if you're making a PR not for code review but for presubmit checks, please label to `skip-precommit-approval` to clarify that you aren't waiting for approval (and that the change

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-07-16 Thread David Blaikie via cfe-commits
dwblaikie wrote: > > That's a pretty substantial policy change to propose, and this probably > > isn't the place to propose/discuss it. If that's your intent, probably best > > to take that up on discord. > > I am not proposing a policy change. I believe the current policy is aimed at > givin

[clang] [Clang] Fix null pointer dereference in enum debug info generation (PR #97105)

2024-07-16 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Thanks @smanna12. I think this looks ok; returning null here does appear to > be consistent with other overloads of `CreateTypeDefinition` for `RecordType` > and `ObjCInterfaceType`. I agree with @Michael137 that it would be nice to > have an example that fails the added con

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-07-14 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Also, I think we presently have sufficient review bandwidth in clang proper, > even including the area of modules, so that any non-trivial change can be > reviewed, and I also propose that we abstain from trying to directly commit > those. That's a pretty substantial policy

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-07-12 Thread David Blaikie via cfe-commits
dwblaikie wrote: > I think the appropriate tag for such commits would be NFCI, and should still > require PR and review. Clarifying a couple of things here 1) I tend to agree the patch might've been a bit subtle and maybe split up into smaller, independent parts (usual rules: [be an isolated c

[clang] [clang][CGRecordLayout] Remove dependency on isZeroSize (PR #96422)

2024-07-09 Thread David Blaikie via cfe-commits
@@ -185,6 +203,18 @@ CALL_AO(PackedMembers) // CHECK: call void @llvm.memcpy.p0.p0.i64({{.*}} align 1 {{.*}} align 1 {{.*}}i64 16, i1 {{.*}}) // CHECK: ret ptr +// WithEmptyField copy-assignment: +// CHECK-LABEL: define linkonce_odr nonnull align {{[0-9]+}} dereferenceable({

[clang] [Clang][Sema] Diagnose variable template explicit specializations with storage-class-specifiers (PR #93873)

2024-07-02 Thread David Blaikie via cfe-commits
dwblaikie wrote: > It looks like the presence of `static` on template variable specializations > makes difference in the namespace context: https://gcc.godbolt.org/z/WGsreqbz8 > > Specifically, the specializations not marked `static` result in an exported > variable. Thus, we have seemingly va

[clang] [Driver] Add -Wa, options --crel and --allow-experimental-crel (PR #97378)

2024-07-02 Thread David Blaikie via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: not %clang -### -c --target=x86_64 -Wa,--crel %s 2>&1 | FileCheck %s --check-prefix=NOEXP + +// NOEXP: error: -Wa,--allow-experimental-crel must be specified to use -Wa,--crel. CREL is experimental and takes a non-standard section type code + +// RUN: %

[clang] [clang] Use std::make_unique (NFC) (PR #97176)

2024-06-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. https://github.com/llvm/llvm-project/pull/97176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use std::make_unique (NFC) (PR #97176)

2024-06-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie edited https://github.com/llvm/llvm-project/pull/97176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Add warning flag for storage class specifiers on explicit specializations (PR #96699)

2024-06-27 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie closed https://github.com/llvm/llvm-project/pull/96699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Clang: Add warning flag for storage class specifiers on explicit specializations (PR #96699)

2024-06-27 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Minor nit: Probably don't need to explicitly define a diagnostic group, since > it's only ever used for this diagnostic. Not sure what the conventions are - but I rather like the normalization of having the explicit group, better chance of finding the group/reusing it maybe?

[clang] [Clang] Static and explicit object member functions with the same parameter-type-lists (PR #93430)

2024-06-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: @cor3ntin ping on this? https://github.com/llvm/llvm-project/pull/93430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-06-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: Oh, this code was touched really recently in 66df6141659375e738d9b9b74bf79b2317576042 (@augusto2112 ) (see notes in previous comments about how this code should be generalized) https://github.com/llvm/llvm-project/pull/93809 ___ cfe-

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-06-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: Here's the smallest patch that would put explicit alignment on any packed structure: ``` diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index a072475ba770..bbb13ddd593b 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CG

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-06-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: The other effects of `packed` are encoded (the changes to the member offsets) but that's not the only effect, and we shouldn't use that effect (which isn't guaranteed to be observable - as in the case of "packed struct with a single member/that just happens to not have padding

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-06-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: oh, slight misquote above - `aligned(1)` is a no-op, as that attribute can't reduce the alignment... But I think my argument still stands, roughly as - if increases in alignment are explicitly specified, decreases in alignment should be too. https://github.com/llvm/llvm-proj

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-06-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: Ah, I think this right solution to /this/ case is that the compiler should be emitting the alignment for the structure? Like there's no way for the debugger to know that this structure is underaligned at the moment: ``` struct __attribute__((packed)) t1 { int i; }; ``` Which

[clang] Clang: Add warning flag for storage class specifiers on explicit specializations (PR #96699)

2024-06-25 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Should we add a test for this flag? Something around existing tests in > clang/test/CXX/temp/temp.spec/temp.expl.spec/p2-20.cpp and > clang/test/CXX/dcl.dcl/dcl.spec/dcl.stc/p1.cpp. Oh, right, I did have a new test I meant to add, but that's a better place for it - so I've

[clang] Clang: Add warning flag for storage class specifiers on explicit specializations (PR #96699)

2024-06-25 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie updated https://github.com/llvm/llvm-project/pull/96699 >From a539afc7b81502ffcab7028bfe8266b8e32951d9 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 25 Jun 2024 21:02:50 + Subject: [PATCH 1/2] Clang: Add warning flag for storage class specifiers on ex

[clang] [llvm] [MC,llvm-readobj,yaml2obj] Support CREL relocation format (PR #91280)

2024-06-25 Thread David Blaikie via cfe-commits
@@ -86,6 +86,8 @@ DYNAMIC_TAG(RELRSZ, 35) // Size of Relr relocation table. DYNAMIC_TAG(RELR, 36)// Address of relocation table (Relr entries). DYNAMIC_TAG(RELRENT, 37) // Size of a Relr relocation entry. +DYNAMIC_TAG(CREL, 38) // CREL relocation table + --

[clang] [Clang][Sema] Diagnose variable template explicit specializations with storage-class-specifiers (PR #93873)

2024-06-25 Thread David Blaikie via cfe-commits
dwblaikie wrote: Sent a patch to add a warning flag for the warning this patch uses: https://github.com/llvm/llvm-project/pull/96699 With that, we could disable the warning during the compiler migration, decoupling compiler migration from code cleanup. https://github.com/llvm/llvm-project/pul

[clang] Clang: Add warning flag for storage class specifiers on explicit specializations (PR #96699)

2024-06-25 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie created https://github.com/llvm/llvm-project/pull/96699 With the recent fix for this situation in class members (#93873) (for which the fixed code is invalid prior to this patch - making migrating code difficult as it must be in lock-step with the compiler migration,

[clang] [Clang] Static and explicit object member functions with the same parameter-type-lists (PR #93430)

2024-06-24 Thread David Blaikie via cfe-commits
dwblaikie wrote: Hit an msan use-of-uninitialized on an internal use case (a tool that uses Clang via API). the test was compiling this source code: ``` #include namespace proto2 { struct Message {}; } // namespace proto2 struct FakeProto : proto2::Message { const std::string& getter() cons

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-24 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. https://github.com/llvm/llvm-project/pull/79230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-24 Thread David Blaikie via cfe-commits
@@ -28,7 +29,7 @@ namespace llvm { } // Prefix of the name of the artificial inline frame. -#define CLANG_TRAP_PREFIX "__clang_trap_msg" +inline constexpr llvm::StringRef CLANG_TRAP_PREFIX = "__clang_trap_msg"; dwblaikie wrote: The name should be changed to u

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-24 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie edited https://github.com/llvm/llvm-project/pull/79230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-24 Thread David Blaikie via cfe-commits
dwblaikie wrote: > > I will say, `-fno-eliminate-unused-debug-types` is a really heavy hammer > > that makes debug info much larger - and my understanding was that games > > tended to have trouble with large debug builds, so I'd be surprised if this > > was a great path forward. > > Absolutel

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-22 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Looks OK - one minor nit, I'd probably avoid defining CLANG_TRAP_PREFIX as a macro, but instead as an inline or some other form of constant https://github.com/llvm/llvm-project/pull/79230 ___ cf

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-22 Thread David Blaikie via cfe-commits
@@ -27,6 +27,9 @@ namespace llvm { } } +// Prefix of the name of the artificial inline frame. +#define CLANG_TRAP_PREFIX "__clang_trap_msg" dwblaikie wrote: inline StringRef? usual reasons to avoid macros, etc https://github.com/llvm/llvm-project/pull/7923

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-22 Thread David Blaikie via cfe-commits
dwblaikie wrote: I will say, `-fno-eliminate-unused-debug-types` is a really heavy hammer that makes debug info much larger - and my understanding was that games tended to have trouble with large debug builds, so I'd be surprised if this was a great path forward. Do you have a small example o

[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

2024-06-22 Thread David Blaikie via cfe-commits
dwblaikie wrote: Yes, the initializers do have to be lazyily evaluated to be a conforming C++ compiler. eg: this code must compile without error so far as I understand: ``` template struct t1 { static constexpr int x = 3 / Value; }; t1<0> v1; ``` Though it seems MSVC doesn't implement this co

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-06-20 Thread David Blaikie via cfe-commits
dwblaikie wrote: I think my last comment/question is still open? How/why did the symbol name end up dropping any llvm/clang component to avoid collisions with other names? https://github.com/llvm/llvm-project/pull/79230 ___ cfe-commits mailing list cf

[clang] [llvm] [BPF] Fix linking issues in static map initializers (PR #91310)

2024-06-18 Thread David Blaikie via cfe-commits
dwblaikie wrote: happy with the test coverage, but I'm probably not the right person to review th ecode in more detail https://github.com/llvm/llvm-project/pull/91310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-06-18 Thread David Blaikie via cfe-commits
dwblaikie wrote: > That would mean if someone wrote `struct Empty {}; struct Z { Empty a,b,c; > }`, we'd lower it to `{ [3 x i8] }` instead of `{%Empty, %Empty, %Empty}`, > which is a bit ugly. Other than that, sure, I guess we could do that. Ah, fair enough. Glad to understand and I don't fee

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-06-17 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Oh, in this particular case, the issue isn't the computed datasize, it's that > FieldDecl::isZeroSize() returns the wrong result. If that's the case, maybe > we can just change FieldDecl::isZeroSize() to say the field is zero size? So > essentially, we pretend all empty fiel

[clang] Revert "Add option to generate additional debug info for expression dereferencing pointer to pointers. #94100" (PR #95174)

2024-06-11 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. https://github.com/llvm/llvm-project/pull/95174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Bump the DWARF version number to 5 on Darwin. (PR #95164)

2024-06-11 Thread David Blaikie via cfe-commits
dwblaikie wrote: Congrats on the milestone! Glad to have more of us together on the same version for all the positive feedback loops, etc :) https://github.com/llvm/llvm-project/pull/95164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #94100)

2024-06-10 Thread David Blaikie via cfe-commits
dwblaikie wrote: > G'day -- we've got some tests for -O0 that, with this patch applied, generate > different code with-and-without the `-g` flag, if > `-fdebug-info-for-profiling` is enabled. Example godbolt: > https://godbolt.org/z/qooo5Eah1 . > > It seems the intention of this patch is gene

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-07 Thread David Blaikie via cfe-commits
@@ -1830,6 +1830,9 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables &CGVT, if (VTable->hasInitializer()) return; + if (RD->shouldEmitInExternalSource()) +return; dwblaikie wrote: But this logic (using available externally definitions) i

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-06 Thread David Blaikie via cfe-commits
@@ -1830,6 +1830,9 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables &CGVT, if (VTable->hasInitializer()) return; + if (RD->shouldEmitInExternalSource()) +return; dwblaikie wrote: Yes, and we do emit them in normal builds above -O0 if th

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-04 Thread David Blaikie via cfe-commits
@@ -3239,6 +3239,12 @@ bool ASTReader::isConsumerInterestedIn(Decl *D) { if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) return true; + // The dynamic class defined in a named module is interesting. + // The code generator needs to emit its vtable

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-04 Thread David Blaikie via cfe-commits
@@ -1185,6 +1190,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the cla

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-04 Thread David Blaikie via cfe-commits
dwblaikie wrote: Per ( https://llvm.org/docs/GitHub.html#updating-pull-requests ) please don't force push, makes it hard to follow the changes to the review as they progress. https://github.com/llvm/llvm-project/pull/75912 ___ cfe-commits mailing list

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-06-03 Thread David Blaikie via cfe-commits
@@ -1180,6 +1185,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the cla

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #94100)

2024-05-31 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Looks worth a shot. Please commit this at a time where you can respond to bot fail-mail for a while after the commit. And ensure the commit message has most/all of the details of the original commit, plus the original commit and revert h

[clang] 6e975ec - Reapply "[DebugInfo] Add flag to only emit referenced member functions" (#93767)

2024-05-30 Thread David Blaikie via cfe-commits
Author: David Blaikie Date: 2024-05-30T20:36:47Z New Revision: 6e975ecf5c93c40d2f088425548eb6476332629c URL: https://github.com/llvm/llvm-project/commit/6e975ecf5c93c40d2f088425548eb6476332629c DIFF: https://github.com/llvm/llvm-project/commit/6e975ecf5c93c40d2f088425548eb6476332629c.diff LOG:

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-05-30 Thread David Blaikie via cfe-commits
@@ -1180,6 +1185,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the cla

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-05-30 Thread David Blaikie via cfe-commits
@@ -1802,6 +1802,12 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables &CGVT, if (VTable->hasInitializer()) return; + // If the class is attached to a C++ named module other than the one + // we're currently compiling, the vtable should be defined there. + i

[clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

2024-05-30 Thread David Blaikie via cfe-commits
dwblaikie wrote: Could probably adjust the assertions to be `assert (debug || whatever)` rather than `if (!debug) assert(whatever)`. My understanding/expectation was that these assertions would be removed entirely - that whatever generated the AST should just be trusted, whether it's the debu

[clang] Revert "[DebugInfo] Add flag to only emit referenced member functions" (PR #93767)

2024-05-29 Thread David Blaikie via cfe-commits
dwblaikie wrote: Thanks! Sorry I didn't get to it sooner https://github.com/llvm/llvm-project/pull/93767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-29 Thread David Blaikie via cfe-commits
dwblaikie wrote: > There is a broken test in CI: > https://lab.llvm.org/buildbot/#/builders/272/builds/17864 Fixed in ea1ecb50fa831583241fc531153bd2c072955d29 https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@li

[clang] ea1ecb5 - Fix test - remove unnecessary/incorrect `-S`, in favor of `-emit-llvm`

2024-05-29 Thread David Blaikie via cfe-commits
Author: David Blaikie Date: 2024-05-29T23:36:43Z New Revision: ea1ecb50fa831583241fc531153bd2c072955d29 URL: https://github.com/llvm/llvm-project/commit/ea1ecb50fa831583241fc531153bd2c072955d29 DIFF: https://github.com/llvm/llvm-project/commit/ea1ecb50fa831583241fc531153bd2c072955d29.diff LOG:

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie closed https://github.com/llvm/llvm-project/pull/87018 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Add option to generate additional debug info for expression dereferencing pointer to pointers. (PR #81545)

2024-05-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Fair enough - let's give it a go. https://github.com/llvm/llvm-project/pull/81545 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [llvm] [BPF] Fix linking issues in static map initializers (PR #91310)

2024-05-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie commented: Is there some test coverage that shows that unreferenced variables/functions aren't included in the output? https://github.com/llvm/llvm-project/pull/91310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [DebugInfo][BPF] Add 'btf:type_tag' annotation in DWARF (PR #91423)

2024-05-29 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. approving mostly on the basis of my own previous approval on phab https://github.com/llvm/llvm-project/pull/91423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-05-29 Thread David Blaikie via cfe-commits
@@ -1802,6 +1802,12 @@ void ItaniumCXXABI::emitVTableDefinitions(CodeGenVTables &CGVT, if (VTable->hasInitializer()) return; + // If the class is attached to a C++ named module other than the one + // we're currently compiling, the vtable should be defined there. + i

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-05-29 Thread David Blaikie via cfe-commits
@@ -1180,6 +1185,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the cla

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-05-29 Thread David Blaikie via cfe-commits
@@ -1180,6 +1185,21 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) { TSK == TSK_ExplicitInstantiationDefinition) return false; + // Itanium C++ ABI [5.2.3]: + // Virtual tables for dynamic classes are emitted as follows: + // + // - If the cla

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-05-29 Thread David Blaikie via cfe-commits
dwblaikie wrote: (a bunch of compiler-rt tests also use ulimit, but doesn't look like any llvm core tests do... ) https://github.com/llvm/llvm-project/pull/79875 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

2024-05-29 Thread David Blaikie via cfe-commits
dwblaikie wrote: there's a couple of tests that use `ulimit` (`clang/test/SemaCXX/PR51712-large-array-constexpr-check-oom.cpp` and `clang/test/PCH/leakfiles.test`) - so that technique could be used to test this in a way that's fast enough to check in? https://github.com/llvm/llvm-project/pull

[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)

2024-05-29 Thread David Blaikie via cfe-commits
dwblaikie wrote: Ah, OK - guess this might not be an ABI issue, then - carry on :) (I'll leave it to other Clang-y folks to do the rest of the review, the ABI issues were my only concern) https://github.com/llvm/llvm-project/pull/92103 ___ cfe-commit

[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)

2024-05-28 Thread David Blaikie via cfe-commits
dwblaikie wrote: > @dwblaikie This patch will bring Clang in line with GCC and MSVC: > https://godbolt.org/z/nj715zbsW would the change be ABI incompatible with previous versions of clang? If so, then it'll need to be versioned in Clang's ClangABI handling, so that platforms (like Sony's Play

[clang] [llvm] [llvm] Add triples for managarm (PR #87845)

2024-05-28 Thread David Blaikie via cfe-commits
dwblaikie wrote: @MaskRay seems like this target might be too niche to go into LLVM at this time? is it worth considering some bar before accepting such a thing into LLVM, rather than encouraging folks to maintain such a thing in a branch for now? https://github.com/llvm/llvm-project/pull/8784

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-28 Thread David Blaikie via cfe-commits
@@ -4260,6 +4260,13 @@ defm strict_dwarf : BoolOption<"g", "strict-dwarf", "the specified version, avoiding features from later versions.">, NegFlag, BothFlags<[], [ClangOption, CLOption, DXCOption]>>, Group; +defm omit_unreferenced_members : BoolOption<"g", "omit

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-24 Thread David Blaikie via cfe-commits
dwblaikie wrote: > I think the comment about `s/members/methods/` is still outstanding - I agree > that methods is more descriptive than members. Yeah, seems I'm outvoted here. I'm a bit of a pedant for the C++ standard language, which doesn't talk about "methods", only "member functions". But

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-24 Thread David Blaikie via cfe-commits
@@ -4260,6 +4260,13 @@ defm strict_dwarf : BoolOption<"g", "strict-dwarf", "the specified version, avoiding features from later versions.">, NegFlag, BothFlags<[], [ClangOption, CLOption, DXCOption]>>, Group; +defm omit_unreferenced_members : BoolOption<"g", "omit

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-24 Thread David Blaikie via cfe-commits
@@ -2755,7 +2755,7 @@ CGDebugInfo::CreateTypeDefinition(const RecordType *Ty) { // Collect data fields (including static variables and any initializers). CollectRecordFields(RD, DefUnit, EltTys, FwdDecl); - if (CXXDecl) + if (CXXDecl && !CGM.getCodeGenOpts().DebugOmitUnr

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-24 Thread David Blaikie via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -debug-info-kind=limited -gomit-unreferenced-members %s -emit-llvm -o - | FileCheck %s dwblaikie wrote: Done https://github.com/llvm/llvm-project/pull/87018 ___ cfe-commits mailing

[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

2024-05-24 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie updated https://github.com/llvm/llvm-project/pull/87018 >From 6834c245205d1e38a615e97217dada3cd941ed03 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 2 Jun 2023 15:04:14 + Subject: [PATCH 1/3] [DebugInfo] Add flag to only emit referenced member functio

[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)

2024-05-20 Thread David Blaikie via cfe-commits
dwblaikie wrote: How's this compare with other implementations clang is trying to be compatible with (gcc (in the normal clang driver mode) and msvc (in clang-cl mode))? Would this be an ABI break against them, or is this intended as an ABI fix to align better with them? Or some third option?

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-05-13 Thread David Blaikie via cfe-commits
@@ -3424,6 +3445,26 @@ llvm::DIMacroFile *CGDebugInfo::CreateTempMacroFile(llvm::DIMacroFile *Parent, return DBuilder.createTempMacroFile(Parent, Line, FName); } +llvm::DILocation *CGDebugInfo::CreateTrapFailureMessageFor( dwblaikie wrote: Eh, I'm not too

[clang] Add support for builtin_verbose_trap (PR #79230)

2024-05-13 Thread David Blaikie via cfe-commits
dwblaikie wrote: Hmm, do other builtins actually end up as symbol names? I think most of them lower to an instruction or two - I guess this one doesn't lower to an actual symbol, only a DWARF symbol - but maybe that's still different enough it should use an llvm or clang in the name... (sorry,

[clang] [clang-tools-extra] [flang] [llvm] [mlir] [polly] [test]: fix filecheck annotation typos (PR #91854)

2024-05-13 Thread David Blaikie via cfe-commits
dwblaikie wrote: @pogo59 - you might find this interesting in terms of bitrotten tests, etc. https://github.com/llvm/llvm-project/pull/91854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [llvm] [MC,llvm-readobj,yaml2obj] Support CREL relocation format (PR #91280)

2024-05-09 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Switched to 0x4014 (generic range) to retain linker errors while making > the experimental status stand out. Add a comment to make the intention > clearer. Seems a bit weird/problematic, using something in the reserved range/not in a user extension space, but I guess so

[clang] [llvm] [MC,clang,llvm-readobj,yaml2obj] Support CREL relocation format (PR #91280)

2024-05-08 Thread David Blaikie via cfe-commits
dwblaikie wrote: > This approahc parallels the strategy used for > [-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang](https://reviews.llvm.org/D125142), > albeit a nicer name. Fair enough - yeah, if we're wordsmithing this. Maybe "allow" would be a good word, rather th

[clang] [llvm] [MC,clang,llvm-readobj,yaml2obj] Support CREL relocation format (PR #91280)

2024-05-07 Thread David Blaikie via cfe-commits
dwblaikie wrote: Oh, and I take it there's no /official/ extension space in the SHT_* space? The intent is to standardize it where it lies? (like use 20 for the shipped version? Or eventually get some lower designation?) I understand tnhe hesitance to use "SHT_LLVM" or the like (though equally

[clang] [llvm] [MC,clang,llvm-readobj,yaml2obj] Support CREL relocation format (PR #91280)

2024-05-07 Thread David Blaikie via cfe-commits
dwblaikie wrote: Presumably this'll be split out into separate reviews for the components here? (I'd guess llvm-mc then clang integrated assembler, with readobj and yaml2obj in any order/don't have dependencies, unless they're needed for testing, in which case I guess they come first?) I hesi

[clang] [Modules] Detect ODR mismatches for enums in non-C++ like in C++. (PR #90298)

2024-05-06 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Though we detect when the types aren't identical and don't try to use them > interchangeably. The change extends the existing behavior for structs/unions > to enums. OK, still a bit confused though - "like in C++", I assume in C++ we reject mismatched types coming from dif

  1   2   3   4   5   6   7   8   9   10   >