This is an archive of the discontinued LLVM Phabricator instance.

Add Rust to CodeView SourceLanguage (CV_CFL_LANG) enum
ClosedPublic

Authored by arlosi on Dec 7 2021, 3:44 PM.

Details

Summary

Microsoft has added several new entries to the CV_CFL_LANG enum, including Rust:

https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/cv-cfl-lang

This change adds Rust to the corresponding LLVM enum and translates dwarf::DW_LANG_Rust to SourceLanguage::Rust in the CodeView AsmPrinter.

This means that Rust will no longer emit as Masm.

Diff Detail

Event Timeline

arlosi created this revision.Dec 7 2021, 3:44 PM
arlosi requested review of this revision.Dec 7 2021, 3:44 PM
arlosi updated this revision to Diff 392831.Dec 8 2021, 10:40 AM

Adds Rust to a few more places that were missed. Test should pass now.

rnk added a comment.Dec 15 2021, 12:59 PM

Sounds good. Can you add a basic test to exercise this? Have llc produce an object file from Rust IR, dump it with llvm-pdbutil, and show that it all round trips. It goes next to the other codeview tests (I forget the exact path).

arlosi updated this revision to Diff 395474.Dec 20 2021, 9:13 AM

Add rust.ll test that verifies IR from rustc produces correct CodeView records with 0x15 (Rust) as the language.

@rnk Thanks for taking a look. I added a test. The test failures currently showing don't look related to this change.

I don't have commit access, so it would be great if you (or someone else) could commit this once approved.

arlosi updated this revision to Diff 397895.Jan 6 2022, 8:07 AM

Re-merging to trigger new build.

rnk accepted this revision.Jan 6 2022, 2:28 PM

Thanks! Will land shortly

This revision is now accepted and ready to land.Jan 6 2022, 2:28 PM
This revision was landed with ongoing or failed builds.Jan 6 2022, 2:29 PM
This revision was automatically updated to reflect the committed changes.