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

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 9 13:09:56 PDT 2024


Author: Ziqing Luo
Date: 2024-04-09T13:09:52-07:00
New Revision: 63934821d56f4d366f61048ed6060978bbde1bc6

URL: https://github.com/llvm/llvm-project/commit/63934821d56f4d366f61048ed6060978bbde1bc6
DIFF: https://github.com/llvm/llvm-project/commit/63934821d56f4d366f61048ed6060978bbde1bc6.diff

LOG: [Static Analyzer] Add handling of the `-nostdlibinc` option to ccc-analyzer (#88017)

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.

rdar://126082053

Added: 
    

Modified: 
    clang/tools/scan-build/libexec/ccc-analyzer

Removed: 
    


################################################################################
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,


        


More information about the cfe-commits mailing list