Skip to content

Allow the creation of a shadow variable when the type is a refcounted pointer #34835

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
Nov 30, 2020

Conversation

augusto2112
Copy link
Contributor

This PR allows the creation of shadow variables when dealing of variable whose type is as a refcounted pointer in -O0. This allows debug information to survive when it otherwise wouldn't.

Resolves SR-13208.

@adrian-prantl @vedantk

@vedantk
Copy link
Contributor

vedantk commented Nov 19, 2020

@swift-ci smoke test

@vedantk
Copy link
Contributor

vedantk commented Nov 19, 2020

error: the package at '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-main/swiftpm/swift-tools-support-core' cannot be accessed

@vedantk
Copy link
Contributor

vedantk commented Nov 19, 2020

@swift-ci smoke test OS X

@adrian-prantl
Copy link
Contributor

Thanks, this LGTM! Could you add an API test to LLDB that makes use of this?

@adrian-prantl
Copy link
Contributor

Oh: you did swiftlang/llvm-project#2156 ?

@augusto2112
Copy link
Contributor Author

Oh: you did apple/llvm-project#2156 ?

Yes! That test is for this problem.

@vedantk
Copy link
Contributor

vedantk commented Nov 20, 2020

There's a failure in https://ci.swift.org/job/swift-PR-osx-smoke-test/26103/consoleFull#-3473459473122a513-f36a-4c87-8ed7-cbc36a1ec144:

/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-main/llvm-project/lldb/test/Shell/SwiftREPL/SwiftInterfaceForceModuleLoadMode.test:31:16: error: NOT-LOADED: expected string not found in input
18:23:50 // NOT-LOADED: cannot find type 'OtherType' in scope

The test defines:

let x: OtherType = testValue

OtherType appears to be imported from test/Shell/SwiftREPL/Inputs/A.swift:public struct OtherType {}.

I don't see how the failure is related to this change.

@vedantk
Copy link
Contributor

vedantk commented Nov 20, 2020

TestGenericError.py also failed with libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: recursive_mutex lock failed: Invalid argument. We've been seeing this failure for ages. I thought switching lldb to use llvm's ThreadPool implementation fixed it, but -- apparently not.

@vedantk
Copy link
Contributor

vedantk commented Nov 20, 2020

I've made a note to investigate those failures. Let's try again for now.

@vedantk
Copy link
Contributor

vedantk commented Nov 20, 2020

@swift-ci smoke test

@augusto2112
Copy link
Contributor Author

There's a failure in https://ci.swift.org/job/swift-PR-osx-smoke-test/26103/consoleFull#-3473459473122a513-f36a-4c87-8ed7-cbc36a1ec144:

/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-main/llvm-project/lldb/test/Shell/SwiftREPL/SwiftInterfaceForceModuleLoadMode.test:31:16: error: NOT-LOADED: expected string not found in input
18:23:50 // NOT-LOADED: cannot find type 'OtherType' in scope

The test defines:

let x: OtherType = testValue

OtherType appears to be imported from test/Shell/SwiftREPL/Inputs/A.swift:public struct OtherType {}.

I don't see how the failure is related to this change.

Hi @vedantk, that's what I suspect as well. I checked out the llvm-project commit that was used in the test, and the same test fails with or without my changes. The problem is that a bunch (280) tests are failing in my system at the moment, and I wanted to sort this to make sure there weren't any problems in my patch before commenting anything. Also, I didn't see any other failures like this one in the CI, which left me puzzled.

But since you've mentioned this already, maybe we could try re-running the tests?

@augusto2112
Copy link
Contributor Author

I see you already re-started the tests. Thanks!

@vedantk
Copy link
Contributor

vedantk commented Nov 20, 2020

Augh "Targeted branch is locked (Holiday)"

@augusto2112
Copy link
Contributor Author

Hi guys! It looks like the previous failures were unrelated to the PR. Could we re-run the tests here?

@vedantk vedantk merged commit 89fab1b into swiftlang:main Nov 30, 2020
ainu-bot pushed a commit to google/swift that referenced this pull request Dec 1, 2020
* 'main' of github.com:apple/swift: (67 commits)
  [build-script] Allow to tune dsymutil parallelism (swiftlang#34795)
  [Testing] Add missing REQUIRES
  [concurrency] SILGen: emit @asyncHandler functions.
  [concurrency] SILGen: allow the Builtin.createAsyncTaskFuture to have a non-generic closure argument.
  [concurrency] stdlib: add a _runAsyncHandler compiler intrinsic.
  Mangling: add support for mangling the body-function of asyncHandlers
  Make sure ~AutoDiffLinearMapContext() is called.
  fix SourceLoc-related crasher and add tests
  [AutoDiff] Bump-pointer allocate pullback structs in loops. (swiftlang#34886)
  update differentiable programming manifesto
  [Async CC] Always add full type metadata to bindings.
  [cxx-interop] Fix assertion to allow variadic members.
  [ome] Remove bad pattern of having a global SILBuilder with a global SILBuilderWithContext and multiple local SILBuilderWithScope.
  [ome] Invoke simplifyInstruction after lowering ownership and use replaceAllSimplifiedUsesAndErase instead of a manual RAUW.
  Partially revert Float16 availability changes (swiftlang#34847)
  Add a field reflection function that constructs keypaths. (swiftlang#34815)
  Allow the creation of a shadow variable when the type is a refcounted pointer (swiftlang#34835)
  [CMake] Extend copy-legacy-layouts dependency to swiftmodules (swiftlang#34846)
  [sil] Remove usage from TypeLowering of SILBuilder::create*AndFold().
  [allocbox-to-stack] Fix an ossa bug in PromotedParamCloner.
  ...
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