[clang] [libclang] Respect CL mode for injected arguments (PR #237563)

Corentin Kerisit via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 1 01:29:26 PST 2026


================
@@ -4402,8 +4403,12 @@ clang_parseTranslationUnit_Impl(CXIndex CIdx, const char *source_filename,
   Args->insert(Args->end(), command_line_args,
                command_line_args + num_command_line_args);
 
+  // Use the driver pass-through spelling for options not accepted by clang-cl.
+  bool IsCLMode = driver::IsClangCL(
+      driver::getDriverMode((*Args)[0], llvm::ArrayRef(*Args).slice(1)));
----------------
cerisier wrote:

Reused this existing method of getting the driver mode.

https://github.com/llvm/llvm-project/pull/237563


More information about the cfe-commits mailing list