[PATCH] D54394: [NewPM] Port msan

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 11 10:28:36 PST 2018


philip.pfaffe created this revision.
philip.pfaffe added reviewers: chandlerc, fedor.sergeev, leonardchan.
Herald added subscribers: jsji, atanasyan, jrtc27, bollu, kbarton, javed.absar, nemanjai, sdardis.

msan as most sanitizers creates a new function to initialize itself,
which function passes cannot do. To keep it as a function pass, I moved the
pass's intialization around:

- Make a free function for creating the global constructor function
- The opt tool calls this function when passing a command line option
- The remaining initialization only creates function declarations and metadata. This I now do lazily when visiting the first function. Consequently I need to keep state in the Pass, which is unfortunate. If this survives review, we need to be careful with other sanitizers when doing this, because state is kept per PM instance, _not_ per module. So this is just best-effort.


Repository:
  rL LLVM

https://reviews.llvm.org/D54394

Files:
  include/llvm/InitializePasses.h
  include/llvm/Transforms/Instrumentation.h
  lib/Passes/PassRegistry.def
  lib/Transforms/Instrumentation/Instrumentation.cpp
  lib/Transforms/Instrumentation/MemorySanitizer.cpp
  test/Instrumentation/MemorySanitizer/AArch64/vararg.ll
  test/Instrumentation/MemorySanitizer/Mips/vararg-mips64.ll
  test/Instrumentation/MemorySanitizer/Mips/vararg-mips64el.ll
  test/Instrumentation/MemorySanitizer/PowerPC/vararg-ppc64.ll
  test/Instrumentation/MemorySanitizer/PowerPC/vararg-ppc64le.ll
  test/Instrumentation/MemorySanitizer/X86/vararg-too-large.ll
  test/Instrumentation/MemorySanitizer/X86/vararg.ll
  test/Instrumentation/MemorySanitizer/X86/vararg_call.ll
  test/Instrumentation/MemorySanitizer/alloca.ll
  test/Instrumentation/MemorySanitizer/array_types.ll
  test/Instrumentation/MemorySanitizer/atomics.ll
  test/Instrumentation/MemorySanitizer/byval-alignment.ll
  test/Instrumentation/MemorySanitizer/check-constant-shadow.ll
  test/Instrumentation/MemorySanitizer/check_access_address.ll
  test/Instrumentation/MemorySanitizer/csr.ll
  test/Instrumentation/MemorySanitizer/global_ctors_2to3.ll
  test/Instrumentation/MemorySanitizer/instrumentation-with-call-threshold.ll
  test/Instrumentation/MemorySanitizer/manual-shadow.ll
  test/Instrumentation/MemorySanitizer/masked-store-load.ll
  test/Instrumentation/MemorySanitizer/missing_origin.ll
  test/Instrumentation/MemorySanitizer/msan_basic.ll
  test/Instrumentation/MemorySanitizer/msan_kernel_basic.ll
  test/Instrumentation/MemorySanitizer/msan_x86_bts_asm.ll
  test/Instrumentation/MemorySanitizer/msan_x86intrinsics.ll
  test/Instrumentation/MemorySanitizer/mul_by_constant.ll
  test/Instrumentation/MemorySanitizer/nosanitize.ll
  test/Instrumentation/MemorySanitizer/origin-alignment.ll
  test/Instrumentation/MemorySanitizer/origin-array.ll
  test/Instrumentation/MemorySanitizer/pr32842.ll
  test/Instrumentation/MemorySanitizer/return_from_main.ll
  test/Instrumentation/MemorySanitizer/store-long-origin.ll
  test/Instrumentation/MemorySanitizer/store-origin.ll
  test/Instrumentation/MemorySanitizer/str-nobuiltin.ll
  test/Instrumentation/MemorySanitizer/unreachable.ll
  test/Instrumentation/MemorySanitizer/unsized_type.ll
  test/Instrumentation/MemorySanitizer/vector_arith.ll
  test/Instrumentation/MemorySanitizer/vector_cmp.ll
  test/Instrumentation/MemorySanitizer/vector_cvt.ll
  test/Instrumentation/MemorySanitizer/vector_pack.ll
  test/Instrumentation/MemorySanitizer/vector_shift.ll
  test/Instrumentation/MemorySanitizer/with-call-type-size.ll
  tools/opt/NewPMDriver.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54394.173563.patch
Type: text/x-patch
Size: 48544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181111/2404ee3b/attachment.bin>


More information about the llvm-commits mailing list