summaryrefslogtreecommitdiff
path: root/gcc/asan.h
diff options
context:
space:
mode:
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-12 15:51:13 +0000
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-12 15:51:13 +0000
commitb92cccf41deffcfc22bb55557399efe1acb60c60 (patch)
treeb87fd787f6078b7ba49ca0fefd8a3b30b94d2db9 /gcc/asan.h
parent9cdc1fbd4c6423a816005a054d800111e7180348 (diff)
downloadgcc-b92cccf41deffcfc22bb55557399efe1acb60c60.tar.gz
Initial import of asan from the Google branch
This patch imports the initial state of asan as it was in the Google branch. It provides basic infrastructure for asan to instrument memory accesses on the heap, at -O3. Note that it supports neither stack nor global variable protection. The rest of the patches of the set is intended to further improve this base. gcc/ChangeLog * Makefile.in: Add asan.c and its dependencies. * common.opt: Add -faddress-sanitizer option. * invoke.texi: Document the new flag. * passes.c: Add the asan pass. * toplev.c (compile_file): Call asan_finish_file. * asan.c: New file. * asan.h: New file. * tree-pass.h: Declare pass_asan. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193432 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/asan.h')
-rw-r--r--gcc/asan.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/asan.h b/gcc/asan.h
new file mode 100644
index 00000000000..590cf359bd2
--- /dev/null
+++ b/gcc/asan.h
@@ -0,0 +1,26 @@
+/* AddressSanitizer, a fast memory error detector.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Kostya Serebryany <kcc@google.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef TREE_ASAN
+#define TREE_ASAN
+
+extern void asan_finish_file(void);
+
+#endif /* TREE_ASAN */