Skip to content

Add a -verify-linetable LLVM option. #19225

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
Sep 10, 2018

Conversation

adrian-prantl
Copy link
Contributor

@adrian-prantl adrian-prantl commented Sep 10, 2018

While stepping through Swift programs in LLDB I noticed that sometimes
the line table entries go like this:

  foo(bar(baz)) // Some auxiliary code for the entire expression.
  ^

  foo(bar(baz))
      ^

  foo(bar(baz)) // And then back again for that actual call to foo.
  ^

This verification step is aimed at identifying situations like this so
they can be fixed.

rdar://problem/44317688

While stepping through Swift programs in LLDB I noticed that sometimes
the line table entries go like this:

  foo(bar(baz)) // Some auxiliary code for the entire expression.
  ^

  foo(bar(baz))
      ^

  foo(bar(baz)) // And then back again for that actual call to foo.
  ^

This verification step is aimed at identifying situations like this so
they can be fixed.
@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

@vedantk
Copy link
Contributor

vedantk commented Sep 10, 2018

I think we should try to fix a handful of issues identified by this check before merging it (per the rationale in https://reviews.llvm.org/D46100#1079885). It would be useful to pass this over the source compatibility suite, see what we find, and make sure that the assumptions in the assert are valid.

@vedantk
Copy link
Contributor

vedantk commented Sep 10, 2018

That said, the assert does look good to me.

Copy link
Member

@dcci dcci left a comment

Choose a reason for hiding this comment

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

This looks sane. How many failures do we have if we flip the switch to true?

@adrian-prantl
Copy link
Contributor Author

It doesn't even compile trivial programs such as swift/test/DebugInfo/guard-let.swift without asserting. Here's is the debug output for it:

clear
clear
insert(20,19)
clear
clear
clear
insert(20,28)
clear
insert(22,1)
clear
clear
insert(20,19)
clear
insert(20,28)
clear
insert(22,1)
insert(20,19)
insert(21,7)
insert(21,3)
insert(22,1)

@adrian-prantl
Copy link
Contributor Author

fnptr.swift

clear
insert(51,1)
clear
insert(14,21)
insert(14,5)
insert(22,5)
insert(35,21)
insert(35,5)
insert(36,5)
insert(36,15)
insert(36,5)

@adrian-prantl
Copy link
Contributor Author

Hopefully these failures can all be tracked down to very few root causes.

@swift-ci swift-ci merged commit e5949ca into swiftlang:master Sep 10, 2018
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.

4 participants