r246991 - When building the alloca for a local variable, set its name
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 8 08:25:58 PDT 2015
On Tue, Sep 8, 2015 at 2:18 AM, John McCall via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> Author: rjmccall
> Date: Tue Sep 8 04:18:30 2015
> New Revision: 246991
>
> URL: http://llvm.org/viewvc/llvm-project?rev=246991&view=rev
> Log:
> When building the alloca for a local variable, set its name
> separately from building the instruction so that it's
> preserved even in -Asserts builds.
>
Why do we want to preserve this name in particular in -Asserts builds?
>
> Employ C++'s mystical "comment" feature to discourage
> breaking this in the future.
>
> Modified:
> cfe/trunk/lib/CodeGen/CGDecl.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=246991&r1=246990&r2=246991&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDecl.cpp Tue Sep 8 04:18:30 2015
> @@ -968,7 +968,11 @@ CodeGenFunction::EmitAutoVarAlloca(const
> allocaAlignment = alignment;
> }
>
> - address = CreateTempAlloca(allocaTy, allocaAlignment, D.getName());
> + // Create the alloca. Note that we set the name separately from
> + // building the instruction so that it's there even in no-asserts
> + // builds.
> + address = CreateTempAlloca(allocaTy, allocaAlignment);
> + address.getPointer()->setName(D.getName());
>
> // Emit a lifetime intrinsic if meaningful. There's no point
> // in doing this if we don't have a valid insertion point (?).
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150908/db83569d/attachment-0001.html>
More information about the cfe-commits
mailing list