[clang] [clang][Modules] Make `Module::Requirement` a struct (PR #67900)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 30 22:00:04 PDT 2023


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 e7247f1010b546ca4d98a6ee40414d2d1cae0381 0253be550776631980d77e7847c6337786d64911 -- clang/include/clang/Basic/Module.h clang/lib/Basic/Module.cpp clang/lib/Lex/PPDirectives.cpp clang/lib/Serialization/ASTWriter.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index fff0067bc..97511ce9a 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -141,7 +141,7 @@ bool Module::isUnimportable(const LangOptions &LangOpts,
     }
     for (unsigned I = 0, N = Current->Requirements.size(); I != N; ++I) {
       if (hasFeature(Current->Requirements[I].FeatureName, LangOpts, Target) !=
-              Current->Requirements[I].RequiredState) {
+          Current->Requirements[I].RequiredState) {
         Req = Current->Requirements[I];
         return true;
       }
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 579836d47..c55ce4ce6 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -1915,7 +1915,8 @@ bool Preprocessor::checkModuleIsAvailable(const LangOptions &LangOpts,
     // FIXME: Track the location at which the requirement was specified, and
     // use it here.
     Diags.Report(M->DefinitionLoc, diag::err_module_unavailable)
-        << M->getFullModuleName() << Requirement.RequiredState << Requirement.FeatureName;
+        << M->getFullModuleName() << Requirement.RequiredState
+        << Requirement.FeatureName;
   }
   return true;
 }

``````````

</details>


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


More information about the cfe-commits mailing list