[flang-commits] [flang] [flang][driver] Improve diagnostic for assembly inputs (PR #174316)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Wed Jan 14 07:13:33 PST 2026


================
@@ -83,6 +83,32 @@ static void ExpandResponseFiles(llvm::StringSaver &saver,
   }
 }
 
+static bool rejectAssemblyInputs(const llvm::opt::ArgList &Args,
+                                 clang::DiagnosticsEngine &Diags) {
+
+  for (const llvm::opt::Arg *Arg : Args) {
+    if (Arg->getOption().getKind() != llvm::opt::Option::InputClass)
----------------
tarunprabhu wrote:

Is there a reason to do an early continue here? Those are useful when there is deep (and unavoidable) nesting in a loop, and if there are multiple cases that must be checked. Neither is true here. IMO, it's more readable, in this case, to use `if (kind == InputClass) { ... }` instead.

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


More information about the flang-commits mailing list