Add experimental clang/driver flag -fsanitize-address-field-padding=N

Summary:
This change adds an experimental flag -fsanitize-address-field-padding=N (0, 1, 2)
to clang and driver. With this flag ASAN will be able to detect some cases of
intra-object-overflow bugs,
see https://code.google.com/p/address-sanitizer/wiki/IntraObjectOverflow

There is no actual functionality here yet, just the flag parsing.
The functionality is being reviewed at http://reviews.llvm.org/D5687

Test Plan: Build and run SPEC, LLVM Bootstrap, Chrome with this flag.

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5676

llvm-svn: 219417
This commit is contained in:
Kostya Serebryany
2014-10-09 17:53:04 +00:00
parent cb34fd09cd
commit aed71a89bc
6 changed files with 34 additions and 1 deletions

View File

@@ -1628,6 +1628,9 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
break;
}
}
// -fsanitize-address-field-padding=N has to be a LangOpt, parse it here.
Opts.Sanitize.SanitizeAddressFieldPadding =
getLastArgIntValue(Args, OPT_fsanitize_address_field_padding, 0, Diags);
}
static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,