Skip to content

[CodeExtractor] Consider Value arguments of dbg.assign (#67987) #7558

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

Conversation

felipepiovezan
Copy link

Currently, the code extractor functionality deletes a debug intrinsic if its "Location" argument is not part of the extracted function. The location is the first argument (or the first few arguments in case of a DIArgList) of all debug intrinsics.

However, according to the docs, the signature of dbg.assign is:

void @llvm.dbg.assign(Value *Value,
                      DIExpression *ValueExpression,
                      DILocalVariable *Variable,
                      DIAssignID *ID,
                      Value *Address,
                      DIExpression *AddressExpression)

That is, there are two Value arguments to it: the usual location argument and an "Address" argument. This Address argument should also receive the same treatment.

(cherry picked from commit 5064ca8)

Currently, the code extractor functionality deletes a debug intrinsic if
its "Location" argument is not part of the extracted function. The
location is the first argument (or the first few arguments in case of a
DIArgList) of all debug intrinsics.

However, according to the docs, the signature of dbg.assign is:

```
void @llvm.dbg.assign(Value *Value,
                      DIExpression *ValueExpression,
                      DILocalVariable *Variable,
                      DIAssignID *ID,
                      Value *Address,
                      DIExpression *AddressExpression)
```

That is, there are two `Value` arguments to it: the usual location
argument and an "Address" argument. This Address argument should also
receive the same treatment.

(cherry picked from commit 5064ca8)
@felipepiovezan
Copy link
Author

@swift-ci please test

@felipepiovezan
Copy link
Author

@swift-ci please test llvm

@felipepiovezan
Copy link
Author

LLVM Linux failures are clang
Swift linux failure seems to be an unrelated build issue

swift macos failure is https://github.com/apple/swift/pull/68942/files rdar://116407797

@felipepiovezan felipepiovezan merged commit e8e6ab0 into swiftlang:stable/20230725 Oct 3, 2023
@felipepiovezan felipepiovezan deleted the felipe/cherry-pick-dbg-assign branch October 3, 2023 21:06
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.

1 participant