From aabb6e157dd4bd2baa6ac40766cd49de9b1a8fbf Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sat, 30 May 2026 05:41:17 +0200 Subject: [PATCH] Improve -cl-ext parsing: ignore trailing comma This is exposed by a LIT test that has trailing comma in -cl-ext option. --- options_compile.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/options_compile.cpp b/options_compile.cpp index 82d5a68e0..457beab23 100644 --- a/options_compile.cpp +++ b/options_compile.cpp @@ -372,6 +372,8 @@ std::string EffectiveOptionsFilter::processOptions(const OpenCLArgList &args, llvm::SmallVector parsedExt; clExtRef.split(parsedExt, ','); for (auto &ext : parsedExt) { + if (ext.empty()) + continue; char sign = ext.front(); bool enabled = sign != '-'; llvm::StringRef extName = ext;