[NewPM] Port Sancov
authorLeonard Chan <leonardchan@google.com>
Thu, 11 Jul 2019 22:35:40 +0000 (22:35 +0000)
committerLeonard Chan <leonardchan@google.com>
Thu, 11 Jul 2019 22:35:40 +0000 (22:35 +0000)
commit5652f35817f07b16f8b3856d594cc42f4d7ee29c
tree2d2827d336ffa7ca7db5066ad5302252da1ac20e
parent28550c8680453b81fa00a3b221f003ac467d15c3
[NewPM] Port Sancov

This patch contains a port of SanitizerCoverage to the new pass manager. This one's a bit hefty.

Changes:

- Split SanitizerCoverageModule into 2 SanitizerCoverage for passing over
  functions and ModuleSanitizerCoverage for passing over modules.
- ModuleSanitizerCoverage exists for adding 2 module level calls to initialization
  functions but only if there's a function that was instrumented by sancov.
- Added legacy and new PM wrapper classes that own instances of the 2 new classes.
- Update llvm tests and add clang tests.

Differential Revision: https://reviews.llvm.org/D62888

llvm-svn: 365838
40 files changed:
clang/lib/CodeGen/BackendUtil.cpp
clang/test/CodeGen/sancov-new-pm.c [new file with mode: 0644]
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Transforms/Instrumentation.h
llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h [new file with mode: 0644]
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/test/Instrumentation/SanitizerCoverage/abort-in-entry-block.ll
llvm/test/Instrumentation/SanitizerCoverage/backedge-pruning.ll
llvm/test/Instrumentation/SanitizerCoverage/chains.ll
llvm/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_32.ll
llvm/test/Instrumentation/SanitizerCoverage/cmp-tracing-api-x86_64.ll
llvm/test/Instrumentation/SanitizerCoverage/cmp-tracing.ll
llvm/test/Instrumentation/SanitizerCoverage/coff-comdat.ll
llvm/test/Instrumentation/SanitizerCoverage/coff-pc-table-inline-8bit-counters.ll
llvm/test/Instrumentation/SanitizerCoverage/coff-used-ctor.ll
llvm/test/Instrumentation/SanitizerCoverage/const-cmp-tracing.ll
llvm/test/Instrumentation/SanitizerCoverage/coverage-dbg.ll
llvm/test/Instrumentation/SanitizerCoverage/coverage.ll
llvm/test/Instrumentation/SanitizerCoverage/coverage2-dbg.ll
llvm/test/Instrumentation/SanitizerCoverage/div-tracing.ll
llvm/test/Instrumentation/SanitizerCoverage/gep-tracing.ll
llvm/test/Instrumentation/SanitizerCoverage/inline-8bit-counters.ll
llvm/test/Instrumentation/SanitizerCoverage/interposable-symbol-nocomdat.ll
llvm/test/Instrumentation/SanitizerCoverage/no-func.ll
llvm/test/Instrumentation/SanitizerCoverage/pc-table.ll
llvm/test/Instrumentation/SanitizerCoverage/postdominator_check.ll
llvm/test/Instrumentation/SanitizerCoverage/seh.ll
llvm/test/Instrumentation/SanitizerCoverage/stack-depth-variable-declared-by-user.ll
llvm/test/Instrumentation/SanitizerCoverage/stack-depth.ll
llvm/test/Instrumentation/SanitizerCoverage/switch-tracing.ll
llvm/test/Instrumentation/SanitizerCoverage/trace-pc-guard-comdat.ll
llvm/test/Instrumentation/SanitizerCoverage/trace-pc-guard-inline-8bit-counters.ll
llvm/test/Instrumentation/SanitizerCoverage/trace-pc-guard-nocomdat.ll
llvm/test/Instrumentation/SanitizerCoverage/tracing-comdat.ll
llvm/test/Instrumentation/SanitizerCoverage/tracing.ll
llvm/test/Instrumentation/SanitizerCoverage/unreachable-critedge.ll
llvm/test/Instrumentation/SanitizerCoverage/wineh.ll