This is an archive of the discontinued LLVM Phabricator instance.

Add some apple-tables lookup tests
ClosedPublic

Authored by labath on May 18 2018, 6:59 AM.

Details

Summary

Now that we are able to parse MachO files everywhere, we can write some
cross-platform tests for handling of apple accelerator tables. This
reruns the same lookup tests we have for manual indexes on MachO files
which will use the accelerator tables instead. This makes sure we return
the same results regardless of the method we used to access the debug
info.

The tests confirm we return the same results for looking up types,
namespaces and variables, but have found an inconsistency in the
treatment of function lookup. In the function case we mis-classify the
method "foo" declared in the local struct sbar (inside function ffbar).
We classify it as a function whereas it really is a method. Preliminary
analysis suggests this is because
DWARFASTParserClang::GetClangDeclContextForDIE returns null when given
the local "struct sbar" DIE. This causes us to get the wrong
CompilerDeclContext when we ask for the context of the inner foo, which
means CompilerDeclContext::ISStructUnionOrClass returns false.

Until this is fixed, I do not include the darwin versions of the "base"
and "method" function lookup tests.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.May 18 2018, 6:59 AM
JDevlieghere accepted this revision.May 18 2018, 7:13 AM

LGTM!

lit/SymbolFile/DWARF/find-basic-function.cpp
17 ↗(On Diff #147500)

%t.o?

This revision is now accepted and ready to land.May 18 2018, 7:13 AM
labath added inline comments.May 18 2018, 7:22 AM
lit/SymbolFile/DWARF/find-basic-function.cpp
17 ↗(On Diff #147500)

I prefer %t, as that makes the RUN lines below identical to the elf versions (in elf I use %t.o because I need an extra lld step).

clayborg accepted this revision.May 18 2018, 2:34 PM
This revision was automatically updated to reflect the committed changes.