This is an archive of the discontinued LLVM Phabricator instance.

Fix logic for generating llvm.type.test()s
ClosedPublic

Authored by vlad.tsyrklevich on Jul 28 2017, 12:18 PM.

Details

Summary

CodeGenFunction::EmitTypeMetadataCodeForVCall() could output an llvm.assume(llvm.type.test())when CFI was enabled, optimizing out the vcall check. This case was only reached when: 1) CFI-vcall was enabled, 2) -fwhole-program-tables was specified, and 3) -fno-sanitize-trap=cfi-vcall was specified.

This change is blocked on D36012 as it uncovers that bug.

Diff Detail

Event Timeline

pcc accepted this revision.Jul 28 2017, 1:13 PM

LGTM

test/CodeGenCXX/cfi-vcall-no-trap.cpp
3

I don't think you need the -cc1 here, it should be implied by %clang_cc1.

11

I'd also test for presence of llvm.type.test to make sure that we're following the non-trapping CFI code path.

This revision is now accepted and ready to land.Jul 28 2017, 1:13 PM
vlad.tsyrklevich marked 2 inline comments as done.
This revision was automatically updated to reflect the committed changes.