Pass DebugLoc::appendInlinedAt DebugLoc arg by const reference not value.

Noticed by clang-tidy performance-unnecessary-value-param warning.
This commit is contained in:
Simon Pilgrim 2020-07-01 14:04:01 +01:00
parent d36f2c6a6c
commit 0ae989a1fe
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ namespace llvm {
/// the chain now is inlined-at the new call site.
/// \param InlinedAt The new outermost inlined-at in the chain.
/// \param ReplaceLast Replace the last location in the inlined-at chain.
static DebugLoc appendInlinedAt(DebugLoc DL, DILocation *InlinedAt,
static DebugLoc appendInlinedAt(const DebugLoc &DL, DILocation *InlinedAt,
LLVMContext &Ctx,
DenseMap<const MDNode *, MDNode *> &Cache,
bool ReplaceLast = false);

View File

@ -79,7 +79,7 @@ DebugLoc DebugLoc::get(unsigned Line, unsigned Col, const MDNode *Scope,
const_cast<MDNode *>(InlinedAt), ImplicitCode);
}
DebugLoc DebugLoc::appendInlinedAt(DebugLoc DL, DILocation *InlinedAt,
DebugLoc DebugLoc::appendInlinedAt(const DebugLoc &DL, DILocation *InlinedAt,
LLVMContext &Ctx,
DenseMap<const MDNode *, MDNode *> &Cache,
bool ReplaceLast) {