[cxx-interop] Various code cleanups, no functional change intended#87574
[cxx-interop] Various code cleanups, no functional change intended#87574Xazax-hun merged 1 commit intoswiftlang:mainfrom
Conversation
Xazax-hun
commented
Feb 27, 2026
- Remove some unused includes
- Simplify conditionals
- Simplify loops
- Use llvm:: algorithms
- Simplify use of isa
- Deduplicate some code
- Other minor simplifications
|
@swift-ci please smoke test |
j-hui
left a comment
There was a problem hiding this comment.
This whole patch sparks joy.
|
|
||
| /// Check whether the given declaration context is from a system module. | ||
| inline bool isInSystemModule(const DeclContext *D) { | ||
| return cast<ClangModuleUnit>(D->getModuleScopeContext())->isSystemModule(); |
There was a problem hiding this comment.
Is this cast still valid if D's module scope context is not a clang module?
Given that this is in the swift namespace, maybe it should be a bit more defense.
And is there any reason not to put this in the swift::importer namespace?
There was a problem hiding this comment.
I don't think it matters because this is a private header that is only available in the importer. Do you still prefer to have changes to this function?
There was a problem hiding this comment.
It's all good, I only noticed afterward that this helper function was de-duplicated from two separate .cpp files, fine to keep it as is!
* Simplify conditionals * Simplify loops * Use llvm:: algorithms * Simplify use of isa * Deduplicate some code * Other minor simplifications
|
@swift-ci please smoke test |
|
@swift-ci please smoke test Windows |