File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -3757,7 +3757,14 @@ static void writeDeclCommentTable(
3757
3757
3758
3758
DeclCommentTableWriter Writer (GroupContext);
3759
3759
3760
- ArrayRef<const FileUnit *> files = SF ? SF : M->getFiles ();
3760
+ ArrayRef<const FileUnit *> files;
3761
+ SmallVector<const FileUnit *, 1 > Scratch;
3762
+ if (SF) {
3763
+ Scratch.push_back (SF);
3764
+ files = llvm::makeArrayRef (Scratch);
3765
+ } else {
3766
+ files = M->getFiles ();
3767
+ }
3761
3768
for (auto nextFile : files) {
3762
3769
Writer.resetSourceOrder ();
3763
3770
const_cast <FileUnit *>(nextFile)->walk (Writer);
@@ -3923,7 +3930,14 @@ void Serializer::writeAST(ModuleOrSourceFile DC) {
3923
3930
3924
3931
Optional<DeclID> entryPointClassID;
3925
3932
3926
- ArrayRef<const FileUnit *> files = SF ? SF : M->getFiles ();
3933
+ ArrayRef<const FileUnit *> files;
3934
+ SmallVector<const FileUnit *, 1 > Scratch;
3935
+ if (SF) {
3936
+ Scratch.push_back (SF);
3937
+ files = llvm::makeArrayRef (Scratch);
3938
+ } else {
3939
+ files = M->getFiles ();
3940
+ }
3927
3941
for (auto nextFile : files) {
3928
3942
if (nextFile->hasEntryPoint ())
3929
3943
entryPointClassID = addDeclRef (nextFile->getMainClass ());
You can’t perform that action at this time.
0 commit comments