summaryrefslogtreecommitdiff
path: root/lib/ubsan/ubsan_type_hash.h
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-10-25 02:07:02 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-10-25 02:07:02 +0000
commiteda8bd0fc07df35c9ad7de5b698bb717b063e7af (patch)
tree690537502017b0dd5d9aa795998595e6b07ff5f0 /lib/ubsan/ubsan_type_hash.h
parenta69eb9a1a0b111a4776a9bd727f4d551ec308261 (diff)
-fcatch-undefined-behavior checking for appropriate vptr value: library side.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@166660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan/ubsan_type_hash.h')
-rw-r--r--lib/ubsan/ubsan_type_hash.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/ubsan/ubsan_type_hash.h b/lib/ubsan/ubsan_type_hash.h
new file mode 100644
index 000000000..982ebdfbc
--- /dev/null
+++ b/lib/ubsan/ubsan_type_hash.h
@@ -0,0 +1,29 @@
+//===-- ubsan_type_hash.h ---------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Hashing of types for Clang's undefined behavior checker.
+//
+//===----------------------------------------------------------------------===//
+#ifndef UBSAN_TYPE_HASH_H
+#define UBSAN_TYPE_HASH_H
+
+#include "sanitizer_common/sanitizer_common.h"
+
+namespace __ubsan {
+
+typedef uptr HashValue;
+
+/// \brief Check whether the dynamic type of \p Object has a \p Type subobject
+/// at offset 0.
+/// \return \c true if the type matches, \c false if not.
+bool checkDynamicType(void *Object, void *Type, HashValue CacheSlot);
+
+} // namespace __ubsan
+
+#endif // UBSAN_TYPE_HASH_H