Author: Alexey Karyakin
Date: 2026-03-11T10:29:43-05:00
New Revision: 61978b606d8687bff2672fe183251e908484054c

URL: 
https://github.com/llvm/llvm-project/commit/61978b606d8687bff2672fe183251e908484054c
DIFF: 
https://github.com/llvm/llvm-project/commit/61978b606d8687bff2672fe183251e908484054c.diff

LOG: [Hexagon] Disable implicit system include paths (#185456)

Hexagon toolchains are almost always cross-compiling and using system
include paths is virtually always an error. In general, adding implicit
paths is confusing as they are not shown in the `-###` output. The
comment in `InitHeaderSearch::AddDefaultIncludePaths()` suggests that
"this code path is going away" and the proper place for path selection
is in the driver. The current logic for adding implicit paths in the
preprocessor is on the opt-out basis, but it looks like almost all
majors OSes are explictly excluded.

Disable implicit system include paths for Hexagon targets.


Disable implicit system include paths for Hexagon targets.

Added: 
    

Modified: 
    clang/lib/Lex/InitHeaderSearch.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Lex/InitHeaderSearch.cpp 
b/clang/lib/Lex/InitHeaderSearch.cpp
index e30925f4e548c..3b0e0704ff8c4 100644
--- a/clang/lib/Lex/InitHeaderSearch.cpp
+++ b/clang/lib/Lex/InitHeaderSearch.cpp
@@ -249,6 +249,10 @@ bool InitHeaderSearch::ShouldAddDefaultIncludePaths(
   if (triple.isOSDarwin())
     return false;
 
+  // On hexagon, include paths are managed by the driver.
+  if (triple.getArch() == llvm::Triple::hexagon)
+    return false;
+
   return true; // Everything else uses AddDefaultIncludePaths().
 }
 


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to