[clang] [Multilib] Extend the Multilib system to support an IncludepPath field. (PR #146651)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 28 05:53:53 PDT 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 HEAD~1 HEAD --extensions cpp,h -- clang/include/clang/Driver/Multilib.h clang/lib/Driver/Multilib.cpp clang/lib/Driver/ToolChains/BareMetal.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/include/clang/Driver/Multilib.h b/clang/include/clang/Driver/Multilib.h
index b4580c6c4..7c643b996 100644
--- a/clang/include/clang/Driver/Multilib.h
+++ b/clang/include/clang/Driver/Multilib.h
@@ -84,8 +84,8 @@ public:
   /// All elements begin with either '-' or '!'
   const flags_list &flags() const { return Flags; }
 
-  /// Get the include directories specified in multilib.yaml under the 'IncludeDirs'
-  /// field
+  /// Get the include directories specified in multilib.yaml under the
+  /// 'IncludeDirs' field
   const includedirs_list &includeDirs() const { return IncludeDirs; }
 
   /// Get the exclusive group label.
diff --git a/clang/lib/Driver/ToolChains/BareMetal.cpp b/clang/lib/Driver/ToolChains/BareMetal.cpp
index cc532940a..aee28ee1b 100644
--- a/clang/lib/Driver/ToolChains/BareMetal.cpp
+++ b/clang/lib/Driver/ToolChains/BareMetal.cpp
@@ -428,8 +428,8 @@ void BareMetal::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
   if (!SysRootDir.empty()) {
     for (const Multilib &M : getOrderedMultilibs()) {
       if (!M.includeDirs().empty()) {
-        // Add include directories specified in multilib.yaml under the 'IncludeDirs'
-        // field
+        // Add include directories specified in multilib.yaml under the
+        // 'IncludeDirs' field
         for (const std::string &Path : M.includeDirs()) {
           SmallString<128> Dir(SysRoot);
           llvm::sys::path::append(Dir, Path);
@@ -522,8 +522,8 @@ void BareMetal::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
         break;
       }
       if (!M.includeDirs().empty()) {
-        // Add include directories specified in multilib.yaml under the 'IncludeDirs'
-        // field
+        // Add include directories specified in multilib.yaml under the
+        // 'IncludeDirs' field
         for (const std::string &Path : M.includeDirs()) {
           Dir = SysRoot;
           llvm::sys::path::append(Dir, Path, "c++", "v1");

``````````

</details>


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


More information about the cfe-commits mailing list