Skip to content

ABI: qualify use of StringRef and Optional (NFC) #32169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions include/swift/ABI/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,7 @@ struct TargetContextDescriptor {

using ContextDescriptor = TargetContextDescriptor<InProcess>;

inline bool isCImportedModuleName(StringRef name) {
inline bool isCImportedModuleName(llvm::StringRef name) {
// This does not include MANGLING_MODULE_CLANG_IMPORTER because that's
// used only for synthesized declarations and not actual imported
// declarations.
Expand Down Expand Up @@ -2757,7 +2757,7 @@ class TargetGenericRequirementDescriptor {

/// Retrieve the generic parameter that is the subject of this requirement,
/// as a mangled type name.
StringRef getParam() const {
llvm::StringRef getParam() const {
return swift::Demangle::makeSymbolicMangledNameStringRef(Param.get());
}

Expand All @@ -2768,7 +2768,7 @@ class TargetGenericRequirementDescriptor {
}

/// Retrieve the right-hand type for a SameType or BaseClass requirement.
StringRef getMangledTypeName() const {
llvm::StringRef getMangledTypeName() const {
assert(getKind() == GenericRequirementKind::SameType ||
getKind() == GenericRequirementKind::BaseClass);
return swift::Demangle::makeSymbolicMangledNameStringRef(Type.get());
Expand Down Expand Up @@ -2999,7 +2999,7 @@ struct TargetExtensionContextDescriptor final

using TrailingGenericContextObjects::getGenericContext;

StringRef getMangledExtendedContext() const {
llvm::StringRef getMangledExtendedContext() const {
return Demangle::makeSymbolicMangledNameStringRef(ExtendedContext.get());
}

Expand Down Expand Up @@ -3223,13 +3223,13 @@ struct TargetOpaqueTypeDescriptor final
return (this
->template getTrailingObjects<RelativeDirectPointer<const char>>())[i];
}
StringRef getUnderlyingTypeArgument(unsigned i) const {

llvm::StringRef getUnderlyingTypeArgument(unsigned i) const {
assert(i < getNumUnderlyingTypeArguments());
const char *ptr = getUnderlyingTypeArgumentMangledName(i);
return Demangle::makeSymbolicMangledNameStringRef(ptr);
}

static bool classof(const TargetContextDescriptor<Runtime> *cd) {
return cd->getKind() == ContextDescriptorKind::OpaqueType;
}
Expand Down
14 changes: 7 additions & 7 deletions include/swift/ABI/TypeIdentity.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class TypeImportInfo {
///
/// \return true if collection was successful.
template <bool Asserting>
bool collect(StringRef value) {
bool collect(llvm::StringRef value) {
#define check(CONDITION, COMMENT) \
do { \
if (!Asserting) { \
Expand Down Expand Up @@ -177,17 +177,17 @@ class TypeImportInfo {
class ParsedTypeIdentity {
public:
/// The user-facing name of the type.
StringRef UserFacingName;
llvm::StringRef UserFacingName;

/// The full identity of the type.
/// Note that this may include interior '\0' characters.
StringRef FullIdentity;
llvm::StringRef FullIdentity;

/// Any extended information that type might have.
llvm::Optional<TypeImportInfo<StringRef>> ImportInfo;
llvm::Optional<TypeImportInfo<llvm::StringRef>> ImportInfo;

/// The ABI name of the type.
StringRef getABIName() const {
llvm::StringRef getABIName() const {
if (ImportInfo && !ImportInfo->ABIName.empty())
return ImportInfo->ABIName;
return UserFacingName;
Expand All @@ -202,11 +202,11 @@ class ParsedTypeIdentity {
return ImportInfo && !ImportInfo->RelatedEntityName.empty();
}

bool isRelatedEntity(StringRef entityName) const {
bool isRelatedEntity(llvm::StringRef entityName) const {
return ImportInfo && ImportInfo->RelatedEntityName == entityName;
}

StringRef getRelatedEntityName() const {
llvm::StringRef getRelatedEntityName() const {
assert(isAnyRelatedEntity());
return ImportInfo->RelatedEntityName;
}
Expand Down