Skip to content

Commit 1306f2b

Browse files
authoredFeb 26, 2024
Merge pull request #71863 from bnbarham/remove-makearrayref
Use the new template deduction guides rather than `makeArrayRef`
2 parents 5f003fd + f292ec9 commit 1306f2b

File tree

122 files changed

+305
-360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+305
-360
lines changed
 

Diff for: ‎CMakeLists.txt

-8
Original file line numberDiff line numberDiff line change
@@ -1385,14 +1385,6 @@ endif()
13851385
add_subdirectory(include)
13861386

13871387
if(SWIFT_INCLUDE_TOOLS)
1388-
# TODO Remove this once release/5.9 is done and we can finish migrating Swift
1389-
# off of `llvm::None`/`llvm::Optional`, and `llvm::makeArrayRef`.
1390-
# This is to silence the avalanche of deprecation warnings from LLVM headers
1391-
# until we can actually do something about them. This is nasty, but it's
1392-
# better than losing context due to the sheer number in-actionable deprecation
1393-
# warnings or the massive number of merge-conflicts we would get otherwise.
1394-
add_definitions(-DSWIFT_TARGET)
1395-
13961388
add_subdirectory(lib)
13971389

13981390
add_subdirectory(SwiftCompilerSources)

Diff for: ‎include/swift/ABI/GenericContext.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -318,19 +318,19 @@ class RuntimeGenericSignature {
318318
PackShapeHeader(packShapeHeader), PackShapeDescriptors(packShapeDescriptors) {}
319319

320320
llvm::ArrayRef<GenericParamDescriptor> getParams() const {
321-
return llvm::makeArrayRef(Params, Header.NumParams);
321+
return llvm::ArrayRef(Params, Header.NumParams);
322322
}
323323

324324
llvm::ArrayRef<TargetGenericRequirementDescriptor<Runtime>> getRequirements() const {
325-
return llvm::makeArrayRef(Requirements, Header.NumRequirements);
325+
return llvm::ArrayRef(Requirements, Header.NumRequirements);
326326
}
327327

328328
const GenericPackShapeHeader &getGenericPackShapeHeader() const {
329329
return PackShapeHeader;
330330
}
331331

332332
llvm::ArrayRef<GenericPackShapeDescriptor> getGenericPackShapeDescriptors() const {
333-
return llvm::makeArrayRef(PackShapeDescriptors, PackShapeHeader.NumPacks);
333+
return llvm::ArrayRef(PackShapeDescriptors, PackShapeHeader.NumPacks);
334334
}
335335

336336
size_t getArgumentLayoutSizeInWords() const {
@@ -379,20 +379,20 @@ class TargetGenericEnvironment
379379
public:
380380
/// Retrieve the cumulative generic parameter counts at each level of genericity.
381381
llvm::ArrayRef<uint16_t> getGenericParameterCounts() const {
382-
return llvm::makeArrayRef(this->template getTrailingObjects<uint16_t>(),
383-
Flags.getNumGenericParameterLevels());
382+
return llvm::ArrayRef(this->template getTrailingObjects<uint16_t>(),
383+
Flags.getNumGenericParameterLevels());
384384
}
385385

386386
/// Retrieve the generic parameters descriptors.
387387
llvm::ArrayRef<GenericParamDescriptor> getGenericParameters() const {
388-
return llvm::makeArrayRef(
388+
return llvm::ArrayRef(
389389
this->template getTrailingObjects<GenericParamDescriptor>(),
390390
getGenericParameterCounts().back());
391391
}
392392

393393
/// Retrieve the generic requirements.
394394
llvm::ArrayRef<GenericRequirementDescriptor> getGenericRequirements() const {
395-
return llvm::makeArrayRef(
395+
return llvm::ArrayRef(
396396
this->template getTrailingObjects<GenericRequirementDescriptor>(),
397397
Flags.getNumGenericRequirements());
398398
}

0 commit comments

Comments
 (0)