[clang] [Clang] Don't crash if input file is not a module. (PR #98439)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 10 23:59:40 PDT 2024


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 dcf70e16684420ae211dad58dbfacc0430409ab4 716e8b7b71422b5850d2f9c3710a28bcf18ffccb --extensions cpp,c -- clang/test/Frontend/module-file-info-not-a-module.c clang/lib/Frontend/FrontendActions.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index ddefa07569..e70210d55f 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -845,7 +845,8 @@ void DumpModuleInfoAction::ExecuteAction() {
 
   // Don't process files of type other than module to avoid crash
   if (!isCurrentFileAST()) {
-    CI.getDiagnostics().Report(diag::err_file_is_not_module) << getCurrentFile();
+    CI.getDiagnostics().Report(diag::err_file_is_not_module)
+        << getCurrentFile();
     return;
   }
 

``````````

</details>


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


More information about the cfe-commits mailing list