This patch reorder the lexical block for the translation unit, visible update block for the TU and the viisble upaete block for the extern C context after the type decl offsets block. This should be a NFC patch. This is helpful for later optimizations for eliding unreachable declarations in the global module fragment. See the comments in https://github.com/llvm/llvm-project/pull/76930. Simply, if we want to get the reachable sets of declaratins during the writing process, we need to write the file-level context later than the process of writing declarations (which is the main process to determine the reachable set).
19 lines
492 B
C++
19 lines
492 B
C++
// Make sure that the declarations inside the language linkage can
|
|
// be generated correctly.
|
|
//
|
|
// RUN: rm -fr %t
|
|
// RUN: mkdir %t
|
|
//
|
|
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %s -emit-module-interface -o %t/M.pcm
|
|
// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/M.pcm -S -emit-llvm -disable-llvm-passes -o - | FileCheck %s
|
|
export module M;
|
|
|
|
extern "C++" {
|
|
void foo() {}
|
|
}
|
|
|
|
extern "C" void bar() {}
|
|
|
|
// CHECK: define {{.*}}@_Z3foov(
|
|
// CHECK: define {{.*}}@bar(
|