
We will only regsiter top level types and decls in ASTWriter and we will register the sub types and decls during the process of writing types and decls. So that the ID for the types in the sub level can be different if the writing decl process changes the order of the to-be- emitted type queues. This is not ideal since it causes unnecessary changes especially in no transitive changes model. This patch migrates the issue by regsitering special types before regsitering decls. This make sure that the special types in the 2nd top level can be registered early than the decls. But it might still be problematic if there are more levels in the special types. Luckily we just don't have such special types.
29 lines
849 B
C++
29 lines
849 B
C++
// Test that adding a new unused decl within reduced BMI may not produce a transitive change.
|
|
//
|
|
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
//
|
|
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.cppm -o %t/A.pcm
|
|
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/B.cppm -o %t/B.pcm \
|
|
// RUN: -fmodule-file=A=%t/A.pcm
|
|
//
|
|
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/A.v1.cppm -o %t/A.v1.pcm
|
|
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/B.cppm -o %t/B.v1.pcm \
|
|
// RUN: -fmodule-file=A=%t/A.v1.pcm
|
|
//
|
|
// RUN: diff %t/B.pcm %t/B.v1.pcm &> /dev/null
|
|
|
|
//--- A.cppm
|
|
export module A;
|
|
export int a() { return 44; }
|
|
|
|
//--- A.v1.cppm
|
|
export module A;
|
|
int a_impl() { return 48; }
|
|
export int a() { return a_impl(); }
|
|
|
|
//--- B.cppm
|
|
export module B;
|
|
import A;
|
|
export int b() { return a(); }
|