dfsan.h revision fa9f5aef0583535f3ac1fa444f2cf62db324537e
1//===-- dfsan.h -------------------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of DataFlowSanitizer.
11//
12// Private DFSan header.
13//===----------------------------------------------------------------------===//
14
15#ifndef DFSAN_H
16#define DFSAN_H
17
18#include "sanitizer/dfsan_interface.h"
19
20namespace __dfsan {
21
22inline dfsan_label *shadow_for(void *ptr) {
23  return (dfsan_label *) ((((uintptr_t) ptr) & ~0x700000000000) << 1);
24}
25
26inline const dfsan_label *shadow_for(const void *ptr) {
27  return shadow_for(const_cast<void *>(ptr));
28}
29
30}  // namespace __dfsan
31
32#endif  // DFSAN_H
33