]> git.proxmox.com Git - rustc.git/blobdiff - src/compiler-rt/lib/dfsan/dfsan.h
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / compiler-rt / lib / dfsan / dfsan.h
index 92a1357d7c554f8a6f28da585b887be0e78a633f..df222e49bb1a113f2f757f93c392e9908a8b514f 100644 (file)
@@ -28,6 +28,7 @@ struct dfsan_label_info {
 };
 
 extern "C" {
+void dfsan_add_label(dfsan_label label, void *addr, uptr size);
 void dfsan_set_label(dfsan_label label, void *addr, uptr size);
 dfsan_label dfsan_read_label(const void *addr, uptr size);
 dfsan_label dfsan_union(dfsan_label l1, dfsan_label l2);
@@ -43,7 +44,17 @@ namespace __dfsan {
 void InitializeInterceptors();
 
 inline dfsan_label *shadow_for(void *ptr) {
+#if defined(__x86_64__)
   return (dfsan_label *) ((((uptr) ptr) & ~0x700000000000) << 1);
+#elif defined(__mips64)
+  return (dfsan_label *) ((((uptr) ptr) & ~0xF000000000) << 1);
+#elif defined(__aarch64__)
+# if SANITIZER_AARCH64_VMA == 39
+  return (dfsan_label *) ((((uptr) ptr) & ~0x7800000000) << 1);
+# elif SANITIZER_AARCH64_VMA == 42
+  return (dfsan_label *) ((((uptr) ptr) & ~0x3c000000000) << 1);
+# endif
+#endif
 }
 
 inline const dfsan_label *shadow_for(const void *ptr) {
@@ -51,15 +62,11 @@ inline const dfsan_label *shadow_for(const void *ptr) {
 }
 
 struct Flags {
-  // Whether to warn on unimplemented functions.
-  bool warn_unimplemented;
-  // Whether to warn on non-zero labels.
-  bool warn_nonzero_labels;
-  // Whether to propagate labels only when there is an obvious data dependency
-  // (e.g., when comparing strings, ignore the fact that the output of the
-  // comparison might be data-dependent on the content of the strings). This
-  // applies only to the custom functions defined in 'custom.c'.
-  bool strict_data_dependencies;
+#define DFSAN_FLAG(Type, Name, DefaultValue, Description) Type Name;
+#include "dfsan_flags.inc"
+#undef DFSAN_FLAG
+
+  void SetDefaults();
 };
 
 extern Flags flags_data;