summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-12-23 02:42:43 +0000
committerTed Kremenek <kremenek@apple.com>2010-12-23 02:42:43 +0000
commite73571b9cccdf0e3e07ab551e0cea6356047458a (patch)
treeb7b609f2c8d30e10ae740396cf465c48190d0a78 /clang/lib/Frontend/CompilerInvocation.cpp
parent0dfe4b7a46d6575ee0b67ce91a70fc257167a82a (diff)
downloadbcm5719-llvm-e73571b9cccdf0e3e07ab551e0cea6356047458a.tar.gz
bcm5719-llvm-e73571b9cccdf0e3e07ab551e0cea6356047458a.zip
Add WIP prototype of a new buffer overflow
checker based on using raw (symbolic) byte offsets from a base region. llvm-svn: 122469
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 7dbc8f23203..ba915101972 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -117,7 +117,9 @@ static void AnalyzerOptsToArgs(const AnalyzerOptions &Opts,
if (Opts.EnableExperimentalInternalChecks)
Res.push_back("-analyzer-experimental-internal-checks");
if (Opts.IdempotentOps)
- Res.push_back("-analyzer-check-idempotent-operations");
+ Res.push_back("-analyzer-check-idempotent-operations");
+ if (Opts.BufferOverflows)
+ Res.push_back("-analyzer-check-buffer-overflows");
}
static void CodeGenOptsToArgs(const CodeGenOptions &Opts,
@@ -857,6 +859,7 @@ static void ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args,
Opts.MaxLoop = Args.getLastArgIntValue(OPT_analyzer_max_loop, 4, Diags);
Opts.InlineCall = Args.hasArg(OPT_analyzer_inline_call);
Opts.IdempotentOps = Args.hasArg(OPT_analysis_WarnIdempotentOps);
+ Opts.BufferOverflows = Args.hasArg(OPT_analysis_WarnBufferOverflows);
}
static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
OpenPOWER on IntegriCloud