diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-07 13:15:54 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-07 13:15:54 +0000 |
| commit | 0327866a53ed11e4d73999f4dd7a32f500a6e40c (patch) | |
| tree | 24b583021f21ce6826a2457502e495be6681e651 /clang/lib | |
| parent | a9591b5880261dd0d379ab09672991d8db12c66c (diff) | |
| download | bcm5719-llvm-0327866a53ed11e4d73999f4dd7a32f500a6e40c.tar.gz bcm5719-llvm-0327866a53ed11e4d73999f4dd7a32f500a6e40c.zip | |
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
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index b0b30a6133a..3c296ae4681 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -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) { diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index c5f358f7a1b..530797d15bf 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -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 |

