diff options
author | Kostya Serebryany <kcc@google.com> | 2011-11-16 17:34:26 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2011-11-16 17:34:26 +0000 |
commit | 1b4eca67e073f0beefb9924cbe6c65427869f1fa (patch) | |
tree | d2dc203e793641cc474ee71969ceadd07d24f0ac /include | |
parent | 2ad226bdc847df6b6b6e4f832856478ab63bb3dc (diff) |
Add -f[no-]address-sanitizer flag
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Driver/CC1Options.td | 2 | ||||
-rw-r--r-- | include/clang/Driver/Options.td | 2 | ||||
-rw-r--r-- | include/clang/Frontend/CodeGenOptions.h | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index ae97341872..c8f4a1d77e 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -114,6 +114,8 @@ def fdebug_compilation_dir : Separate<"-fdebug-compilation-dir">, HelpText<"The compilation directory to embed in the debug info.">; def dwarf_debug_flags : Separate<"-dwarf-debug-flags">, HelpText<"The string to embed in the Dwarf debug flags record.">; +def faddress_sanitizer: Flag<"-faddress-sanitizer">, + HelpText<"Enable AddressSanitizer instrumentation (memory error detection)">; def fforbid_guard_variables : Flag<"-fforbid-guard-variables">, HelpText<"Emit an error if a C++ static local initializer would need a guard variable">; def g : Flag<"-g">, HelpText<"Generate source level debug information">; diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 1e2274a8b7..1cda33d758 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -262,6 +262,8 @@ def faccess_control : Flag<"-faccess-control">, Group<f_Group>; def fallow_unsupported : Flag<"-fallow-unsupported">, Group<f_Group>; def fapple_kext : Flag<"-fapple-kext">, Group<f_Group>; def fapple_pragma_pack : Flag<"-fapple-pragma-pack">, Group<f_Group>; +def faddress_sanitizer : Flag<"-faddress-sanitizer">, Group<f_Group>; +def fno_address_sanitizer : Flag<"-fno-address-sanitizer">, Group<f_Group>; def fasm : Flag<"-fasm">, Group<f_Group>; def fasm_blocks : Flag<"-fasm-blocks">, Group<f_Group>; diff --git a/include/clang/Frontend/CodeGenOptions.h b/include/clang/Frontend/CodeGenOptions.h index 9962ea8cf9..80720d4e36 100644 --- a/include/clang/Frontend/CodeGenOptions.h +++ b/include/clang/Frontend/CodeGenOptions.h @@ -35,6 +35,7 @@ public: Mixed = 2 }; + unsigned AddressSanitizer : 1; /// Enable AddressSanitizer. unsigned AsmVerbose : 1; /// -dA, -fverbose-asm. unsigned ObjCAutoRefCountExceptions : 1; /// Whether ARC should be EH-safe. unsigned CUDAIsDevice : 1; /// Set when compiling for CUDA device. @@ -151,6 +152,7 @@ public: public: CodeGenOptions() { + AddressSanitizer = 0; AsmVerbose = 0; CUDAIsDevice = 0; CXAAtExit = 1; |