[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #83124)

2024-04-17 Thread David Blaikie via cfe-commits
dwblaikie wrote: Simplified a bit more: ``` template void f1() { int (*x)[1] = new int[1][1]; // fails } template void f1(); void f2() { int (*x)[1] = new int[1][1]; // passes } ``` https://godbolt.org/z/MhaYbvefG - yeah seems pretty clear this is a regression. Compiles with GCC, fails

[clang] [llvm] [Clang] Emit DW_TAG_template_alias for template aliases (PR #87623)

2024-04-15 Thread David Blaikie via cfe-commits
dwblaikie wrote: > Thanks @dwblaikie > > > Bit unfortunate to store template parameters in different ways (in the > > extraData for the alias template, but in the templateParams for the > > composite types) - but I guess it'd be more invasive to try to represent > > alias templates as

[clang] [llvm] [Clang] Emit DW_TAG_template_alias for template aliases (PR #87623)

2024-04-12 Thread David Blaikie via cfe-commits
dwblaikie wrote: Re: code: Looks about right. Bit unfortunate to store template parameters in different ways (in the `extraData` for the alias template, but in the `templateParams` for the composite types) - but I guess it'd be more invasive to try to represent alias templates as composite

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

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

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-12 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Give it a go https://github.com/llvm/llvm-project/pull/85050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-12 Thread David Blaikie via cfe-commits
@@ -1061,6 +1070,16 @@ CodeGenAction::CreateASTConsumer(CompilerInstance , StringRef InFile) { CI.getPreprocessor().addPPCallbacks(std::move(Callbacks)); } + if (CI.getFrontendOpts().GenReducedBMI && + !CI.getFrontendOpts().ModuleOutputPath.empty()) { +

[clang] [llvm] [Clang] Emit DW_TAG_template_alias for template aliases (PR #87623)

2024-04-12 Thread David Blaikie via cfe-commits
dwblaikie wrote: > > I'm a little uncomfortable with adding a new user-facing option for > > template aliases. Even with that in place, we should not warn and refuse to > > do what the user asked for, based on DWARF version. -gdwarf-2 -gsplit-dwarf > > generates a .dwo file claiming to be v2,

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

2024-04-02 Thread David Blaikie via cfe-commits
dwblaikie wrote: > As for impact, I believe @namhyung did some measurement for building the > Linux kernel, and it does not have a significant impact. That'd surprise me quite a bit - perhaps a self-host build of clang (ideally in Google's build config, that being the one you and I care about

[clang] [clang][Sema] Ignore the parentheses in the guard of DiagnoseUnexpandedParameterPack (PR #86401)

2024-04-01 Thread David Blaikie via cfe-commits
dwblaikie wrote: Thanks for continuing to look into this! @cor3ntin - perhaps you've got some more thoughts on this too? https://github.com/llvm/llvm-project/pull/86401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-04-01 Thread David Blaikie via cfe-commits
@@ -1483,10 +1483,15 @@ void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) { if (D->isThisDeclarationADefinition()) Record.AddCXXDefinitionData(D); - // Store (what we currently believe to be) the key function to avoid - // deserializing every method so we can

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

2024-04-01 Thread David Blaikie via cfe-commits
@@ -41,9 +43,10 @@ Base::~Base() {} // CHECK: @_ZTSW3Mod4Base = constant // CHECK: @_ZTIW3Mod4Base = constant -// CHECK-INLINE: @_ZTVW3Mod4Base = linkonce_odr {{.*}}unnamed_addr constant -// CHECK-INLINE: @_ZTSW3Mod4Base = linkonce_odr {{.*}}constant -// CHECK-INLINE:

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-01 Thread David Blaikie via cfe-commits
@@ -3017,6 +3017,7 @@ defm prebuilt_implicit_modules : BoolFOption<"prebuilt-implicit-modules", def fmodule_output_EQ : Joined<["-"], "fmodule-output=">, Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>, + MarshallingInfoString>, dwblaikie

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-01 Thread David Blaikie via cfe-commits
@@ -193,6 +193,20 @@ DwarfFissionKind getDebugFissionKind(const Driver , const llvm::opt::ArgList , llvm::opt::Arg *); +// Calculate the output path of the module file when compiling a module unit +//

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

2024-03-28 Thread David Blaikie via cfe-commits
dwblaikie wrote: Cleaning up some old branches - @pogo59 @rnk who commented on the original https://reviews.llvm.org/D152017 I think the only outstanding thing was the flag name, I've renamed it from `-gincomplete-types` to `-gomit-unreferenced-members` to try to address the feedback. It's

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

2024-03-28 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie created https://github.com/llvm/llvm-project/pull/87018 Complete C++ type information can be quite expensive - and there's limited value in representing every member function, even those that can't be called (we don't do similarly for every non-member function

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

2024-03-28 Thread David Blaikie via cfe-commits
dwblaikie wrote: > > Reading LLVM IR lit CHECK lines from clang codegen is a bit difficult - > > could you include some simple examples (perhaps from the new clang tests in > > this patch) showing the DWARF output just as comments in this review for > > something more easily glanceable? > >

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

2024-03-28 Thread David Blaikie via cfe-commits
@@ -60,11 +63,11 @@ int use() { // CHECK-NOT: @_ZTSW3Mod4Base = constant // CHECK-NOT: @_ZTIW3Mod4Base = constant -// CHECK: @_ZTVW3Mod4Base = external unnamed_addr +// CHECK: @_ZTVW3Mod4Base = external -// CHECK-INLINE: @_ZTVW3Mod4Base = linkonce_odr {{.*}}unnamed_addr

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

2024-03-28 Thread David Blaikie via cfe-commits
@@ -41,9 +43,10 @@ Base::~Base() {} // CHECK: @_ZTSW3Mod4Base = constant // CHECK: @_ZTIW3Mod4Base = constant -// CHECK-INLINE: @_ZTVW3Mod4Base = linkonce_odr {{.*}}unnamed_addr constant -// CHECK-INLINE: @_ZTSW3Mod4Base = linkonce_odr {{.*}}constant -// CHECK-INLINE:

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

2024-03-28 Thread David Blaikie via cfe-commits
@@ -1483,10 +1483,15 @@ void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) { if (D->isThisDeclarationADefinition()) Record.AddCXXDefinitionData(D); - // Store (what we currently believe to be) the key function to avoid - // deserializing every method so we can

[clang] [C++20] [Modules] Introduce -fmodules-reduced-bmi (PR #85050)

2024-03-28 Thread David Blaikie via cfe-commits
dwblaikie wrote: > > > > > @iains @dwblaikie Understood. And I thought the major problem is that > > > > > there are a lot flags from clang modules. And it is indeed confusing. > > > > > But given we have to introduce new flags in this case, probably we > > > > > can only try to make it more

[clang] [clang][Sema] Ignore the parentheses in the guard of DiagnoseUnexpandedParameterPack (PR #86401)

2024-03-28 Thread David Blaikie via cfe-commits
dwblaikie wrote: Yep, the original code still crashes with this PR applied, and the reduced test case comes down to something identical to the code shown in https://github.com/llvm/llvm-project/pull/86401#issuecomment-2024151742 with a stack trace that looks the same as the one caused by the

[clang] [clang][Sema] Ignore the parentheses in the guard of DiagnoseUnexpandedParameterPack (PR #86401)

2024-03-27 Thread David Blaikie via cfe-commits
dwblaikie wrote: > @dwblaikie Feel free to checkout this patch locally and see if it resolves > the original issue - I won't merge it until you confirm it works or discover > another issue that goes beyond the scope of this patch. (e.g. another > aforementioned issue) First glance it seems

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-03-25 Thread David Blaikie via cfe-commits
dwblaikie wrote: > For those files in the repository that do need CRLF endings, I've adopted a > policy of eol=crlf which means that git will store them in history with LF, > but regardless of user config, they'll be checked out in tree with CRLF. This ^ seems a bit problematic to me, though

[clang] [clang][Sema] Ignore the parentheses in the guard of DiagnoseUnexpandedParameterPack (PR #86401)

2024-03-25 Thread David Blaikie via cfe-commits
dwblaikie wrote: Hmm, actually - does this fix address /other/ ways a pack could appear, like this? https://godbolt.org/z/oez8TbGqM Presumably a pack could appear in a variety of expressions, not just wrapped in parens - could be in a function call (as in the above example), or nested

[clang] [clang][Sema] Ignore the parentheses in the guard of DiagnoseUnexpandedParameterPack (PR #86401)

2024-03-25 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. LGTM, seems consistent with the previous patch - thanks! https://github.com/llvm/llvm-project/pull/86401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-25 Thread David Blaikie via cfe-commits
dwblaikie wrote: +1 to @iains's comments about being careful about the introduction and naming of driver flags & probably avoid it in this case, if possible, or try to make it clearly experimental. https://github.com/llvm/llvm-project/pull/85050 ___

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

2024-03-18 Thread David Blaikie via cfe-commits
dwblaikie wrote: Reading LLVM IR lit CHECK lines from clang codegen is a bit difficult - could you include some simple examples (perhaps from the new clang tests in this patch) showing the DWARF output just as comments in this review for something more easily glanceable? As for flags - I

[clang] [clang][Sema] Skip the RequiresExprBodyDecls for lambda dependencies (PR #83997)

2024-03-13 Thread David Blaikie via cfe-commits
dwblaikie wrote: FWIW, @jyknight's example fails to compile with GCC - succeeds with clang 18 release but assert-fails with clang 18 +Asserts build. (not sure about the original/full internal reproduction - we have a way to run compile with assertions enaled, but I'm not sure I'm holding it

[clang] f15a790 - Remove use of reference lifetime extension introduced in cdde0d9

2024-03-13 Thread David Blaikie via cfe-commits
Author: David Blaikie Date: 2024-03-13T16:03:16Z New Revision: f15a790fd383665ec4defa0711e975476fd8b18b URL: https://github.com/llvm/llvm-project/commit/f15a790fd383665ec4defa0711e975476fd8b18b DIFF: https://github.com/llvm/llvm-project/commit/f15a790fd383665ec4defa0711e975476fd8b18b.diff

[clang] [clang-tools-extra] [llvm] [llvm][Support] Add and use errnoAsErrorCode (PR #84423)

2024-03-08 Thread David Blaikie via cfe-commits
dwblaikie wrote: Cool cool - thanks for the extra context! https://github.com/llvm/llvm-project/pull/84423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [llvm][Support] Add and use errnoAsErrorCode (PR #84423)

2024-03-08 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Sounds OK to me. (though several other instances of system_category are touched in this patch - out of curiosity, how are those different from the one fixed case you called out in JSONTransport.cpp? Are the other uses of system_category

[clang] [CLANG][DWARF] Do not emit -ggnu-pubnames for LLDB tuning, unless -ggnu-pubnames is specified. (PR #83331)

2024-03-06 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Yeah, still not sure why something like `%clang -### -c -target x86_64 -g -gsplit-dwarf %s` wouldn't change behavior on a darwin host and cause the check for gnu-pubnames to fail there but if you say that works, guess that's OK & if

[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] Rename llvm::ThreadPool -> llvm::DefaultThreadPool (NFC) (PR #83702)

2024-03-05 Thread David Blaikie via cfe-commits
dwblaikie wrote: Oh, maybe issues related to layered patches - this is intended to be submitted after the introduction of the ThreadPoolInterface? But includes those changes in this review at the moment (I still haven't figured out what we're doing for dependent changes - and I thought the

[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] Rename llvm::ThreadPool -> llvm::DefaultThreadPool (NFC) (PR #83702)

2024-03-05 Thread David Blaikie via cfe-commits
dwblaikie wrote: > I did the first part of the renaming @dwblaikie : looks good? Hmm - this patch still seems to have both renamings in it, if I'm reading the PR correctly? I take it from the subject that isn't the intent/the intent is that his patch only does the

[clang] [llvm] [RISCV] Improve error message when the extension is not supported (PR #83989)

2024-03-05 Thread David Blaikie via cfe-commits
dwblaikie wrote: perhaps the llvm libSupport prats of this change should be unit tested in LLVM, rather than only tested indirectly in clang? https://github.com/llvm/llvm-project/pull/83989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread David Blaikie via cfe-commits
@@ -1591,6 +1591,14 @@ static void checkConfigMacro(Preprocessor , StringRef ConfigMacro, } } +static void checkConfigMacros(Preprocessor , Module *M, + SourceLocation ImportLoc) { + clang::Module *TopModule = M->getTopLevelModule(); + for

[clang] [llvm] [HIP] add --offload-compression-level= option (PR #83605)

2024-03-04 Thread David Blaikie via cfe-commits
dwblaikie wrote: > level 20 is a sweet spot for both compression rate and compression time I wonder how much this is overfitting for kernels of a particular size, though? (is it making the window just large enough that there's some "memory" from one kernel to the next - but a slightly larger

[clang] [CLANG][DWARF] Do not emit -ggnu-pubnames for LLDB tuning, unless -ggnu-pubnames is specified. (PR #83331)

2024-03-01 Thread David Blaikie via cfe-commits
@@ -11,7 +11,6 @@ // NOINLINE-NOT: "-fsplit-dwarf-inlining" // SPLIT-NOT: "-dumpdir" // SPLIT: "-debug-info-kind=constructor" -// SPLIT-SAME: "-ggnu-pubnames" dwblaikie wrote: Nah, I think that's probably fine without an explicit `-ggdb` test - though

[clang] [CLANG][DWARF] Do not emit -ggnu-pubnames for LLDB tuning, unless -ggnu-pubnames is specified. (PR #83331)

2024-03-01 Thread David Blaikie via cfe-commits
@@ -11,7 +11,6 @@ // NOINLINE-NOT: "-fsplit-dwarf-inlining" // SPLIT-NOT: "-dumpdir" // SPLIT: "-debug-info-kind=constructor" -// SPLIT-SAME: "-ggnu-pubnames" dwblaikie wrote: > As discussed in original PR, #82840 , the idea is if -gsplit-dwarf with >

[clang] [Sema] -Wpointer-bool-conversion: suppress lambda function pointer conversion diagnostic during instantiation (PR #83497)

2024-03-01 Thread David Blaikie via cfe-commits
dwblaikie wrote: Presumably similar things might show up in macros? But can cross that bridge when we come to it. Perhaps we have some/could use some generic utility for this sort of contextual warning "if these things are literally written next to each other, warn, but if they came to be

[clang] [CLANG][DWARF] Do not emit -ggnu-pubnames for split dwarf version 5 (PR #83331)

2024-03-01 Thread David Blaikie via cfe-commits
@@ -11,7 +11,6 @@ // NOINLINE-NOT: "-fsplit-dwarf-inlining" // SPLIT-NOT: "-dumpdir" // SPLIT: "-debug-info-kind=constructor" -// SPLIT-SAME: "-ggnu-pubnames" dwblaikie wrote: has this lost coverage for non `-glldb` configurations? (like would we still

[clang] [Clang][DebugInfo] Use CGDebugInfo::createFile in CGDebugInfo::CreateCompileUnit (#83174) (PR #83175)

2024-02-27 Thread David Blaikie via cfe-commits
dwblaikie wrote: Some test coverage would be good to help demonstrate the issue/fix https://github.com/llvm/llvm-project/pull/83175 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG][DWARF] Do not emit -ggnu-pubnames for split dwarf version 5. (PR #82840)

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

[clang] [clang][NFC] Trim license header comments to 81 characters (PR #82919)

2024-02-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: +1 to @pogo59's comment about pruning complete paths - I suspect they're in the minority. Might be worth checking whether the `===` at the start and end is markup for any particular thing (I /think/ the `-*- C++ -*-` is load bearing for some editors to inform them this `.h`

[clang] [attributes][analyzer] Generalize [[clang::suppress]] to declarations. (PR #80371)

2024-02-26 Thread David Blaikie via cfe-commits
dwblaikie wrote: Commit without precommit review is fine, especially from a code owner - if you only wanted the PR for automated precommit checking, you can add the `skip-precommit-approval` to indicate that the PR isn't intended for precommit review. But, yeah, otherwise it's good that if

[clang] [clang-tools-extra] [compiler-rt] [flang] [libclc] [libcxx] [lld] [lldb] [llvm] [NFC] Remove trailing whitespace across all non-test related files (PR #82838)

2024-02-23 Thread David Blaikie via cfe-commits
dwblaikie wrote: The dev policy says "Avoid committing formatting- or whitespace-only changes outside of code you plan to make subsequent changes to." - I think it's reasonable to consider changing this, but probably under the "clang-format everything" or a similar discussion (broad

[clang] [CLANG][DWARF] Do not emit -ggnu-pubnames for split dwarf version 5. (PR #82840)

2024-02-23 Thread David Blaikie via cfe-commits
dwblaikie wrote: If you're debugging with lldb you should probably be using -glldb - if you're doing that, certainly gnu-pubnames should not be enabled by default or implicitly by gsplit-dwarf. I'd say -gsplit-dwarf -glldb probably doesn't need any names/accelerator table by default (any

[clang] [attributes][analyzer] Generalize [[clang::suppress]] to declarations. (PR #80371)

2024-02-20 Thread David Blaikie via cfe-commits
dwblaikie wrote: did I miss something - it looks like this was committed without approval? https://github.com/llvm/llvm-project/pull/80371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

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

[clang] [clang-tools-extra] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-02-13 Thread David Blaikie via cfe-commits
@@ -5401,6 +5409,8 @@ std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const { // feasible some day. return TA.getAsIntegral().getBitWidth() <= 64 && IsReconstitutableType(TA.getIntegralType()); + case

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-06 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [clang][Sema] Subclass `-Wshorten-64-to-32` under `-Wimplicit-int-conversion` (PR #80814)

2024-02-06 Thread David Blaikie via cfe-commits
dwblaikie wrote: Can't seem to load the image - and generally a copy/paste of the text is more usable for everyone than a screenshot. If you could include the copy/pasted text, that'd be handy, thanks! https://github.com/llvm/llvm-project/pull/80814

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
@@ -610,6 +610,345 @@ the following style significantly: The key part of the tip is to reduce the duplications from the text includes. +Ideas for converting to modules +--- + +For new libraries, we encourage them to use modules completely from day

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

2024-02-05 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie commented: Generally seems like good stuff to write down - I'm not sure about the ABI breaking version (that mostly seems like it would make more problems than solutions). Commented on some minor grammatical issues. https://github.com/llvm/llvm-project/pull/80687

[clang] [docs] [C++20] [Modules] Ideas for transitioning to modules (PR #80687)

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

[llvm] [clang] Revert "[RISCV] Relax march string order constraint" (PR #79976)

2024-01-30 Thread David Blaikie via cfe-commits
dwblaikie wrote: Sure - wrote down my thoughts here: https://discourse.llvm.org/t/prs-without-approvals-muddy-the-waters/76656 (my understanding is that this (waiting for approval after sending out a review - and that all PRs are reviews until we figure out a way to differentiate them) is

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

2024-01-30 Thread David Blaikie via cfe-commits
@@ -346,6 +346,14 @@ class CGDebugInfo { const FieldDecl *BitFieldDecl, const llvm::DIDerivedType *BitFieldDI, llvm::ArrayRef PreviousFieldsDI, const RecordDecl *RD); + // A cache that maps artificial inlined function names used for + // __builtin_verbose_trap

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

2024-01-30 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: There's

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

2024-01-30 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( +llvm::DebugLoc TrapLocation, StringRef

[clang] [C++20] [Modules] Introduce -fskip-odr-check-in-gmf (PR #79959)

2024-01-30 Thread David Blaikie via cfe-commits
dwblaikie wrote: I'd still idly vote against adding this flag/support - but if other modules contributors feel it's the right thing to do, I won't stand in the way. https://github.com/llvm/llvm-project/pull/79959 ___ cfe-commits mailing list

[llvm] [clang] Revert "[RISCV] Relax march string order constraint" (PR #79976)

2024-01-30 Thread David Blaikie via cfe-commits
dwblaikie wrote: (Please don't send pull requests that aren't going to be reviewed - commit directly instead. Otherwise it's unclear which pull requests are expecting review (& should wait on it) and which pull requests don't need review. Especially for new contributors, it'd be good to not

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

2024-01-30 Thread David Blaikie via cfe-commits
dwblaikie wrote: > > Could you show the stack (omitting/annotating the repeated part) that leads > > to failure? and/or the AST shape that leads to failure? > > See the test I added. All you need is ~10k overloads of a method in a class > and a `using Base::func` in the derived class. The AST

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

2024-01-29 Thread David Blaikie via cfe-commits
dwblaikie wrote: Could you show the stack (omitting/annotating the repeated part) that leads to failure? and/or the AST shape that leads to failure? https://github.com/llvm/llvm-project/pull/79875 ___ cfe-commits mailing list

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

2024-01-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] Add support for builtin_verbose_trap (PR #79230)

2024-01-24 Thread David Blaikie via cfe-commits
@@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify %s + +#if !__has_builtin(__builtin_verbose_trap) +#error +#endif dwblaikie wrote: Is this necessary? https://github.com/llvm/llvm-project/pull/79230

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

2024-01-24 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie commented: neat idea (I imagine some debuggers will trip over the space in the inlined name, but seems pretty good) I'd guess sometimes we'll lose the inlined debug info if two of these traps are merged, fwiw - but it's probably relatively robust, apart from that.

[clang] [clang-tools-extra] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-01-24 Thread David Blaikie via cfe-commits
@@ -5401,6 +5409,8 @@ std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const { // feasible some day. return TA.getAsIntegral().getBitWidth() <= 64 && IsReconstitutableType(TA.getIntegralType()); + case

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-20 Thread David Blaikie via cfe-commits
dwblaikie wrote: > @zmodem template parameter shadowing is an extension with > `-fms-compatibility`, if that works Given the prevalence (wellr, given how quickly folks have tripped over it probably indicates it's fairly prevalent), I think it'll need to be/should be pulled out into its own

Re: [clang] d5000e9 - rename to 'try' isntead of 'Try'x

2024-01-17 Thread David Blaikie via cfe-commits
Ah, no worries - thanks for being aware of it & I get we're all having some teething problems with github, etc. On Wed, Jan 17, 2024 at 3:36 PM Erich Keane wrote: > yeah, something weird happened with this one that i haven't figured out > yet. This was a response to a review comment, and was

Re: [clang] cf3421d - [Format] Fix a warning

2024-01-17 Thread David Blaikie via cfe-commits
In general, if the lambda is only used within its scope, I'd suggest switching to a default ref capture "[&]" to reduce maintenance burden of keeping the capture list up to date. On Thu, Jan 11, 2024 at 12:09 PM Kazu Hirata via cfe-commits < cfe-commits@lists.llvm.org> wrote: > > Author: Kazu

Re: [clang] d5000e9 - rename to 'try' isntead of 'Try'x

2024-01-17 Thread David Blaikie via cfe-commits
Be good to have more description of "why" in commit messages in general (the "what" is provided by the patch itself, especially when it's a small one like this) - I guess this was to match naming conventions, that this file generally already follows lower-first, etc. On Tue, Jan 16, 2024 at 7:04 

[llvm] [clang] [LLVM][DWARF] Fix accelerator table switching between CU and TU (PR #77511)

2024-01-10 Thread David Blaikie via cfe-commits
@@ -925,6 +926,7 @@ class DwarfDebug : public DebugHandlerBase { /// Sets the current DWARF5AccelTable to use. void setCurrentDWARF5AccelTable(const DWARF5AccelTableKind Kind) { +CurrentKind = Kind; dwblaikie wrote: Could skip this variable and check

[clang] [llvm] [LLVM][DWARF] Fix accelerator table switching between CU and TU (PR #77511)

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

[clang] [llvm] [LLVM][DWARF] Fix accelerator table switching between CU and TU (PR #77511)

2024-01-10 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Looks OK but please skip the extra assert-only `CurrentKind` variable in favor of testing the `CurrentDebugNames` value. https://github.com/llvm/llvm-project/pull/77511 ___ cfe-commits mailing

[clang] [clang][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72235)

2024-01-09 Thread David Blaikie via cfe-commits
dwblaikie wrote: looking good from what I've tested - thanks again! https://github.com/llvm/llvm-project/pull/72235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Load Specializations Lazily (PR #76774)

2024-01-09 Thread David Blaikie via cfe-commits
dwblaikie wrote: @ilya-biryukov any chance you/your folks could test this change for performance implications in google? It's especially helpful to CERN, but the last iteration of this direction had some regressions that stalled out progress on that version a few years ago, so it'd be good to

[clang] [llvm] [CloneFunction][DebugInfo] Avoid cloning DILocalVariables of inlined functions (PR #75385)

2024-01-09 Thread David Blaikie via cfe-commits
https://github.com/dwblaikie approved this pull request. Yeah, looks OK to me - sorry for the delay. https://github.com/llvm/llvm-project/pull/75385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [SpecialCaseList] Use glob by default (PR #74809)

2024-01-08 Thread David Blaikie via cfe-commits
dwblaikie wrote: (this sort of example reinforces my concerns expressed earlier that this kind of silent change in behavior is problematic - moreso in the wild, rather than in Google's fairly constrained environment (frequent updates, good test coverage, and good bisection infrastructure, etc

[clang] [clang][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72235)

2024-01-05 Thread David Blaikie via cfe-commits
dwblaikie wrote: Thanks! https://github.com/llvm/llvm-project/pull/72235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-01-04 Thread David Blaikie via cfe-commits
@@ -0,0 +1,50 @@ +// REQUIRES: !system-windows + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \ +// RUN: -emit-module-interface -o %t/foo-layer1.pcm +// RUN: %clang_cc1 -std=c++20

[clang] [clang][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72235)

2024-01-04 Thread David Blaikie via cfe-commits
dwblaikie wrote: Yes, in the totally reduced reproducer - another debugger might be able to do this name lookup with only a declaration, but I understand that at least Clang's AST expression evaluator wouldn't be able to handle this case. (though perhaps the lldb-eval work will provide some

[clang] [clang][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72235)

2024-01-03 Thread David Blaikie via cfe-commits
dwblaikie wrote: In our practical example this clearly reproduces in cases where the definition is available in another .dwo within the same executable. So I'm guessing something needs to go looking for a definition (& then if it can't find one, fail gracefully) here. There's probably some

[clang] [clang][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72235)

2024-01-03 Thread David Blaikie via cfe-commits
dwblaikie wrote: Yeah, that seems to do it: ``` struct t1 { t1(); static int i; }; int t1::i = 43; int main() { } ``` ``` $ clang++-tot -gsplit-dwarf -g test.cpp $ lldb ./a.out -o "b main" -o "run" -o "p t1::i" -batch This is google-lldb. Help: http://go/lldb. File a bug: http://go/lldb-bug.

[clang] [clang][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72235)

2024-01-03 Thread David Blaikie via cfe-commits
dwblaikie wrote: Perhaps not surprisingly from the backtrace, the DIE that's tripping things up is the DW_TAG_variable here: ``` 0x3819: DW_TAG_class_type DW_AT_name ("ScopedLockService") DW_AT_declaration (true) 0x381b: DW_TAG_variable

[clang] [clang][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72235)

2024-01-03 Thread David Blaikie via cfe-commits
dwblaikie wrote: > > Should've mentioned this earlier, but we've been seeing crashes in lldb due > > to this change (though possibly related to our use of GALA python/gdb > > interop https://github.com/sivachandra/gala - we haven't isolated the > > failures from that yet (though we've been

[clang] [clang][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (PR #72235)

2024-01-02 Thread David Blaikie via cfe-commits
dwblaikie wrote: Should've mentioned this earlier, but we've been seeing crashes in lldb due to this change (though possibly related to our use of GALA python/gdb interop https://github.com/sivachandra/gala - we haven't isolated the failures from that yet (though we've been using it for

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

2023-12-19 Thread David Blaikie via cfe-commits
@@ -0,0 +1,50 @@ +// REQUIRES: !system-windows + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \ +// RUN: -emit-module-interface -o %t/foo-layer1.pcm +// RUN: %clang_cc1 -std=c++20

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

2023-12-19 Thread David Blaikie via cfe-commits
@@ -0,0 +1,50 @@ +// REQUIRES: !system-windows + +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \ +// RUN: -emit-module-interface -o %t/foo-layer1.pcm +// RUN: %clang_cc1 -std=c++20

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