[flang-commits] [flang] [flang][Driver] Improve error message for assembly file input (PR #174069)

via flang-commits flang-commits at lists.llvm.org
Wed Dec 31 08:52:31 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- flang/tools/flang-driver/driver.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp
index 660b291f2..d6a73c95e 100644
--- a/flang/tools/flang-driver/driver.cpp
+++ b/flang/tools/flang-driver/driver.cpp
@@ -100,7 +100,6 @@ static bool hasAssemblyInput(llvm::ArrayRef<const char *> args) {
   return false;
 }
 
-
 int main(int argc, const char **argv) {
 
   // Initialize variables to call the driver
@@ -115,12 +114,12 @@ int main(int argc, const char **argv) {
   llvm::StringSaver saver(a);
   ExpandResponseFiles(saver, args);
 
-    // Check if any input file is an assembly file before processing
+  // Check if any input file is an assembly file before processing
   if (hasAssemblyInput(args)) {
     llvm::errs() << "error: Currently, the driver does not accept assembly "
-                << "code. Use clang instead. "
-                << "Note that '-lflang_rt.runtime -lm' is required for "
-                << "linking.\n";
+                 << "code. Use clang instead. "
+                 << "Note that '-lflang_rt.runtime -lm' is required for "
+                 << "linking.\n";
     return 1;
   }
 

``````````

</details>


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


More information about the flang-commits mailing list