Fix 2 leftover rebranch warnings

```
lib/Index/Index.cpp:137:41: warning: returning address of local temporary object [-Wreturn-stack-address]
lib/Sema/ImportResolution.cpp:627:9: warning: 'AttributedImport' may not intend to support class template argument deduction [-Wctad-maybe-unsupported]
```
This commit is contained in:
Anthony Latsis
2025-10-03 10:58:34 +01:00
parent bc88160378
commit f20a6bc5ff
2 changed files with 7 additions and 4 deletions

View File

@@ -134,8 +134,12 @@ public:
}
ArrayRef<FileUnit *> getFiles() const {
return isa<SourceFile *>(SFOrMod) ? *SFOrMod.getAddrOfPtr1()
: cast<ModuleDecl *>(SFOrMod)->getFiles();
if (isa<SourceFile *>(SFOrMod)) {
SourceFile *const *SF = SFOrMod.getAddrOfPtr1();
return ArrayRef((FileUnit *const *)SF, 1);
} else {
return cast<ModuleDecl *>(SFOrMod)->getFiles();
}
}
StringRef getFilename() const {

View File

@@ -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();
}