r228492 - CodeGen: Move DebugLocs.
David Blaikie
dblaikie at gmail.com
Sat Feb 7 09:39:56 PST 2015
On Feb 7, 2015 5:20 AM, "Benjamin Kramer" <benny.kra at googlemail.com> wrote:
>
> Author: d0k
> Date: Sat Feb 7 07:15:54 2015
> New Revision: 228492
>
> URL: http://llvm.org/viewvc/llvm-project?rev=228492&view=rev
> Log:
> CodeGen: Move DebugLocs.
>
> It's slightly cheaper than copying it, if the DebugLoc points to
replaceable
> metadata every copy is recorded in a DenseMap, moving reduces the peak
size of
> that map.
Thanks! I'll try to keep that in mind.
>
> Modified:
> cfe/trunk/lib/CodeGen/CGCall.cpp
> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
> URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=228492&r1=228491&r2=228492&view=diff
>
==============================================================================
> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Sat Feb 7 07:15:54 2015
> @@ -2342,7 +2342,7 @@ void CodeGenFunction::EmitFunctionEpilog
> }
>
> if (!RetDbgLoc.isUnknown())
> - Ret->setDebugLoc(RetDbgLoc);
> + Ret->setDebugLoc(std::move(RetDbgLoc));
> }
>
> static bool isInAllocaArgument(CGCXXABI &ABI, QualType type) {
>
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=228492&r1=228491&r2=228492&view=diff
>
==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Sat Feb 7 07:15:54 2015
> @@ -93,7 +93,7 @@ ApplyDebugLocation::ApplyDebugLocation(C
> if (CGF.getDebugInfo()) {
> OriginalLocation = CGF.Builder.getCurrentDebugLocation();
> if (!Loc.isUnknown())
> - CGF.Builder.SetCurrentDebugLocation(Loc);
> + CGF.Builder.SetCurrentDebugLocation(std::move(Loc));
> }
> }
>
> @@ -101,7 +101,7 @@ ApplyDebugLocation::~ApplyDebugLocation(
> // Query CGF so the location isn't overwritten when location updates
are
> // temporarily disabled (for C++ default function arguments)
> if (CGF.getDebugInfo())
> - CGF.Builder.SetCurrentDebugLocation(OriginalLocation);
> + CGF.Builder.SetCurrentDebugLocation(std::move(OriginalLocation));
> }
>
> /// ArtificialLocation - An RAII object that temporarily switches to
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150207/dac2b149/attachment.html>
More information about the cfe-commits
mailing list