forked from OSchip/llvm-project
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:
parent
a9591b5880
commit
0327866a53
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue