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