1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

Pass DIEnumerator APInt args by const reference not value.

Noticed by clang-tidy performance-unnecessary-value-param warning.
This commit is contained in:
Simon Pilgrim 2020-07-01 13:07:35 +01:00
parent 91403d8b4a
commit 7783603535
2 changed files with 4 additions and 4 deletions

View File

@ -359,7 +359,7 @@ class DIEnumerator : public DINode {
friend class MDNode;
APInt Value;
DIEnumerator(LLVMContext &C, StorageType Storage, APInt Value,
DIEnumerator(LLVMContext &C, StorageType Storage, const APInt &Value,
bool IsUnsigned, ArrayRef<Metadata *> Ops)
: DINode(C, DIEnumeratorKind, Storage, dwarf::DW_TAG_enumerator, Ops),
Value(Value) {
@ -371,13 +371,13 @@ class DIEnumerator : public DINode {
Ops) {}
~DIEnumerator() = default;
static DIEnumerator *getImpl(LLVMContext &Context, APInt Value,
static DIEnumerator *getImpl(LLVMContext &Context, const APInt &Value,
bool IsUnsigned, StringRef Name,
StorageType Storage, bool ShouldCreate = true) {
return getImpl(Context, Value, IsUnsigned,
getCanonicalMDString(Context, Name), Storage, ShouldCreate);
}
static DIEnumerator *getImpl(LLVMContext &Context, APInt Value,
static DIEnumerator *getImpl(LLVMContext &Context, const APInt &Value,
bool IsUnsigned, MDString *Name,
StorageType Storage, bool ShouldCreate = true);

View File

@ -435,7 +435,7 @@ DISubrange::BoundType DISubrange::getStride() const {
return BoundType();
}
DIEnumerator *DIEnumerator::getImpl(LLVMContext &Context, APInt Value,
DIEnumerator *DIEnumerator::getImpl(LLVMContext &Context, const APInt &Value,
bool IsUnsigned, MDString *Name,
StorageType Storage, bool ShouldCreate) {
assert(isCanonical(Name) && "Expected canonical MDString");