r255312 - [VFS] Fix status() of opened redirected file

2015-12-10 Thread Ben Langmuir via cfe-commits
Author: benlangmuir Date: Thu Dec 10 17:41:39 2015 New Revision: 255312 URL: http://llvm.org/viewvc/llvm-project?rev=255312&view=rev Log: [VFS] Fix status() of opened redirected file Make RedirectedFileSystem::openFilForRead(path)->status() the same as RedirectedFileSystem::status(path). Previous

r255324 - Revert "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag"

2015-12-10 Thread Ben Langmuir via cfe-commits
Author: benlangmuir Date: Thu Dec 10 19:44:43 2015 New Revision: 255324 URL: http://llvm.org/viewvc/llvm-project?rev=255324&view=rev Log: Revert "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag" This is causing assertion failures; reverting until I can fix. This

r255377 - Reapply "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag"

2015-12-11 Thread Ben Langmuir via cfe-commits
Author: benlangmuir Date: Fri Dec 11 16:05:13 2015 New Revision: 255377 URL: http://llvm.org/viewvc/llvm-project?rev=255377&view=rev Log: Reapply "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag" Now not trying to use a C++ lookup mechanism in C (d'oh). Unqualif

[clang] [Clang] Allow raw string literals in C as an extension (PR #88265)

2024-07-05 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: > I assume that @benlangmuir added the scanner unit-test to demonstrate the > current behavior instead of trying to make sure it's preserved. Correct. They're only interesting to the scanner insofar as they're used in `_Pragma()` as far as I know. If we can handle them, gre

[clang] [clang][deps] Don't treat ObjC method args as module directives (PR #97654)

2024-07-05 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/97654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-08 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir 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] [clang-tools-extra] [clang][modules] Do not resolve `HeaderFileInfo` externally in `ASTWriter` (PR #87848)

2024-04-09 Thread Ben Langmuir via cfe-commits
@@ -409,7 +409,7 @@ class SymbolCollector::HeaderFileURICache { // Framework headers are spelled as , not // "path/FrameworkName.framework/Headers/Foo.h". auto &HS = PP->getHeaderSearchInfo(); -if (const auto *HFI = HS.getExistingFileInfo(*FE, /*WantExternal*/ f

[clang] [clang-tools-extra] [clang][modules] Do not resolve `HeaderFileInfo` externally in `ASTWriter` (PR #87848)

2024-04-09 Thread Ben Langmuir via cfe-commits
@@ -409,7 +409,7 @@ class SymbolCollector::HeaderFileURICache { // Framework headers are spelled as , not // "path/FrameworkName.framework/Headers/Foo.h". auto &HS = PP->getHeaderSearchInfo(); -if (const auto *HFI = HS.getExistingFileInfo(*FE, /*WantExternal*/ f

[clang] [llvm] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2024-04-11 Thread Ben Langmuir via cfe-commits
@@ -226,9 +247,28 @@ class DependencyScanningFilesystemLocalCache { insertEntryForFilename(StringRef Filename, const CachedFileSystemEntry &Entry) { assert(llvm::sys::path::is_absolute_gnu(Filename)); -const auto *InsertedEntry = Cache.insert(

[clang] [llvm] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2024-04-11 Thread Ben Langmuir via cfe-commits
@@ -130,11 +130,11 @@ DependencyScanningFilesystemSharedCache::CacheShard:: getOrEmplaceEntryForFilename(StringRef Filename, llvm::ErrorOr Stat) { std::lock_guard LockGuard(CacheLock); - auto Insertion = EntriesByFilename.insert({Filename

[clang] [llvm] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2024-04-11 Thread Ben Langmuir via cfe-commits
@@ -159,7 +159,37 @@ DependencyScanningFilesystemSharedCache::CacheShard:: getOrInsertEntryForFilename(StringRef Filename, const CachedFileSystemEntry &Entry) { std::lock_guard LockGuard(CacheLock); - return *EntriesByFilename.insert({File

[clang] [llvm] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2024-04-11 Thread Ben Langmuir via cfe-commits
@@ -230,6 +251,26 @@ class DependencyScanningFilesystemLocalCache { assert(InsertedEntry == &Entry && "entry already present"); return *InsertedEntry; } + + /// Returns real path associated with the filename or nullptr if none is + /// found. + const CachedRealPath

[clang] [llvm] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2024-04-11 Thread Ben Langmuir via cfe-commits
@@ -194,6 +201,17 @@ class DependencyScanningFilesystemSharedCache { const CachedFileSystemEntry & getOrInsertEntryForFilename(StringRef Filename, const CachedFileSystemEntry &Entry); + +/// Returns real path associated with the filen

[clang] [clang-tools-extra] [clang][modules] Do not resolve `HeaderFileInfo` externally in `ASTWriter` (PR #87848)

2024-04-11 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. LGTM (with the `Not to be committed, just here as a demonstration` test removed, of course). https://github.com/llvm/llvm-project/pull/87848 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [llvm] [clang][deps] Cache `VFS::getRealPath()` (PR #68645)

2024-04-12 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/68645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Collect discovered module dependencies' Link Libraries (PR #93588)

2024-06-03 Thread Ben Langmuir via cfe-commits
@@ -138,6 +139,14 @@ struct ModuleDeps { /// determined that the differences are benign for this compilation. std::vector ClangModuleDeps; + /// The set of libraries or frameworks to link against when + /// an entity from this module is used. + llvm::SmallVector LinkLib

[clang] [clang][deps] Collect discovered module dependencies' Link Libraries (PR #93588)

2024-06-03 Thread Ben Langmuir via cfe-commits
@@ -138,6 +139,14 @@ struct ModuleDeps { /// determined that the differences are benign for this compilation. std::vector ClangModuleDeps; + /// The set of libraries or frameworks to link against when + /// an entity from this module is used. + llvm::SmallVector LinkLib

[clang] [clang][deps] Collect discovered module dependencies' Link Libraries (PR #93588)

2024-06-03 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/93588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Collect discovered module dependencies' Link Libraries (PR #93588)

2024-06-04 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir closed https://github.com/llvm/llvm-project/pull/93588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Add `-o` flag to specify output path (PR #88767)

2024-04-15 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. LGTM with a couple minor comments https://github.com/llvm/llvm-project/pull/88767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [clang][deps] Add `-o` flag to specify output path (PR #88767)

2024-04-15 Thread Ben Langmuir via cfe-commits
@@ -864,8 +873,24 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { }); SharedStream Errs(llvm::errs()); - // Print out the dependency results to STDOUT by default. - SharedStream DependencyOS(llvm::outs()); + + std::optional FileOS; +

[clang] [clang][deps] Add `-o` flag to specify output path (PR #88767)

2024-04-15 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir edited https://github.com/llvm/llvm-project/pull/88767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Add `-o` flag to specify output path (PR #88767)

2024-04-15 Thread Ben Langmuir via cfe-commits
@@ -864,8 +873,24 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { }); SharedStream Errs(llvm::errs()); - // Print out the dependency results to STDOUT by default. - SharedStream DependencyOS(llvm::outs()); + + std::optional FileOS; +

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

2024-04-15 Thread Ben Langmuir via cfe-commits
@@ -1,23 +1,10 @@ // RUN: rm -rf %t // RUN: split-file %s %t -//--- missing_tu.json.in -[{ - "directory": "DIR", - "command": "clang -fsyntax-only DIR/missing_tu.c", - "file": "DIR/missing_tu.c" -}] -//--- missing_header.json.in -[{ - "directory": "DIR", - "command": "cla

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

2024-04-15 Thread Ben Langmuir via cfe-commits
@@ -1,23 +1,10 @@ // RUN: rm -rf %t // RUN: split-file %s %t -//--- missing_tu.json.in -[{ - "directory": "DIR", - "command": "clang -fsyntax-only DIR/missing_tu.c", - "file": "DIR/missing_tu.c" -}] -//--- missing_header.json.in -[{ - "directory": "DIR", - "command": "cla

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

2024-04-16 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/88764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [clang] Split ObjectFilePCHContainerReader from ObjectFilePCHContainerWriter (PR #99599)

2024-07-19 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. LGTM other than what Jan already mentioned, thanks! https://github.com/llvm/llvm-project/pull/99599 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-26 Thread Ben Langmuir via cfe-commits
@@ -249,9 +245,27 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { for (const auto &KH : HS.findResolvedModulesForHeader(*File)) if (const Module *M = KH.getModule()) -CollectIncludingMapsFromAncestors(M); +CollectModuleMapsFor

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-04-26 Thread Ben Langmuir via cfe-commits
@@ -249,9 +245,27 @@ GetAffectingModuleMaps(const Preprocessor &PP, Module *RootModule) { for (const auto &KH : HS.findResolvedModulesForHeader(*File)) if (const Module *M = KH.getModule()) -CollectIncludingMapsFromAncestors(M); +CollectModuleMapsFor

[clang] [Modules] Process include files changes with -fmodules-validate-input-files-content and -fno-pch-timestamp options (PR #90319)

2024-04-30 Thread Ben Langmuir via cfe-commits
@@ -0,0 +1,34 @@ +// UNSUPPORTED: system-windows +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: cp a1.h a.h +// RUN: %clang -fmodules -fmodules-validate-input-files-content -Xclang -fno-pch-timestamp -fimplicit-modules -fmodule-map-file=module.modulemap

[clang] [clang-tools-extra] [clang] Hide the `TargetOptions` pointer from `CompilerInvocation` (PR #106271)

2024-08-27 Thread Ben Langmuir via cfe-commits
@@ -302,9 +302,8 @@ class TargetInfo : public TransferrableTargetInfo, /// \param Opts - The options to use to initialize the target. The target may /// modify the options to canonicalize the target feature information to match /// what the backend expects. - static Tar

[clang] [clang-tools-extra] [clang] Hide the `TargetOptions` pointer from `CompilerInvocation` (PR #106271)

2024-08-27 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. Seems reasonable https://github.com/llvm/llvm-project/pull/106271 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Process include files changes with -fmodules-validate-input-files-content and -fno-pch-timestamp options (PR #90319)

2024-04-30 Thread Ben Langmuir via cfe-commits
@@ -0,0 +1,34 @@ +// UNSUPPORTED: system-windows +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t +// +// RUN: cp a1.h a.h +// RUN: %clang -fmodules -fmodules-validate-input-files-content -Xclang -fno-pch-timestamp -fimplicit-modules -fmodule-map-file=module.modulemap

[clang] [Modules] Process include files changes with -fmodules-validate-input-files-content and -fno-pch-timestamp options (PR #90319)

2024-04-30 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/90319 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Allow including module maps to be non-affecting (PR #89992)

2024-05-01 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/89992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-03 Thread Ben Langmuir via cfe-commits
@@ -839,17 +839,15 @@ static bool checkHeaderSearchOptions(const HeaderSearchOptions &HSOpts, DiagnosticsEngine *Diags, const LangOptions &LangOpts, const Preprocesso

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-03 Thread Ben Langmuir via cfe-commits
@@ -839,17 +839,15 @@ static bool checkHeaderSearchOptions(const HeaderSearchOptions &HSOpts, DiagnosticsEngine *Diags, const LangOptions &LangOpts, const Preprocesso

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-07 Thread Ben Langmuir via cfe-commits
@@ -833,32 +833,33 @@ bool SimpleASTReaderListener::ReadPreprocessorOptions( /// against the header search options in an existing preprocessor. /// /// \param Diags If non-null, produce diagnostics for any mismatches incurred. -static bool checkHeaderSearchOptions(const HeaderS

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-07 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. LGTM if we rename the checkHeaderSearchOptions function. https://github.com/llvm/llvm-project/pull/90925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [llvm] [modules] Accept equivalent module caches from different symlink (PR #90925)

2024-05-07 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir edited https://github.com/llvm/llvm-project/pull/90925 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Processing real directories added as virtual ones (PR #91645)

2024-05-20 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/91645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 0e5ea40 - Fix running orc-rt tests with LLVM_BUILD_EXTERNAL_COMPILER_RT

2022-01-25 Thread Ben Langmuir via cfe-commits
Author: Ben Langmuir Date: 2022-01-25T08:27:40-08:00 New Revision: 0e5ea403e8deeb5374a9072aaa12292b9c0bed30 URL: https://github.com/llvm/llvm-project/commit/0e5ea403e8deeb5374a9072aaa12292b9c0bed30 DIFF: https://github.com/llvm/llvm-project/commit/0e5ea403e8deeb5374a9072aaa12292b9c0bed30.diff

[clang] 93c87fc - [index] Improve macro indexing support

2021-04-06 Thread Ben Langmuir via cfe-commits
Author: Ben Langmuir Date: 2021-04-06T09:12:14-07:00 New Revision: 93c87fc06eca8d8a65ff6c0bdd9f2671227224ac URL: https://github.com/llvm/llvm-project/commit/93c87fc06eca8d8a65ff6c0bdd9f2671227224ac DIFF: https://github.com/llvm/llvm-project/commit/93c87fc06eca8d8a65ff6c0bdd9f2671227224ac.diff

[clang] b8da594 - Reapply [ORC-RT] Configure the ORC runtime for more architectures and platforms

2021-10-21 Thread Ben Langmuir via cfe-commits
Author: Ben Langmuir Date: 2021-10-21T09:00:18-07:00 New Revision: b8da594750762f811283820c19b02cedfb6632d4 URL: https://github.com/llvm/llvm-project/commit/b8da594750762f811283820c19b02cedfb6632d4 DIFF: https://github.com/llvm/llvm-project/commit/b8da594750762f811283820c19b02cedfb6632d4.diff

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-09-12 Thread Ben Langmuir via cfe-commits
@@ -1115,13 +1115,13 @@ void ASTWriter::WriteBlockInfoBlock() { } /// Prepares a path for being written to an AST file by converting it -/// to an absolute path and removing nested './'s. +/// to an absolute path and removing nested './'s and '../'s. /// /// \return \c true

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-09-13 Thread Ben Langmuir via cfe-commits
@@ -1115,13 +1115,13 @@ void ASTWriter::WriteBlockInfoBlock() { } /// Prepares a path for being written to an AST file by converting it -/// to an absolute path and removing nested './'s. +/// to an absolute path and removing nested './'s and '../'s. /// /// \return \c true

[clang] [clang][deps] Serialize JSON without creating intermediate objects (PR #111734)

2024-10-09 Thread Ben Langmuir via cfe-commits
@@ -450,58 +458,65 @@ class FullDeps { ModuleIDs.push_back(M.first); llvm::sort(ModuleIDs); -using namespace llvm::json; - -Array OutModules; -for (auto &&ModID : ModuleIDs) { - auto &MD = Modules[ModID]; - Object O{{"name", MD.ID.ModuleName}, -

[clang] [clang][deps] Serialize JSON without creating intermediate objects (PR #111734)

2024-10-09 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/111734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-10-11 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: Right, that's what I meant by "Is it trying to set it too early before the VFS is created or something?". We could make the driver setup the VFS like the frontend would and do that before checking the -working-directory; not sure if there's a reason we don't do that already

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-10-11 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: @sheredom I think I'm missing something. What's the actual failure? Setting `-working-directory` causes `FileManager` to prepend to paths the configured directory, so the VFS lookups would then be absolute paths not relative. I see the driver checks if the path in `-working

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-10-11 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: > We tried setting -working-directory=Z:/working, but the VFS requires that > this is a real path. What error are you seeing if it's not? Is it trying to set it too early before the VFS is created or something? https://github.com/llvm/llvm-project/pull/106577 __

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-10-04 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: > `-emit-pch -o "%t.pch" %t/From/../From/B.h` > `'could not find file > 'D:\llvm-project\build\tools\clang\test\VFS\Output\remap-to-fake.c.tmp\From\..\From\B.h'` Isn't that the same issue I mentioned, that it doesn't appear to work for the main PCH input file? If you remov

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-10-04 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: > Build machine A with a path E:/foo/header.h which wants to make a PCH from > it. We want it to remap E:/foo -> Z:/fake. What I have in mind is that you have a VFS on build machine A that maps Z:/fake (virtual path) -> E:/foo (external path), with use-external-names: false.

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-10-04 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: I think it's something much earlier in clang is not using the VFS at all when looking up the main input path, so then it only knows the external path for that case. My guess is that if that were fixed then the ASTWriter/Reader would do the right thing here. https://githu

[clang] [clang] Allocate `Module` instances in `BumpPtrAllocator` (PR #112795)

2024-10-21 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/112795 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-22 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/112452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

2024-10-29 Thread Ben Langmuir via cfe-commits
@@ -34,8 +34,8 @@ module mod { header "mod.h" } // CHECK:], // CHECK-NEXT: "context-hash": "[[HASH_MOD:.*]]", // CHECK-NEXT: "file-deps": [ -// CHECK-NEXT: "[[PREFIX]]/mod.h" -// CHECK-NEXT: "[[PREFIX]]/module.modulemap" +// CHECK-DAG:

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

2024-10-29 Thread Ben Langmuir via cfe-commits
@@ -472,7 +465,8 @@ class FullDeps { JOS.attributeArray("command-line", toJSONStrings(JOS, MD.getBuildArguments())); JOS.attribute("context-hash", StringRef(MD.ID.ContextHash)); -JOS.attributeArray("file-deps",

[clang] [clang][deps] Stop relying on name of inferred module maps (PR #114085)

2024-10-29 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir commented: Can this be tested? https://github.com/llvm/llvm-project/pull/114085 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-29 Thread Ben Langmuir via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

2024-10-29 Thread Ben Langmuir via cfe-commits
@@ -472,7 +465,8 @@ class FullDeps { JOS.attributeArray("command-line", toJSONStrings(JOS, MD.getBuildArguments())); JOS.attribute("context-hash", StringRef(MD.ID.ContextHash)); -JOS.attributeArray("file-deps",

[clang] [clang][deps] Stop sorting file dependencies (PR #114079)

2024-10-29 Thread Ben Langmuir via cfe-commits
@@ -34,8 +34,8 @@ module mod { header "mod.h" } // CHECK:], // CHECK-NEXT: "context-hash": "[[HASH_MOD:.*]]", // CHECK-NEXT: "file-deps": [ -// CHECK-NEXT: "[[PREFIX]]/mod.h" -// CHECK-NEXT: "[[PREFIX]]/module.modulemap" +// CHECK-DAG:

[clang] [clang][deps] Share `FileManager` between modules (PR #115065)

2024-11-05 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/115065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-30 Thread Ben Langmuir via cfe-commits
@@ -1342,19 +1343,47 @@ class ASTReader bool Complain = true); /// Buffer we use as temporary storage backing resolved paths. - SmallString<256> PathBuf; + std::optional> PathBuf{{}}; + + /// A RAII wrapper around \c StringRef that

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-30 Thread Ben Langmuir via cfe-commits
@@ -1342,19 +1343,47 @@ class ASTReader bool Complain = true); /// Buffer we use as temporary storage backing resolved paths. - SmallString<256> PathBuf; + std::optional> PathBuf{{}}; + + /// A RAII wrapper around \c StringRef that

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-30 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/113984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Stop relying on name of inferred module maps (PR #114085)

2024-11-01 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: Okay, sounds impractical https://github.com/llvm/llvm-project/pull/114085 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Stop relying on name of inferred module maps (PR #114085)

2024-11-01 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/114085 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

2024-10-28 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/113389 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-28 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/113391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Optimize construction and usage of the submodule index (PR #113391)

2024-10-28 Thread Ben Langmuir via cfe-commits
@@ -541,11 +541,11 @@ class ModuleMap { /// /// \param IsExplicit Whether this is an explicit submodule. /// - /// \returns The found or newly-created module, along with a boolean value - /// that will be true if the module is newly-created. - std::pair findOrCreateMod

[clang] [clang][modules] Preserve the module map that allowed inferring (PR #113389)

2024-10-28 Thread Ben Langmuir via cfe-commits
@@ -3018,13 +3019,19 @@ void ASTWriter::WriteSubmodules(Module *WritingModule) { SourceLocationEncoding::RawLocEncoding DefinitionLoc = getRawSourceLocationEncoding(getAdjustedLocation(Mod->DefinitionLoc)); +ModuleMap &ModMap = PP->getHeaderSearchInfo().getModu

[clang] [clang][deps] Improve timing output (PR #113726)

2024-10-28 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/113726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][serialization] Enable `ASTWriter` to work with `Preprocessor` only (PR #115237)

2024-11-11 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/115237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][serialization] Enable `ASTWriter` to work with `Preprocessor` only (PR #115237)

2024-11-11 Thread Ben Langmuir via cfe-commits
@@ -661,8 +661,8 @@ class ASTWriter : public ASTDeserializationListener, /// Write a precompiled header for the given semantic analysis. /// - /// \param SemaRef a reference to the semantic analysis object that processed - /// the AST to be written into the precompiled h

[clang] [clang][serialization] Enable `ASTWriter` to work with `Preprocessor` only (PR #115237)

2024-11-11 Thread Ben Langmuir via cfe-commits
@@ -4858,14 +4860,21 @@ time_t ASTWriter::getTimestampForOutput(const FileEntry *E) const { return IncludeTimestamps ? E->getModificationTime() : 0; } -ASTFileSignature ASTWriter::WriteAST(Sema &SemaRef, StringRef OutputFile, - Module *Wr

[clang] [clang][deps] Only write preprocessor info into PCMs (PR #115239)

2024-11-11 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/115239 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] De-duplicate some logic in `HeaderFileInfoTrait` (PR #114330)

2024-10-31 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/114330 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][lex] Remove `-index-header-map` (PR #114459)

2024-10-31 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/114459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][lex] Remove `HeaderFileInfo::Framework` (PR #114460)

2024-10-31 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/114460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-09-24 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir commented: Sorry for being slow to look at this in more detail: > When generating a PCH map the original directory to some fake directory. You > could imagine D:/Foo being mapped to Z:/Foo for instance. Can you clarify what this means? Is `Z:/Foo` a virtual-only

[clang] Make PCH's respect any VFS specified. (PR #106577)

2024-09-30 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: It looks like it almost works: if I create a module in a virtual path and use `use-external-names: false`, then the module stores the virtual path for its input files. E.g. ``` { "version": 0, "use-external-names": false, "roots": [ { "contents": [

[clang] [clang-tools-extra] [clang] Make deprecations of some `FileManager` APIs formal (PR #110014)

2024-09-25 Thread Ben Langmuir via cfe-commits
@@ -1925,8 +1921,8 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( M = HS.lookupModule(ModuleName, ImportLoc, true, !IsInclusionDirective); // Check whether M refers to the file in the prebuilt module path. -if (M && M->getASTFile()) - if

[clang] [clang-tools-extra] [clang] Make deprecations of some `FileManager` APIs formal (PR #110014)

2024-09-25 Thread Ben Langmuir via cfe-commits
@@ -199,7 +199,7 @@ int main(int argc, const char **argv) { for (auto I = Files.begin(), E = Files.end(); I != E; ++I) { OS << " {\n"; OS << "\"FilePath\": \"" << *I << "\",\n"; -const auto Entry = FileMgr.getFile(*I); +const auto Entr

[clang] [clang-tools-extra] [clang] Make deprecations of some `FileManager` APIs formal (PR #110014)

2024-09-25 Thread Ben Langmuir via cfe-commits
@@ -427,12 +427,8 @@ static void InitializeFileRemapping(DiagnosticsEngine &Diags, } // Create the file entry for the file that we're mapping from. -const FileEntry *FromFile = -FileMgr.getVirtualFile(RF.first, ToFile->getSize(), 0); -if (!FromFile) {

[clang] [clang-tools-extra] [clang] Make deprecations of some `FileManager` APIs formal (PR #110014)

2024-09-25 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. Thanks for cleaning this up! https://github.com/llvm/llvm-project/pull/110014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

2024-11-06 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/114457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][serialization] Pass `ASTContext` explicitly (PR #115235)

2024-11-07 Thread Ben Langmuir via cfe-commits
@@ -4753,15 +4755,12 @@ void ASTWriter::AddString(StringRef Str, RecordDataImpl &Record) { } bool ASTWriter::PreparePathForOutput(SmallVectorImpl &Path) { - assert(Context && "should have context when outputting path"); - // Leave special file names as they are. String

[clang] [clang][serialization] Pass `ASTContext` explicitly (PR #115235)

2024-11-07 Thread Ben Langmuir via cfe-commits
@@ -4753,15 +4755,12 @@ void ASTWriter::AddString(StringRef Str, RecordDataImpl &Record) { } bool ASTWriter::PreparePathForOutput(SmallVectorImpl &Path) { - assert(Context && "should have context when outputting path"); - // Leave special file names as they are. String

[clang] [clang][serialization] Pass `ASTContext` explicitly (PR #115235)

2024-11-07 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/115235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Improve timing output (PR #113726)

2024-10-25 Thread Ben Langmuir via cfe-commits
@@ -88,6 +88,7 @@ static bool DeprecatedDriverCommand; static ResourceDirRecipeKind ResourceDirRecipe; static bool Verbose; static bool PrintTiming; +static bool NoPrintTimingHeader; benlangmuir wrote: Nit: even if the command-line argument is "-no" I would ph

[clang] [clang][deps] Improve timing output (PR #113726)

2024-10-25 Thread Ben Langmuir via cfe-commits
@@ -34,6 +34,7 @@ def deprecated_driver_command : F<"deprecated-driver-command", "use a single dri defm resource_dir_recipe : Eq<"resource-dir-recipe", "How to produce missing '-resource-dir' argument">; def print_timing : F<"print-timing", "Print timing information">; +def

[clang] [clang][modules] Only serialize info for locally-included headers (PR #113718)

2024-10-25 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. https://github.com/llvm/llvm-project/pull/113718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][serialization] Blobify IMPORTS strings and signatures (PR #116095)

2024-11-18 Thread Ben Langmuir via cfe-commits
@@ -350,9 +350,8 @@ enum ControlRecordTypes { /// and information about the compiler used to build this AST file. METADATA = 1, - /// Record code for the list of other AST files imported by - /// this AST file. - IMPORTS, + /// Record code for other AST file imported b

[clang] [clang][serialization] Blobify IMPORTS strings and signatures (PR #116095)

2024-11-18 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir approved this pull request. Gotta love having three copies of this code 😬 but obviously not something you need to fix here. LGTM https://github.com/llvm/llvm-project/pull/116095 ___ cfe-commits mailing list cfe-commits@

[clang] [clang][serialization] Blobify IMPORTS strings and signatures (PR #116095)

2024-11-18 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir edited https://github.com/llvm/llvm-project/pull/116095 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] Revert "Reapply "[ORC] Enable JIT support for the compact-unwind frame..." with fixes." (PR #125098)

2025-01-30 Thread Ben Langmuir via cfe-commits
https://github.com/benlangmuir closed https://github.com/llvm/llvm-project/pull/125098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] Revert "Reapply "[ORC] Enable JIT support for the compact-unwind frame..." with fixes." (PR #125098)

2025-01-30 Thread Ben Langmuir via cfe-commits
benlangmuir wrote: Failure looks unrelated. Merging. https://github.com/llvm/llvm-project/pull/125098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [DependencyScanning] Add ability to scan TU with a buffer input (PR #125111)

2025-01-30 Thread Ben Langmuir via cfe-commits
@@ -0,0 +1,111 @@ +// UNSUPPORTED: target=powerpc64-ibm-aix{{.*}} + +// RUN: rm -rf %t +// RUN: split-file %s %t + +//--- module.modulemap +module root { header "root.h" } +module direct { header "direct.h" } +module transitive { header "transitive.h" } +module addition { header "

[clang] [DependencyScanning] Add ability to scan TU with a buffer input (PR #125111)

2025-01-30 Thread Ben Langmuir via cfe-commits
@@ -0,0 +1,111 @@ +// UNSUPPORTED: target=powerpc64-ibm-aix{{.*}} + +// RUN: rm -rf %t +// RUN: split-file %s %t + +//--- module.modulemap +module root { header "root.h" } +module direct { header "direct.h" } +module transitive { header "transitive.h" } +module addition { header "

<    1   2   3   4   5   >