mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-17 19:36:48 +00:00

When using explicit Clang modules, some declarations might unexpectedly become invisible. This is caused by the mechanism that loads PCM files passed via `-fmodule-file=<path>` and creates an `IdentifierInfo` for the module name. The `IdentifierInfo` creation takes place when the `ASTReader` is in a weird state, with modules that are loaded but not yet set up properly. This patch delays the creation of `IdentifierInfo` until the `ASTReader` is done with reading the PCM. Note that the `-fmodule-file=<name>=<path>` form of the argument doesn't suffer from this issue, since it doesn't create `IdentifierInfo` for the module name. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D111543
26 lines
1.2 KiB
Objective-C
26 lines
1.2 KiB
Objective-C
// RUN: rm -rf %t && mkdir %t
|
|
|
|
// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-name=InterfaceBridge \
|
|
// RUN: %S/Inputs/module-name-used-by-objc-bridge/module.modulemap -o %t/InterfaceBridge.pcm
|
|
|
|
// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-name=Interface \
|
|
// RUN: %S/Inputs/module-name-used-by-objc-bridge/module.modulemap -o %t/Interface.pcm
|
|
|
|
// Check that the `-fmodule-file=<name>=<path>` form succeeds:
|
|
// RUN: %clang_cc1 -fmodules -fsyntax-only %s -I %S/Inputs/module-name-used-by-objc-bridge \
|
|
// RUN: -fmodule-file=InterfaceBridge=%t/InterfaceBridge.pcm -fmodule-file=Interface=%t/Interface.pcm \
|
|
// RUN: -fmodule-map-file=%S/Inputs/module-name-used-by-objc-bridge/module.modulemap -verify
|
|
|
|
// Check that the `-fmodule-file=<path>` form succeeds:
|
|
// RUN: %clang_cc1 -fmodules -fsyntax-only %s -I %S/Inputs/module-name-used-by-objc-bridge \
|
|
// RUN: -fmodule-file=%t/InterfaceBridge.pcm -fmodule-file=%t/Interface.pcm \
|
|
// RUN: -fmodule-map-file=%S/Inputs/module-name-used-by-objc-bridge/module.modulemap -verify
|
|
|
|
#import "InterfaceBridge.h"
|
|
#import "Interface.h"
|
|
|
|
@interface Interface (User)
|
|
@end
|
|
|
|
// expected-no-diagnostics
|