[gn build] Add build files for clang/lib/{ASTMatchers,CrossTU}, clang/lib/StaticAnaly...
authorNico Weber <nicolasweber@gmx.de>
Sat, 22 Dec 2018 03:14:05 +0000 (03:14 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 22 Dec 2018 03:14:05 +0000 (03:14 +0000)
The intent is to add the build file for clang/lib/StaticAnalyzer/Frontend; everything else is pulled in by that.

Differential Revision: https://reviews.llvm.org/D55978

llvm-svn: 349986

llvm/utils/gn/secondary/BUILD.gn
llvm/utils/gn/secondary/clang/lib/ASTMatchers/BUILD.gn [new file with mode: 0644]
llvm/utils/gn/secondary/clang/lib/CrossTU/BUILD.gn [new file with mode: 0644]
llvm/utils/gn/secondary/clang/lib/Index/BUILD.gn [new file with mode: 0644]
llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Checkers/BUILD.gn [new file with mode: 0644]
llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Core/BUILD.gn [new file with mode: 0644]
llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Frontend/BUILD.gn [new file with mode: 0644]

index eb74029..0db9084 100644 (file)
@@ -1,11 +1,18 @@
 group("default") {
   deps = [
+    "//clang/lib/AST",
+    "//clang/lib/ASTMatchers",
     "//clang/lib/CodeGen",
+    "//clang/lib/CrossTU",
     "//clang/lib/Driver",
     "//clang/lib/Frontend",
     "//clang/lib/Frontend/Rewrite",
+    "//clang/lib/Index",
     "//clang/lib/Parse",
     "//clang/lib/Serialization",
+    "//clang/lib/StaticAnalyzer/Checkers",
+    "//clang/lib/StaticAnalyzer/Core",
+    "//clang/lib/StaticAnalyzer/Frontend",
     "//clang/tools/clang-format",
     "//lld/test",
     "//llvm/tools/llvm-undname",
diff --git a/llvm/utils/gn/secondary/clang/lib/ASTMatchers/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/ASTMatchers/BUILD.gn
new file mode 100644 (file)
index 0000000..8dbb132
--- /dev/null
@@ -0,0 +1,13 @@
+static_library("ASTMatchers") {
+  output_name = "clangASTMatchers"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang/lib/AST",
+    "//clang/lib/Basic",
+    "//llvm/lib/Support",
+  ]
+  sources = [
+    "ASTMatchFinder.cpp",
+    "ASTMatchersInternal.cpp",
+  ]
+}
diff --git a/llvm/utils/gn/secondary/clang/lib/CrossTU/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/CrossTU/BUILD.gn
new file mode 100644 (file)
index 0000000..81fb0b6
--- /dev/null
@@ -0,0 +1,14 @@
+static_library("CrossTU") {
+  output_name = "clangCrossTU"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang/lib/AST",
+    "//clang/lib/Basic",
+    "//clang/lib/Frontend",
+    "//clang/lib/Index",
+    "//llvm/lib/Support",
+  ]
+  sources = [
+    "CrossTranslationUnit.cpp",
+  ]
+}
diff --git a/llvm/utils/gn/secondary/clang/lib/Index/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/Index/BUILD.gn
new file mode 100644 (file)
index 0000000..8c7190f
--- /dev/null
@@ -0,0 +1,28 @@
+static_library("Index") {
+  output_name = "clangIndex"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang/lib/AST",
+    "//clang/lib/Basic",
+    "//clang/lib/Format",
+    "//clang/lib/Frontend",
+    "//clang/lib/Rewrite",
+    "//clang/lib/Serialization",
+    "//clang/lib/Tooling/Core",
+    "//llvm/lib/IR",
+    "//llvm/lib/Support",
+  ]
+  sources = [
+    "CodegenNameGenerator.cpp",
+    "CommentToXML.cpp",
+    "IndexBody.cpp",
+    "IndexDecl.cpp",
+    "IndexSymbol.cpp",
+    "IndexTypeSourceInfo.cpp",
+    "IndexingAction.cpp",
+    "IndexingContext.cpp",
+    "IndexingContext.h",
+    "SimpleFormatContext.h",
+    "USRGeneration.cpp",
+  ]
+}
diff --git a/llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Checkers/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Checkers/BUILD.gn
new file mode 100644 (file)
index 0000000..e8e0c71
--- /dev/null
@@ -0,0 +1,114 @@
+static_library("Checkers") {
+  output_name = "clangStaticAnalyzerCheckers"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang/include/clang/StaticAnalyzer/Checkers",
+    "//clang/lib/AST",
+    "//clang/lib/ASTMatchers",
+    "//clang/lib/Analysis",
+    "//clang/lib/Basic",
+    "//clang/lib/Lex",
+    "//clang/lib/StaticAnalyzer/Core",
+    "//llvm/lib/Support",
+  ]
+  sources = [
+    "AnalysisOrderChecker.cpp",
+    "AnalyzerStatsChecker.cpp",
+    "ArrayBoundChecker.cpp",
+    "ArrayBoundCheckerV2.cpp",
+    "BasicObjCFoundationChecks.cpp",
+    "BlockInCriticalSectionChecker.cpp",
+    "BoolAssignmentChecker.cpp",
+    "BuiltinFunctionChecker.cpp",
+    "CStringChecker.cpp",
+    "CStringSyntaxChecker.cpp",
+    "CXXSelfAssignmentChecker.cpp",
+    "CallAndMessageChecker.cpp",
+    "CastSizeChecker.cpp",
+    "CastToStructChecker.cpp",
+    "CheckObjCDealloc.cpp",
+    "CheckObjCInstMethSignature.cpp",
+    "CheckSecuritySyntaxOnly.cpp",
+    "CheckSizeofPointer.cpp",
+    "CheckerDocumentation.cpp",
+    "ChrootChecker.cpp",
+    "CloneChecker.cpp",
+    "ConversionChecker.cpp",
+    "DeadStoresChecker.cpp",
+    "DebugCheckers.cpp",
+    "DeleteWithNonVirtualDtorChecker.cpp",
+    "DereferenceChecker.cpp",
+    "DirectIvarAssignment.cpp",
+    "DivZeroChecker.cpp",
+    "DynamicTypeChecker.cpp",
+    "DynamicTypePropagation.cpp",
+    "EnumCastOutOfRangeChecker.cpp",
+    "ExprInspectionChecker.cpp",
+    "FixedAddressChecker.cpp",
+    "GCDAntipatternChecker.cpp",
+    "GTestChecker.cpp",
+    "GenericTaintChecker.cpp",
+    "IdenticalExprChecker.cpp",
+    "InnerPointerChecker.cpp",
+    "IteratorChecker.cpp",
+    "IvarInvalidationChecker.cpp",
+    "LLVMConventionsChecker.cpp",
+    "LocalizationChecker.cpp",
+    "MPI-Checker/MPIBugReporter.cpp",
+    "MPI-Checker/MPIChecker.cpp",
+    "MPI-Checker/MPIFunctionClassifier.cpp",
+    "MacOSKeychainAPIChecker.cpp",
+    "MacOSXAPIChecker.cpp",
+    "MallocChecker.cpp",
+    "MallocOverflowSecurityChecker.cpp",
+    "MallocSizeofChecker.cpp",
+    "MmapWriteExecChecker.cpp",
+    "MoveChecker.cpp",
+    "NSAutoreleasePoolChecker.cpp",
+    "NSErrorChecker.cpp",
+    "NoReturnFunctionChecker.cpp",
+    "NonNullParamChecker.cpp",
+    "NonnullGlobalConstantsChecker.cpp",
+    "NullabilityChecker.cpp",
+    "NumberObjectConversionChecker.cpp",
+    "ObjCAtSyncChecker.cpp",
+    "ObjCAutoreleaseWriteChecker.cpp",
+    "ObjCContainersASTChecker.cpp",
+    "ObjCContainersChecker.cpp",
+    "ObjCMissingSuperCallChecker.cpp",
+    "ObjCPropertyChecker.cpp",
+    "ObjCSelfInitChecker.cpp",
+    "ObjCSuperDeallocChecker.cpp",
+    "ObjCUnusedIVarsChecker.cpp",
+    "PaddingChecker.cpp",
+    "PointerArithChecker.cpp",
+    "PointerSubChecker.cpp",
+    "PthreadLockChecker.cpp",
+    "RetainCountChecker/RetainCountChecker.cpp",
+    "RetainCountChecker/RetainCountDiagnostics.cpp",
+    "ReturnPointerRangeChecker.cpp",
+    "ReturnUndefChecker.cpp",
+    "RunLoopAutoreleaseLeakChecker.cpp",
+    "SimpleStreamChecker.cpp",
+    "StackAddrEscapeChecker.cpp",
+    "StdLibraryFunctionsChecker.cpp",
+    "StreamChecker.cpp",
+    "TaintTesterChecker.cpp",
+    "TestAfterDivZeroChecker.cpp",
+    "TraversalChecker.cpp",
+    "TrustNonnullChecker.cpp",
+    "UndefBranchChecker.cpp",
+    "UndefCapturedBlockVarChecker.cpp",
+    "UndefResultChecker.cpp",
+    "UndefinedArraySubscriptChecker.cpp",
+    "UndefinedAssignmentChecker.cpp",
+    "UninitializedObject/UninitializedObjectChecker.cpp",
+    "UninitializedObject/UninitializedPointee.cpp",
+    "UnixAPIChecker.cpp",
+    "UnreachableCodeChecker.cpp",
+    "VLASizeChecker.cpp",
+    "ValistChecker.cpp",
+    "VforkChecker.cpp",
+    "VirtualCallChecker.cpp",
+  ]
+}
diff --git a/llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Core/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Core/BUILD.gn
new file mode 100644 (file)
index 0000000..e08a476
--- /dev/null
@@ -0,0 +1,67 @@
+static_library("Core") {
+  output_name = "clangStaticAnalyzerCore"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang/include/clang/Config",
+    "//clang/lib/AST",
+    "//clang/lib/ASTMatchers",
+    "//clang/lib/Analysis",
+    "//clang/lib/Basic",
+    "//clang/lib/CrossTU",
+    "//clang/lib/Lex",
+    "//clang/lib/Rewrite",
+    "//llvm/lib/Support",
+  ]
+  sources = [
+    "APSIntType.cpp",
+    "AnalysisManager.cpp",
+    "AnalyzerOptions.cpp",
+    "BasicValueFactory.cpp",
+    "BlockCounter.cpp",
+    "BugReporter.cpp",
+    "BugReporterVisitors.cpp",
+    "CallEvent.cpp",
+    "Checker.cpp",
+    "CheckerContext.cpp",
+    "CheckerHelpers.cpp",
+    "CheckerManager.cpp",
+    "CommonBugCategories.cpp",
+    "ConstraintManager.cpp",
+    "CoreEngine.cpp",
+    "DynamicTypeMap.cpp",
+    "Environment.cpp",
+    "ExplodedGraph.cpp",
+    "ExprEngine.cpp",
+    "ExprEngineC.cpp",
+    "ExprEngineCXX.cpp",
+    "ExprEngineCallAndReturn.cpp",
+    "ExprEngineObjC.cpp",
+    "FunctionSummary.cpp",
+    "HTMLDiagnostics.cpp",
+    "IssueHash.cpp",
+    "LoopUnrolling.cpp",
+    "LoopWidening.cpp",
+    "MemRegion.cpp",
+    "PathDiagnostic.cpp",
+    "PlistDiagnostics.cpp",
+    "ProgramState.cpp",
+    "RangeConstraintManager.cpp",
+    "RangedConstraintManager.cpp",
+    "RegionStore.cpp",
+    "RetainSummaryManager.cpp",
+    "SValBuilder.cpp",
+    "SVals.cpp",
+    "SarifDiagnostics.cpp",
+    "SimpleConstraintManager.cpp",
+    "SimpleSValBuilder.cpp",
+    "Store.cpp",
+    "SubEngine.cpp",
+    "SymbolManager.cpp",
+    "TaintManager.cpp",
+    "WorkList.cpp",
+    "Z3ConstraintManager.cpp",
+  ]
+
+  # FIXME: clang/Config/BUILD.gn currently always sets CLANG_ANALYZER_WITH_Z3
+  # to false. If that changes we need to link to Z3 libs here.
+}
diff --git a/llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Frontend/BUILD.gn b/llvm/utils/gn/secondary/clang/lib/StaticAnalyzer/Frontend/BUILD.gn
new file mode 100644 (file)
index 0000000..e4654bf
--- /dev/null
@@ -0,0 +1,23 @@
+static_library("Frontend") {
+  output_name = "clangStaticAnalyzerFrontend"
+  configs += [ "//llvm/utils/gn/build:clang_code" ]
+  deps = [
+    "//clang/lib/AST",
+    "//clang/lib/Analysis",
+    "//clang/lib/Basic",
+    "//clang/lib/CrossTU",
+    "//clang/lib/Frontend",
+    "//clang/lib/Lex",
+    "//clang/lib/StaticAnalyzer/Checkers",
+    "//clang/lib/StaticAnalyzer/Core",
+    "//llvm/lib/Support",
+  ]
+  sources = [
+    "AnalysisConsumer.cpp",
+    "CheckerRegistration.cpp",
+    "CheckerRegistry.cpp",
+    "FrontendActions.cpp",
+    "ModelConsumer.cpp",
+    "ModelInjector.cpp",
+  ]
+}