[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-02 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Since I moved up the special-casing of built-ins buffer up in my last commit, it was happening before we got chance to walk up from `FileID(3)` to `FileID(2)`, meaning it wasn't kicking in. I think we need to sink the special-casing into `isInTheSameTranslationUnit()` and a

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-02 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Turns out some clients are calling `isBeforeInTranslationUnit()` before checking if both `SourceLocations` are indeed in the same TU. I left behind a FIXME to call `llvm_unreachable()`, but for now, I just compare the `FileIDs` to keep things working. https://github.com/ll

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-02 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: I don't understand why the tie-breaking code calls the previously visited `FileID` a parent. We're walking **up** the include/expansion tree, so I think it should be called child instead. LMK if I'm misunderstanding. https://github.com/llvm/llvm-project/pull/66962 _

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-02 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/66962 >From 61e8961cde95e9e8ce8cea3efd6aa52273f430e9 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 20 Sep 2023 16:50:48 -0700 Subject: [PATCH 1/3] [clang][modules] Remove preloaded SLocEntries from PCM fi

[clang] [clang][modules] Move `SLocEntry` search into `ASTReader` (PR #66966)

2023-10-02 Thread Jan Svoboda via cfe-commits
@@ -864,74 +864,7 @@ FileID SourceManager::getFileIDLocal(SourceLocation::UIntTy SLocOffset) const { /// This function knows that the SourceLocation is in a loaded buffer, not a /// local one. FileID SourceManager::getFileIDLoaded(SourceLocation::UIntTy SLocOffset) const { -

[clang] [clang][modules] Move `SLocEntry` search into `ASTReader` (PR #66966)

2023-10-02 Thread Jan Svoboda via cfe-commits
@@ -288,10 +288,12 @@ class ModuleFile { /// for the entry is SLocEntryOffsetsBase + SLocEntryOffsets[i]. uint64_t SLocEntryOffsetsBase = 0; - /// Offsets for all of the source location entries in the - /// AST file. + /// Stream bit offsets for all of the source locati

[clang] [clang][modules] Move `SLocEntry` search into `ASTReader` (PR #66966)

2023-10-02 Thread Jan Svoboda via cfe-commits
@@ -50,6 +50,7 @@ int y = a2; // CHECK: In module 'a': // CHECK-NEXT: a.h:1:45: error: +int z = b; // MISSING-B: could not find file '{{.*}}b.h' // MISSING-B-NOT: please delete the module cache jansvoboda11 wrote: I'm not sure. To me, this seems like an imp

[clang] [clang][modules] Move `SLocEntry` search into `ASTReader` (PR #66966)

2023-10-02 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/66966 >From 4edf9d8559339a12108d9c4d1e2f3bb062a5a768 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 20 Sep 2023 17:30:45 -0700 Subject: [PATCH 1/7] [clang][modules] Move `SLocEntry` search into `ASTReader`

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-03 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > > That said, isBeforeInTranslationUnit is slow already, and I don't think > > it's hot in clang, moreso in tools like clang-tidy whose performance is > > less-critical. So let's make it right, and then optimize it again if > > problems arise. > > It may not be a hot func

[clang-tools-extra] [clang] NFCI: Use `FileEntryRef` for `FileID` creation (PR #67838)

2023-10-03 Thread Jan Svoboda via cfe-commits
@@ -527,17 +527,6 @@ FileID SourceManager::getNextFileID(FileID FID) const { /// Create a new FileID that represents the specified file /// being \#included from the specified IncludePosition. -/// -/// This translates NULL into standard input. -FileID SourceManager::createFil

[clang-tools-extra] [clang] NFCI: Use `FileEntryRef` for `FileID` creation (PR #67838)

2023-10-03 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/67838 >From 87a590f89f346113fce04ad6e75908a896b3894b Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 12 Sep 2023 15:02:23 -0700 Subject: [PATCH 1/2] [clang] NFCI: Use `FileEntryRef` for `FileID` creation in

[clang] [clang] NFCI: Use `FileEntryRef` for `FileID` creation (PR #67838)

2023-10-03 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Thanks for the feedback. I used `llvm::cantFail(FM.getFileRef(Name))` in some places to fail more gracefully. The error-reporting changes you suggest I'd like to put into a follow-up patch, to keep this one as NFC as possible. WDYT? https://github.com/llvm/llvm-project/pull

[clang-tools-extra] [clang] NFCI: Use `FileEntryRef` for `FileID` creation (PR #67838)

2023-10-03 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/67838 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] NFC: Remove unused `FileEntry::getLastRef()` (PR #68156)

2023-10-03 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/68156 The last usage of the deprecated `FileEntry::getLastRef()` was removed in #67838, let's remove it entirely. >From 2691f3e3c5867a8102fe2b288534f6c794318d3c Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: T

[clang] [clang] NFC: Remove unused `FileEntry::getLastRef()` (PR #68156)

2023-10-03 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/68156 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] NFC: Deprecate `FileEntry::getName()` (PR #68157)

2023-10-03 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/68157 All uses of `FileEntry::getName()` were removed in favor of `FileEntryRef::getName()`. This patch finally formally deprecates that function. The plan is to remove it entirely in the main branch after we cut

[clang] [clang] NFC: Deprecate `FileEntry::getName()` (PR #68157)

2023-10-03 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: (Note that this is currently blocked on #67839.) https://github.com/llvm/llvm-project/pull/68157 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-03 Thread Jan Svoboda via cfe-commits
@@ -2082,6 +2082,11 @@ std::pair SourceManager::isInTheSameTranslationUnit( if (LOffs.first == ROffs.first) return std::make_pair(true, LOffs.second < ROffs.second); + // Built-ins are not considered part of any TU. jansvoboda11 wrote: This comment ap

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-03 Thread Jan Svoboda via cfe-commits
@@ -701,6 +701,10 @@ class SourceManager : public RefCountedBase { /// use (-ID - 2). SmallVector LoadedSLocEntryTable; + /// For each allocation in LoadedSLocEntryTable, we keep the new size. This + /// can be used to determine whether two FileIDs come from the same AS

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-03 Thread Jan Svoboda via cfe-commits
@@ -458,11 +458,14 @@ SourceManager::AllocateLoadedSLocEntries(unsigned NumSLocEntries, CurrentLoadedOffset - TotalSize < NextLocalOffset) { return std::make_pair(0, 0); } - LoadedSLocEntryTable.resize(LoadedSLocEntryTable.size() + NumSLocEntries); - SLocEntryLoa

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-03 Thread Jan Svoboda via cfe-commits
@@ -701,6 +701,10 @@ class SourceManager : public RefCountedBase { /// use (-ID - 2). SmallVector LoadedSLocEntryTable; + /// For each allocation in LoadedSLocEntryTable, we keep the new size. This + /// can be used to determine whether two FileIDs come from the same AS

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-03 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/66962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-03 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/66962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/66962 >From 61e8961cde95e9e8ce8cea3efd6aa52273f430e9 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 20 Sep 2023 16:50:48 -0700 Subject: [PATCH 1/4] [clang][modules] Remove preloaded SLocEntries from PCM fi

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/66962 >From 61e8961cde95e9e8ce8cea3efd6aa52273f430e9 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 20 Sep 2023 16:50:48 -0700 Subject: [PATCH 1/5] [clang][modules] Remove preloaded SLocEntries from PCM fi

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
@@ -458,14 +458,12 @@ SourceManager::AllocateLoadedSLocEntries(unsigned NumSLocEntries, CurrentLoadedOffset - TotalSize < NextLocalOffset) { return std::make_pair(0, 0); } - - unsigned NewTableSize = LoadedSLocEntryTable.size() + NumSLocEntries; - LoadedSLocEntry

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
@@ -458,14 +458,12 @@ SourceManager::AllocateLoadedSLocEntries(unsigned NumSLocEntries, CurrentLoadedOffset - TotalSize < NextLocalOffset) { return std::make_pair(0, 0); } - - unsigned NewTableSize = LoadedSLocEntryTable.size() + NumSLocEntries; - LoadedSLocEntry

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/66962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
@@ -1986,13 +1984,15 @@ bool SourceManager::isInTheSameTranslationUnitImpl( if (isLoadedFileID(LOffs.first) != isLoadedFileID(ROffs.first)) return false; - // If both are loaded from different AST files. if (isLoadedFileID(LOffs.first) && isLoadedFileID(ROffs.first))

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
@@ -1986,13 +1984,15 @@ bool SourceManager::isInTheSameTranslationUnitImpl( if (isLoadedFileID(LOffs.first) != isLoadedFileID(ROffs.first)) return false; - // If both are loaded from different AST files. if (isLoadedFileID(LOffs.first) && isLoadedFileID(ROffs.first))

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/66962 >From 61e8961cde95e9e8ce8cea3efd6aa52273f430e9 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 20 Sep 2023 16:50:48 -0700 Subject: [PATCH 1/6] [clang][modules] Remove preloaded SLocEntries from PCM fi

[clang] [clang][modules] Move `SLocEntry` search into `ASTReader` (PR #66966)

2023-10-04 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/66966 >From 4edf9d8559339a12108d9c4d1e2f3bb062a5a768 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Wed, 20 Sep 2023 17:30:45 -0700 Subject: [PATCH 1/9] [clang][modules] Move `SLocEntry` search into `ASTReader`

[clang] [clang][modules] Move `SLocEntry` search into `ASTReader` (PR #66966)

2023-10-04 Thread Jan Svoboda via cfe-commits
@@ -1444,6 +1444,74 @@ llvm::Error ASTReader::ReadSourceManagerBlock(ModuleFile &F) { } } +llvm::Expected +ASTReader::readSLocOffset(ModuleFile *F, unsigned Index) { + BitstreamCursor &Cursor = F->SLocEntryCursor; + SavedStreamPosition SavedPosition(Cursor); + if (llvm::

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > Thanks for iterating! I find the current implementation much clearer. Thanks for your patience! > The only thing I might quibble about is the "child" vs. "parent" terminology > you changed: I think it's fairly ambiguous either way, because the node is > the "child" from

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-04 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: @sam-mccall Do you have any additional feedback? You might want to check how this PR and #66966 impact performance for you. https://github.com/llvm/llvm-project/pull/66962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [clang] use absolute path for builtin headers during module compilation (PR #68023)

2023-10-05 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: This is now always storing an absolute path into `Header::PathRelativeToRootModuleDirectory` for built-in headers. I guess that's not much more surprising than the "as-written" resource directory prepended to the header name we stored previously, but I think this should be

[clang] [clang] use absolute path for builtin headers during module compilation (PR #68023)

2023-10-05 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > If the resource dir is outside of the cwd then you would have to have an > absolute path here anyway, wouldn't you? Yes. But my understanding was that's not what you're interested in. I thought you're trying to fix the situation where your resource dir is in the CWD, so

[clang] [clang][driver] Fix an issue where clang does not correctly resolve the system header if invoked via symlink (on MacOS) (PR #68091)

2023-10-05 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > @jansvoboda11, since the Apple clang already fixed this bug, could you > suggest how to proceed? Could you backport the Apple patch to upstream? I'm not familiar with this, but @yln might. https://github.com/llvm/llvm-project/pull/68091 ___

[clang] [clang] use absolute path for builtin headers during module compilation (PR #68023)

2023-10-05 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > > I was going to suggest keeping Header::PathRelativeToRootModuleDirectory as > > "float.h", and generating this into the buffer > > Wouldn't this work without the pragma? Isn't the resource directory always > added to the header search paths, so the header should be fou

[clang] abcf7ce - [clang][modules] Serialize `Module::DefinitionLoc`

2023-07-17 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-07-17T13:50:23-07:00 New Revision: abcf7ce45794839a473a236d55d163016cde5ba6 URL: https://github.com/llvm/llvm-project/commit/abcf7ce45794839a473a236d55d163016cde5ba6 DIFF: https://github.com/llvm/llvm-project/commit/abcf7ce45794839a473a236d55d163016cde5ba6.diff L

[clang] 227f719 - [clang][modules][deps] Avoid checks for relocated modules

2023-07-17 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-07-17T13:50:24-07:00 New Revision: 227f71995804fa5df3f917ae3a7b1499cd24726c URL: https://github.com/llvm/llvm-project/commit/227f71995804fa5df3f917ae3a7b1499cd24726c DIFF: https://github.com/llvm/llvm-project/commit/227f71995804fa5df3f917ae3a7b1499cd24726c.diff L

[clang] be01456 - [clang][modules][deps] Parse "FW_Private" module map even after loading "FW" PCM

2023-07-17 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-07-17T13:50:24-07:00 New Revision: be014563f2f492658abcfa68cfaffc58a4ed7d9a URL: https://github.com/llvm/llvm-project/commit/be014563f2f492658abcfa68cfaffc58a4ed7d9a DIFF: https://github.com/llvm/llvm-project/commit/be014563f2f492658abcfa68cfaffc58a4ed7d9a.diff L

[clang] dba2b5c - [clang][modules] Skip submodule & framework re-definitions in module maps

2023-07-17 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-07-17T13:50:25-07:00 New Revision: dba2b5c9314e1d127ee5200e739e6c8ca53a9831 URL: https://github.com/llvm/llvm-project/commit/dba2b5c9314e1d127ee5200e739e6c8ca53a9831 DIFF: https://github.com/llvm/llvm-project/commit/dba2b5c9314e1d127ee5200e739e6c8ca53a9831.diff L

[clang] bbdb0c7 - [clang][modules] Respect "-fmodule-name=" when serializing included files into a PCH

2023-08-10 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-10T10:11:43-07:00 New Revision: bbdb0c7e4496b145a5e9354f951eec272695049d URL: https://github.com/llvm/llvm-project/commit/bbdb0c7e4496b145a5e9354f951eec272695049d DIFF: https://github.com/llvm/llvm-project/commit/bbdb0c7e4496b145a5e9354f951eec272695049d.diff L

[clang] 6a11557 - [clang][modules] Avoid storing command-line macro definitions into implicitly built PCM files

2023-08-17 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-17T11:11:29-07:00 New Revision: 6a115578324f273ae2b8caef0f034f4bc05ad0b4 URL: https://github.com/llvm/llvm-project/commit/6a115578324f273ae2b8caef0f034f4bc05ad0b4 DIFF: https://github.com/llvm/llvm-project/commit/6a115578324f273ae2b8caef0f034f4bc05ad0b4.diff L

[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)

2023-10-06 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/66962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Move `SLocEntry` search into `ASTReader` (PR #66966)

2023-10-06 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/66966 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 28e8ade - [clang] Fix build after 537344fc

2023-10-06 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-10-06T15:08:06-07:00 New Revision: 28e8ade041d04ba1847d7b05f56b0b2632471169 URL: https://github.com/llvm/llvm-project/commit/28e8ade041d04ba1847d7b05f56b0b2632471169 DIFF: https://github.com/llvm/llvm-project/commit/28e8ade041d04ba1847d7b05f56b0b2632471169.diff L

[clang] 285ab3e - [clang] Fix tests build after 537344fc

2023-10-06 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-10-06T15:49:57-07:00 New Revision: 285ab3e936018c8f46594f721a9a2d2a45a0597d URL: https://github.com/llvm/llvm-project/commit/285ab3e936018c8f46594f721a9a2d2a45a0597d DIFF: https://github.com/llvm/llvm-project/commit/285ab3e936018c8f46594f721a9a2d2a45a0597d.diff L

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

2023-10-09 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/68645 This PR starts caching calls to `DependencyScanningWorkerFilesystem::getRealPath()` that we use whenever we canonicalize module map path. In the case of the real VFS, this functions performs an expensive s

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

2023-10-09 Thread Jan Svoboda via cfe-commits
@@ -168,6 +170,12 @@ class DependencyScanningFilesystemSharedCache { /// The backing storage for cached contents. llvm::SpecificBumpPtrAllocator ContentsStorage; +/// Map from filenames to cached real paths. +llvm::StringMap RealPathsByFilename; ---

[clang] [clang][modules] Use file name as requested (PR #68957)

2023-10-12 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/68957 This prevents redefinition errors due to having multiple paths for the same module map. (rdar://24116019) Originally implemented and tested downstream by @bcardosolopes, I just made use of `FileEntryRef::g

[clang] [clang][modules] Use file name as requested (PR #68957)

2023-10-13 Thread Jan Svoboda via cfe-commits
@@ -1384,10 +1384,10 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context, SmallVector ModMaps(AdditionalModMaps->begin(), AdditionalModMaps->end()); llvm::sort(ModMaps, [](FileEntryRef A, FileEntryRe

[clang] [clang][modules] Use file name as requested (PR #68957)

2023-10-13 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/68957 >From 4f60df88e1623733a64896ef332fd9a31e5b0e47 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 12 Oct 2023 21:46:47 -0700 Subject: [PATCH 1/3] [clang][modules] Use file name as requested This prevents

[clang] [clang][modules] Use file name as requested (PR #68957)

2023-10-13 Thread Jan Svoboda via cfe-commits
@@ -1384,10 +1384,10 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context, SmallVector ModMaps(AdditionalModMaps->begin(), AdditionalModMaps->end()); llvm::sort(ModMaps, [](FileEntryRef A, FileEntryRe

[clang] 8a077cf - [clang][deps] Make the C++ API more type-safe

2023-07-28 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-07-28T12:03:54-07:00 New Revision: 8a077cfe23e3856d406bd3633e1a3026609f3537 URL: https://github.com/llvm/llvm-project/commit/8a077cfe23e3856d406bd3633e1a3026609f3537 DIFF: https://github.com/llvm/llvm-project/commit/8a077cfe23e3856d406bd3633e1a3026609f3537.diff L

[clang] c75b331 - [clang][deps] Remove `ModuleDeps::ImportedByMainFile`

2023-07-28 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-07-28T12:04:35-07:00 New Revision: c75b331fc23192a8249dc5e95e053258f5fb5194 URL: https://github.com/llvm/llvm-project/commit/c75b331fc23192a8249dc5e95e053258f5fb5194 DIFF: https://github.com/llvm/llvm-project/commit/c75b331fc23192a8249dc5e95e053258f5fb5194.diff L

[clang] 2d1e46f - [clang][deps] NFC: Convert test to split-file

2023-08-01 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-01T10:44:30-07:00 New Revision: 2d1e46fec6dbc6c4ecdf1354c091d01bc8267158 URL: https://github.com/llvm/llvm-project/commit/2d1e46fec6dbc6c4ecdf1354c091d01bc8267158 DIFF: https://github.com/llvm/llvm-project/commit/2d1e46fec6dbc6c4ecdf1354c091d01bc8267158.diff L

[clang] eb8c4b1 - [clang][deps] NFC: Convert test to split-file

2023-08-01 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-01T11:48:25-07:00 New Revision: eb8c4b1d0f6154704af669c3f2f7514cb921 URL: https://github.com/llvm/llvm-project/commit/eb8c4b1d0f6154704af669c3f2f7514cb921 DIFF: https://github.com/llvm/llvm-project/commit/eb8c4b1d0f6154704af669c3f2f7514cb921.diff L

[clang] 59a57ca - [clang][deps] NFC: Convert test to split-file

2023-08-01 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-01T12:27:14-07:00 New Revision: 59a57ca6d3e801a90dcef7b4216f6baca6ca99b8 URL: https://github.com/llvm/llvm-project/commit/59a57ca6d3e801a90dcef7b4216f6baca6ca99b8 DIFF: https://github.com/llvm/llvm-project/commit/59a57ca6d3e801a90dcef7b4216f6baca6ca99b8.diff L

[clang] 243bc75 - [clang][cli] Accept option spelling as `Twine`

2023-08-03 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-03T15:09:52-07:00 New Revision: 243bc7504965b885c34487f358d2a4b4a355a6b5 URL: https://github.com/llvm/llvm-project/commit/243bc7504965b885c34487f358d2a4b4a355a6b5 DIFF: https://github.com/llvm/llvm-project/commit/243bc7504965b885c34487f358d2a4b4a355a6b5.diff L

[clang] 8345265 - [clang] Abstract away string allocation in command line generation

2023-08-03 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-03T20:35:00-07:00 New Revision: 83452650490eb1021939129682b01fcdff34c691 URL: https://github.com/llvm/llvm-project/commit/83452650490eb1021939129682b01fcdff34c691 DIFF: https://github.com/llvm/llvm-project/commit/83452650490eb1021939129682b01fcdff34c691.diff L

[clang] acd1ab8 - [clang] NFC: Avoid double allocation when generating command line

2023-08-03 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-03T20:35:42-07:00 New Revision: acd1ab869fca0cfa09065aac518da399f755ed5c URL: https://github.com/llvm/llvm-project/commit/acd1ab869fca0cfa09065aac518da399f755ed5c DIFF: https://github.com/llvm/llvm-project/commit/acd1ab869fca0cfa09065aac518da399f755ed5c.diff L

[clang] 8fd56ea - [clang][deps] NFC: Speed up canonical context hash computation

2023-08-03 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-03T20:36:34-07:00 New Revision: 8fd56ea11256f220502fe9819b496b15582f8d1e URL: https://github.com/llvm/llvm-project/commit/8fd56ea11256f220502fe9819b496b15582f8d1e DIFF: https://github.com/llvm/llvm-project/commit/8fd56ea11256f220502fe9819b496b15582f8d1e.diff L

[clang] 6b4de7b - [clang][deps] add support for dependency scanning with cc1 command line

2023-08-04 Thread Jan Svoboda via cfe-commits
Author: Connor Sughrue Date: 2023-08-04T14:13:18-07:00 New Revision: 6b4de7b1c71b6b701e130c2a533d285dc93b8370 URL: https://github.com/llvm/llvm-project/commit/6b4de7b1c71b6b701e130c2a533d285dc93b8370 DIFF: https://github.com/llvm/llvm-project/commit/6b4de7b1c71b6b701e130c2a533d285dc93b8370.diff

[clang] 501f92d - [llvm] Construct option's prefixed name at compile-time

2023-08-09 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-09T09:52:34-07:00 New Revision: 501f92d343828c0066d3286c3ae6606021b8b271 URL: https://github.com/llvm/llvm-project/commit/501f92d343828c0066d3286c3ae6606021b8b271 DIFF: https://github.com/llvm/llvm-project/commit/501f92d343828c0066d3286c3ae6606021b8b271.diff L

[clang] acf5785 - [clang] NFC: Use compile-time option spelling when generating command line

2023-08-09 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-09T09:55:07-07:00 New Revision: acf57858c1acb4ff776a1d734b86e1c05303132a URL: https://github.com/llvm/llvm-project/commit/acf57858c1acb4ff776a1d734b86e1c05303132a DIFF: https://github.com/llvm/llvm-project/commit/acf57858c1acb4ff776a1d734b86e1c05303132a.diff L

[clang] dcd3a0c - [clang][modules][deps] Create more efficient API for visitation of `ModuleFile` inputs

2023-08-09 Thread Jan Svoboda via cfe-commits
Author: Jan Svoboda Date: 2023-08-09T10:19:36-07:00 New Revision: dcd3a0c9f13b551ca2bcefa0dd181a383f44df49 URL: https://github.com/llvm/llvm-project/commit/dcd3a0c9f13b551ca2bcefa0dd181a383f44df49 DIFF: https://github.com/llvm/llvm-project/commit/dcd3a0c9f13b551ca2bcefa0dd181a383f44df49.diff L

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -94,47 +96,37 @@ class CompilerInvocationRefBase { /// Options controlling the static analyzer. AnalyzerOptionsRef AnalyzerOpts; - CompilerInvocationRefBase(); - CompilerInvocationRefBase(const CompilerInvocationRefBase &X); - CompilerInvocationRefBase(CompilerInvoca

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -94,47 +96,37 @@ class CompilerInvocationRefBase { /// Options controlling the static analyzer. AnalyzerOptionsRef AnalyzerOpts; - CompilerInvocationRefBase(); - CompilerInvocationRefBase(const CompilerInvocationRefBase &X); - CompilerInvocationRefBase(CompilerInvoca

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -154,46 +146,158 @@ class CompilerInvocationValueBase { PreprocessorOutputOptions PreprocessorOutputOpts; public: - MigratorOptions &getMigratorOpts() { return MigratorOpts; } + // clang-format off const MigratorOptions &getMigratorOpts() const { return MigratorOpts;

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -123,49 +123,101 @@ static Expected> parseToleranceOption(StringRef Arg) { } //===--===// -// Initialization. +// Storage details. //===--

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -123,49 +123,101 @@ static Expected> parseToleranceOption(StringRef Arg) { } //===--===// -// Initialization. +// Storage details. //===--

[clang] [clang] Make the entire `CompilerInvocation` ref-counted (PR #65647)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 review_requested https://github.com/llvm/llvm-project/pull/65647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make the entire `CompilerInvocation` ref-counted (PR #65647)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 review_requested https://github.com/llvm/llvm-project/pull/65647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Make the entire `CompilerInvocation` ref-counted (PR #65647)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/65647: This enables making the whole `CompilerInvocation` more efficient through copy-on-write. >From 4a29ff15728ac3e93de26066274493c1fd6c50fa Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 7 Sep 2023 10:

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -4588,28 +4641,29 @@ std::string CompilerInvocation::getModuleHash() const { return toString(llvm::APInt(64, Hash), 36, /*Signed=*/false); } -void CompilerInvocation::generateCC1CommandLine( +void CompilerInvocationBase::generateCC1CommandLine( ArgumentConsumer Consu

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Made the entirety of `ValBase` ref-counted in https://github.com/llvm/llvm-project/pull/65647, which also resolves some other comments here. https://github.com/llvm/llvm-project/pull/65412 ___ cfe-commits mailing list cfe-commits@

[clang] [clang] Make the entire `CompilerInvocation` ref-counted (PR #65647)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/65647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/65412: >From 1cf820b6e89b8747ed77bf998e0c0784a23bf851 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 7 Sep 2023 12:54:51 -0700 Subject: [PATCH] [clang] Introduce copy-on-write `CompilerInvocation` --- cla

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 review_requested https://github.com/llvm/llvm-project/pull/65412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/65412: >From dd1c433670028232f172a5372cc325d0c85f9d4f Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 7 Sep 2023 12:54:51 -0700 Subject: [PATCH] [clang] Introduce copy-on-write `CompilerInvocation` When ado

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 review_requested https://github.com/llvm/llvm-project/pull/65412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce copy-on-write `CompilerInvocation` (PR #65412)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/65412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Store common, partially-formed invocation (PR #65677)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/65677: We create one `CompilerInvocation` for each modular dependency we discover. This means we create a lot of copies, even though most of the invocation is the same between modules. This patch makes use of the

[clang] [clang][deps] Store common, partially-formed invocation (PR #65677)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 review_requested https://github.com/llvm/llvm-project/pull/65677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Store common, partially-formed invocation (PR #65677)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 review_requested https://github.com/llvm/llvm-project/pull/65677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Store common, partially-formed invocation (PR #65677)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -279,13 +281,16 @@ class ModuleDepCollector final : public DependencyCollector { /// Add module files (pcm) to the invocation, if needed. void addModuleFiles(CompilerInvocation &CI, ArrayRef ClangModuleDeps) const; + void addModuleFiles(CowCompile

[clang] [clang][deps] Store common, partially-formed invocation (PR #65677)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 edited https://github.com/llvm/llvm-project/pull/65677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Store common, partially-formed invocation (PR #65677)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -117,14 +112,37 @@ ModuleDepCollector::makeInvocationForModuleBuildWithoutOutputs( CI.getFrontendOpts().ARCMTAction = FrontendOptions::ARCMT_None; CI.getFrontendOpts().ObjCMTAction = FrontendOptions::ObjCMT_None; CI.getFrontendOpts().MTMigrateDir.clear(); - CI.getLan

[clang] [clang][deps] Store common, partially-formed invocation (PR #65677)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/65677: >From 0b4be90372e314e7ae79d58099ef940092a73536 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Thu, 24 Aug 2023 17:33:38 -0700 Subject: [PATCH] [clang][deps] Store common, partially-formed invocation ---

[clang] [clang][deps] Store common, partially-formed invocation (PR #65677)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 review_requested https://github.com/llvm/llvm-project/pull/65677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Store common, partially-formed invocation (PR #65677)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/65677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Generate command lines lazily (PR #65691)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 review_requested https://github.com/llvm/llvm-project/pull/65691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Generate command lines lazily (PR #65691)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/65691: This patch makes the generation of command lines for modular dependencies lazy/on-demand. That operation is somewhat expensive and prior to this patch used to be performed multiple times for the identical

[clang] [clang][deps] Generate command lines lazily (PR #65691)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 review_requested https://github.com/llvm/llvm-project/pull/65691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Generate command lines lazily (PR #65691)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -532,7 +539,8 @@ ModuleDepCollectorPP::handleTopLevelModule(const Module *M) { // Finish the compiler invocation. Requires dependencies and the context hash. MDC.addOutputPaths(CI, MD); - MD.BuildArguments = CI.getCC1CommandLine(); + MD.BuildInvocationOrArguments =

[clang] [clang][deps] Generate command lines lazily (PR #65691)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -136,9 +138,15 @@ struct ModuleDeps { /// determined that the differences are benign for this compilation. std::vector ClangModuleDeps; - /// Compiler invocation that can be used to build this module. Does not - /// include argv[0]. - std::vector BuildArguments; + /

[clang] [clang][deps] Generate command lines lazily (PR #65691)

2023-09-07 Thread Jan Svoboda via cfe-commits
@@ -136,9 +138,15 @@ struct ModuleDeps { /// determined that the differences are benign for this compilation. std::vector ClangModuleDeps; - /// Compiler invocation that can be used to build this module. Does not - /// include argv[0]. - std::vector BuildArguments; + /

[clang] [clang][deps] Generate command lines lazily (PR #65691)

2023-09-07 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 updated https://github.com/llvm/llvm-project/pull/65691: >From 6b8c1ee1507fbc143752fac966e4aabb36699e53 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Fri, 1 Sep 2023 13:01:24 -0700 Subject: [PATCH] [clang][deps] Generate command-lines lazily --- .../Dependen

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