[clang] [Clang][OpenMP] Check if value is contained in array, not if it's contained in the first element (PR #69462)
Juan Manuel Martinez CaamaƱo via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 18 06:37:11 PDT 2023
https://github.com/jmmartinez created https://github.com/llvm/llvm-project/pull/69462
None
>From c388e5f65d3dfc8fc193686e182e74c3dcfb27e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Manuel=20MARTINEZ=20CAAMA=C3=91O?= <juamarti at amd.com>
Date: Wed, 18 Oct 2023 15:32:22 +0200
Subject: [PATCH] [Clang][OpenMP] Check if value is contained in array, not if
it's contained in the first element
---
clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 25fd940584624ee..7b2966f70bf6fc6 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2295,7 +2295,7 @@ void tools::AddStaticDeviceLibs(Compilation *C, const Tool *T,
static const StringRef HostOnlyArchives[] = {
"omp", "cudart", "m", "gcc", "gcc_s", "pthread", "hip_hcc"};
for (auto SDLName : DriverArgs.getAllArgValues(options::OPT_l)) {
- if (!HostOnlyArchives->contains(SDLName)) {
+ if (!llvm::is_contained(HostOnlyArchives, SDLName)) {
SDLNames.insert(std::string("-l") + SDLName);
}
}
More information about the cfe-commits
mailing list