[flang-commits] [flang] [flang][driver] Improve diagnostic for assembly inputs (PR #174316)
Tarun Prabhu via flang-commits
flang-commits at lists.llvm.org
Mon Jan 12 07:30:15 PST 2026
================
@@ -147,6 +147,31 @@ int main(int argc, const char **argv) {
llvm::SmallVector<std::pair<int, const clang::driver::Command *>, 4>
failingCommands;
+ // Reject assembly files as flang does not support assembling
+ if (c) {
+ for (const llvm::opt::Arg *arg : c->getInputArgs()) {
+ if (arg->getOption().getKind() != llvm::opt::Option::InputClass)
+ continue;
+
+ llvm::StringRef filename(arg->getValue());
+
+ // Determine file type from extension
+ clang::driver::types::ID type =
+ clang::driver::types::lookupTypeForExtension(
+ filename.rsplit('.').second);
+
+ if (type == clang::driver::types::TY_Asm ||
+ type == clang::driver::types::TY_PP_Asm) {
+
----------------
tarunprabhu wrote:
We can probably do without the blank line here.
```suggestion
```
https://github.com/llvm/llvm-project/pull/174316
More information about the flang-commits
mailing list