Skip to content

Commit 71b69dd

Browse files
authored
[WebAssembly] Pass ArrayRef by value (NFC) (#85732)
`ArrayRef` is supposed to be passed by value: https://github.com/llvm/llvm-project/blob/bda05140fb758156ae35f3919e6283d94bfa3905/llvm/include/llvm/ADT/ArrayRef.h#L38-L39
1 parent 3176c15 commit 71b69dd

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ wasm::ValType WebAssembly::toValType(MVT Type) {
6363
}
6464

6565
void WebAssembly::wasmSymbolSetType(MCSymbolWasm *Sym, const Type *GlobalVT,
66-
const ArrayRef<MVT> &VTs) {
66+
ArrayRef<MVT> VTs) {
6767
assert(!Sym->getType());
6868

6969
// Tables are represented as Arrays in LLVM IR therefore

llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ wasm::ValType toValType(MVT Type);
6060

6161
/// Sets a Wasm Symbol Type.
6262
void wasmSymbolSetType(MCSymbolWasm *Sym, const Type *GlobalVT,
63-
const ArrayRef<MVT> &VTs);
63+
ArrayRef<MVT> VTs);
6464

6565
} // end namespace WebAssembly
6666
} // end namespace llvm

llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void llvm::computeSignatureVTs(const FunctionType *Ty,
105105
}
106106
}
107107

108-
void llvm::valTypesFromMVTs(const ArrayRef<MVT> &In,
108+
void llvm::valTypesFromMVTs(ArrayRef<MVT> In,
109109
SmallVectorImpl<wasm::ValType> &Out) {
110110
for (MVT Ty : In)
111111
Out.push_back(WebAssembly::toValType(Ty));

llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ void computeSignatureVTs(const FunctionType *Ty, const Function *TargetFunc,
169169
SmallVectorImpl<MVT> &Params,
170170
SmallVectorImpl<MVT> &Results);
171171

172-
void valTypesFromMVTs(const ArrayRef<MVT> &In,
173-
SmallVectorImpl<wasm::ValType> &Out);
172+
void valTypesFromMVTs(ArrayRef<MVT> In, SmallVectorImpl<wasm::ValType> &Out);
174173

175174
std::unique_ptr<wasm::WasmSignature>
176175
signatureFromMVTs(const SmallVectorImpl<MVT> &Results,

llvm/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ buildVRegToDbgValueMap(MachineFunction &MF, const LiveIntervals *Liveness) {
129129
// changes.
130130
static void undefInvalidDbgValues(
131131
const LiveIntervals *Liveness,
132-
const ArrayRef<SmallVector<LiveInterval *, 4>> &Assignments,
132+
ArrayRef<SmallVector<LiveInterval *, 4>> Assignments,
133133
DenseMap<Register, std::vector<std::pair<SlotIndex, MachineInstr *>>>
134134
&DbgVRegToValues) {
135135
#ifndef NDEBUG

0 commit comments

Comments
 (0)