diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml index 461b723bd736b..6b80d4291c0ee 100644 --- a/.github/workflows/libcxx-build-and-test.yaml +++ b/.github/workflows/libcxx-build-and-test.yaml @@ -222,7 +222,7 @@ jobs: python3 -m venv .venv source .venv/bin/activate python -m pip install psutil - bash libcxx/utils/ci/run-buildbot ${{ matrix.config }} + xcrun bash libcxx/utils/ci/run-buildbot ${{ matrix.config }} - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 if: always() # Upload artifacts even if the build or test suite fails with: diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp index 07df986463690..b7cd5f6be14a6 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp @@ -1796,11 +1796,11 @@ static void findRISCVBareMetalMultilibs(const Driver &D, std::string MArch = tools::riscv::getRISCVArch(Args, TargetTriple); for (auto Element : RISCVMultilibSet) { addMultilibFlag(MArch == Element.march, - Twine("-march=", Element.march).str().c_str(), Flags); + Twine("-march=", Element.march).str(), Flags); if (!Added_ABIs.count(Element.mabi)) { Added_ABIs.insert(Element.mabi); addMultilibFlag(ABIName == Element.mabi, - Twine("-mabi=", Element.mabi).str().c_str(), Flags); + Twine("-mabi=", Element.mabi).str(), Flags); } } diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot index 57ecf1e49dbf2..d265dddebe11f 100755 --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -35,8 +35,6 @@ CC The C compiler to use, this value is used by CMake. This CXX The C++ compiler to use, this value is used by CMake. This variable is optional. -CMAKE The CMake binary to use. This variable is optional. - CLANG_FORMAT The clang-format binary to use when generating the format ignore list. @@ -73,29 +71,6 @@ MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}" BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/${BUILDER}}" INSTALL_DIR="${BUILD_DIR}/install" -# If we can find Ninja/CMake provided by Xcode, use those since we know their -# version will generally work with the Clang shipped in Xcode (e.g. if Clang -# knows about -std=c++20, the CMake bundled in Xcode will probably know about -# that flag too). -if xcrun --find ninja &>/dev/null; then - NINJA="$(xcrun --find ninja)" -elif which ninja &>/dev/null; then - # The current implementation of modules needs the absolute path to the ninja - # binary. - # TODO MODULES Is this still needed when CMake has libc++ module support? - NINJA="$(which ninja)" -else - NINJA="ninja" -fi - -if [ -z "${CMAKE}" ]; then - if xcrun --find cmake &>/dev/null; then - CMAKE="$(xcrun --find cmake)" - else - CMAKE="cmake" - fi -fi - function step() { endstep set +x @@ -129,10 +104,10 @@ function generate-cmake-base() { step "Generating CMake" # We can remove -DCMAKE_INSTALL_MESSAGE=NEVER once https://gitlab.kitware.com/cmake/cmake/-/issues/26085 is fixed. - ${CMAKE} \ + cmake \ -S "${MONOREPO_ROOT}/runtimes" \ -B "${BUILD_DIR}" \ - -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ + -GNinja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ -DLIBCXX_ENABLE_WERROR=YES \ @@ -168,25 +143,25 @@ function generate-cmake-android() { function check-runtimes() { step "Building libc++ test dependencies" - ${NINJA} -vC "${BUILD_DIR}" cxx-test-depends + ninja -vC "${BUILD_DIR}" cxx-test-depends step "Running the libc++ tests" - ${NINJA} -vC "${BUILD_DIR}" check-cxx + ninja -vC "${BUILD_DIR}" check-cxx step "Running the libc++abi tests" - ${NINJA} -vC "${BUILD_DIR}" check-cxxabi + ninja -vC "${BUILD_DIR}" check-cxxabi step "Running the libunwind tests" - ${NINJA} -vC "${BUILD_DIR}" check-unwind + ninja -vC "${BUILD_DIR}" check-unwind } # TODO: The goal is to test this against all configurations. We should also move # this to the Lit test suite instead of being a separate CMake target. function check-abi-list() { step "Running the libc++ ABI list test" - ${NINJA} -vC "${BUILD_DIR}" check-cxx-abilist || ( + ninja -vC "${BUILD_DIR}" check-cxx-abilist || ( error "Generating the libc++ ABI list after failed check" - ${NINJA} -vC "${BUILD_DIR}" generate-cxx-abilist + ninja -vC "${BUILD_DIR}" generate-cxx-abilist false ) } @@ -212,10 +187,10 @@ function test-armv7m-picolibc() { # architecture name, which is not what Clang's driver expects to find. # The install location will however be wrong with # LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON, so we correct that below. - ${CMAKE} \ + cmake \ -S "${MONOREPO_ROOT}/compiler-rt" \ -B "${BUILD_DIR}/compiler-rt" \ - -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ + -GNinja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ -DCMAKE_C_FLAGS="${flags}" \ @@ -233,7 +208,7 @@ function test-armv7m-picolibc() { "${@}" step "Installing compiler-rt" - ${NINJA} -vC "${BUILD_DIR}/compiler-rt" install + ninja -vC "${BUILD_DIR}/compiler-rt" install # Move compiler-rt libs into the same directory as all the picolib objects. mv "${INSTALL_DIR}/lib/armv7m-unknown-none-eabi"/* "${INSTALL_DIR}/lib" @@ -242,8 +217,8 @@ function test-armv7m-picolibc() { # Print the version of a few tools to aid diagnostics in some cases step "Diagnose tools in use" -${CMAKE} --version -${NINJA} --version +cmake --version +ninja --version if [ ! -z "${CXX}" ]; then ${CXX} --version; fi case "${BUILDER}" in @@ -256,7 +231,7 @@ check-generated-output) # Reject patches that forgot to re-run the generator scripts. step "Making sure the generator scripts were run" set +x # Printing all the commands below just creates extremely confusing output - ${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files + ninja -vC "${BUILD_DIR}" libcxx-generate-files git diff | tee ${BUILD_DIR}/generated_output.patch git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false @@ -383,10 +358,10 @@ bootstrapping-build) clean step "Generating CMake" - ${CMAKE} \ + cmake \ -S "${MONOREPO_ROOT}/llvm" \ -B "${BUILD_DIR}" \ - -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ + -GNinja \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ @@ -400,13 +375,13 @@ bootstrapping-build) -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" step "Running the libc++ and libc++abi tests" - ${NINJA} -vC "${BUILD_DIR}" check-runtimes + ninja -vC "${BUILD_DIR}" check-runtimes step "Installing libc++ and libc++abi to a fake location" - ${NINJA} -vC "${BUILD_DIR}" install-runtimes + ninja -vC "${BUILD_DIR}" install-runtimes step "Running the LLDB libc++ data formatter tests" - ${NINJA} -vC "${BUILD_DIR}" lldb-api-test-deps + ninja -vC "${BUILD_DIR}" lldb-api-test-deps ${BUILD_DIR}/bin/llvm-lit -sv --param dotest-args='--category libc++' "${MONOREPO_ROOT}/lldb/test/API" ccache -s @@ -572,10 +547,10 @@ apple-system|apple-system-hardened) # In the Apple system configuration, we build libc++ and libunwind separately. step "Installing libc++ and libc++abi in Apple-system configuration" - ${CMAKE} \ + cmake \ -S "${MONOREPO_ROOT}/runtimes" \ -B "${BUILD_DIR}/cxx" \ - -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ + -GNinja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}/cxx" \ -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \ @@ -588,10 +563,10 @@ apple-system|apple-system-hardened) -DLIBCXXABI_TEST_PARAMS="${params}" step "Installing libunwind in Apple-system configuration" - ${CMAKE} \ + cmake \ -S "${MONOREPO_ROOT}/runtimes" \ -B "${BUILD_DIR}/unwind" \ - -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ + -GNinja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}/unwind" \ -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \ @@ -601,13 +576,13 @@ apple-system|apple-system-hardened) -DCMAKE_INSTALL_NAME_DIR="/usr/lib/system" step "Running the libc++ tests" - ${NINJA} -vC "${BUILD_DIR}/cxx" check-cxx + ninja -vC "${BUILD_DIR}/cxx" check-cxx step "Running the libc++abi tests" - ${NINJA} -vC "${BUILD_DIR}/cxx" check-cxxabi + ninja -vC "${BUILD_DIR}/cxx" check-cxxabi step "Running the libunwind tests" - ${NINJA} -vC "${BUILD_DIR}/unwind" check-unwind + ninja -vC "${BUILD_DIR}/unwind" check-unwind ;; aarch64) clean @@ -665,13 +640,13 @@ clang-cl-dll) # setting when cmake and the test driver does the right thing automatically. generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" step "Running the libc++ tests" - ${NINJA} -vC "${BUILD_DIR}" check-cxx + ninja -vC "${BUILD_DIR}" check-cxx ;; clang-cl-static) clean generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF step "Running the libc++ tests" - ${NINJA} -vC "${BUILD_DIR}" check-cxx + ninja -vC "${BUILD_DIR}" check-cxx ;; clang-cl-no-vcruntime) clean @@ -682,14 +657,14 @@ clang-cl-no-vcruntime) generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-no-vcruntime-clangcl.cfg.in" step "Running the libc++ tests" - ${NINJA} -vC "${BUILD_DIR}" check-cxx + ninja -vC "${BUILD_DIR}" check-cxx ;; clang-cl-debug) clean generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" \ -DCMAKE_BUILD_TYPE=Debug step "Running the libc++ tests" - ${NINJA} -vC "${BUILD_DIR}" check-cxx + ninja -vC "${BUILD_DIR}" check-cxx ;; clang-cl-static-crt) clean @@ -698,7 +673,7 @@ clang-cl-static-crt) generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF \ -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded step "Running the libc++ tests" - ${NINJA} -vC "${BUILD_DIR}" check-cxx + ninja -vC "${BUILD_DIR}" check-cxx ;; mingw-dll) clean @@ -744,7 +719,7 @@ mingw-incomplete-sysroot) # Only test that building succeeds; there's not much extra value in running # the tests here, as it would be equivalent to the mingw-dll config above. step "Building the runtimes" - ${NINJA} -vC "${BUILD_DIR}" + ninja -vC "${BUILD_DIR}" ;; aix) clean @@ -781,7 +756,7 @@ android-ndk-*) -DLIBCXX_TEST_PARAMS="${PARAMS}" \ -DLIBCXXABI_TEST_PARAMS="${PARAMS}" check-abi-list - ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi + ninja -vC "${BUILD_DIR}" install-cxx install-cxxabi # Start the emulator and make sure we can connect to the adb server running # inside of it. @@ -794,9 +769,9 @@ android-ndk-*) adb shell mkdir -p /data/local/tmp/adb_run adb push "${BUILD_DIR}/lib/libc++_shared.so" /data/local/tmp/libc++/libc++_shared.so step "Running the libc++ tests" - ${NINJA} -vC "${BUILD_DIR}" check-cxx + ninja -vC "${BUILD_DIR}" check-cxx step "Running the libc++abi tests" - ${NINJA} -vC "${BUILD_DIR}" check-cxxabi + ninja -vC "${BUILD_DIR}" check-cxxabi ;; ################################################################# # Insert vendor-specific internal configurations below. diff --git a/llvm/include/llvm/ADT/StringSwitch.h b/llvm/include/llvm/ADT/StringSwitch.h index 53ebec1eb3a54..5da6076c27390 100644 --- a/llvm/include/llvm/ADT/StringSwitch.h +++ b/llvm/include/llvm/ADT/StringSwitch.h @@ -158,7 +158,7 @@ class StringSwitch { StringSwitch &EndsWithLower(StringLiteral S, T Value) { if (!Result && Str.ends_with_insensitive(S)) - Result = Value; + Result = std::move(Value); return *this; } diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp index 32f6dbefb8480..96f0b66adec92 100644 --- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp +++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp @@ -768,7 +768,7 @@ std::string LibraryScanHelper::resolveCanonical(StringRef Path, PathType LibraryScanHelper::classifyKind(StringRef Path) const { // Detect home directory const char *Home = getenv("HOME"); - if (Home && Path.find(Home) == 0) + if (Home && Path.starts_with(Home)) return PathType::User; static const std::array UserPrefixes = { @@ -780,7 +780,7 @@ PathType LibraryScanHelper::classifyKind(StringRef Path) const { }; for (const auto &Prefix : UserPrefixes) { - if (Path.find(Prefix) == 0) + if (Path.starts_with(Prefix)) return PathType::User; } diff --git a/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp index 3056251809308..5dd10f402f2ca 100644 --- a/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp +++ b/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp @@ -80,15 +80,14 @@ void ScalarEnumerationTraits::enumeration(IO &io, SymbolKind &Value) { auto SymbolNames = getSymbolTypeNames(); for (const auto &E : SymbolNames) - io.enumCase(Value, E.Name.str().c_str(), E.Value); + io.enumCase(Value, E.Name, E.Value); } void ScalarBitSetTraits::bitset(IO &io, CompileSym2Flags &Flags) { auto FlagNames = getCompileSym2FlagNames(); for (const auto &E : FlagNames) { - io.bitSetCase(Flags, E.Name.str().c_str(), - static_cast(E.Value)); + io.bitSetCase(Flags, E.Name, static_cast(E.Value)); } } @@ -96,40 +95,35 @@ void ScalarBitSetTraits::bitset(IO &io, CompileSym3Flags &Flags) { auto FlagNames = getCompileSym3FlagNames(); for (const auto &E : FlagNames) { - io.bitSetCase(Flags, E.Name.str().c_str(), - static_cast(E.Value)); + io.bitSetCase(Flags, E.Name, static_cast(E.Value)); } } void ScalarBitSetTraits::bitset(IO &io, ExportFlags &Flags) { auto FlagNames = getExportSymFlagNames(); for (const auto &E : FlagNames) { - io.bitSetCase(Flags, E.Name.str().c_str(), - static_cast(E.Value)); + io.bitSetCase(Flags, E.Name, static_cast(E.Value)); } } void ScalarBitSetTraits::bitset(IO &io, PublicSymFlags &Flags) { auto FlagNames = getPublicSymFlagNames(); for (const auto &E : FlagNames) { - io.bitSetCase(Flags, E.Name.str().c_str(), - static_cast(E.Value)); + io.bitSetCase(Flags, E.Name, static_cast(E.Value)); } } void ScalarBitSetTraits::bitset(IO &io, LocalSymFlags &Flags) { auto FlagNames = getLocalFlagNames(); for (const auto &E : FlagNames) { - io.bitSetCase(Flags, E.Name.str().c_str(), - static_cast(E.Value)); + io.bitSetCase(Flags, E.Name, static_cast(E.Value)); } } void ScalarBitSetTraits::bitset(IO &io, ProcSymFlags &Flags) { auto FlagNames = getProcSymFlagNames(); for (const auto &E : FlagNames) { - io.bitSetCase(Flags, E.Name.str().c_str(), - static_cast(E.Value)); + io.bitSetCase(Flags, E.Name, static_cast(E.Value)); } } @@ -137,15 +131,14 @@ void ScalarBitSetTraits::bitset( IO &io, FrameProcedureOptions &Flags) { auto FlagNames = getFrameProcSymFlagNames(); for (const auto &E : FlagNames) { - io.bitSetCase(Flags, E.Name.str().c_str(), - static_cast(E.Value)); + io.bitSetCase(Flags, E.Name, static_cast(E.Value)); } } void ScalarEnumerationTraits::enumeration(IO &io, CPUType &Cpu) { auto CpuNames = getCPUTypeNames(); for (const auto &E : CpuNames) { - io.enumCase(Cpu, E.Name.str().c_str(), static_cast(E.Value)); + io.enumCase(Cpu, E.Name, static_cast(E.Value)); } } @@ -177,7 +170,7 @@ void ScalarEnumerationTraits::enumeration(IO &io, RegisterId &Reg) { RegNames = getRegisterNames(*CpuType); for (const auto &E : RegNames) { - io.enumCase(Reg, E.Name.str().c_str(), static_cast(E.Value)); + io.enumCase(Reg, E.Name, static_cast(E.Value)); } io.enumFallback(Reg); } @@ -186,8 +179,7 @@ void ScalarEnumerationTraits::enumeration( IO &io, TrampolineType &Tramp) { auto TrampNames = getTrampolineNames(); for (const auto &E : TrampNames) { - io.enumCase(Tramp, E.Name.str().c_str(), - static_cast(E.Value)); + io.enumCase(Tramp, E.Name, static_cast(E.Value)); } } @@ -195,7 +187,7 @@ void ScalarEnumerationTraits::enumeration(IO &io, ThunkOrdinal &Ord) { auto ThunkNames = getThunkOrdinalNames(); for (const auto &E : ThunkNames) { - io.enumCase(Ord, E.Name.str().c_str(), static_cast(E.Value)); + io.enumCase(Ord, E.Name, static_cast(E.Value)); } } @@ -203,8 +195,7 @@ void ScalarEnumerationTraits::enumeration( IO &io, FrameCookieKind &FC) { auto ThunkNames = getFrameCookieKindNames(); for (const auto &E : ThunkNames) { - io.enumCase(FC, E.Name.str().c_str(), - static_cast(E.Value)); + io.enumCase(FC, E.Name, static_cast(E.Value)); } } @@ -212,8 +203,7 @@ void ScalarEnumerationTraits::enumeration( IO &io, JumpTableEntrySize &FC) { auto ThunkNames = getJumpTableEntrySizeNames(); for (const auto &E : ThunkNames) { - io.enumCase(FC, E.Name.str().c_str(), - static_cast(E.Value)); + io.enumCase(FC, E.Name, static_cast(E.Value)); } } diff --git a/llvm/lib/ObjectYAML/DXContainerYAML.cpp b/llvm/lib/ObjectYAML/DXContainerYAML.cpp index 5dff9bad12b52..5019298baebbd 100644 --- a/llvm/lib/ObjectYAML/DXContainerYAML.cpp +++ b/llvm/lib/ObjectYAML/DXContainerYAML.cpp @@ -589,55 +589,55 @@ void MappingTraits::mapping( void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::PSV::SemanticKind &Value) { for (const auto &E : dxbc::PSV::getSemanticKinds()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::PSV::ComponentType &Value) { for (const auto &E : dxbc::PSV::getComponentTypes()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::PSV::InterpolationMode &Value) { for (const auto &E : dxbc::PSV::getInterpolationModes()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::PSV::ResourceType &Value) { for (const auto &E : dxbc::PSV::getResourceTypes()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::PSV::ResourceKind &Value) { for (const auto &E : dxbc::PSV::getResourceKinds()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::D3DSystemValue &Value) { for (const auto &E : dxbc::getD3DSystemValues()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::SigMinPrecision &Value) { for (const auto &E : dxbc::getSigMinPrecisions()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::SigComponentType &Value) { for (const auto &E : dxbc::getSigComponentTypes()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::RootParameterType &Value) { for (const auto &E : dxbc::getRootParameterTypes()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( @@ -650,37 +650,37 @@ void ScalarEnumerationTraits::enumeration( }; for (const auto &E : ResourceClasses) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::SamplerFilter &Value) { for (const auto &E : dxbc::getSamplerFilters()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::StaticBorderColor &Value) { for (const auto &E : dxbc::getStaticBorderColors()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::TextureAddressMode &Value) { for (const auto &E : dxbc::getTextureAddressModes()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::ShaderVisibility &Value) { for (const auto &E : dxbc::getShaderVisibility()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } void ScalarEnumerationTraits::enumeration( IO &IO, dxbc::ComparisonFunc &Value) { for (const auto &E : dxbc::getComparisonFuncs()) - IO.enumCase(Value, E.Name.str().c_str(), E.Value); + IO.enumCase(Value, E.Name, E.Value); } } // namespace yaml diff --git a/llvm/lib/Target/NVPTX/NVPTX.h b/llvm/lib/Target/NVPTX/NVPTX.h index 1e0f747f8f7fc..95fd05f2a926f 100644 --- a/llvm/lib/Target/NVPTX/NVPTX.h +++ b/llvm/lib/Target/NVPTX/NVPTX.h @@ -66,7 +66,6 @@ void initializeNVPTXCtorDtorLoweringLegacyPass(PassRegistry &); void initializeNVPTXLowerAggrCopiesPass(PassRegistry &); void initializeNVPTXLowerAllocaPass(PassRegistry &); void initializeNVPTXLowerUnreachablePass(PassRegistry &); -void initializeNVPTXCtorDtorLoweringLegacyPass(PassRegistry &); void initializeNVPTXLowerArgsLegacyPassPass(PassRegistry &); void initializeNVPTXProxyRegErasurePass(PassRegistry &); void initializeNVPTXForwardParamsPassPass(PassRegistry &); diff --git a/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp b/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp index c734d3d430073..7f190f33da808 100644 --- a/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp @@ -28,10 +28,6 @@ using namespace llvm; -namespace llvm { -void initializeGenericToNVVMLegacyPassPass(PassRegistry &); -} - namespace { class GenericToNVVM { public: diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h index ee575e3527673..0e913fb1ee669 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h +++ b/llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h @@ -211,8 +211,8 @@ template <> struct CustomMappingTraits { } static void output(IO &YamlIO, BBNumberMap &SrcToUnwindDest) { - for (auto KV : SrcToUnwindDest) - YamlIO.mapRequired(std::to_string(KV.first).c_str(), KV.second); + for (auto [Src, Dest] : SrcToUnwindDest) + YamlIO.mapRequired(std::to_string(Src), Dest); } };