mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
-build-module-from-parseable-interface: Don't make an extra ASTContext (#25185)
This mode is supposed to get all its configuration information from the switftinterface being read in, but that means that the ASTContext and ClangImporter that get created by default may not be a sensible configuration (for example, a mismatched target and SDK, which Clang emits a warning about). Avoid this by just not creating the ASTContext if it's already been determined that the frontend is building a module from a parseable interface.
This commit is contained in:
@@ -116,6 +116,9 @@ namespace unittest {
|
||||
|
||||
namespace swift {
|
||||
|
||||
class LangOptions;
|
||||
class SearchPathOptions;
|
||||
|
||||
/// A ModuleLoader that runs a subordinate \c CompilerInvocation and
|
||||
/// \c CompilerInstance to convert .swiftinterface files to .swiftmodule
|
||||
/// files on the fly, caching the resulting .swiftmodules in the module cache
|
||||
@@ -162,10 +165,11 @@ public:
|
||||
/// Unconditionally build \p InPath (a swiftinterface file) to \p OutPath (as
|
||||
/// a swiftmodule file).
|
||||
///
|
||||
/// A simplified version of the core logic in #openModuleFiles, mostly for
|
||||
/// testing purposes.
|
||||
/// A simplified version of the core logic in #openModuleFiles.
|
||||
static bool buildSwiftModuleFromSwiftInterface(
|
||||
ASTContext &Ctx, StringRef CacheDir, StringRef PrebuiltCacheDir,
|
||||
SourceManager &SourceMgr, DiagnosticEngine &Diags,
|
||||
const SearchPathOptions &SearchPathOpts, const LangOptions &LangOpts,
|
||||
StringRef CacheDir, StringRef PrebuiltCacheDir,
|
||||
StringRef ModuleName, StringRef InPath, StringRef OutPath,
|
||||
bool SerializeDependencyHashes, bool TrackSystemDependencies,
|
||||
bool RemarkOnRebuildFromInterface);
|
||||
|
||||
Reference in New Issue
Block a user