use ref to avoid copy in range for-loop
authorWang, Xin10 <xin10.wang@intel.com>
Mon, 29 May 2023 02:23:32 +0000 (22:23 -0400)
committerWang, Xin10 <xin10.wang@intel.com>
Mon, 29 May 2023 02:24:21 +0000 (22:24 -0400)
commitfbb241c5523c07842af6cbe7a3a5a1c6513f1302
tree12d9876cc60608096b61915da198f4e37f0bfeb8
parent9032a94637981cce528f0838df4d4d474105d076
use ref to avoid copy in range for-loop

Use big obj copy in range for-loop will call copy constructor every time,
which can be avoided by use ref instead.

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D150024
llvm/include/llvm/MC/MCParser/MCAsmParser.h
llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
llvm/lib/CodeGen/MIRParser/MIRParser.cpp
llvm/lib/ObjectYAML/MachOEmitter.cpp
llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp