This is an archive of the discontinued LLVM Phabricator instance.

[unittest][DebugInfo/DWARF] Do not create dwarfgen::Generator if MCAsmBackend is missing
ClosedPublic

Authored by ikudrin on Dec 21 2021, 7:04 AM.

Details

Summary

dwarfgen::Generator cannot be created if there is no asm backend for a target. For example, if the default target triple is nvptx-nvidia-cuda, some tests fail even after D98400, which added checks for most cases. This patch extends the approach to the remaining cases.

Diff Detail

Event Timeline

ikudrin requested review of this revision.Dec 21 2021, 7:04 AM
ikudrin created this revision.
dblaikie accepted this revision.Dec 21 2021, 9:14 AM

Is this accurate? Do all uses of DWARFUtils need the asm emission? I'd have thought the DWARFGenerator would mostly be used to go straight to machine code, without assembly?

This revision is now accepted and ready to land.Dec 21 2021, 9:14 AM

Is this accurate? Do all uses of DWARFUtils need the asm emission? I'd have thought the DWARFGenerator would mostly be used to go straight to machine code, without assembly?

The generator requires the assembler internally, see dwarfgen::Generator::generate(). dwarfgen::Generator::init() creates MCAsmBackend and fails if the asm backend is not available.

After D98400, there are only two places where isConfigurationSupported() is still called, but right after the check, dwarfgen::Generator is created.

This revision was landed with ongoing or failed builds.Dec 22 2021, 3:54 AM
This revision was automatically updated to reflect the committed changes.