PR c++/85305 - pack in lambda init-capture.
[official-gcc.git] / libsanitizer / ubsan / ubsan_type_hash.cc
blob65160aa4abac8e3c36b6013353f6b99af71cb1be
1 //===-- ubsan_type_hash.cc ------------------------------------------------===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // Implementation of a hash table for fast checking of inheritance
9 // relationships. This file is only linked into C++ compilations, and is
10 // permitted to use language features which require a C++ ABI library.
12 // Most of the implementation lives in an ABI-specific source file
13 // (ubsan_type_hash_{itanium,win}.cc).
15 //===----------------------------------------------------------------------===//
17 #include "ubsan_platform.h"
18 #if CAN_SANITIZE_UB
19 #include "ubsan_type_hash.h"
21 #include "sanitizer_common/sanitizer_common.h"
23 /// A cache of recently-checked hashes. Mini hash table with "random" evictions.
24 __ubsan::HashValue
25 __ubsan::__ubsan_vptr_type_cache[__ubsan::VptrTypeCacheSize];
27 __ubsan::DynamicTypeInfo __ubsan::getDynamicTypeInfoFromObject(void *Object) {
28 void *VtablePtr = *reinterpret_cast<void **>(Object);
29 return getDynamicTypeInfoFromVtable(VtablePtr);
32 #endif // CAN_SANITIZE_UB