[clang] Add handling of the `-nostdlibinc` option to ccc-analyzer (PR #88017)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 8 10:38:09 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Ziqing Luo (ziqingluo-90)

<details>
<summary>Changes</summary>

Compiler options recognizable to ccc-analyzer are stored in maps.  An option missing in the map will be dropped by ccc-analyzer.  This causes a build error in one of our projects that only happens in scan-build but not regular build, because ccc-analyzer do not recognize `-nostdlibinc`.

This commit adds the option to the map.

---
Full diff: https://github.com/llvm/llvm-project/pull/88017.diff


1 Files Affected:

- (modified) clang/tools/scan-build/libexec/ccc-analyzer (+1) 


``````````diff
diff --git a/clang/tools/scan-build/libexec/ccc-analyzer b/clang/tools/scan-build/libexec/ccc-analyzer
index 60796a543fcd06..c5588814e8f0de 100755
--- a/clang/tools/scan-build/libexec/ccc-analyzer
+++ b/clang/tools/scan-build/libexec/ccc-analyzer
@@ -361,6 +361,7 @@ sub Analyze {
 
 my %CompileOptionMap = (
   '-nostdinc' => 0,
+  '-nostdlibinc' => 0,
   '-include' => 1,
   '-idirafter' => 1,
   '-imacros' => 1,

``````````

</details>


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


More information about the cfe-commits mailing list