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 c,h,cpp --
clang/test/Modules/duplicate-header-ownership.c
clang/include/clang/Basic/Module.h clang/include/clang/Lex/ModuleMap.h
clang/lib/Lex/ModuleMap.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/clang/include/clang/Lex/ModuleMap.h
b/clang/include/clang/Lex/ModuleMap.h
index 46655c3aa..ed326a7fd 100644
--- a/clang/include/clang/Lex/ModuleMap.h
+++ b/clang/include/clang/Lex/ModuleMap.h
@@ -740,9 +740,8 @@ public:
/// Adds this header to the given module.
/// \param Role The role of the header wrt the module.
- void addHeader(Module *Mod, Module::Header Header,
- ModuleHeaderRole Role, bool Imported = false,
- SourceLocation Loc = SourceLocation());
+ void addHeader(Module *Mod, Module::Header Header, ModuleHeaderRole Role,
+ bool Imported = false, SourceLocation Loc = SourceLocation());
/// Parse a module map without creating `clang::Module` instances.
bool parseModuleMapFile(FileEntryRef File, bool IsSystem,
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index a8016cf8a..9b98048d0 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -301,8 +301,7 @@ void ModuleMap::resolveHeader(Module *Mod,
else
// Record this umbrella header.
setUmbrellaHeaderAsWritten(Mod, *File, Header.FileName,
- RelativePathName.str(),
- Header.FileNameLoc);
+ RelativePathName.str(), Header.FileNameLoc);
} else {
Module::Header H = {Header.FileName, std::string(RelativePathName),
*File};
@@ -576,8 +575,7 @@ void
ModuleMap::diagnoseDuplicateHeaderOwnership(SourceLocation FilenameLoc,
if (Known == Headers.end())
return;
- if (Diags.isIgnored(diag::warn_mmap_duplicate_header_ownership,
- FilenameLoc))
+ if (Diags.isIgnored(diag::warn_mmap_duplicate_header_ownership, FilenameLoc))
return;
// Only diagnose each header once.
@@ -624,14 +622,15 @@ void
ModuleMap::diagnoseDuplicateHeaderOwnership(SourceLocation FilenameLoc,
// excluded from the umbrella module.
if (SeenTopLevel.insert(TopLevel).second) {
// Check that the header isn't excluded in the umbrella module.
- bool IsExcluded = llvm::any_of(Known->second, [TopLevel](const
KnownHeader &H) {
- return H.getModule()->getTopLevelModule() == TopLevel &&
- H.getRole() == ExcludedHeader;
- });
+ bool IsExcluded =
+ llvm::any_of(Known->second, [TopLevel](const KnownHeader &H) {
+ return H.getModule()->getTopLevelModule() == TopLevel &&
+ H.getRole() == ExcludedHeader;
+ });
if (!IsExcluded) {
- OwningModules.push_back(
- {TopLevel, UmbrellaOwner.getModule()->UmbrellaDeclLoc,
- /*IsUmbrella=*/true});
+ OwningModules.push_back({TopLevel,
+ UmbrellaOwner.getModule()->UmbrellaDeclLoc,
+ /*IsUmbrella=*/true});
}
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/188538
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits