diff --git a/lib/Index/Index.cpp b/lib/Index/Index.cpp index 8b10c193cec34..d8a62e3257cfa 100644 --- a/lib/Index/Index.cpp +++ b/lib/Index/Index.cpp @@ -134,8 +134,12 @@ class SourceFileOrModule { } ArrayRef getFiles() const { - return isa(SFOrMod) ? *SFOrMod.getAddrOfPtr1() - : cast(SFOrMod)->getFiles(); + if (isa(SFOrMod)) { + SourceFile *const *SF = SFOrMod.getAddrOfPtr1(); + return ArrayRef((FileUnit *const *)SF, 1); + } else { + return cast(SFOrMod)->getFiles(); + } } StringRef getFilename() const { diff --git a/lib/Sema/ImportResolution.cpp b/lib/Sema/ImportResolution.cpp index f0773077dd551..3c4f4325f4674 100644 --- a/lib/Sema/ImportResolution.cpp +++ b/lib/Sema/ImportResolution.cpp @@ -623,8 +623,7 @@ void ImportResolver::addImplicitImports() { const ModuleDecl *moduleToInherit = nullptr; if (underlyingClangModule) { moduleToInherit = underlyingClangModule; - boundImports.push_back( - AttributedImport(ImportedModule(underlyingClangModule))); + boundImports.emplace_back(ImportedModule(underlyingClangModule)); } else { moduleToInherit = SF.getParentModule(); }