mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
TBDGen: Don't emit pretty-printed API descriptor JSON by default.
Instead, use the `%validate-json` lit substitution to validate and format the API descriptor file before running it through FileCheck. This allows us to avoid needing to introduce a dedicated frontend option just to control whether the output of -emit-api-descriptor is pretty printed.
This commit is contained in:
@@ -810,11 +810,10 @@ static bool writeTBDIfNeeded(CompilerInstance &Instance) {
|
||||
}
|
||||
|
||||
static bool writeAPIDescriptor(ModuleDecl *M, StringRef OutputPath,
|
||||
llvm::vfs::OutputBackend &Backend,
|
||||
bool PrettyPrinted) {
|
||||
llvm::vfs::OutputBackend &Backend) {
|
||||
return withOutputPath(M->getDiags(), Backend, OutputPath,
|
||||
[&](raw_ostream &OS) -> bool {
|
||||
writeAPIJSONFile(M, OS, PrettyPrinted);
|
||||
writeAPIJSONFile(M, OS, /*PrettyPrinted=*/false);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
@@ -834,9 +833,8 @@ static bool writeAPIDescriptorIfNeeded(CompilerInstance &Instance) {
|
||||
const std::string &APIDescriptorPath =
|
||||
Invocation.getAPIDescriptorPathForWholeModule();
|
||||
|
||||
// FIXME: Need a frontend flag for pretty printing
|
||||
return writeAPIDescriptor(Instance.getMainModule(), APIDescriptorPath,
|
||||
Instance.getOutputBackend(), true);
|
||||
Instance.getOutputBackend());
|
||||
}
|
||||
|
||||
static bool performCompileStepsPostSILGen(CompilerInstance &Instance,
|
||||
|
||||
Reference in New Issue
Block a user