https://github.com/jansvoboda11 closed
https://github.com/llvm/llvm-project/pull/94488
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jansvoboda11 approved this pull request.
https://github.com/llvm/llvm-project/pull/94488
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jansvoboda11 wrote:
> > You can have a project that has both C and C++ implementation files that
> > end up including the same header files from the C standard library. One can
> > be compiled under C11 (without separator support), the other under C++14
> > (with separator support).
>
>
jansvoboda11 wrote:
> Thanks for the comments @jansvoboda11 . I am new to all these different
> moving parts and want to understand better. I have a few questions.
>
> > If you concurrently scan the same file under two language standards with
> > the same scanning service, it becomes
jansvoboda11 wrote:
I don't think this is correct. If you concurrently scan the same file under two
language standards with the same scanning service, it becomes non-deterministic
which one gets cached in the filesystem cache. For subsequent FS queries the
cache might return wrong results,
@@ -111,6 +109,28 @@ void *Decl::operator new(std::size_t Size, const
ASTContext ,
return ::operator new(Size + Extra, Ctx);
}
+GlobalDeclID Decl::getGlobalID() const {
+ if (!isFromASTFile())
+return GlobalDeclID();
+ uint64_t ID = *((const uint64_t *)this - 1);
@@ -918,7 +918,7 @@ ASTSelectorLookupTrait::ReadKey(const unsigned char* d,
unsigned) {
SelectorTable = Reader.getContext().Selectors;
unsigned N = endian::readNext(d);
const IdentifierInfo *FirstII = Reader.getLocalIdentifier(
- F, endian::readNext(d));
+ F,
@@ -3896,7 +3903,7 @@ void ASTWriter::WriteIdentifierTable(Preprocessor ,
// Write out identifiers if either the ID is local or the identifier has
// changed since it was loaded.
- if (ID >= FirstIdentID || !Chain || !II->isFromAST() ||
+ if
https://github.com/jansvoboda11 commented:
This looks good conceptually, I left a couple of minor notes.
https://github.com/llvm/llvm-project/pull/92083
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -7802,20 +7800,31 @@ Decl *ASTReader::GetDecl(GlobalDeclID ID) {
LocalDeclID ASTReader::mapGlobalIDToModuleFileGlobalID(ModuleFile ,
GlobalDeclID GlobalID) {
- DeclID ID = GlobalID.get();
- if (ID <
@@ -111,6 +109,28 @@ void *Decl::operator new(std::size_t Size, const
ASTContext ,
return ::operator new(Size + Extra, Ctx);
}
+GlobalDeclID Decl::getGlobalID() const {
+ if (!isFromASTFile())
+return GlobalDeclID();
+ uint64_t ID = *((const uint64_t *)this - 1);
@@ -255,6 +255,12 @@ class DeclOffset {
}
};
+// The unaligned decl ID used in the Blobs of bistreams.
+using unalighed_decl_id_t =
jansvoboda11 wrote:
I know this typo isn't introduced by your PR, but since your PR is touching it,
please fix it in a prep
@@ -124,6 +130,15 @@ class DeclIDBase {
bool isInvalid() const { return ID == PREDEF_DECL_NULL_ID; }
+ unsigned getModuleFileIndex() const { return ID >> 32; }
+
+ unsigned getLocalDeclIndex() const {
+// Implement it directly instead of calling
https://github.com/jansvoboda11 approved this pull request.
LGTM, thanks!
https://github.com/llvm/llvm-project/pull/89950
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jansvoboda11 deleted
https://github.com/llvm/llvm-project/pull/89950
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,36 @@
+// Check that the scanner can adjust arguments by reading .rsp files in
advance.
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
jansvoboda11 wrote:
Ok, that makes sense, thanks!
@@ -86,6 +86,8 @@ static bool DeprecatedDriverCommand;
static ResourceDirRecipeKind ResourceDirRecipe;
static bool Verbose;
static bool PrintTiming;
+static llvm::BumpPtrAllocator Alloc;
+static llvm::StringSaver Saver{Alloc};
jansvoboda11 wrote:
Why do these
https://github.com/jansvoboda11 approved this pull request.
https://github.com/llvm/llvm-project/pull/91140
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,36 @@
+// Check that the scanner can adjust arguments by reading .rsp files in
advance.
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
+// RUN: echo /Fo%t/tu.obj >> %t/args_nested.rsp
jansvoboda11 wrote:
I don't think I'll have time to work on this PR in the short-term.
https://github.com/llvm/llvm-project/pull/88800
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jansvoboda11 wrote:
This sounds good in principle, but some tests are failing in CI, so this might
need more refinement.
https://github.com/llvm/llvm-project/pull/91140
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -2841,6 +2841,30 @@ static bool ParseFrontendArgs(FrontendOptions ,
ArgList ,
}
Opts.ProgramAction = *ProgramAction;
+
+// Catch common mistakes when multiple actions are specified for cc1 (e.g.
+// -S -emit-llvm means -emit-llvm while -emit-llvm -S means
https://github.com/jansvoboda11 closed
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
https://github.com/jansvoboda11 edited
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
https://github.com/jansvoboda11 edited
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
@@ -249,9 +245,27 @@ GetAffectingModuleMaps(const Preprocessor , Module
*RootModule) {
for (const auto : HS.findResolvedModulesForHeader(*File))
if (const Module *M = KH.getModule())
-CollectIncludingMapsFromAncestors(M);
+
@@ -249,9 +245,27 @@ GetAffectingModuleMaps(const Preprocessor , Module
*RootModule) {
for (const auto : HS.findResolvedModulesForHeader(*File))
if (const Module *M = KH.getModule())
-CollectIncludingMapsFromAncestors(M);
+
https://github.com/jansvoboda11 ready_for_review
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
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89992
>From 8c2989ffe7b6e61b32facf831aa7eeabbf0001d2 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Wed, 24 Apr 2024 11:12:28 -0700
Subject: [PATCH 1/3] [clang][modules] Allow including module maps to be
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89992
>From 8c2989ffe7b6e61b32facf831aa7eeabbf0001d2 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Wed, 24 Apr 2024 11:12:28 -0700
Subject: [PATCH 1/3] [clang][modules] Allow including module maps to be
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89992
>From 8c2989ffe7b6e61b32facf831aa7eeabbf0001d2 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Wed, 24 Apr 2024 11:12:28 -0700
Subject: [PATCH 1/2] [clang][modules] Allow including module maps to be
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89992
>From 6e77e37977bbecc8053d12b4db3f790042b8f34d Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Wed, 24 Apr 2024 11:12:28 -0700
Subject: [PATCH 1/2] [clang][modules] Allow including module maps to be
https://github.com/jansvoboda11 edited
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
@@ -792,10 +792,15 @@ int clang_scan_deps_main(int argc, char **argv, const
llvm::ToolContext &) {
llvm::cl::PrintOptionValues();
+ // Expand response files in advance, so that we can "see" all the arguments
+ // when adjusting below.
+ auto ResponseExpander =
@@ -0,0 +1,36 @@
+// Check that the scanner can adjust arguments by reading .rsp files in
advance.
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
+// RUN: echo /Fo%t/tu.obj >> %t/args_nested.rsp
https://github.com/jansvoboda11 edited
https://github.com/llvm/llvm-project/pull/89950
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,36 @@
+// Check that the scanner can adjust arguments by reading .rsp files in
advance.
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
jansvoboda11 wrote:
You can now do this:
@@ -1069,7 +1069,7 @@ void Clang::AddPreprocessingOptions(Compilation , const
JobAction ,
// If user provided -o, that is the dependency target, except
// when we are only generating a dependency file.
- Arg *OutputOpt = Args.getLastArg(options::OPT_o);
+
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89992
>From 6e77e37977bbecc8053d12b4db3f790042b8f34d Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Wed, 24 Apr 2024 11:12:28 -0700
Subject: [PATCH] [clang][modules] Allow including module maps to be
https://github.com/jansvoboda11 created
https://github.com/llvm/llvm-project/pull/89992
None
>From e16becb9357fd560a1c9c673389e6dbba02e024c Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Wed, 24 Apr 2024 11:12:28 -0700
Subject: [PATCH] [clang][modules] Allow including module maps to be
https://github.com/jansvoboda11 closed
https://github.com/llvm/llvm-project/pull/72400
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jansvoboda11 wrote:
Hmm, that driver code is only executed if the dependency file was requested on
the Clang command line, though. `clang-scan-deps` should be able to generate
the dependency file even if the original command line doesn't have `-MD` and
friends. That's why we call
jansvoboda11 wrote:
> Maybe the issue is that the DependencyOptions we pass have no target set,
> since the original command line doesn't have -MD (or something like that)?
No, even then we should deduce the output path:
jansvoboda11 wrote:
This change makes sense to me, but I forget what's the purpose of the whole
output path deducing code. Even for `clang-cl` command lines we should go
through the driver and get a `CompilerInvocation` that will have the output
file set (if the action does produce an output
jansvoboda11 wrote:
(Out of interest, what machine are you seeing the contention with?)
https://github.com/llvm/llvm-project/pull/88427
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jansvoboda11 approved this pull request.
LGTM, thanks!
https://github.com/llvm/llvm-project/pull/88427
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jansvoboda11 approved this pull request.
The changes LGTM, don't want to block this on my remaining nits.
I believe @Bigcheese wanted to test test impact on PCM size on our side before
this lands.
https://github.com/llvm/llvm-project/pull/86912
@@ -2220,33 +2221,40 @@ 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
@@ -2221,33 +,45 @@ 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
https://github.com/jansvoboda11 closed
https://github.com/llvm/llvm-project/pull/89441
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jansvoboda11 edited
https://github.com/llvm/llvm-project/pull/89441
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89441
>From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 12:13:06 -0700
Subject: [PATCH 1/8] [clang][modules] Allow module map files with textual
@@ -1574,6 +1574,7 @@ bool HeaderSearch::ShouldEnterIncludeFile(Preprocessor
,
}
}
+ FileInfo.IsLocallyIncluded = true;
jansvoboda11 wrote:
I agree, I wanted to colocate this with call to `Preprocessor::markIncluded()`.
If we find a better way of
@@ -0,0 +1,20 @@
+// This test checks that a module map with a textual header can be marked as
jansvoboda11 wrote:
(And thanks for the extended test case!)
https://github.com/llvm/llvm-project/pull/89441
___
@@ -0,0 +1,20 @@
+// This test checks that a module map with a textual header can be marked as
jansvoboda11 wrote:
Should work with
[b03c34f](https://github.com/llvm/llvm-project/pull/89441/commits/b03c34f99bd90398f0599b5703cbf82d8b881981).
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89441
>From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 12:13:06 -0700
Subject: [PATCH 1/6] [clang][modules] Allow module map files with textual
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89441
>From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 12:13:06 -0700
Subject: [PATCH 1/5] [clang][modules] Allow module map files with textual
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89441
>From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 12:13:06 -0700
Subject: [PATCH 1/5] [clang][modules] Allow module map files with textual
@@ -0,0 +1,20 @@
+// This test checks that a module map with a textual header can be marked as
jansvoboda11 wrote:
This patch unfortunately doesn't pass that test (on line 44) due to
[this](https://github.com/llvm/llvm-project/pull/89441/files#r1576422103):
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89441
>From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 12:13:06 -0700
Subject: [PATCH 1/4] [clang][modules] Allow module map files with textual
@@ -187,7 +187,8 @@ GetAffectingModuleMaps(const Preprocessor , Module
*RootModule) {
continue;
const HeaderFileInfo *HFI = HS.getExistingLocalFileInfo(*File);
-if (!HFI || (HFI->isModuleHeader && !HFI->isCompilingModuleHeader))
+if (!HFI ||
jansvoboda11 wrote:
> I've sent a version of this as #89729, based on your first commit here.
I left a comment there.
> > I think one option we have here is to consider all module maps describing a
> > textual header that got included as affecting. I'm concerned that a long
> > chain of
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89441
>From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 12:13:06 -0700
Subject: [PATCH 1/3] [clang][modules] Allow module map files with textual
@@ -1441,6 +1441,10 @@ void HeaderSearch::MarkFileModuleHeader(FileEntryRef FE,
HFI.isCompilingModuleHeader |= isCompilingModuleHeader;
}
+void HeaderSearch::EnteredTextualFile(FileEntryRef File) {
+ getFileInfo(File).isCompilingModuleHeader = true;
jansvoboda11 wrote:
No worries, happy to get to the bottom of it.
https://github.com/llvm/llvm-project/pull/87442
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jansvoboda11 wrote:
@sam-mccall That makes sense.
I think one option we have here is to consider all module maps describing a
textual header that got included as affecting. I'm concerned that a long chain
of textual header includes might again be problematic.
For this particular test, we
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89441
>From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 12:13:06 -0700
Subject: [PATCH 1/2] [clang][modules] Allow module map files with textual
https://github.com/jansvoboda11 approved this pull request.
https://github.com/llvm/llvm-project/pull/88602
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jansvoboda11 wrote:
@alexfh Can you check it doesn't boil down to the same thing as the issue you
reported in https://reviews.llvm.org/D137213?
https://github.com/llvm/llvm-project/pull/87442
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/jansvoboda11 approved this pull request.
https://github.com/llvm/llvm-project/pull/72400
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jansvoboda11 wrote:
> Is this a pre-existing issue, or did my patch change to make "each textual
> header gets a `HFI`"?
I'm not sure yet, I think we'll need to investigate [Sam's
reproducer](https://github.com/llvm/llvm-project/pull/89005#issuecomment-2067300965)
and consider [Richard's
jansvoboda11 wrote:
I updated the description of this PR, hopefully it makes more sense now. I
still need to investigate what goes wrong in "Modules/preprocess-decluse.cpp".
It seems that it assumes `%t/b.pcm` embeds the information from "a.modulemap".
https://github.com/jansvoboda11 edited
https://github.com/llvm/llvm-project/pull/89441
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jansvoboda11 wrote:
Just so you're aware, it's possible that
https://github.com/llvm/llvm-project/pull/87848 introduced some unexpected
behavior change. It would be good to check if your issues are caused just by
one patch in isolation or by a combination of more patches that landed recently.
jansvoboda11 wrote:
Hmm, this will probably only work if you compile `A` into a PCM and then pass
it to `B`. This is not how "Modules/preprocess-decluse.cpp" is set up.
https://github.com/llvm/llvm-project/pull/89441
___
cfe-commits mailing list
https://github.com/jansvoboda11 edited
https://github.com/llvm/llvm-project/pull/89441
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89441
>From 9165d6086e2570198fba1c333d0c9cb9c09037c7 Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 12:13:06 -0700
Subject: [PATCH] [clang][modules] Allow module map files with textual header
https://github.com/jansvoboda11 closed
https://github.com/llvm/llvm-project/pull/89428
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jansvoboda11 edited
https://github.com/llvm/llvm-project/pull/89441
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/jansvoboda11 edited
https://github.com/llvm/llvm-project/pull/89441
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jansvoboda11 wrote:
(Only commit c68b6468347e0a6141ff312139a82a3a8be9ce2e is relevant here, the
other one is from #89428.)
https://github.com/llvm/llvm-project/pull/89441
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
jansvoboda11 wrote:
https://github.com/llvm/llvm-project/pull/89441 might be of interest too.
https://github.com/llvm/llvm-project/pull/89005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/jansvoboda11 created
https://github.com/llvm/llvm-project/pull/89441
Depends on #89428.
>From baa15bb0f35e3f9845407c6b843b82c3a466369f Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 10:28:33 -0700
Subject: [PATCH 1/2] [clang][modules] Only avoid pruning
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89428
>From baa15bb0f35e3f9845407c6b843b82c3a466369f Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 10:28:33 -0700
Subject: [PATCH] [clang][modules] Only avoid pruning module maps when asked to
https://github.com/jansvoboda11 updated
https://github.com/llvm/llvm-project/pull/89428
>From baa15bb0f35e3f9845407c6b843b82c3a466369f Mon Sep 17 00:00:00 2001
From: Jan Svoboda
Date: Fri, 19 Apr 2024 10:28:33 -0700
Subject: [PATCH 1/2] [clang][modules] Only avoid pruning module maps when
https://github.com/jansvoboda11 created
https://github.com/llvm/llvm-project/pull/89428
Pruning non-affecting module maps is useful even when passing module maps
explicitly via `-fmodule-map-file=`. For this situation, this patch
reinstates the behavior we had prior to #87849. For the
@@ -1292,6 +1292,31 @@ void func() {}
EXPECT_EQ(attrCount, 1);
}
+TEST_F(LibclangParseTest, clang_getSpellingLocation) {
+ std::string fileName = "main.c";
+ WriteFile(fileName, "#define X(value) int x = value;\nX(42)\n");
+
+ ClangTU = clang_parseTranslationUnit(Index,
@@ -2220,33 +2221,40 @@ 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
@@ -1293,6 +1293,10 @@ compileModuleImpl(CompilerInstance ,
SourceLocation ImportLoc,
diag::remark_module_build_done)
<< ModuleName;
+ // Propagate the statistics to the parent FileManager.
+ if
@@ -5574,10 +5577,34 @@ void ASTWriter::AddFileID(FileID FID, RecordDataImpl
) {
Record.push_back(getAdjustedFileID(FID).getOpaqueValue());
}
+SourceLocationEncoding::RawLocEncoding
+ASTWriter::getRawSourceLocationEncoding(SourceLocation Loc, LocSeq *Seq) {
+ unsigned
@@ -4082,14 +4069,14 @@ void ASTReader::ReadModuleOffsetMap(ModuleFile )
const {
: ModuleMgr.lookupByFileName(Name));
if (!OM) {
std::string Msg =
- "SourceLocation remap refers to unknown module, cannot find ";
+ "cannot
@@ -2221,33 +,45 @@ 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
jansvoboda11 wrote:
Sorry, I'm not familiar with the rewriter. Maybe @PiotrZSL would be able to
take look?
https://github.com/llvm/llvm-project/pull/73827
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
jansvoboda11 wrote:
The change itself looks good, but I think we should have a test and an entry in
release notes.
https://github.com/llvm/llvm-project/pull/72400
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
jansvoboda11 wrote:
Also note that `ASTWriter` uses this logic in couple of places to avoid
serializing unrelated headers:
```c++
if (!HFI || (HFI->isModuleHeader && !HFI->isCompilingModuleHeader))
continue;
```
Since textual headers from other modules have `isModuleHeader=false` and
jansvoboda11 wrote:
> getExistingFileInfo(, /*WantExternal=*/false)
Until [recently](https://github.com/llvm/llvm-project/pull/87848) that function
still consulted `ExternalSource` for `HeaderFileInfo` that `IsValid &&
!External && !Resolved`. Maybe you want to try the new
https://github.com/jansvoboda11 closed
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
https://github.com/jansvoboda11 closed
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
jansvoboda11 wrote:
As a test, maybe you could probe the resulting PCM with `-module-file-info`.
https://github.com/llvm/llvm-project/pull/89005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -161,8 +161,13 @@ static TypeCode getTypeCodeForTypeClass(Type::TypeClass
id) {
namespace {
-std::set GetAffectingModuleMaps(const Preprocessor ,
- Module *RootModule) {
+std::optional>
+GetAffectingModuleMaps(const
1 - 100 of 1052 matches
Mail list logo