Merge "Fold annotations." am: b3f3e7b3f7
am: e27ecb85d4
am: b878b8ff56
Original change: https://android-review.googlesource.com/c/platform/build/+/1944765 Change-Id: I479e77a37ff9b62887f45b2880f1e8a12b9a0fb4
This commit is contained in:
@@ -20,6 +20,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// RecognizedAnnotations identifies the set of annotations that have
|
||||||
|
// meaning for compliance policy.
|
||||||
|
RecognizedAnnotations = map[string]string{
|
||||||
|
// used in readgraph.go to avoid creating 1000's of copies of the below 3 strings.
|
||||||
|
"static": "static",
|
||||||
|
"dynamic": "dynamic",
|
||||||
|
"toolchain": "toolchain",
|
||||||
|
}
|
||||||
|
|
||||||
// ImpliesUnencumbered lists the condition names representing an author attempt to disclaim copyright.
|
// ImpliesUnencumbered lists the condition names representing an author attempt to disclaim copyright.
|
||||||
ImpliesUnencumbered = ConditionNames{"unencumbered"}
|
ImpliesUnencumbered = ConditionNames{"unencumbered"}
|
||||||
|
|
||||||
|
@@ -188,10 +188,11 @@ func addDependencies(edges *[]*dependencyEdge, target string, dependencies []*li
|
|||||||
}
|
}
|
||||||
annotations := newEdgeAnnotations()
|
annotations := newEdgeAnnotations()
|
||||||
for _, a := range ad.Annotations {
|
for _, a := range ad.Annotations {
|
||||||
if len(a) == 0 {
|
// look up a common constant annotation string from a small map
|
||||||
continue
|
// instead of creating 1000's of copies of the same 3 strings.
|
||||||
|
if ann, ok := RecognizedAnnotations[a]; ok {
|
||||||
|
annotations.annotations[ann] = true
|
||||||
}
|
}
|
||||||
annotations.annotations[a] = true
|
|
||||||
}
|
}
|
||||||
*edges = append(*edges, &dependencyEdge{target, dependency, annotations})
|
*edges = append(*edges, &dependencyEdge{target, dependency, annotations})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user