[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -7650,6 +7647,16 @@ ModuleFile *ASTReader::getOwningModuleFile(GlobalDeclID ID) const { return ()[ModuleFileIndex - 1]; } +ModuleFile *ASTReader::getOwningModuleFile(TypeID ID) const { + if (ID < NUM_PREDEF_TYPE_IDS) +return nullptr; + + uint64_t ModuleFileIndex =

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -3262,17 +3262,18 @@ void ASTWriter::WritePragmaDiagnosticMappings(const DiagnosticsEngine , /// Write the representation of a type to the AST stream. void ASTWriter::WriteType(QualType T) { TypeIdx = TypeIdxs[T]; - if (IdxRef.getIndex() == 0) // we haven't seen this

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/92511 >From 57cfb2b7791666022ee46201b5126ac610c19bdd Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 17 May 2024 14:25:53 +0800 Subject: [PATCH 1/2] [serialization] No transitive type change ---

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/92511 >From 57cfb2b7791666022ee46201b5126ac610c19bdd Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 17 May 2024 14:25:53 +0800 Subject: [PATCH 1/2] [serialization] No transitive type change ---

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -7392,27 +7388,28 @@ QualType ASTReader::GetType(TypeID ID) { return TypesLoaded[Index].withFastQualifiers(FastQuals); } -QualType ASTReader::getLocalType(ModuleFile , unsigned LocalID) { +QualType ASTReader::getLocalType(ModuleFile , TypeID LocalID) {

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -12,44 +12,44 @@ // RUN: -fmodule-file=Module=%t/Module.pcm -emit-llvm -o - | FileCheck %t/Object.cppm // Test again with reduced BMI. -// RUN: rm -rf %t -// RUN: mkdir -p %t -// RUN: split-file %s %t +// RUNX: rm -rf %t ChuanqiXu9 wrote: Oh, sorry.

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
@@ -7100,14 +7084,25 @@ TypeSourceInfo *ASTRecordReader::readTypeSourceInfo() { return TInfo; } +std::pair +ASTReader::translateTypeIDToIndex(serialization::TypeID ID) const { + unsigned Index = + (ID & llvm::maskTrailingOnes(32)) >> Qualifiers::FastWidth; + +

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Chuanqi Xu via llvm-branch-commits
ChuanqiXu9 wrote: > Thanks for the change! I have done a round of review and left a few > suggestion and also have a bunch of questions. I am sorry if some of them may > look too obvious, I did try to dig into the code where I could, but Clang's > serialization is complicated and some things

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -7392,27 +7388,28 @@ QualType ASTReader::GetType(TypeID ID) { return TypesLoaded[Index].withFastQualifiers(FastQuals); } -QualType ASTReader::getLocalType(ModuleFile , unsigned LocalID) { +QualType ASTReader::getLocalType(ModuleFile , TypeID LocalID) {

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -12,44 +12,44 @@ // RUN: -fmodule-file=Module=%t/Module.pcm -emit-llvm -o - | FileCheck %t/Object.cppm // Test again with reduced BMI. -// RUN: rm -rf %t -// RUN: mkdir -p %t -// RUN: split-file %s %t +// RUNX: rm -rf %t ilya-biryukov wrote: are

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -6659,13 +6655,22 @@ void ASTWriter::MacroRead(serialization::MacroID ID, MacroInfo *MI) { } void ASTWriter::TypeRead(TypeIdx Idx, QualType T) { - // Always take the highest-numbered type index. This copes with an interesting + // Always take the type index that comes

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -3262,17 +3262,18 @@ void ASTWriter::WritePragmaDiagnosticMappings(const DiagnosticsEngine , /// Write the representation of a type to the AST stream. void ASTWriter::WriteType(QualType T) { TypeIdx = TypeIdxs[T]; - if (IdxRef.getIndex() == 0) // we haven't seen this

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -7650,6 +7647,16 @@ ModuleFile *ASTReader::getOwningModuleFile(GlobalDeclID ID) const { return ()[ModuleFileIndex - 1]; } +ModuleFile *ASTReader::getOwningModuleFile(TypeID ID) const { + if (ID < NUM_PREDEF_TYPE_IDS) +return nullptr; + + uint64_t ModuleFileIndex =

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -70,38 +71,53 @@ using DeclID = DeclIDBase::DeclID; /// An ID number that refers to a type in an AST file. /// -/// The ID of a type is partitioned into two parts: the lower +/// The ID of a type is partitioned into three parts: +/// - the lower /// three bits are used to

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
@@ -7100,14 +7084,25 @@ TypeSourceInfo *ASTRecordReader::readTypeSourceInfo() { return TInfo; } +std::pair +ASTReader::translateTypeIDToIndex(serialization::TypeID ID) const { + unsigned Index = + (ID & llvm::maskTrailingOnes(32)) >> Qualifiers::FastWidth; + +

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
https://github.com/ilya-biryukov commented: Thanks for the change! I have done a round of review and left a few suggestion and also have a bunch of questions. I am sorry if some of them may look too obvious, I did try to dig into the code where I could, but Clang's serialization is

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-19 Thread Ilya Biryukov via llvm-branch-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/92511 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-18 Thread Ilya Biryukov via llvm-branch-commits
ilya-biryukov wrote: I am happy to take a look, but will run out of time for it today. I will definitely do it tomorrow, though. https://github.com/llvm/llvm-project/pull/92511 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-17 Thread Chuanqi Xu via llvm-branch-commits
ChuanqiXu9 wrote: @jansvoboda11 @ilya-biryukov would you like to take look? https://github.com/llvm/llvm-project/pull/92511 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-06-04 Thread Chuanqi Xu via llvm-branch-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/92511 >From 57cfb2b7791666022ee46201b5126ac610c19bdd Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 17 May 2024 14:25:53 +0800 Subject: [PATCH] [serialization] No transitive type change ---

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-05-27 Thread Chuanqi Xu via llvm-branch-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/92511 >From 1a83e2b0f00183c61e7a5303ea7eeb0b279c7e91 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 17 May 2024 14:25:53 +0800 Subject: [PATCH] [serialization] No transitive type change ---

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-05-19 Thread Chuanqi Xu via llvm-branch-commits
ChuanqiXu9 wrote: @jansvoboda11 @Bigcheese gentle ping https://github.com/llvm/llvm-project/pull/92511 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-05-17 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Chuanqi Xu (ChuanqiXu9) Changes Following of https://github.com/llvm/llvm-project/pull/92085. motivation The motivation is still cutting of the unnecessary change in the dependency chain. See the above link (recursively)

[llvm-branch-commits] [clang] [serialization] No transitive type change (PR #92511)

2024-05-17 Thread Chuanqi Xu via llvm-branch-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/92511 Following of https://github.com/llvm/llvm-project/pull/92085. motivation The motivation is still cutting of the unnecessary change in the dependency chain. See the above link (recursively) for