From d9c34b0e0b60d2a27f89c3afe7f6b99964d1f127 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 30 Jun 2020 15:28:27 +0100 Subject: [PATCH] Pass MDFieldPrinter::printAPInt APInt arg by reference not value. Noticed by clang-tidy performance-unnecessary-value-param warning. --- lib/IR/AsmWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index 6930ad85796..d408d7a4705 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -1654,7 +1654,7 @@ struct MDFieldPrinter { bool ShouldSkipNull = true); template void printInt(StringRef Name, IntTy Int, bool ShouldSkipZero = true); - void printAPInt(StringRef Name, APInt Int, bool IsUnsigned, + void printAPInt(StringRef Name, const APInt &Int, bool IsUnsigned, bool ShouldSkipZero); void printBool(StringRef Name, bool Value, Optional Default = None); void printDIFlags(StringRef Name, DINode::DIFlags Flags); @@ -1731,8 +1731,8 @@ void MDFieldPrinter::printInt(StringRef Name, IntTy Int, bool ShouldSkipZero) { Out << FS << Name << ": " << Int; } -void MDFieldPrinter::printAPInt(StringRef Name, APInt Int, bool IsUnsigned, - bool ShouldSkipZero) { +void MDFieldPrinter::printAPInt(StringRef Name, const APInt &Int, + bool IsUnsigned, bool ShouldSkipZero) { if (ShouldSkipZero && Int.isNullValue()) return;