This is an archive of the discontinued LLVM Phabricator instance.

[InstrProf] Fix Windows cross compilation TODOs to fix failing tests
Needs ReviewPublic

Authored by rnk on Apr 14 2017, 10:57 AM.

Details

Reviewers
davidxl
pcc
vsk
Summary

Coverage and profiling tests have been failing on Windows since r300279:
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/4061

Pass the object format to the section name lookup functions rather than
the Module, since we can compute the object format from the object file.
Add a helper to ObjectFile that can get the object format in Triple
enum.

There is a complication around MachO, which is that sometimes we want
DATA,llvm_foo,regular,live_support and sometimes we just want
__llvm_foo. Typically llvm-cov wants the bare section name without the
segment and flags, because it's looking the section name up in an
executable. Currently I have a hack in the coverage reader to pretend
that MachO files have an unknown object file type to suppress the
segment prefix, but we can probably come up with a better API than that.

Event Timeline

rnk created this revision.Apr 14 2017, 10:57 AM
davidxl edited edge metadata.Apr 14 2017, 11:16 AM

Can you extract the getObjectFormat Triple interface into a separate patch?

vsk has a bigger cleanup plan (to expose sectionKind) for more interface unification. Perhaps we can wait for that patch (after getObjectFormat patch is in)?

llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
655

Using 'unknown object' kind seems like a hack. What vsk had in mind is to restore addsegment parameter but with default to false.

vsk edited edge metadata.Apr 14 2017, 5:33 PM

I repackaged this patch a bit and checked it in as r300381.