Add in_main_file to context

Reviewed By: jvillard

Differential Revision: D3705270

fbshipit-source-id: dd693ad
master
Ryan Rhee 8 years ago committed by Facebook Github Bot 3
parent 0e84560bfe
commit 88897addfa

@ -499,6 +499,11 @@ struct
Some (decl_list, impl_decl_info) Some (decl_list, impl_decl_info)
| _ -> None | _ -> None
let is_in_main_file decl =
let decl_info = Clang_ast_proj.get_decl_tuple decl in
let file_opt = (fst decl_info.Clang_ast_t.di_source_range).Clang_ast_t.sl_file in
opt_equal string_equal file_opt Config.source_file && Option.is_some file_opt
(* (*
let rec getter_attribute_opt attributes = let rec getter_attribute_opt attributes =
match attributes with match attributes with

@ -171,6 +171,11 @@ sig
Clang_ast_t.obj_c_implementation_decl_info) Clang_ast_t.obj_c_implementation_decl_info)
option option
(** Returns true if the declaration or statement is inside the main source
file, as opposed to an imported header file. For statements, this refers
to the parent decl. *)
val is_in_main_file : Clang_ast_t.decl -> bool
end end
module General_utils : module General_utils :

Loading…
Cancel
Save