Skip to content

Bring the Swift frontend's handling of DIFiles in synch with CFE. #22392

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
Feb 15, 2019

Conversation

adrian-prantl
Copy link
Contributor

This applies the same changes from Clang CFE r349065 to the Swift
frontend to unify how filenames, cmpilation directories and absolute
paths in filenames and path remappings are handled.

@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

@@ -3,6 +3,7 @@
// Verify that we don't emit any debug info by default.
// RUN: %target-swift-frontend %s -emit-ir -o - \
// RUN: | %FileCheck %s --check-prefix NDEBUG
// NDEBUG: foo
Copy link
Contributor

Choose a reason for hiding this comment

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

This breaks the NDEBUG-NOT checks below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I follow. Why?

Copy link
Contributor

Choose a reason for hiding this comment

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

The FileCheck interpretation of

CHECK: a
CHECK-NOT: b
CHECK-NOT: c

is "find 'a', then make sure that I don't find 'b' or 'c' after it". It doesn't stop 'b' and 'c' from appearing before 'a'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for clarifying! That's actually what I intended effect here: I just wanted to add a positive check to ensure that we emit LLVM IR at all, in this case the function definition and then make sure no !dbg attachment appears in the function body after that. Since foo is a terrible string to search for I changed it to source_filename now, which is guaranteed to appear at the very top of the output.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, okay! Sorry, seen too many cases where I add a CHECK line and miss that I just allowed a negative pattern to slip in before it.

@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

1 similar comment
@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

This applies the same changes from Clang CFE r349065 to the Swift
frontend to unify how filenames, cmpilation directories and absolute
paths in filenames and path remappings are handled.
@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

1 similar comment
@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

@adrian-prantl
Copy link
Contributor Author

(Fixed and edge case that required the SDK path to have zero common components with the compilation directory, such as Xcode installed in /Application to reproduce)

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 70140a2 into swiftlang:master Feb 15, 2019
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