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.

llvm-svn: 228492
This commit is contained in:
Benjamin Kramer 2015-02-07 13:15:54 +00:00
parent a9591b5880
commit 0327866a53
2 changed files with 3 additions and 3 deletions

View File

@ -2342,7 +2342,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI,
}
if (!RetDbgLoc.isUnknown())
Ret->setDebugLoc(RetDbgLoc);
Ret->setDebugLoc(std::move(RetDbgLoc));
}
static bool isInAllocaArgument(CGCXXABI &ABI, QualType type) {

View File

@ -93,7 +93,7 @@ ApplyDebugLocation::ApplyDebugLocation(CodeGenFunction &CGF, llvm::DebugLoc Loc)
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