Skip to content

Commit f7df8e7

Browse files
authored
Merge pull request #31759 from compnerd/shared-inline-spaces
runtime: namespace SmallVectorImpl for inline namespace
2 parents adad8ec + e72b43f commit f7df8e7

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

include/swift/Basic/LLVM.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ namespace llvm {
3434
class Twine;
3535
template <typename T> class SmallPtrSetImpl;
3636
template <typename T, unsigned N> class SmallPtrSet;
37+
#if !defined(swiftCore_EXPORTS)
3738
template <typename T> class SmallVectorImpl;
39+
#endif
3840
template <typename T, unsigned N> class SmallVector;
3941
template <unsigned N> class SmallString;
4042
template <typename T, unsigned N> class SmallSetVector;
@@ -79,7 +81,9 @@ namespace swift {
7981
using llvm::SmallSetVector;
8082
using llvm::SmallString;
8183
using llvm::SmallVector;
84+
#if !defined(swiftCore_EXPORTS)
8285
using llvm::SmallVectorImpl;
86+
#endif
8387
using llvm::StringLiteral;
8488
using llvm::StringRef;
8589
using llvm::TinyPtrVector;

include/swift/Demangling/TypeDecoder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ class TypeDecoder {
896896
private:
897897
template <typename T>
898898
bool decodeImplFunctionPart(Demangle::NodePointer node,
899-
SmallVectorImpl<T> &results) {
899+
llvm::SmallVectorImpl<T> &results) {
900900
if (node->getNumChildren() != 2)
901901
return true;
902902

@@ -919,7 +919,7 @@ class TypeDecoder {
919919

920920
bool decodeImplFunctionParam(
921921
Demangle::NodePointer node,
922-
SmallVectorImpl<ImplFunctionParam<BuiltType>> &results) {
922+
llvm::SmallVectorImpl<ImplFunctionParam<BuiltType>> &results) {
923923
// Children: `convention, differentiability?, type`
924924
if (node->getNumChildren() != 2 && node->getNumChildren() != 3)
925925
return true;
@@ -1021,7 +1021,7 @@ class TypeDecoder {
10211021

10221022
bool decodeMangledFunctionInputType(
10231023
Demangle::NodePointer node,
1024-
SmallVectorImpl<FunctionParam<BuiltType>> &params,
1024+
llvm::SmallVectorImpl<FunctionParam<BuiltType>> &params,
10251025
bool &hasParamFlags) {
10261026
// Look through a couple of sugar nodes.
10271027
if (node->getKind() == NodeKind::Type ||

stdlib/public/runtime/MetadataLookup.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -911,9 +911,9 @@ swift::_depthIndexToFlatIndex(unsigned depth, unsigned index,
911911
///
912912
/// \returns true if the innermost descriptor is generic.
913913
bool swift::_gatherGenericParameterCounts(
914-
const ContextDescriptor *descriptor,
915-
SmallVectorImpl<unsigned> &genericParamCounts,
916-
Demangler &BorrowFrom) {
914+
const ContextDescriptor *descriptor,
915+
llvm::SmallVectorImpl<unsigned> &genericParamCounts,
916+
Demangler &BorrowFrom) {
917917
DemanglerForRuntimeTypeResolution<> demangler;
918918
demangler.providePreallocatedMemory(BorrowFrom);
919919

@@ -1974,10 +1974,9 @@ demangleToGenericParamRef(StringRef typeName) {
19741974
}
19751975

19761976
void swift::gatherWrittenGenericArgs(
1977-
const Metadata *metadata,
1978-
const TypeContextDescriptor *description,
1979-
SmallVectorImpl<const Metadata *> &allGenericArgs,
1980-
Demangler &BorrowFrom) {
1977+
const Metadata *metadata, const TypeContextDescriptor *description,
1978+
llvm::SmallVectorImpl<const Metadata *> &allGenericArgs,
1979+
Demangler &BorrowFrom) {
19811980
if (!description)
19821981
return;
19831982
auto generics = description->getGenericContext();

stdlib/public/runtime/Private.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,10 @@ class TypeInfo {
387387
/// Use with \c _getTypeByMangledName to decode potentially-generic types.
388388
class SWIFT_RUNTIME_LIBRARY_VISIBILITY SubstGenericParametersFromWrittenArgs {
389389
/// The complete set of generic arguments.
390-
const SmallVectorImpl<const Metadata *> &allGenericArgs;
390+
const llvm::SmallVectorImpl<const Metadata *> &allGenericArgs;
391391

392392
/// The counts of generic parameters at each level.
393-
const SmallVectorImpl<unsigned> &genericParamCounts;
393+
const llvm::SmallVectorImpl<unsigned> &genericParamCounts;
394394

395395
public:
396396
/// Initialize a new function object to handle substitutions. Both
@@ -404,10 +404,10 @@ class TypeInfo {
404404
/// \param genericParamCounts The count of generic parameters at each
405405
/// generic level, typically gathered by _gatherGenericParameterCounts.
406406
explicit SubstGenericParametersFromWrittenArgs(
407-
const SmallVectorImpl<const Metadata *> &allGenericArgs,
408-
const SmallVectorImpl<unsigned> &genericParamCounts)
409-
: allGenericArgs(allGenericArgs), genericParamCounts(genericParamCounts) {
410-
}
407+
const llvm::SmallVectorImpl<const Metadata *> &allGenericArgs,
408+
const llvm::SmallVectorImpl<unsigned> &genericParamCounts)
409+
: allGenericArgs(allGenericArgs),
410+
genericParamCounts(genericParamCounts) {}
411411

412412
const Metadata *getMetadata(unsigned depth, unsigned index) const;
413413
const WitnessTable *getWitnessTable(const Metadata *type,

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ static bool isSubclass(const Metadata *subclass, const Metadata *superclass) {
793793

794794
bool swift::_checkGenericRequirements(
795795
llvm::ArrayRef<GenericRequirementDescriptor> requirements,
796-
SmallVectorImpl<const void *> &extraArguments,
796+
llvm::SmallVectorImpl<const void *> &extraArguments,
797797
SubstGenericParameterFn substGenericParam,
798798
SubstDependentWitnessTableFn substWitnessTable) {
799799
for (const auto &req : requirements) {

0 commit comments

Comments
 (0)