This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Preserve Assembler Source Locations
AbandonedPublic

Authored by lenary on Dec 7 2020, 3:27 PM.

Details

Summary

We weren't using the IDLoc available everywhere in the RISCVAsmParser. This
means we were losing potential source code location information.

This commit adds a way of providing the location (only once) to MCInstBuilder,
and uses that interface within the RISCVAsmParser, so location information isn't
lost.

I *think* (but I'm not 100% sure) this would manifest as a lack of location
information for e.g. call and li instructions when assembled into object
files.

Diff Detail

Event Timeline

lenary created this revision.Dec 7 2020, 3:27 PM
lenary requested review of this revision.Dec 7 2020, 3:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2020, 3:27 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

Aren't MCInst locations only used for diagnostics? I don't think they affect object files.

lenary abandoned this revision.Dec 7 2020, 4:46 PM

I was weirded out by seeing debug info left as unused arguments, but I went looking in AsmParser.cpp and it does something completely different for emitting debug info, which I wasn't expecting.