This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Add minimal support for the new Mojo language
ClosedPublic

Authored by wallace on May 2 2023, 4:01 PM.

Details

Summary

Modular just announced a new language called Mojo. This patch adds an entry in the language list in LLDB for minimal support (e.g. being able to create a TypeSystem for this language). We will later add debug info entries when the language matures.

Diff Detail

Event Timeline

wallace created this revision.May 2 2023, 4:01 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: hiraditya. · View Herald Transcript
wallace requested review of this revision.May 2 2023, 4:01 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 2 2023, 4:01 PM
bulbazord added inline comments.
lldb/include/lldb/lldb-enumerations.h
493

These values correspond to DWARF5's official language codes and 0x0030 is technically already taken. LLDB just hasn't been updated yet. I don't think this should necessarily block this patch but this value will need to be changed at some point.

See: https://dwarfstd.org/languages.html

aprantl added a subscriber: aprantl.May 2 2023, 4:20 PM
aprantl added inline comments.
lldb/include/lldb/lldb-enumerations.h
493

Registering a new language with the DWARF committee is a pretty quick process nowadays. Please do that before taking a constant in the reserved range.

wallace added inline comments.May 2 2023, 4:20 PM
lldb/include/lldb/lldb-enumerations.h
493

Thanks for the information. I'll do so then :)

You can also use a constant in the Vendor extension space, which might be more appropriate until the languages sees adoption by a wider audience.

You can also use a constant in the Vendor extension space, which might be more appropriate until the languages sees adoption by a wider audience.

That sounds like a better idea. Thanks! I'll give it a try

wallace updated this revision to Diff 519338.May 3 2023, 7:39 PM

add the language as a vendor extension

wallace retitled this revision from [DebugInfo] Add language code for the new Mojo language to [LLDB] Add minimal support for the new Mojo language.May 3 2023, 7:40 PM
wallace edited the summary of this revision. (Show Details)
bulbazord accepted this revision.May 5 2023, 3:10 PM

Don't forget to come back and update it when you get an official designation!

This revision is now accepted and ready to land.May 5 2023, 3:10 PM
rriddle accepted this revision.May 5 2023, 6:30 PM

Nice!

wallace closed this revision.May 5 2023, 6:44 PM