Skip to content

Commit ea85345

Browse files
authored
[RISCV][NFC] Use raw_svector_ostream to construct key of SubtargetMap (#72964)
To simplify some code.
1 parent 8859a4f commit ea85345

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,8 @@ RISCVTargetMachine::getSubtargetImpl(const Function &F) const {
213213
llvm::bit_floor((RVVBitsMax < 64 || RVVBitsMax > 65536) ? 0 : RVVBitsMax);
214214

215215
SmallString<512> Key;
216-
Key += "RVVMin";
217-
Key += std::to_string(RVVBitsMin);
218-
Key += "RVVMax";
219-
Key += std::to_string(RVVBitsMax);
220-
Key += CPU;
221-
Key += TuneCPU;
222-
Key += FS;
216+
raw_svector_ostream(Key) << "RVVMin" << RVVBitsMin << "RVVMax" << RVVBitsMax
217+
<< CPU << TuneCPU << FS;
223218
auto &I = SubtargetMap[Key];
224219
if (!I) {
225220
// This needs to be done before we create a new subtarget since any

0 commit comments

Comments
 (0)