Page MenuHomePhabricator

[clang-import-test] Improve coverage by adding a test and eliminating dead code
ClosedPublic

Authored by spyffe on Jul 10 2017, 1:24 PM.

Details

Summary

clang-import-test had some dead code. I did the following to eliminate it:

  • eliminated error handling for the indirect CompilerInstance, which should never generate an error as it is created;
  • added a new test for direct importation; and
  • removed an unused implementation of the CompleteType() API.

This brings clang-import-test.cpp and ExternalASTMerge.cpp back to 100% coverage on all metrics measured by DLLVM_BUILD_INSTRUMENTED_COVERAGE.

Diff Detail

Repository
rL LLVM

Event Timeline

spyffe created this revision.Jul 10 2017, 1:24 PM
spyffe added inline comments.Jul 10 2017, 2:47 PM
tools/clang-import-test/clang-import-test.cpp
308 ↗(On Diff #105909)

The original API (BuildIndirect) doesn't even return an Expectedso this is completely dead code. I'm going to eliminate the Expected and the assert.

spyffe updated this revision to Diff 105930.Jul 10 2017, 3:58 PM

Eliminated a useless Expected.

lhames accepted this revision.Jul 10 2017, 4:43 PM

Looks good to me. :)

This revision is now accepted and ready to land.Jul 10 2017, 4:43 PM
This revision was automatically updated to reflect the committed changes.