[clang] [clang-tools-extra] [llvm] [clang][modules] stdarg.h and stddef.h shouldn't directly declare anything (PR #90676)

2024-05-06 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/90676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/90574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
@@ -932,6 +932,12 @@ def warn_module_conflict : Warning< InGroup; // C++20 modules +def err_module_decl_cannot_be_macros : Error< + "the name of a module%select{| partition}0 declaration cannot contains " + "an object-like macro %1, and the macro will not expand" +

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
@@ -1329,6 +1341,129 @@ bool Preprocessor::LexAfterModuleImport(Token ) { return true; } +/// Lex a token following the 'module' contextual keyword. +/// +/// [cpp.module]/p2: +/// The pp-tokens, if any, of a pp-module shall be of the form: +/// pp-module-name

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
@@ -932,6 +932,12 @@ def warn_module_conflict : Warning< InGroup; // C++20 modules +def err_module_decl_cannot_be_macros : Error< + "the name of a module%select{| partition}0 declaration cannot contains " + "an object-like macro %1, and the macro will not expand" +

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
@@ -1329,6 +1341,129 @@ bool Preprocessor::LexAfterModuleImport(Token ) { return true; } +/// Lex a token following the 'module' contextual keyword. +/// +/// [cpp.module]/p2: +/// The pp-tokens, if any, of a pp-module shall be of the form: +/// pp-module-name

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
@@ -1329,6 +1341,129 @@ bool Preprocessor::LexAfterModuleImport(Token ) { return true; } +/// Lex a token following the 'module' contextual keyword. +/// +/// [cpp.module]/p2: +/// The pp-tokens, if any, of a pp-module shall be of the form: +/// pp-module-name

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,87 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: split-file %s %t + +// RUN: %clang_cc1 -std=c++20 %t/A.cppm -triple x86_64-linux-gnu -verify +// RUN: %clang_cc1 -std=c++20 %t/B.cppm -triple x86_64-linux-gnu -verify +// RUN: %clang_cc1 -std=c++20 %t/C.cppm

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
@@ -1329,6 +1341,129 @@ bool Preprocessor::LexAfterModuleImport(Token ) { return true; } +/// Lex a token following the 'module' contextual keyword. +/// +/// [cpp.module]/p2: +/// The pp-tokens, if any, of a pp-module shall be of the form: +/// pp-module-name

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-05-06 Thread Michael Spencer via cfe-commits
Bigcheese wrote: > The paper does not clearly says whether disallow function-like macro is also > needed, but I think disallow function-like macro has the same goal as the > paper. WDYT? @cor3ntin @ChuanqiXu9 > > The wording in the paper said: _No identifier in the pp-module-name or >

[clang] [clang-tools-extra] [llvm] [clang][modules] stdarg.h and stddef.h shouldn't directly declare anything (PR #90676)

2024-05-02 Thread Michael Spencer via cfe-commits
@@ -15,9 +15,11 @@ const HeaderMapCollector::RegexHeaderMap *getSTLPostfixHeaderMap() { static const HeaderMapCollector::RegexHeaderMap STLPostfixHeaderMap = { {"include/__stdarg___gnuc_va_list.h$", ""}, {"include/__stdarg___va_copy.h$", ""}, +

[clang] [clang-tools-extra] [llvm] [clang][modules] stdarg.h and stddef.h shouldn't directly declare anything (PR #90676)

2024-05-02 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese commented: I think I like this as a solution, although I wonder if __stdarg_guard_macro.h would be a better name. The name now somewhat implies that it contains the macros that stddef and stdarg define. https://github.com/llvm/llvm-project/pull/90676

[clang] [clang-tools-extra] [llvm] [clang][modules] stdarg.h and stddef.h shouldn't directly declare anything (PR #90676)

2024-05-02 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/90676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-30 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. I did some testing today and this change seems fine. For scanning modules I actually saw some get smaller with your change. https://github.com/llvm/llvm-project/pull/86912 ___ cfe-commits

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-24 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,289 @@ +//===--- cc1modbuildd_main.cpp - Clang CC1 Module Build Daemon ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-19 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,25 @@ +// Check that a clang invocation can spawn and handshake with a module build daemon + +// RUN: %kill-process "-cc1modbuildd mbd-handshake" +// RUN: rm -rf mbd-handshake %t +// RUN: split-file %s %t + +//--- main.c +int main() {return 0;} + +// RUN: %clang

[clang] [clang][deps] Only bypass scanning VFS for the module cache (PR #88800)

2024-04-18 Thread Michael Spencer via cfe-commits
@@ -201,11 +201,8 @@ const CachedRealPath ::CacheShard:: return *StoredRealPath; } -static bool shouldCacheStatFailures(StringRef Filename) { - StringRef Ext = llvm::sys::path::extension(Filename); - if (Ext.empty()) -return false; // This may be the module cache

[clang] [llvm] [llvm][support] Implement tracing virtual file system (PR #88326)

2024-04-17 Thread Michael Spencer via cfe-commits
@@ -1125,6 +1125,54 @@ class YAMLVFSWriter { void write(llvm::raw_ostream ); }; +/// File system that tracks the number of calls to the underlying file system. +/// This is particularly useful when wrapped around \c RealFileSystem to add +/// lightweight tracking of

[clang] [llvm] [llvm][support] Implement tracing virtual file system (PR #88326)

2024-04-17 Thread Michael Spencer via cfe-commits
@@ -2933,8 +2933,21 @@ recursive_directory_iterator::increment(std::error_code ) { return *this; } +void TracingFileSystem::printImpl(raw_ostream , PrintType Type, Bigcheese wrote: Should this print the current stat values?

[clang] [llvm] [llvm][support] Implement tracing virtual file system (PR #88326)

2024-04-17 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. lgtm with some comments. https://github.com/llvm/llvm-project/pull/88326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][support] Implement tracing virtual file system (PR #88326)

2024-04-17 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/88326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-17 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,289 @@ +//===--- cc1modbuildd_main.cpp - Clang CC1 Module Build Daemon ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-17 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,289 @@ +//===--- cc1modbuildd_main.cpp - Clang CC1 Module Build Daemon ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-17 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,289 @@ +//===--- cc1modbuildd_main.cpp - Clang CC1 Module Build Daemon ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-17 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese commented: Looks about ready to land, just a few comments. https://github.com/llvm/llvm-project/pull/67562 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-17 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/67562 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Parameterize Initialization of `clang::CodeGenerator` on a `TargetInfo` instance which may differ from the one in the `ASTContext` (PR #88977)

2024-04-16 Thread Michael Spencer via cfe-commits
@@ -26,123 +26,132 @@ namespace clang { class VarDecl; class FunctionDecl; class ImportDecl; - -/// ASTConsumer - This is an abstract interface that should be implemented by -/// clients that read ASTs. This abstraction layer allows the client to be -/// independent of

[clang] [NFC] Parameterize Initialization of `clang::CodeGenerator` on a `TargetInfo` instance which may differ from the one in the `ASTContext` (PR #88977)

2024-04-16 Thread Michael Spencer via cfe-commits
@@ -26,123 +26,132 @@ namespace clang { class VarDecl; class FunctionDecl; class ImportDecl; - -/// ASTConsumer - This is an abstract interface that should be implemented by -/// clients that read ASTs. This abstraction layer allows the client to be -/// independent of

[clang] [clang][deps] Support single-file mode for all formats (PR #88764)

2024-04-15 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. lgtm. Good to get rid of more unneeded differences between ways of doing modules. https://github.com/llvm/llvm-project/pull/88764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-10 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,278 @@ +//===--- cc1modbuildd_main.cpp - Clang CC1 Module Build Daemon ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-10 Thread Michael Spencer via cfe-commits
@@ -237,18 +251,24 @@ int cc1modbuildd_main(ArrayRef Argv) { if (!validBasePathLength(BasePath)) { errs() << "BasePath '" << BasePath << "' is longer then the max length of " << std::to_string(BASEPATH_MAX_LENGTH) << '\n'; -return 1; +return

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-10 Thread Michael Spencer via cfe-commits
@@ -133,31 +133,42 @@ void ModuleBuildDaemonServer::setupDaemonEnv() { // Creates unix socket for IPC with frontends void ModuleBuildDaemonServer::createDaemonSocket() { - Expected MaybeServerListener = - llvm::ListeningSocket::createUnix(SocketPath); - - if

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-10 Thread Michael Spencer via cfe-commits
@@ -43,8 +44,7 @@ constexpr size_t SOCKET_ADDR_MAX_LENGTH = sizeof(sockaddr_un::sun_path); constexpr size_t BASEPATH_MAX_LENGTH = SOCKET_ADDR_MAX_LENGTH - SOCKET_FILE_NAME.length(); -// How long should the module build daemon sit ideal before exiting -constexpr int

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-10 Thread Michael Spencer via cfe-commits
@@ -71,6 +101,18 @@ ListeningSocket::ListeningSocket(ListeningSocket &) Expected ListeningSocket::createUnix(StringRef SocketPath, int MaxBacklog) { + // Identify instances where the target socket address already exist

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-10 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,66 @@ +//=== SocketMsgSupport.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [llvm] [clang][MBD] set up module build daemon infrastructure (PR #67562)

2024-04-10 Thread Michael Spencer via cfe-commits
@@ -0,0 +1,285 @@ +//===--- cc1modbuildd_main.cpp - Clang CC1 Module Build Daemon ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [clang][modules] Only compute affecting module maps with implicit search (PR #87849)

2024-04-09 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. https://github.com/llvm/llvm-project/pull/87849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-09 Thread Michael Spencer via cfe-commits
@@ -2220,40 +2227,47 @@ class ASTReader return Sema::AlignPackInfo::getFromRawEncoding(Raw); } + using RawLocEncoding = SourceLocationEncoding::RawLocEncoding; + /// Read a source location from raw form and return it in its /// originating module file's source

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-09 Thread Michael Spencer via cfe-commits
@@ -2220,40 +2227,47 @@ class ASTReader return Sema::AlignPackInfo::getFromRawEncoding(Raw); } + using RawLocEncoding = SourceLocationEncoding::RawLocEncoding; + /// Read a source location from raw form and return it in its /// originating module file's source

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-09 Thread Michael Spencer via cfe-commits
@@ -2220,40 +2227,47 @@ class ASTReader return Sema::AlignPackInfo::getFromRawEncoding(Raw); } + using RawLocEncoding = SourceLocationEncoding::RawLocEncoding; + /// Read a source location from raw form and return it in its /// originating module file's source

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-09 Thread Michael Spencer via cfe-commits
@@ -149,14 +157,44 @@ class SourceLocationSequence::State { operator SourceLocationSequence *() { return } }; -inline uint64_t SourceLocationEncoding::encode(SourceLocation Loc, - SourceLocationSequence *Seq) { - return Seq ?

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-09 Thread Michael Spencer via cfe-commits
@@ -4078,8 +4065,8 @@ void ASTReader::ReadModuleOffsetMap(ModuleFile ) const { return; Bigcheese wrote: There's no more SourceLocation remap so I believe this error message is wrong now. https://github.com/llvm/llvm-project/pull/86912

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-09 Thread Michael Spencer via cfe-commits
@@ -149,14 +157,44 @@ class SourceLocationSequence::State { operator SourceLocationSequence *() { return } }; -inline uint64_t SourceLocationEncoding::encode(SourceLocation Loc, - SourceLocationSequence *Seq) { - return Seq ?

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-09 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese edited https://github.com/llvm/llvm-project/pull/86912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-09 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese commented: I have a few minor comments on the patch. I want to do some additional perf testing on module scanning perf because I'm a bit concerned about the cost of `ASTWriter::getRawSourceLocationEncoding`. https://github.com/llvm/llvm-project/pull/86912

[clang] [Modules] No transitive source location change (PR #86912)

2024-04-09 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese commented: I think the general approach makes sense. I'll take a closer look at the specific changes. https://github.com/llvm/llvm-project/pull/86912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][frontend] Make DumpModuleInfoAction emit the full macro (PR #85745)

2024-04-09 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese requested changes to this pull request. Generally when we get the definition of a macro we loop over the tokens, for example: ```c++ SmallString<128> SpellingBuffer; bool First = true; for (const auto : MI.tokens()) { if (!First && T.hasLeadingSpace())

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-26 Thread Michael Spencer via cfe-commits
Bigcheese wrote: I'm checking with the C and C++ Compatibility study group (SG22) for what's expected here. https://github.com/llvm/llvm-project/pull/86748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-03-08 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed 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 Michael Spencer via cfe-commits
Bigcheese wrote: The other cases of `std::system_category` were in `LLVM_ON_UNIX` (or similar) blocks that would only be used on systems where it's mostly fine to use either one, as most of the time you'll get an error that's in `std::errc`, and then there's no difference (or they just are

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

2024-03-07 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/84423 LLVM is inconsistent about how it converts `errno` to `std::error_code`. This can cause problems because values outside of `std::errc` compare differently if one is system and one is generic on POSIX systems.

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

2024-03-05 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/83641 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-03-04 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/83641 >From e8993b51f0dcdecd2fcb72f91d7e4631e95c2c09 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 1 Mar 2024 17:18:20 -0800 Subject: [PATCH] [clang] Diagnose config_macros before building modules

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

2024-03-04 Thread Michael Spencer via cfe-commits
@@ -2006,6 +2021,11 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, if (auto MaybeModule = MM.getCachedModuleLoad(*Path[0].first)) { // Use the cached result, which may be nullptr. Module = *MaybeModule; +// Config macros are already checked before

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

2024-03-04 Thread Michael Spencer via cfe-commits
@@ -22,7 +58,10 @@ #define WANT_BAR 1 // expected-note{{macro was defined here}} @import config; // expected-warning{{definition of configuration macro 'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on the command line to configure the module}}

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

2024-03-04 Thread Michael Spencer via cfe-commits
@@ -22,7 +58,10 @@ #define WANT_BAR 1 // expected-note{{macro was defined here}} @import config; // expected-warning{{definition of configuration macro 'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on the command line to configure the module}}

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

2024-03-04 Thread Michael Spencer via cfe-commits
@@ -22,7 +58,10 @@ #define WANT_BAR 1 // expected-note{{macro was defined here}} @import config; // expected-warning{{definition of configuration macro 'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on the command line to configure the module}}

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

2024-03-04 Thread Michael Spencer via cfe-commits
@@ -2006,6 +2021,11 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, if (auto MaybeModule = MM.getCachedModuleLoad(*Path[0].first)) { // Use the cached result, which may be nullptr. Module = *MaybeModule; +// Config macros are already checked before

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

2024-03-01 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/83641 >From c2445d426e374592522ac392254c9909ab52fc40 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 1 Mar 2024 17:18:20 -0800 Subject: [PATCH] [clang] Diagnose config_macros before building modules

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

2024-03-01 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/83641 Before this patch, if a module fails to build because of a missing config_macro, the user will never see the config macro warning. This patch diagnoses this before building, and each subsequent time a module

[clang] [llvm] [clang][ScanDeps] Allow PCHs to have different VFS overlays (PR #82294)

2024-02-28 Thread Michael Spencer via cfe-commits
@@ -175,8 +192,19 @@ static void sanitizeDiagOpts(DiagnosticOptions ) { DiagOpts.ShowCarets = false; // Don't write out diagnostic file. DiagOpts.DiagnosticSerializationFile.clear(); - // Don't emit warnings as errors (and all other warnings too). -

[clang] [llvm] [clang][ScanDeps] Allow PCHs to have different VFS overlays (PR #82294)

2024-02-23 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/82294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][ScanDeps] Allow PCHs to have different VFS overlays (PR #82294)

2024-02-23 Thread Michael Spencer via cfe-commits
Bigcheese wrote: CI failure is a preexisting Flang test failure and a preexisting trailing whitespace issue. https://github.com/llvm/llvm-project/pull/82294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] reland: [clang][ScanDeps] Canonicalize -D and -U flags (PR #82568)

2024-02-23 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/82568 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] reland: [clang][ScanDeps] Canonicalize -D and -U flags (PR #82568)

2024-02-23 Thread Michael Spencer via cfe-commits
Bigcheese wrote: CI failure was a preexisting trailing whitespace issue. https://github.com/llvm/llvm-project/pull/82568 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][ScanDeps] Allow PCHs to have different VFS overlays (PR #82294)

2024-02-23 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/82294 >From 45852f569575d0735c686376ad30753fe791db26 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Thu, 15 Feb 2024 16:44:45 -0800 Subject: [PATCH] [clang][ScanDeps] Allow PCHs to have different VFS overlays

[clang] reland: [clang][ScanDeps] Canonicalize -D and -U flags (PR #82568)

2024-02-23 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/82568 >From a690c96562dea29a760390644d78a01a263993ca Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 16 Feb 2024 22:05:25 -0800 Subject: [PATCH] [clang][ScanDeps] Canonicalize -D and -U flags Canonicalize

[clang] reland: [clang][ScanDeps] Canonicalize -D and -U flags (PR #82568)

2024-02-23 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/82568 >From eb622c20b8d84afabdbb82543c1f9e4889639735 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 16 Feb 2024 22:05:25 -0800 Subject: [PATCH] [clang][ScanDeps] Canonicalize -D and -U flags Canonicalize

[clang] reland: [clang][ScanDeps] Canonicalize -D and -U flags (PR #82568)

2024-02-22 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Try double quotes. https://github.com/llvm/llvm-project/pull/82568 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] reland: [clang][ScanDeps] Canonicalize -D and -U flags (PR #82568)

2024-02-22 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/82568 >From 9759145f34306f1832b1deff0ca1b5e41d2ad89d Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 16 Feb 2024 22:05:25 -0800 Subject: [PATCH] [clang][ScanDeps] Canonicalize -D and -U flags Canonicalize

[clang] reland: [clang][ScanDeps] Canonicalize -D and -U flags (PR #82568)

2024-02-21 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Windows didn't like the quoted argument, now let's see if Linux is happy with an unquoted argument. https://github.com/llvm/llvm-project/pull/82568 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] reland: [clang][ScanDeps] Canonicalize -D and -U flags (PR #82568)

2024-02-21 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/82568 >From d8bfbdeedbf0a3bdd2db25e7dd389d6f223091a3 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 16 Feb 2024 22:05:25 -0800 Subject: [PATCH] [clang][ScanDeps] Canonicalize -D and -U flags Canonicalize

[clang] reland: [clang][ScanDeps] Canonicalize -D and -U flags (PR #82568)

2024-02-21 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/82568 Canonicalize `-D` and `-U` flags by sorting them and only keeping the last instance of a given name. This optimization will only fire if all `-D` and `-U` flags start with a simple identifier that we can

[clang] [clang][ScanDeps] Canonicalize -D and -U flags (PR #82298)

2024-02-21 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Weird that it passes on macOS. Also weird that discord doesn't ping about build failures anymore, seems that merging on github now just blames all CI failures on noreply@​github.com. https://github.com/llvm/llvm-project/pull/82298

[clang] [clang][ScanDeps] Canonicalize -D and -U flags (PR #82298)

2024-02-20 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/82298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ScanDeps] Canonicalize -D and -U flags (PR #82298)

2024-02-20 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/82298 >From b60972ed9183dd9e2deb3860f7732dc87bdfc84e Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 16 Feb 2024 22:05:25 -0800 Subject: [PATCH] Canonicalize -D and -U flags Canonicalize `-D` and `-U`

[clang] [llvm] [clang][ScanDeps] Allow PCHs to have different VFS overlays (PR #82294)

2024-02-20 Thread Michael Spencer via cfe-commits
@@ -67,7 +68,7 @@ static bool checkHeaderSearchPaths(const HeaderSearchOptions , if (LangOpts.Modules) { if (HSOpts.VFSOverlayFiles != ExistingHSOpts.VFSOverlayFiles) { if (Diags) { -Diags->Report(diag::err_pch_vfsoverlay_mismatch); +

[clang] [llvm] [clang][ScanDeps] Allow PCHs to have different VFS overlays (PR #82294)

2024-02-20 Thread Michael Spencer via cfe-commits
Bigcheese wrote: > Just to clarify, this patch doesn't attempt to solve the case where Clang can > crash when the VFS overlay files are different between the PCH and the TU, > since that's existing behavior. Correct? Yep, this patch still allows that to happen in cases where it would today.

[clang] [llvm] [clang][ScanDeps] Allow PCHs to have different VFS overlays (PR #82294)

2024-02-20 Thread Michael Spencer via cfe-commits
@@ -65,11 +66,25 @@ static void optimizeHeaderSearchOpts(HeaderSearchOptions , llvm::DenseSet Visited; std::function VisitMF = [&](const serialization::ModuleFile *MF) { - VFSUsage |= MF->VFSUsage; Visited.insert(MF); - for (const

[clang] [clang][ScanDeps] Canonicalize -D and -U flags (PR #82298)

2024-02-19 Thread Michael Spencer via cfe-commits
@@ -179,6 +179,73 @@ static void sanitizeDiagOpts(DiagnosticOptions ) { DiagOpts.IgnoreWarnings = true; } +// Clang implements -D and -U by splatting text into a predefines buffer. This +// allows constructs such as `-DFඞ=3 "-D F\u{0D9E} 4 3 2”` to be accepted and +//

[clang] [clang][ScanDeps] Canonicalize -D and -U flags (PR #82298)

2024-02-19 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/82298 Canonicalize `-D` and `-U` flags by sorting them and only keeping the last instance of a given name. This optimization will only fire if all `-D` and `-U` flags start with a simple identifier that we can

[clang] [llvm] [clang][ScanDeps] Allow PCHs to have different VFS overlays (PR #82294)

2024-02-19 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/82294 It turns out it's not that uncommon for real code to pass a different set of VFSs while building a PCH than while using the PCH. This can cause problems as seen in `test/ClangScanDeps/optimize-vfs-pch.m`. If

[clang] [clang][DependencyScanner] Remove unused -fmodule-map-file arguments (PR #80090)

2024-01-31 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/80090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][DependencyScanner] Remove unused -fmodule-map-file arguments (PR #80090)

2024-01-30 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/80090 Since we already add a `-fmodule-map-file=` argument for every used modulemap, we can remove all `ModuleMapFiles` entries before adding them. This reduces the number of module variants when

[clang] b21a2f9 - [clang][scan-deps] Stop scanning if any scanning setup emits an error.

2024-01-30 Thread Michael Spencer via cfe-commits
Author: Michael Spencer Date: 2024-01-30T17:03:13-08:00 New Revision: b21a2f9365b6c5fd464a97be5dfe7085742870ef URL: https://github.com/llvm/llvm-project/commit/b21a2f9365b6c5fd464a97be5dfe7085742870ef DIFF:

[clang] [llvm] [clang][DependencyScanner] Remove unused -ivfsoverlay files (PR #73734)

2024-01-30 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/73734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][DependencyScanner] Remove unused -ivfsoverlay files (PR #73734)

2024-01-30 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/73734 >From 42666e6c0b46a83f0b4fbc7d7945825c56e6ac5a Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 24 Feb 2023 17:18:51 -0800 Subject: [PATCH] [clang][DepScan] Remove unused -ivfsoverlay files

[llvm] [clang] [clang][DependencyScanner] Remove unused -ivfsoverlay files (PR #73734)

2024-01-29 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/73734 >From 0559ec44d2d3c39292bae6d6431dde9626ac755e Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 24 Feb 2023 17:18:51 -0800 Subject: [PATCH 1/2] [clang][DepScan] Remove unused -ivfsoverlay files

[clang] [llvm] [clang][DependencyScanner] Remove unused -ivfsoverlay files (PR #73734)

2024-01-25 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/73734 >From 0559ec44d2d3c39292bae6d6431dde9626ac755e Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 24 Feb 2023 17:18:51 -0800 Subject: [PATCH] [clang][DepScan] Remove unused -ivfsoverlay files

[llvm] [clang] [clang][DependencyScanner] Remove unused -ivfsoverlay files (PR #73734)

2024-01-25 Thread Michael Spencer via cfe-commits
Bigcheese wrote: I've updated the patch to use the alternative implementation Jan suggested. https://github.com/llvm/llvm-project/pull/73734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [clang][DependencyScanner] Remove unused -ivfsoverlay files (PR #73734)

2024-01-25 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/73734 >From 3c7f36b087e09e1b7ab3231e8267bcdd8400fac4 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Fri, 24 Feb 2023 17:18:51 -0800 Subject: [PATCH] [clang][DepScan] Remove unused -ivfsoverlay files

[clang] [clang][modules] Fix CodeGen options that can affect the AST. (PR #78816)

2024-01-19 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese approved this pull request. LGTM, although are we sure none of the other options should be affecting? I just did a quick search and it seems like this is it. I don't think it matters here, but the actual option that controls the macro is on `LangOptions` and where

[clang] [clang] Disable gch-probe.c on AIX as `-gmodules` is not supported there yet. (PR #78513)

2024-01-17 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/78513 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Disable gch-probe.c on AIX as `-gmodules` is not supported there yet. (PR #78513)

2024-01-17 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese created https://github.com/llvm/llvm-project/pull/78513 Followup fix for https://github.com/llvm/llvm-project/pull/77711 >From a12b3ab8663c591f66848a7e46620a79583f5045 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Wed, 17 Jan 2024 14:27:03 -0800 Subject:

[clang] [llvm] [clang][Driver] Don't ignore -gmodules .gch files (PR #77711)

2024-01-17 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Ah, looks like all the other gmodules tests have: ``` // Unsupported on AIX because we don't support the requisite "__clangast" // section in XCOFF yet. // UNSUPPORTED: target={{.*}}-aix{{.*}} ``` I'll just add that. https://github.com/llvm/llvm-project/pull/77711

[clang] [llvm] [clang][Driver] Don't ignore -gmodules .gch files (PR #77711)

2024-01-17 Thread Michael Spencer via cfe-commits
Bigcheese wrote: Yep, I'll take a look. https://github.com/llvm/llvm-project/pull/77711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang][Driver] Don't ignore -gmodules .gch files (PR #77711)

2024-01-16 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/77711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang][Driver] Don't ignore -gmodules .gch files (PR #77711)

2024-01-15 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/77711 >From d3e928fc5b725cb3e484a8cfd50fa23c26f7eb22 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Wed, 10 Jan 2024 16:58:59 -0800 Subject: [PATCH] [clang][Driver] Don't ignore -gmodules .gch files A

[llvm] [clang] [clang][Driver] Don't ignore -gmodules .gch files (PR #77711)

2024-01-11 Thread Michael Spencer via cfe-commits
Bigcheese wrote: I updated the patch to try to actually open the object file. https://github.com/llvm/llvm-project/pull/77711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang][Driver] Don't ignore -gmodules .gch files (PR #77711)

2024-01-11 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese updated https://github.com/llvm/llvm-project/pull/77711 >From ef781002ef63817afa4df4834742ec3c2f22 Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Wed, 10 Jan 2024 16:58:59 -0800 Subject: [PATCH] [clang][Driver] Don't ignore -gmodules .gch files A

  1   2   >