Skip to content

Commit fe8ac4b

Browse files
David Ungardavidungar
David Ungar
authored andcommitted
Per Jordan, use raw_ostream instead of raw_fd_ostream.
1 parent 44e5cd3 commit fe8ac4b

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

Diff for: lib/FrontendTool/ReferenceDependencies.cpp

+32-32
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ static std::string escape(DeclBaseName name) {
127127
return llvm::yaml::escape(name.userFacingName());
128128
}
129129

130-
static void emitProvides(const SourceFile *SF, llvm::raw_fd_ostream &out);
130+
static void emitProvides(const SourceFile *SF, llvm::raw_ostream &out);
131131
static void emitDepends(const SourceFile *SF,
132132
const DependencyTracker &depTracker,
133-
llvm::raw_fd_ostream &out);
134-
static void emitInterfaceHash(SourceFile *SF, llvm::raw_fd_ostream &out);
133+
llvm::raw_ostream &out);
134+
static void emitInterfaceHash(SourceFile *SF, llvm::raw_ostream &out);
135135

136136
bool swift::emitReferenceDependencies(DiagnosticEngine &diags,
137137
SourceFile *const SF,
@@ -164,25 +164,25 @@ bool swift::emitReferenceDependencies(DiagnosticEngine &diags,
164164
}
165165

166166
static void emitProvidesTopLevelNames(
167-
const SourceFile *SF, llvm::raw_fd_ostream &out,
167+
const SourceFile *SF, llvm::raw_ostream &out,
168168
llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
169169
llvm::SmallVectorImpl<const ExtensionDecl *> &extensionsWithJustMembers);
170170

171171
static void emitProvidesNominalTypes(
172172
const llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
173-
llvm::raw_fd_ostream &out);
173+
llvm::raw_ostream &out);
174174

175175
static void emitProvidesMembers(
176176
const llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
177177
const llvm::SmallVectorImpl<const ExtensionDecl *>
178178
&extensionsWithJustMembers,
179-
llvm::raw_fd_ostream &out);
179+
llvm::raw_ostream &out);
180180

181181
static void emitProvidesDynamicLookupMembers(const SourceFile *SF,
182-
llvm::raw_fd_ostream &out);
182+
llvm::raw_ostream &out);
183183

184184
static void emitProvides(const SourceFile *const SF,
185-
llvm::raw_fd_ostream &out) {
185+
llvm::raw_ostream &out) {
186186
llvm::MapVector<const NominalTypeDecl *, bool> extendedNominals;
187187
llvm::SmallVector<const ExtensionDecl *, 8> extensionsWithJustMembers;
188188

@@ -196,13 +196,13 @@ static void emitProvides(const SourceFile *const SF,
196196
}
197197

198198
static void emitProvidesTopLevelDecl(
199-
const Decl *const D, llvm::raw_fd_ostream &out,
199+
const Decl *const D, llvm::raw_ostream &out,
200200
llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
201201
llvm::SmallVectorImpl<const FuncDecl *> &memberOperatorDecls,
202202
llvm::SmallVectorImpl<const ExtensionDecl *> &extensionsWithJustMembers);
203203

204204
static void emitProvidesTopLevelNames(
205-
const SourceFile *const SF, llvm::raw_fd_ostream &out,
205+
const SourceFile *const SF, llvm::raw_ostream &out,
206206
llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
207207
llvm::SmallVectorImpl<const ExtensionDecl *> &extensionsWithJustMembers) {
208208
llvm::SmallVector<const FuncDecl *, 8> memberOperatorDecls;
@@ -215,21 +215,21 @@ static void emitProvidesTopLevelNames(
215215
}
216216

217217
static void emitProvidesExtensionDecl(
218-
const ExtensionDecl *ED, llvm::raw_fd_ostream &out,
218+
const ExtensionDecl *ED, llvm::raw_ostream &out,
219219
llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
220220
llvm::SmallVectorImpl<const FuncDecl *> &memberOperatorDecls,
221221
llvm::SmallVectorImpl<const ExtensionDecl *> &extensionsWithJustMembers);
222222

223223
static void emitProvidesNominalTypeDecl(
224-
const NominalTypeDecl *NTD, llvm::raw_fd_ostream &out,
224+
const NominalTypeDecl *NTD, llvm::raw_ostream &out,
225225
llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
226226
llvm::SmallVectorImpl<const FuncDecl *> &memberOperatorDecls);
227227

228228
static void emitProvidesValueDecl(const ValueDecl *VD,
229-
llvm::raw_fd_ostream &out);
229+
llvm::raw_ostream &out);
230230

231231
static void emitProvidesTopLevelDecl(
232-
const Decl *const D, llvm::raw_fd_ostream &out,
232+
const Decl *const D, llvm::raw_ostream &out,
233233
llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
234234
llvm::SmallVectorImpl<const FuncDecl *> &memberOperatorDecls,
235235
llvm::SmallVectorImpl<const ExtensionDecl *> &extensionsWithJustMembers) {
@@ -293,7 +293,7 @@ static void emitProvidesTopLevelDecl(
293293
}
294294

295295
static void emitProvidesExtensionDecl(
296-
const ExtensionDecl *const ED, llvm::raw_fd_ostream &out,
296+
const ExtensionDecl *const ED, llvm::raw_ostream &out,
297297
llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
298298
llvm::SmallVectorImpl<const FuncDecl *> &memberOperatorDecls,
299299
llvm::SmallVectorImpl<const ExtensionDecl *> &extensionsWithJustMembers) {
@@ -322,7 +322,7 @@ static void emitProvidesExtensionDecl(
322322
}
323323

324324
static void emitProvidesNominalTypeDecl(
325-
const NominalTypeDecl *const NTD, llvm::raw_fd_ostream &out,
325+
const NominalTypeDecl *const NTD, llvm::raw_ostream &out,
326326
llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
327327
llvm::SmallVectorImpl<const FuncDecl *> &memberOperatorDecls) {
328328
if (!NTD->hasName())
@@ -337,7 +337,7 @@ static void emitProvidesNominalTypeDecl(
337337
}
338338

339339
static void emitProvidesValueDecl(const ValueDecl *const VD,
340-
llvm::raw_fd_ostream &out) {
340+
llvm::raw_ostream &out) {
341341
if (!VD->hasName())
342342
return;
343343
if (VD->hasAccess() && VD->getFormalAccess() <= AccessLevel::FilePrivate) {
@@ -348,7 +348,7 @@ static void emitProvidesValueDecl(const ValueDecl *const VD,
348348

349349
static void emitProvidesNominalTypes(
350350
const llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
351-
llvm::raw_fd_ostream &out) {
351+
llvm::raw_ostream &out) {
352352
out << "provides-nominal:\n";
353353
for (auto entry : extendedNominals) {
354354
if (!entry.second)
@@ -363,7 +363,7 @@ static void emitProvidesMembers(
363363
const llvm::MapVector<const NominalTypeDecl *, bool> &extendedNominals,
364364
const llvm::SmallVectorImpl<const ExtensionDecl *>
365365
&extensionsWithJustMembers,
366-
llvm::raw_fd_ostream &out) {
366+
llvm::raw_ostream &out) {
367367
out << "provides-member:\n";
368368
for (auto entry : extendedNominals) {
369369
out << "- [\"";
@@ -389,7 +389,7 @@ static void emitProvidesMembers(
389389
}
390390

391391
static void emitProvidesDynamicLookupMembers(const SourceFile *const SF,
392-
llvm::raw_fd_ostream &out) {
392+
llvm::raw_ostream &out) {
393393
if (SF->getASTContext().LangOpts.EnableObjCInterop) {
394394
// FIXME: This requires a traversal of the whole file to compute.
395395
// We should (a) see if there's a cheaper way to keep it up to date,
@@ -434,25 +434,25 @@ sortedByName(const llvm::DenseMap<DeclBaseName, bool> map) {
434434
}
435435

436436
static void emitDependsTopLevelNames(const ReferencedNameTracker *tracker,
437-
llvm::raw_fd_ostream &out);
437+
llvm::raw_ostream &out);
438438

439439
using TableEntryTy = std::pair<ReferencedNameTracker::MemberPair, bool>;
440440

441441
static void emitDependsMember(ArrayRef<TableEntryTy> sortedMembers,
442-
llvm::raw_fd_ostream &out);
442+
llvm::raw_ostream &out);
443443

444444
static void emitDependsNominal(ArrayRef<TableEntryTy> sortedMembers,
445-
llvm::raw_fd_ostream &out);
445+
llvm::raw_ostream &out);
446446

447447
static void emitDependsDynamicLookup(const ReferencedNameTracker *tracker,
448-
llvm::raw_fd_ostream &out);
448+
llvm::raw_ostream &out);
449449

450450
static void emitDependsExternal(const DependencyTracker &depTracker,
451-
llvm::raw_fd_ostream &out);
451+
llvm::raw_ostream &out);
452452

453453
static void emitDepends(const SourceFile *const SF,
454454
const DependencyTracker &depTracker,
455-
llvm::raw_fd_ostream &out) {
455+
llvm::raw_ostream &out) {
456456

457457
const ReferencedNameTracker *const tracker = SF->getReferencedNameTracker();
458458
assert(tracker && "Cannot emit reference dependencies without a tracker");
@@ -490,7 +490,7 @@ static void emitDepends(const SourceFile *const SF,
490490
}
491491

492492
static void emitDependsTopLevelNames(const ReferencedNameTracker *const tracker,
493-
llvm::raw_fd_ostream &out) {
493+
llvm::raw_ostream &out) {
494494
out << "depends-top-level:\n";
495495
for (auto &entry : sortedByName(tracker->getTopLevelNames())) {
496496
assert(!entry.first.empty());
@@ -502,7 +502,7 @@ static void emitDependsTopLevelNames(const ReferencedNameTracker *const tracker,
502502
}
503503

504504
static void emitDependsMember(ArrayRef<TableEntryTy> sortedMembers,
505-
llvm::raw_fd_ostream &out) {
505+
llvm::raw_ostream &out) {
506506
out << "depends-member:\n";
507507
for (auto &entry : sortedMembers) {
508508
assert(entry.first.first != nullptr);
@@ -523,7 +523,7 @@ static void emitDependsMember(ArrayRef<TableEntryTy> sortedMembers,
523523
}
524524

525525
static void emitDependsNominal(ArrayRef<TableEntryTy> sortedMembers,
526-
llvm::raw_fd_ostream &out) {
526+
llvm::raw_ostream &out) {
527527
out << "depends-nominal:\n";
528528
for (auto i = sortedMembers.begin(), e = sortedMembers.end(); i != e; ++i) {
529529
bool isCascading = i->second;
@@ -546,7 +546,7 @@ static void emitDependsNominal(ArrayRef<TableEntryTy> sortedMembers,
546546
}
547547

548548
static void emitDependsDynamicLookup(const ReferencedNameTracker *const tracker,
549-
llvm::raw_fd_ostream &out) {
549+
llvm::raw_ostream &out) {
550550
out << "depends-dynamic-lookup:\n";
551551
for (auto &entry : sortedByName(tracker->getDynamicLookupNames())) {
552552
assert(!entry.first.empty());
@@ -558,14 +558,14 @@ static void emitDependsDynamicLookup(const ReferencedNameTracker *const tracker,
558558
}
559559

560560
static void emitDependsExternal(const DependencyTracker &depTracker,
561-
llvm::raw_fd_ostream &out) {
561+
llvm::raw_ostream &out) {
562562
out << "depends-external:\n";
563563
for (auto &entry : reversePathSortedFilenames(depTracker.getDependencies())) {
564564
out << "- \"" << llvm::yaml::escape(entry) << "\"\n";
565565
}
566566
}
567567

568-
static void emitInterfaceHash(SourceFile *const SF, llvm::raw_fd_ostream &out) {
568+
static void emitInterfaceHash(SourceFile *const SF, llvm::raw_ostream &out) {
569569
llvm::SmallString<32> interfaceHash;
570570
SF->getInterfaceHash(interfaceHash);
571571
out << "interface-hash: \"" << interfaceHash << "\"\n";

0 commit comments

Comments
 (0)