diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-17 23:11:54 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-17 23:11:54 +0000 |
commit | af84ec0a9612261a56085aa48b4cce3f06cb8805 (patch) | |
tree | 28d26398aa148f35677411470f85de216c465928 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | afe16a71f77798be1314e046585367c5aca0d2d1 (diff) | |
download | bcm5719-llvm-af84ec0a9612261a56085aa48b4cce3f06cb8805.tar.gz bcm5719-llvm-af84ec0a9612261a56085aa48b4cce3f06cb8805.zip |
Introduce option -Wargument-larger-than[=N] which warns about function definitions if they take by-value
or return by-value any POD that is larger than some threshold (default is 64 bytes).
Implements rdar://8548050.
llvm-svn: 119583
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b20520bbeea..466dfbd9af4 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1373,6 +1373,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.MathErrno = Args.hasArg(OPT_fmath_errno); Opts.InstantiationDepth = Args.getLastArgIntValue(OPT_ftemplate_depth, 1024, Diags); + Opts.ArgumentLargerThan = Args.getLastArgIntValue(OPT_Wargument_larger_than, + 0, Diags); Opts.NeXTRuntime = !Args.hasArg(OPT_fgnu_runtime); Opts.ObjCConstantStringClass = Args.getLastArgValue(OPT_fconstant_string_class); |