[dfsan] Expose dfsan_get_track_origins to get origin tracking status
authorJianzhou Zhao <jianzhouzh@google.com>
Tue, 29 Jun 2021 06:17:00 +0000 (06:17 +0000)
committerJianzhou Zhao <jianzhouzh@google.com>
Tue, 29 Jun 2021 20:32:39 +0000 (20:32 +0000)
commitae6648cee01bc5c390b74dacd1851cf5df74599b
tree514cb14d63ed2b6af895d59f2249ca9367bac1e5
parent485cc55edfb875628e19bb6d9de4706af2865d3e
[dfsan] Expose dfsan_get_track_origins to get origin tracking status

This allows application code checks if origin tracking is on before
printing out traces.

-dfsan-track-origins can be 0,1,2.
The current code only distinguishes 1 and 2 in compile time, but not at runtime.
Made runtime distinguish 1 and 2 too.

Reviewed By: browneee

Differential Revision: https://reviews.llvm.org/D105128
compiler-rt/include/sanitizer/dfsan_interface.h
compiler-rt/lib/dfsan/dfsan.cpp
compiler-rt/lib/dfsan/done_abilist.txt
compiler-rt/test/dfsan/dfsan_get_track_origins.c [new file with mode: 0644]
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
llvm/test/Instrumentation/DataFlowSanitizer/basic.ll