Merge pull request #58847 from bnbarham/rebranch-test-fixes

[next] Fixes for various test failures on rebranch
This commit is contained in:
Ben Barham
2022-05-12 09:30:39 -07:00
committed by GitHub
17 changed files with 48 additions and 48 deletions

View File

@@ -5892,7 +5892,7 @@ void swift::serializeToBuffers(
std::unique_ptr<llvm::MemoryBuffer> *moduleSourceInfoBuffer,
const SILModule *M) {
assert(!withNullAsEmptyStringRef(options.OutputPath).empty());
assert(!options.OutputPath.empty());
{
FrontendStatsTracer tracer(getContext(DC).Stats,
"Serialization, swiftmodule, to buffer");
@@ -5911,10 +5911,11 @@ void swift::serializeToBuffers(
emitABIDescriptor(DC, options);
if (moduleBuffer)
*moduleBuffer = std::make_unique<llvm::SmallVectorMemoryBuffer>(
std::move(buf), options.OutputPath);
std::move(buf), options.OutputPath,
/*RequiresNullTerminator=*/false);
}
if (!withNullAsEmptyStringRef(options.DocOutputPath).empty()) {
if (!options.DocOutputPath.empty()) {
FrontendStatsTracer tracer(getContext(DC).Stats,
"Serialization, swiftdoc, to buffer");
llvm::SmallString<1024> buf;
@@ -5928,10 +5929,11 @@ void swift::serializeToBuffers(
});
if (moduleDocBuffer)
*moduleDocBuffer = std::make_unique<llvm::SmallVectorMemoryBuffer>(
std::move(buf), options.DocOutputPath);
std::move(buf), options.DocOutputPath,
/*RequiresNullTerminator=*/false);
}
if (!withNullAsEmptyStringRef(options.SourceInfoOutputPath).empty()) {
if (!options.SourceInfoOutputPath.empty()) {
FrontendStatsTracer tracer(getContext(DC).Stats,
"Serialization, swiftsourceinfo, to buffer");
llvm::SmallString<1024> buf;
@@ -5945,7 +5947,8 @@ void swift::serializeToBuffers(
});
if (moduleSourceInfoBuffer)
*moduleSourceInfoBuffer = std::make_unique<llvm::SmallVectorMemoryBuffer>(
std::move(buf), options.SourceInfoOutputPath);
std::move(buf), options.SourceInfoOutputPath,
/*RequiresNullTerminator=*/false);
}
}
@@ -5954,12 +5957,12 @@ void swift::serialize(ModuleOrSourceFile DC,
const symbolgraphgen::SymbolGraphOptions &symbolGraphOptions,
const SILModule *M,
const fine_grained_dependencies::SourceFileDepGraph *DG) {
assert(!withNullAsEmptyStringRef(options.OutputPath).empty());
assert(!options.OutputPath.empty());
if (StringRef(options.OutputPath) == "-") {
if (options.OutputPath == "-") {
// Special-case writing to stdout.
Serializer::writeToStream(llvm::outs(), DC, M, options, DG);
assert(withNullAsEmptyStringRef(options.DocOutputPath).empty());
assert(options.DocOutputPath.empty());
return;
}
@@ -5974,7 +5977,7 @@ void swift::serialize(ModuleOrSourceFile DC,
if (hadError)
return;
if (!withNullAsEmptyStringRef(options.DocOutputPath).empty()) {
if (!options.DocOutputPath.empty()) {
(void)withOutputFile(getContext(DC).Diags,
options.DocOutputPath,
[&](raw_ostream &out) {
@@ -5985,7 +5988,7 @@ void swift::serialize(ModuleOrSourceFile DC,
});
}
if (!withNullAsEmptyStringRef(options.SourceInfoOutputPath).empty()) {
if (!options.SourceInfoOutputPath.empty()) {
(void)withOutputFile(getContext(DC).Diags,
options.SourceInfoOutputPath,
[&](raw_ostream &out) {