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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228492
91177308-0d34-0410-b5e6-
96231b3b80d8
}
if (!RetDbgLoc.isUnknown())
- Ret->setDebugLoc(RetDbgLoc);
+ Ret->setDebugLoc(std::move(RetDbgLoc));
}
static bool isInAllocaArgument(CGCXXABI &ABI, QualType type) {
if (CGF.getDebugInfo()) {
OriginalLocation = CGF.Builder.getCurrentDebugLocation();
if (!Loc.isUnknown())
- CGF.Builder.SetCurrentDebugLocation(Loc);
+ CGF.Builder.SetCurrentDebugLocation(std::move(Loc));
}
}
// 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