Skip to content
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

[LLVM 4.0] Update LLVM global variable debug info API for 4.0 #38295

Merged
merged 1 commit into from
Dec 14, 2016

Conversation

dylanmckay
Copy link
Contributor

@dylanmckay dylanmckay commented Dec 11, 2016

This teaches Rust about an LLVM 4.0 API change for creating debug info
for global variables.

This change was made in upstream LLVM patch https://reviews.llvm.org/D20147

This is almost a 1:1 copy of how clang did it in http://reviews.llvm.org/D20415

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@dylanmckay
Copy link
Contributor Author

This will bring us closer to upgrading to LLVM 4.0 in #37609

@dylanmckay dylanmckay changed the title Update LLVM global variable debug info API for 4.0 [LLVM 4.0] Update LLVM global variable debug info API for 4.0 Dec 11, 2016
@alexcrichton
Copy link
Member

r? @michaelwoerister

Constant *InitVal = cast<Constant>(unwrap(Val));

#if LLVM_VERSION_GE(4, 0)
llvm::DIExpression *InitExpr = nullptr;
Copy link
Member

Choose a reason for hiding this comment

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

It looks like these are 3 spaces instead of 4?

FYI, this will have some conflicts with #38317.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated


#if LLVM_VERSION_GE(4, 0)
llvm::DIExpression *InitExpr = nullptr;
if (llvm::ConstantInt *IntVal = llvm::dyn_cast<llvm::ConstantInt>(InitVal))
Copy link
Member

Choose a reason for hiding this comment

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

Should this have braces on the if clause?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@michaelwoerister
Copy link
Member

@bors r+

Thanks for the PR!

@bors
Copy link
Contributor

bors commented Dec 13, 2016

📌 Commit 5b2b712 has been approved by michaelwoerister

@bors
Copy link
Contributor

bors commented Dec 13, 2016

☔ The latest upstream changes (presumably #38317) made this pull request unmergeable. Please resolve the merge conflicts.

This teaches Rust about an LLVM 4.0 API change for creating debug info
for global variables.

This change was made in upstream LLVM patch https://reviews.llvm.org/D20147

This is almost 1:1 copy of how clang did it in http://reviews.llvm.org/D20415
@dylanmckay
Copy link
Contributor Author

Rebased on top of master

@michaelwoerister
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Dec 14, 2016

📌 Commit e080804 has been approved by michaelwoerister

@bors
Copy link
Contributor

bors commented Dec 14, 2016

⌛ Testing commit e080804 with merge b197e4a...

bors added a commit that referenced this pull request Dec 14, 2016
…rister

[LLVM 4.0] Update LLVM global variable debug info API for 4.0

This teaches Rust about an LLVM 4.0 API change for creating debug info
for global variables.

This change was made in upstream LLVM patch https://reviews.llvm.org/D20147

This is almost a 1:1 copy of how clang did it in http://reviews.llvm.org/D20415
@bors bors merged commit e080804 into rust-lang:master Dec 14, 2016
@dylanmckay dylanmckay deleted the llvm-4.0-di-globalvar branch February 4, 2017 10:20
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.

6 participants