[clang] Return `std::string_view` from `TargetInfo::getClobbers()`
authorStoorx <me@stoorx.one>
Fri, 21 Apr 2023 14:33:15 +0000 (17:33 +0300)
committerStoorx <me@stoorx.one>
Mon, 24 Apr 2023 09:16:54 +0000 (12:16 +0300)
commit42d758bfa690d898918816509490a55bc50779df
treedad82c91e886c85e3dc25391956fd67d0bd75d67
parent368112e2024aabc91592cd21347968787919f044
[clang] Return `std::string_view` from `TargetInfo::getClobbers()`

Change the return type of `getClobbers` function from `const char*`
to `std::string_view`. Update the function usages in CodeGen module.

The reasoning of these changes is to remove unsafe `const char*`
strings and prevent unnecessary allocations for constructing the
`std::string` in usages of `getClobbers()` function.

Differential Revision: https://reviews.llvm.org/D148799
33 files changed:
clang/include/clang/Basic/TargetInfo.h
clang/lib/Basic/Targets/AArch64.cpp
clang/lib/Basic/Targets/AArch64.h
clang/lib/Basic/Targets/AMDGPU.h
clang/lib/Basic/Targets/ARC.h
clang/lib/Basic/Targets/ARM.cpp
clang/lib/Basic/Targets/ARM.h
clang/lib/Basic/Targets/AVR.h
clang/lib/Basic/Targets/BPF.h
clang/lib/Basic/Targets/CSKY.h
clang/lib/Basic/Targets/DirectX.h
clang/lib/Basic/Targets/Hexagon.h
clang/lib/Basic/Targets/Lanai.h
clang/lib/Basic/Targets/Le64.h
clang/lib/Basic/Targets/LoongArch.h
clang/lib/Basic/Targets/M68k.cpp
clang/lib/Basic/Targets/M68k.h
clang/lib/Basic/Targets/MSP430.h
clang/lib/Basic/Targets/Mips.h
clang/lib/Basic/Targets/NVPTX.h
clang/lib/Basic/Targets/PNaCl.h
clang/lib/Basic/Targets/PPC.h
clang/lib/Basic/Targets/RISCV.h
clang/lib/Basic/Targets/SPIR.h
clang/lib/Basic/Targets/Sparc.h
clang/lib/Basic/Targets/SystemZ.h
clang/lib/Basic/Targets/TCE.h
clang/lib/Basic/Targets/VE.h
clang/lib/Basic/Targets/WebAssembly.h
clang/lib/Basic/Targets/X86.h
clang/lib/Basic/Targets/XCore.h
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/CodeGen/CGStmt.cpp