From 322066d2486e86eaa9a53a89e00b73a744a71b5f Mon Sep 17 00:00:00 2001 From: David Lively Date: Tue, 8 Jan 2019 08:40:07 -0800 Subject: [PATCH] Rename {has_,}cxx_full_name to {has_,}cxx_fully_qualified_name. Reviewed By: jvillard Differential Revision: D13597510 fbshipit-source-id: 4b48d6444 --- infer/src/clang/cFrontend_errors.ml | 4 ++-- infer/src/clang/cPredicates.ml | 8 ++++---- infer/src/clang/cPredicates.mli | 2 +- infer/src/clang/cTL.ml | 4 ++-- infer/src/clang/ctl_parser_types.ml | 10 +++++----- infer/src/clang/ctl_parser_types.mli | 2 +- .../cpp/linters-for-test-only/linters_example.al | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/infer/src/clang/cFrontend_errors.ml b/infer/src/clang/cFrontend_errors.ml index 533c3d3f7..4a7e9e489 100644 --- a/infer/src/clang/cFrontend_errors.ml +++ b/infer/src/clang/cFrontend_errors.ml @@ -127,8 +127,8 @@ let evaluate_place_holder context ph an = MF.monospaced_to_string (Ctl_parser_types.stmt_node_child_type an) | "%name%" -> MF.monospaced_to_string (Ctl_parser_types.ast_node_name an) - | "%cxx_full_name%" -> - MF.monospaced_to_string (Ctl_parser_types.ast_node_cxx_full_name an) + | "%cxx_fully_qualified_name%" -> + MF.monospaced_to_string (Ctl_parser_types.ast_node_cxx_fully_qualified_name an) | _ -> L.die InternalError "helper function %s is unknown" ph diff --git a/infer/src/clang/cPredicates.ml b/infer/src/clang/cPredicates.ml index 9211f97ae..5df8e50d2 100644 --- a/infer/src/clang/cPredicates.ml +++ b/infer/src/clang/cPredicates.ml @@ -1412,12 +1412,12 @@ let is_cxx_copy_constructor an = false -let has_cxx_full_name an qual_name_re = - match Ctl_parser_types.ast_node_cxx_full_name an with +let has_cxx_fully_qualified_name an qual_name_re = + match Ctl_parser_types.ast_node_cxx_fully_qualified_name an with | "" -> false - | full_name -> - ALVar.compare_str_with_alexp full_name qual_name_re + | fully_qualified_name -> + ALVar.compare_str_with_alexp fully_qualified_name qual_name_re let is_cxx_method_overriding an qual_name_re = diff --git a/infer/src/clang/cPredicates.mli b/infer/src/clang/cPredicates.mli index 5823b59e1..96444ee96 100644 --- a/infer/src/clang/cPredicates.mli +++ b/infer/src/clang/cPredicates.mli @@ -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 (** 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) * matching the given regexp *) diff --git a/infer/src/clang/cTL.ml b/infer/src/clang/cTL.ml index 857305838..7ea54b77e 100644 --- a/infer/src/clang/cTL.ml +++ b/infer/src/clang/cTL.ml @@ -973,8 +973,8 @@ let rec eval_Atomic pred_name_ args an lcxt = CPredicates.context_in_synchronized_block lcxt | "declaration_has_name", [decl_name], an -> CPredicates.declaration_has_name an decl_name - | "has_cxx_full_name", [qual_name_re], an -> - CPredicates.has_cxx_full_name an qual_name_re + | "has_cxx_fully_qualified_name", [qual_name_re], an -> + CPredicates.has_cxx_fully_qualified_name an qual_name_re | "declaration_ref_name", [decl_name], an -> CPredicates.declaration_ref_name an decl_name | "decl_unavailable_in_supported_ios_sdk", [], an -> diff --git a/infer/src/clang/ctl_parser_types.ml b/infer/src/clang/ctl_parser_types.ml index dfe78614e..ef293a98d 100644 --- a/infer/src/clang/ctl_parser_types.ml +++ b/infer/src/clang/ctl_parser_types.ml @@ -80,25 +80,25 @@ let rec ast_node_name an = "" -let rec ast_node_cxx_full_name an = - let full_name qual_name = "::" ^ String.concat ~sep:"::" (List.rev qual_name) in +let rec ast_node_cxx_fully_qualified_name an = + let fully_qualified_name qual_name = "::" ^ String.concat ~sep:"::" (List.rev qual_name) in let open Clang_ast_t in match an with | Decl dec -> ( match Clang_ast_proj.get_named_decl_tuple dec with | Some (_, n) -> - full_name n.Clang_ast_t.ni_qual_name + fully_qualified_name n.Clang_ast_t.ni_qual_name | None -> "" ) | Stmt (DeclRefExpr (_, _, _, {drti_decl_ref= Some dr})) -> 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 (ImplicitCastExpr (_, [stmt], _, _)) | Stmt (PseudoObjectExpr (_, stmt :: _, _)) | Stmt (ParenExpr (_, [stmt], _)) | Stmt (CallExpr (_, stmt :: _, _)) -> - ast_node_cxx_full_name (Stmt stmt) + ast_node_cxx_fully_qualified_name (Stmt stmt) | _ -> "" diff --git a/infer/src/clang/ctl_parser_types.mli b/infer/src/clang/ctl_parser_types.mli index 1a7a20a9e..416a61f98 100644 --- a/infer/src/clang/ctl_parser_types.mli +++ b/infer/src/clang/ctl_parser_types.mli @@ -15,7 +15,7 @@ val ast_node_equal : ast_node -> ast_node -> bool 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 diff --git a/infer/tests/codetoanalyze/cpp/linters-for-test-only/linters_example.al b/infer/tests/codetoanalyze/cpp/linters-for-test-only/linters_example.al index 57ecb1af7..364af7f62 100644 --- a/infer/tests/codetoanalyze/cpp/linters-for-test-only/linters_example.al +++ b/infer/tests/codetoanalyze/cpp/linters-for-test-only/linters_example.al @@ -39,6 +39,6 @@ DEFINE-CHECKER FIND_CXX_METHOD_OVERRIDES_MATCHING = { }; DEFINE-CHECKER FIND_NODES_WITH_CXX_FULL_NAME = { - SET report_when = has_cxx_full_name(REGEXP("::Foo::Bar::")); - SET message = "%cxx_full_name% matches"; + SET report_when = has_cxx_fully_qualified_name(REGEXP("::Foo::Bar::")); + SET message = "%cxx_fully_qualified_name% matches"; };