This is an archive of the discontinued LLVM Phabricator instance.

[MC] Move .seh_ directive implementation to MCObjectStreamer
AbandonedPublic

Authored by rnk on Oct 5 2017, 3:51 PM.

Details

Reviewers
MatzeB
Summary

This suppresses the generation of .Lcfi labels in our textual assembler
output when targetting Win64. It was annoying that this generates
cascading .Lcfi labels:

llc foo.ll -o - | llvm-mc | llvm-mc

After three trips through MCAsmStreamer, we'd have three labels in the
output when none are necessary. We should only bother creating the
labels and frame data when making a real object file.

With this change, we will not check for mis-ordered .seh directives when
generating textual assembly. Personally, that seems like a reasonable
cost to pay to clean our assembly output.

This was a test before attempting to sink the generation of .Lcfi labels
for DWARF .cfi_ directives. If people like this, I will try that next.

Event Timeline

rnk created this revision.Oct 5 2017, 3:51 PM
rnk updated this revision to Diff 117921.Oct 5 2017, 3:52 PM
  • remove useless calls to MCStreamer::EmitWinCFI*
majnemer added inline comments.
llvm/include/llvm/MC/MCObjectStreamer.h
44

Should this be std::vector<std::unique_ptr<WinEH:FrameInfo>> ?

llvm/lib/MC/MCObjectStreamer.cpp
38–39

DeleteContainerPointers(WinFrameInfos)

78–80

Ditto.

rnk abandoned this revision.Oct 6 2017, 10:54 AM

Actually, I'm just going to sink EmitCFILabel into MCObjectStreamer and call it a day. That handles both .seh_ and .cfi_ directives. New patch soon.

llvm/include/llvm/MC/MCObjectStreamer.h
44

Done in rL315080.