diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2013-08-12 23:51:33 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-08-12 23:51:33 +0000 |
commit | fa9f5aef0583535f3ac1fa444f2cf62db324537e (patch) | |
tree | 10613e639be941f0d8bab5eaffa2578135e82ab9 /lib/dfsan/dfsan.h | |
parent | 249cdca5989af3b55e42460283ca63096aeddfeb (diff) |
[dfsan] Begin a private header and move shadow_for there.
Differential Revision: http://llvm-reviews.chandlerc.com/D1348
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/dfsan/dfsan.h')
-rw-r--r-- | lib/dfsan/dfsan.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/dfsan/dfsan.h b/lib/dfsan/dfsan.h new file mode 100644 index 000000000..873eb31a5 --- /dev/null +++ b/lib/dfsan/dfsan.h @@ -0,0 +1,32 @@ +//===-- dfsan.h -------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of DataFlowSanitizer. +// +// Private DFSan header. +//===----------------------------------------------------------------------===// + +#ifndef DFSAN_H +#define DFSAN_H + +#include "sanitizer/dfsan_interface.h" + +namespace __dfsan { + +inline dfsan_label *shadow_for(void *ptr) { + return (dfsan_label *) ((((uintptr_t) ptr) & ~0x700000000000) << 1); +} + +inline const dfsan_label *shadow_for(const void *ptr) { + return shadow_for(const_cast<void *>(ptr)); +} + +} // namespace __dfsan + +#endif // DFSAN_H |