[HWAsan][NewPM] Handle hwasan like other sanitizers
authorArthur Eubanks <aeubanks@google.com>
Tue, 6 Oct 2020 23:13:50 +0000 (16:13 -0700)
committerArthur Eubanks <aeubanks@google.com>
Thu, 8 Oct 2020 21:43:21 +0000 (14:43 -0700)
commitafff74e5c26fd8b57968ae111a2a4fc8fc8deda8
treef3e16f91ab97994fd87afc7dc433d53829495398
parent97e7fbb343e2a4ea913686254105b9965c5468f8
[HWAsan][NewPM] Handle hwasan like other sanitizers

Move it as an EP callback (-O[123]) or in addSanitizersAtO0.

This makes it not run in ThinLTO pre-link (like the other sanitizers),
so don't check LTO runs in hwasan-new-pm.c. Changing its position also
seems to change the generated IR. I think we just need to make sure the
pass runs.

Reviewed By: leonardchan

Differential Revision: https://reviews.llvm.org/D88936
clang/lib/CodeGen/BackendUtil.cpp
clang/test/CodeGen/hwasan-new-pm.c