c43622e897
Previously, we had a special class, ConstantEvaluationTarget_Annotation, for this purpose. It held on to a the AST node for the annotation. This was bad because it meant that the presence of any ConstantEvaluationTarget_Annotation referring to a given compilation unit would keep the entire compilation unit's AST in memory. Now we copy just the portions of the AST we need into ElementAnnotation, just as we do for all other constant evaluation targets. In addition to saving memory, this paves the way for supporting annotations in summaries, by making it possible to compute the constant value of an annotation without having to consult the full AST. Fixes #25285. R=brianwilkerson@google.com Review URL: https://codereview.chromium.org/1665353002 .