r263429 - [Frontend] Disable value name discarding for all sanitizers.
Alexey Samsonov via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 14 16:41:33 PDT 2016
On Mon, Mar 14, 2016 at 9:50 AM, Richard Smith via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> On 14 Mar 2016 6:28 a.m., "Benjamin Kramer via cfe-commits" <
> cfe-commits at lists.llvm.org> wrote:
> >
> > Author: d0k
> > Date: Mon Mar 14 08:23:58 2016
> > New Revision: 263429
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=263429&view=rev
> > Log:
> > [Frontend] Disable value name discarding for all sanitizers.
> >
> > ASan also relies on names on allocas and will emit unhelpful output if
> > they're not present. Just force-enable value names for now. Should
> > unbreak release builds of asan.
> >
> > Modified:
> > cfe/trunk/lib/Frontend/CompilerInvocation.cpp
> >
> > Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=263429&r1=263428&r2=263429&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
> > +++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Mar 14 08:23:58
> 2016
> > @@ -541,6 +541,7 @@ static bool ParseCodeGenArgs(CodeGenOpti
> > Opts.DisableFPElim =
> > (Args.hasArg(OPT_mdisable_fp_elim) || Args.hasArg(OPT_pg));
> > Opts.DisableFree = Args.hasArg(OPT_disable_free);
> > + Opts.DiscardValueNames = Args.hasArg(OPT_discard_value_names);
> > Opts.DisableTailCalls = Args.hasArg(OPT_mdisable_tail_calls);
> > Opts.FloatABI = Args.getLastArgValue(OPT_mfloat_abi);
> > if (Arg *A = Args.getLastArg(OPT_meabi)) {
> > @@ -793,12 +794,6 @@ static bool ParseCodeGenArgs(CodeGenOpti
> > Opts.CudaGpuBinaryFileNames =
> > Args.getAllArgValues(OPT_fcuda_include_gpubinary);
> >
> > - // DiscardValueNames is set here so that it can depend (perhaps
> temporarily)
> > - // on other options.
> > - // We check SanitizeMemoryTrackOrigins here because the backend pass
> depends
> > - // on the name of the alloca in order to print out names.
> > - Opts.DiscardValueNames =
> > - Args.hasArg(OPT_discard_value_names) &&
> !Opts.SanitizeMemoryTrackOrigins;
> > return Success;
> > }
> >
> > @@ -2158,6 +2153,12 @@ bool CompilerInvocation::CreateFromArgs(
> > if (Res.getFrontendOpts().ProgramAction == frontend::RewriteObjC)
> > Res.getLangOpts()->ObjCExceptions = 1;
> > }
> > +
> > + // FIXME: Override value name discarding when sanitizers are used
> because the
> > + // backend passes depend on the name of the alloca in order to print
> out
> > + // names.
> > + Res.getCodeGenOpts().DiscardValueNames &=
> Res.getLangOpts()->Sanitize.empty();
>
> This should not be applied to all sanitizers. UBSan checks have no need of
> this (there is no backend pass).
>
+1. IIRC we only use it in ASan/MSan.
> > // FIXME: ParsePreprocessorArgs uses the FileManager to read the
> contents of
> > // PCH file and find the original header name. Remove the need to do
> that in
> > // ParsePreprocessorArgs and remove the FileManager
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
--
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160314/8f389693/attachment-0001.html>
More information about the cfe-commits
mailing list