2013-08-13 07:51:33 +08:00
|
|
|
//===-- 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 {
|
|
|
|
|
2013-08-16 05:18:53 +08:00
|
|
|
void InitializeInterceptors();
|
|
|
|
|
2013-08-13 07:51:33 +08:00
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2013-09-10 09:51:35 +08:00
|
|
|
struct Flags {
|
|
|
|
// Whether to warn on unimplemented functions.
|
|
|
|
bool warn_unimplemented;
|
|
|
|
// Whether to warn on non-zero labels.
|
|
|
|
bool warn_nonzero_labels;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern Flags flags_data;
|
|
|
|
inline Flags &flags() {
|
|
|
|
return flags_data;
|
|
|
|
}
|
|
|
|
|
2013-08-13 07:51:33 +08:00
|
|
|
} // namespace __dfsan
|
|
|
|
|
|
|
|
#endif // DFSAN_H
|