Rename {has_,}cxx_full_name to {has_,}cxx_fully_qualified_name.

Reviewed By: jvillard

Differential Revision: D13597510

fbshipit-source-id: 4b48d6444
master
David Lively 6 years ago committed by Facebook Github Bot
parent d5faf2de52
commit 322066d248

@ -127,8 +127,8 @@ let evaluate_place_holder context ph an =
MF.monospaced_to_string (Ctl_parser_types.stmt_node_child_type an) MF.monospaced_to_string (Ctl_parser_types.stmt_node_child_type an)
| "%name%" -> | "%name%" ->
MF.monospaced_to_string (Ctl_parser_types.ast_node_name an) MF.monospaced_to_string (Ctl_parser_types.ast_node_name an)
| "%cxx_full_name%" -> | "%cxx_fully_qualified_name%" ->
MF.monospaced_to_string (Ctl_parser_types.ast_node_cxx_full_name an) MF.monospaced_to_string (Ctl_parser_types.ast_node_cxx_fully_qualified_name an)
| _ -> | _ ->
L.die InternalError "helper function %s is unknown" ph L.die InternalError "helper function %s is unknown" ph

@ -1412,12 +1412,12 @@ let is_cxx_copy_constructor an =
false false
let has_cxx_full_name an qual_name_re = let has_cxx_fully_qualified_name an qual_name_re =
match Ctl_parser_types.ast_node_cxx_full_name an with match Ctl_parser_types.ast_node_cxx_fully_qualified_name an with
| "" -> | "" ->
false false
| full_name -> | fully_qualified_name ->
ALVar.compare_str_with_alexp full_name qual_name_re ALVar.compare_str_with_alexp fully_qualified_name qual_name_re
let is_cxx_method_overriding an qual_name_re = let is_cxx_method_overriding an qual_name_re =

@ -487,7 +487,7 @@ val is_method_called_by_superclass : Ctl_parser_types.ast_node -> bool
val is_cxx_copy_constructor : Ctl_parser_types.ast_node -> bool val is_cxx_copy_constructor : Ctl_parser_types.ast_node -> bool
(** true if the current node is a C++ copy constructor *) (** true if the current node is a C++ copy constructor *)
val has_cxx_full_name : Ctl_parser_types.ast_node -> ALVar.alexp -> bool val has_cxx_fully_qualified_name : Ctl_parser_types.ast_node -> ALVar.alexp -> bool
(** true iff node has C++ fully qualified name (w/class and namespace) (** true iff node has C++ fully qualified name (w/class and namespace)
* matching the given regexp * matching the given regexp
*) *)

@ -973,8 +973,8 @@ let rec eval_Atomic pred_name_ args an lcxt =
CPredicates.context_in_synchronized_block lcxt CPredicates.context_in_synchronized_block lcxt
| "declaration_has_name", [decl_name], an -> | "declaration_has_name", [decl_name], an ->
CPredicates.declaration_has_name an decl_name CPredicates.declaration_has_name an decl_name
| "has_cxx_full_name", [qual_name_re], an -> | "has_cxx_fully_qualified_name", [qual_name_re], an ->
CPredicates.has_cxx_full_name an qual_name_re CPredicates.has_cxx_fully_qualified_name an qual_name_re
| "declaration_ref_name", [decl_name], an -> | "declaration_ref_name", [decl_name], an ->
CPredicates.declaration_ref_name an decl_name CPredicates.declaration_ref_name an decl_name
| "decl_unavailable_in_supported_ios_sdk", [], an -> | "decl_unavailable_in_supported_ios_sdk", [], an ->

@ -80,25 +80,25 @@ let rec ast_node_name an =
"" ""
let rec ast_node_cxx_full_name an = let rec ast_node_cxx_fully_qualified_name an =
let full_name qual_name = "::" ^ String.concat ~sep:"::" (List.rev qual_name) in let fully_qualified_name qual_name = "::" ^ String.concat ~sep:"::" (List.rev qual_name) in
let open Clang_ast_t in let open Clang_ast_t in
match an with match an with
| Decl dec -> ( | Decl dec -> (
match Clang_ast_proj.get_named_decl_tuple dec with match Clang_ast_proj.get_named_decl_tuple dec with
| Some (_, n) -> | Some (_, n) ->
full_name n.Clang_ast_t.ni_qual_name fully_qualified_name n.Clang_ast_t.ni_qual_name
| None -> | None ->
"" ) "" )
| Stmt (DeclRefExpr (_, _, _, {drti_decl_ref= Some dr})) -> | Stmt (DeclRefExpr (_, _, _, {drti_decl_ref= Some dr})) ->
let ndi, _, _ = CAst_utils.get_info_from_decl_ref dr in let ndi, _, _ = CAst_utils.get_info_from_decl_ref dr in
full_name ndi.ni_qual_name fully_qualified_name ndi.ni_qual_name
| Stmt (OpaqueValueExpr (_, _, _, {ovei_source_expr= Some stmt})) | Stmt (OpaqueValueExpr (_, _, _, {ovei_source_expr= Some stmt}))
| Stmt (ImplicitCastExpr (_, [stmt], _, _)) | Stmt (ImplicitCastExpr (_, [stmt], _, _))
| Stmt (PseudoObjectExpr (_, stmt :: _, _)) | Stmt (PseudoObjectExpr (_, stmt :: _, _))
| Stmt (ParenExpr (_, [stmt], _)) | Stmt (ParenExpr (_, [stmt], _))
| Stmt (CallExpr (_, stmt :: _, _)) -> | Stmt (CallExpr (_, stmt :: _, _)) ->
ast_node_cxx_full_name (Stmt stmt) ast_node_cxx_fully_qualified_name (Stmt stmt)
| _ -> | _ ->
"" ""

@ -15,7 +15,7 @@ val ast_node_equal : ast_node -> ast_node -> bool
val ast_node_name : ast_node -> string val ast_node_name : ast_node -> string
val ast_node_cxx_full_name : ast_node -> string val ast_node_cxx_fully_qualified_name : ast_node -> string
val ast_node_type : ast_node -> string val ast_node_type : ast_node -> string

@ -39,6 +39,6 @@ DEFINE-CHECKER FIND_CXX_METHOD_OVERRIDES_MATCHING = {
}; };
DEFINE-CHECKER FIND_NODES_WITH_CXX_FULL_NAME = { DEFINE-CHECKER FIND_NODES_WITH_CXX_FULL_NAME = {
SET report_when = has_cxx_full_name(REGEXP("::Foo::Bar::")); SET report_when = has_cxx_fully_qualified_name(REGEXP("::Foo::Bar::"));
SET message = "%cxx_full_name% matches"; SET message = "%cxx_fully_qualified_name% matches";
}; };

Loading…
Cancel
Save