[annotations] Print annotations in the dotty file

Reviewed By: sblackshear

Differential Revision: D4566096

fbshipit-source-id: fcd3044
master
Dulma Churchill 8 years ago committed by Facebook Github Bot
parent db285f976c
commit 6188f1c7a5

@ -27,7 +27,9 @@ let volatile = {class_name: "volatile", parameters: []};
/** Pretty print an annotation. */
let pp fmt annotation => F.fprintf fmt "@@%s" annotation.class_name;
let prefix = Config.curr_language_is Config.Java ? "@" : "_";
let pp fmt annotation => F.fprintf fmt "%s%s" prefix annotation.class_name;
let module Map = PrettyPrintable.MakePPMap {
type nonrec t = t;

@ -958,13 +958,18 @@ let pp_cfgnodelabel pdesc fmt (n : Procdesc.Node.t) =
let pp_label fmt n =
match Procdesc.Node.get_kind n with
| Procdesc.Node.Start_node pname ->
let pname_string = Procname.to_string pname in
Format.fprintf fmt "Start %s\\nFormals: %a\\nLocals: %a"
(Procname.to_string pname)
pname_string
pp_etlist (Procdesc.get_formals pdesc)
pp_local_list (Procdesc.get_locals pdesc);
if IList.length (Procdesc.get_captured pdesc) <> 0 then
Format.fprintf fmt "\\nCaptured: %a"
pp_local_list (Procdesc.get_captured pdesc)
pp_local_list (Procdesc.get_captured pdesc);
let attributes = Procdesc.get_attributes pdesc in
let method_annotation = attributes.ProcAttributes.method_annotation in
if not (Annot.Method.is_empty method_annotation) then
Format.fprintf fmt "\\nAnnotation: %a" (Annot.Method.pp pname_string) method_annotation
| Procdesc.Node.Exit_node pname ->
Format.fprintf fmt "Exit %s" (Procname.to_string pname)
| Procdesc.Node.Join_node ->

Loading…
Cancel
Save