Skip to content

[NFC] Rename ExtInfo::Uncommon to ExtInfo::ClangTypeInfo. #33117

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

Conversation

varungandhi-apple
Copy link
Contributor

The previous name was poorly chosen (by me). Time to fix that.

I broke off this commit out of the ExtInfo builder-pattern refactoring (that one's pretty large, like 1k+, 1k-).

@varungandhi-apple
Copy link
Contributor Author

@swift-ci please smoke test

AnyFunctionType(TypeKind Kind, const ASTContext *CanTypeContext,
Type Output, RecursiveTypeProperties properties,
unsigned NumParams, ExtInfo Info)
: TypeBase(Kind, CanTypeContext, properties), Output(Output) {
Bits.AnyFunctionType.ExtInfoBits = Info.Bits;
Bits.AnyFunctionType.HasUncommonInfo = Info.getUncommonInfo().hasValue();
Bits.AnyFunctionType.HasClangTypeInfo = Info.getClangTypeInfo().hasValue();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @varungandhi-apple, looking at this I was wondering if maybe worth to ExtInfo to have an hasClangTypeInfo() API? Just a thought, maybe something like this could not be a relevant gain but could be an improvement over the getClangTypeInfo().hasValue() calls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deliberately avoided that. IMO it doesn't make sense to implement hasXYZ(), getXYZ() for every type and optional field; that's precisely what Optional is for, so you can just return an Optional and have the caller use that. If it was the case that a large number of callers want to check only for existence, I would've been fine with adding a convenience method, but that's not the case here.

@varungandhi-apple
Copy link
Contributor Author

In the future, I will be adding more fields to ClangTypeInfo, specifically an "isDerivable" bit in this PR. #29349

The ExtInfo builder-pattern refactoring is here: #33118.

@varungandhi-apple varungandhi-apple force-pushed the vg-rename-Uncommon-type branch from 3630010 to 5f18829 Compare July 27, 2020 20:32
@varungandhi-apple
Copy link
Contributor Author

Force pushed because changing some comments above/below created merge conflicts.

@swift-ci please smoke test

@varungandhi-apple
Copy link
Contributor Author

Oh wait, some whitespace changes snuck in. 🤦

The previous name was poorly chosen (by me). Time to fix that.
@varungandhi-apple varungandhi-apple force-pushed the vg-rename-Uncommon-type branch from 5f18829 to aeda622 Compare July 27, 2020 20:41
@varungandhi-apple
Copy link
Contributor Author

@swift-ci please smoke test

@varungandhi-apple varungandhi-apple merged commit ff82551 into swiftlang:master Jul 28, 2020
@varungandhi-apple varungandhi-apple deleted the vg-rename-Uncommon-type branch July 28, 2020 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants