This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Fix DenseMap for compiler-rt
ClosedPublic

Authored by vitalybuka on Nov 16 2021, 5:24 PM.

Diff Detail

Event Timeline

vitalybuka created this revision.Nov 16 2021, 5:24 PM
vitalybuka requested review of this revision.Nov 16 2021, 5:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2021, 5:24 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

fix missed tests

dvyukov accepted this revision.Nov 16 2021, 11:09 PM
dvyukov added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_dense_map.h
73

Now it's more reasonable to rename Val to Key.

78

Now it's more reasonable to rename Val to Key.

84

Now it's more reasonable to rename Val to Key.

287

I think we can use existing RoundUpToPowerOfTwo here.

622

I think we can use existing RoundUpToPowerOfTwo here if remove - 1.

This revision is now accepted and ready to land.Nov 16 2021, 11:09 PM
melver accepted this revision.Nov 17 2021, 2:42 AM
melver added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_dense_map.h
80

If the header <type_traits> is safe to use from compiler-rt, we could static_assert(is_trivially_destructible<ValueT>....).

448

I think there's no reason for us to loose perfect forwarding.

We just have to open-code forward/move, like we already do for New() in compiler-rt/lib/tsan/rtl/tsan_mman.h.

This means we should also be able to provide emplace().

vitalybuka marked 6 inline comments as done.

use type_traits

compiler-rt/lib/sanitizer_common/sanitizer_dense_map.h
80

I copied some stuff into sanitizer_type_traits.h and supported non trivially copiable/destructable types

This revision was landed with ongoing or failed builds.Nov 17 2021, 7:10 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2021, 7:10 PM