Skip to content

[cxx-interop] Break when we find a linkage specification when traversing all decls in IRGen. #67211

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 2 commits into from
Jul 11, 2023

Conversation

zoecarver
Copy link
Contributor

Without this, we will find the linkage specification decl rather than a function decl (for example). The problem here is that we will check if we've already traversed this decl and bail out. If we do that we will not codegen the function decl (for example) and get linker errors.

I have a test case that I'm trying to reduce and I will add that as a test. rdar://110439422

@zoecarver zoecarver requested review from hyp, egorzhdan and plotfi July 11, 2023 01:22
@zoecarver zoecarver added the c++ interop Feature: Interoperability with C++ label Jul 11, 2023
@zoecarver
Copy link
Contributor Author

extern "C" {

inline void inlineFn();

void cacheMis();
void incorrectCacheHit() {
  inlineFn();
}

static void caller() {  
  cacheMis();
  incorrectCacheHit();
}

inline void inlineFn() {
}

}

// Swift

public func test() {
  caller()
}

@plotfi
Copy link
Contributor

plotfi commented Jul 11, 2023

@zoecarver Ah so this is to keep the ClangDeclFinder from quitting on LinkageSpecDecls?

@plotfi
Copy link
Contributor

plotfi commented Jul 11, 2023

Ah yeah it is, I reread your description. Can we add a test? Otherwise LGTM.

@zoecarver
Copy link
Contributor Author

Yep added a test!

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants