diff options
author | Mike Stump <mrs@apple.com> | 2009-12-12 01:27:46 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-12-12 01:27:46 +0000 |
commit | 9c276ae0f24d4cee8f7954069d4b8eae45d0447d (patch) | |
tree | 967ccefb7c10869562faaa2dd6f5b9feb43c8ce7 /lib/Frontend/PCHReader.cpp | |
parent | 498eb7ece2a5699e215acf071040de27d7882931 (diff) |
Implement runtime checks for undefined behavior. WIP.
This implements a new flag -fcatch-undefined-behavior. The flag turns
on additional runtime checks for:
T a[I];
a[i] abort when i < 0 or i >= I.
Future stuff includes shifts by >= bitwidth amounts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index aae201400d..58209c8701 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -116,6 +116,7 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) { diag::warn_pch_stack_protector); PARSE_LANGOPT_BENIGN(InstantiationDepth); PARSE_LANGOPT_IMPORTANT(OpenCL, diag::warn_pch_opencl); + PARSE_LANGOPT_BENIGN(CatchUndefined); PARSE_LANGOPT_IMPORTANT(ElideConstructors, diag::warn_pch_elide_constructors); #undef PARSE_LANGOPT_IRRELEVANT #undef PARSE_LANGOPT_BENIGN @@ -1719,6 +1720,8 @@ bool PCHReader::ParseLanguageOptions( ++Idx; PARSE_LANGOPT(InstantiationDepth); PARSE_LANGOPT(OpenCL); + PARSE_LANGOPT(CatchUndefined); + // FIXME: Missing ElideConstructors?! #undef PARSE_LANGOPT return Listener->ReadLanguageOptions(LangOpts); |