mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #71863 from bnbarham/remove-makearrayref
Use the new template deduction guides rather than `makeArrayRef`
This commit is contained in:
@@ -668,7 +668,7 @@ getDeclAttributes(const Decl *D, std::vector<const DeclAttribute*> &Scratch) {
|
||||
}
|
||||
}
|
||||
|
||||
return llvm::makeArrayRef(Scratch);
|
||||
return llvm::ArrayRef(Scratch);
|
||||
}
|
||||
|
||||
// Only reports @available.
|
||||
@@ -1292,9 +1292,8 @@ public:
|
||||
std::vector<CategorizedEdits> Results;
|
||||
for (unsigned I = 0, N = UIds.size(); I < N; I ++) {
|
||||
auto Pair = StartEnds[I];
|
||||
Results.push_back({UIds[I],
|
||||
llvm::makeArrayRef(AllEdits.data() + Pair.first,
|
||||
Pair.second - Pair.first)});
|
||||
Results.push_back({UIds[I], llvm::ArrayRef(AllEdits.data() + Pair.first,
|
||||
Pair.second - Pair.first)});
|
||||
}
|
||||
Receiver(RequestResult<ArrayRef<CategorizedEdits>>::fromResult(Results));
|
||||
}
|
||||
|
||||
@@ -1947,8 +1947,7 @@ public:
|
||||
// There are multiple trailing closures.
|
||||
SmallVector<ClosureInfo, 4> trailingClosures;
|
||||
trailingClosures.reserve(params.size() - firstTrailingIndex);
|
||||
for (const auto ¶m :
|
||||
llvm::makeArrayRef(params).slice(firstTrailingIndex)) {
|
||||
for (const auto ¶m : llvm::ArrayRef(params).slice(firstTrailingIndex)) {
|
||||
trailingClosures.push_back(*param.placeholderClosure);
|
||||
}
|
||||
MultiClosureCallback(Args, firstTrailingIndex, trailingClosures);
|
||||
|
||||
@@ -367,9 +367,9 @@ static bool getModuleInterfaceInfo(
|
||||
if (!Group && InterestedUSR) {
|
||||
Group = findGroupNameForUSR(Mod, InterestedUSR.value());
|
||||
}
|
||||
printModuleInterface(Mod, Group.has_value()
|
||||
? llvm::makeArrayRef(Group.value())
|
||||
: ArrayRef<StringRef>(),
|
||||
printModuleInterface(Mod,
|
||||
Group.has_value() ? llvm::ArrayRef(Group.value())
|
||||
: ArrayRef<StringRef>(),
|
||||
TraversalOptions, Printer, Options,
|
||||
Group.has_value() && SynthesizedExtensions);
|
||||
|
||||
|
||||
@@ -695,7 +695,7 @@ static bool passCursorInfoForModule(ModuleEntity Mod,
|
||||
Symbol.IsSystem = Mod.isNonUserModule();
|
||||
if (auto MD = Mod.getAsSwiftModule()) {
|
||||
ide::collectModuleGroups(const_cast<ModuleDecl *>(MD), ModuleGroups);
|
||||
Symbol.ModuleGroupArray = llvm::makeArrayRef(ModuleGroups);
|
||||
Symbol.ModuleGroupArray = llvm::ArrayRef(ModuleGroups);
|
||||
}
|
||||
|
||||
CursorInfoData Data;
|
||||
@@ -829,7 +829,7 @@ static StringRef copyAndClearString(llvm::BumpPtrAllocator &Allocator,
|
||||
template <typename T>
|
||||
static ArrayRef<T> copyAndClearArray(llvm::BumpPtrAllocator &Allocator,
|
||||
SmallVectorImpl<T> &Array) {
|
||||
auto Ref = copyArray(Allocator, llvm::makeArrayRef(Array));
|
||||
auto Ref = copyArray(Allocator, llvm::ArrayRef(Array));
|
||||
Array.clear();
|
||||
return Ref;
|
||||
}
|
||||
@@ -1034,7 +1034,7 @@ fillSymbolInfo(CursorSymbolInfo &Symbol, const DeclInfo &DInfo,
|
||||
Component.Kind,
|
||||
copyAndClearString(Allocator, Buffer));
|
||||
};
|
||||
Symbol.ParentContexts = copyArray(Allocator, llvm::makeArrayRef(Parents));
|
||||
Symbol.ParentContexts = copyArray(Allocator, llvm::ArrayRef(Parents));
|
||||
|
||||
SmallVector<ReferencedDeclInfo, 8> ReferencedDecls;
|
||||
for (auto &FI: FragmentInfos) {
|
||||
@@ -1066,10 +1066,10 @@ fillSymbolInfo(CursorSymbolInfo &Symbol, const DeclInfo &DInfo,
|
||||
swift::getAccessLevelSpelling(FI.VD->getFormalAccess()), Filename,
|
||||
getModuleName(FI.VD, Allocator),
|
||||
FI.VD->getModuleContext()->isNonUserModule(), FI.VD->isSPI(),
|
||||
copyArray(Allocator, llvm::makeArrayRef(FIParents)));
|
||||
copyArray(Allocator, llvm::ArrayRef(FIParents)));
|
||||
}
|
||||
Symbol.ReferencedSymbols = copyArray(Allocator,
|
||||
llvm::makeArrayRef(ReferencedDecls));
|
||||
Symbol.ReferencedSymbols =
|
||||
copyArray(Allocator, llvm::ArrayRef(ReferencedDecls));
|
||||
}
|
||||
|
||||
Symbol.ModuleName = getModuleName(DInfo.VD, Allocator);
|
||||
@@ -1329,7 +1329,7 @@ getClangDeclarationName(const clang::NamedDecl *ND, NameTranslatingInfo &Info) {
|
||||
if (Info.ArgNames.size() > NumPieces)
|
||||
return clang::DeclarationName();
|
||||
|
||||
ArrayRef<StringRef> Args = llvm::makeArrayRef(Info.ArgNames);
|
||||
ArrayRef<StringRef> Args = llvm::ArrayRef(Info.ArgNames);
|
||||
std::vector<clang::IdentifierInfo *> Pieces;
|
||||
for (unsigned i = 0; i < NumPieces; ++i) {
|
||||
if (i >= Info.ArgNames.size() || Info.ArgNames[i].empty()) {
|
||||
@@ -1365,7 +1365,7 @@ static DeclName getSwiftDeclName(const ValueDecl *VD,
|
||||
Args[i] = Ctx.getIdentifier(Arg == "_" ? StringRef() : Arg);
|
||||
}
|
||||
}
|
||||
return DeclName(Ctx, BaseName, llvm::makeArrayRef(Args));
|
||||
return DeclName(Ctx, BaseName, llvm::ArrayRef(Args));
|
||||
}
|
||||
|
||||
/// Returns true on success, false on error (and sets `Diagnostic` accordingly).
|
||||
@@ -1470,7 +1470,7 @@ protected:
|
||||
bool CancelOnSubsequentRequest;
|
||||
protected:
|
||||
ArrayRef<ImmutableTextSnapshotRef> getPreviousASTSnaps() {
|
||||
return llvm::makeArrayRef(PreviousASTSnaps);
|
||||
return llvm::ArrayRef(PreviousASTSnaps);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user