Skip to content

Handle extension contexts when demangling bound generic arguments #3828

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

Closed
wants to merge 1 commit into from
Closed

Handle extension contexts when demangling bound generic arguments #3828

wants to merge 1 commit into from

Conversation

bitjammer
Copy link
Contributor

Local generic types can appear inside functions inside extensions
of other types. When demangling bound generic arguments, the demangler
assumed that a module was the only other kind of context outside
of nominal types.

rdar://problem/27573079

Local generic types can appear inside functions inside extensions
of other types. When demangling bound generic arguments, the demangler
assumed that a module was the only other kind of context outside
of nominal types.

rdar://problem/27573079
@bitjammer
Copy link
Contributor Author

@swift-ci Please test

@tkremenek
Copy link
Member

CI fails:

/Users/buildnode/jenkins/workspace/swift-PR-osx/swift/stdlib/public/SDK/Foundation/Notification.swift:134:16: warning: explicitly specified type '[String : Any]?' adds an additional level of optional to the initializer, making the optional check always succeed
            if let info : [String : Any]? = _NSUserInfoDictionary.bridgeReference(from: userInfo) {
               ^          ~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          [String : Any]
Assertion failed: (srcAddr->getType() == destAddr->getType()), function createCopyAddr, file /Users/buildnode/jenkins/workspace/swift-PR-osx/swift/include/swift/SIL/SILBuilder.h, line 516.
0  swift                    0x000000010b02a71b llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x000000010b029946 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x000000010b02aff1 SignalHandler(int) + 641
3  libsystem_platform.dylib 0x00007fff966d252a _sigtramp + 26
4  swift                    0x000000010bc255e1 cmark_strbuf__initbuf + 71488
5  swift                    0x000000010b02ac3e abort + 14
6  swift                    0x000000010b02ac21 __assert_rtn + 81
7  swift                    0x000000010872adcd swift::SILBuilder::createCopyAddr(swift::SILLocation, swift::SILValue, swift::SILValue, swift::IsTake_t, swift::IsInitialization_t) + 333
8  swift                    0x00000001084bddd7 swift::SILCloner<swift::SILInliner>::visitCopyAddrInst(swift::CopyAddrInst*) + 343
9  swift                    0x00000001084ba11b swift::SILCloner<swift::SILInliner>::visitSILBasicBlock(swift::SILBasicBlock*) + 91
10 swift                    0x00000001084b9bb6 swift::SILInliner::inlineFunction(swift::FullApplySite, llvm::ArrayRef<swift::SILValue>) + 1206
11 swift                    0x000000010857d730 (anonymous namespace)::SILPerformanceInliner::inlineCallsIntoFunction(swift::SILFunction*) + 12112
12 swift                    0x000000010857a6ba (anonymous namespace)::SILPerformanceInlinerPass::run() + 410
13 swift                    0x00000001084d22cf swift::SILPassManager::runPassesOnFunction(llvm::ArrayRef<swift::SILFunctionTransform*>, swift::SILFunction*, bool) + 2255
14 swift                    0x00000001084d32f9 swift::SILPassManager::runFunctionPasses(llvm::ArrayRef<swift::SILFunctionTransform*>) + 1193
15 swift                    0x00000001084d4634 swift::SILPassManager::runOneIteration() + 964
16 swift                    0x00000001084df317 swift::runSILOptimizationPasses(swift::SILModule&) + 231
17 swift                    0x00000001081d1acf performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 13903
18 swift                    0x00000001081cd1af swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2895
19 swift                    0x000000010818fb00 main + 2448
20 libdyld.dylib            0x00007fff879795ad start + 1

@tkremenek tkremenek assigned bitjammer and unassigned tkremenek Jul 28, 2016
@tkremenek
Copy link
Member

I'd prefer we just pick this fix up when we pull a seed branch again from master.

@tkremenek tkremenek closed this Jul 28, 2016
@bitjammer bitjammer deleted the local-generic-type-mangling-27573079 branch November 9, 2016 01:15
kateinoigakukun pushed a commit that referenced this pull request Aug 31, 2022
As previously announced by @kateinoigakukun:
>The last required commit for swiftwasm has been cherry-picked to the swift's llvm branch! swiftlang/llvm-project#3451
>We no longer need to maintain our llvm downstream fork
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.

2 participants