From d763cfdd6f0827ffac13342a6698eb8562b1c2b8 Mon Sep 17 00:00:00 2001 From: Dulma Churchill Date: Wed, 7 Mar 2018 06:26:31 -0800 Subject: [PATCH] [clang] Keep QualifiedCppName free of clang frontend modules dependencies Reviewed By: da319 Differential Revision: D7179736 fbshipit-source-id: 7b4055b --- infer/src/IR/QualifiedCppName.ml | 4 ++-- infer/src/IR/QualifiedCppName.mli | 2 +- infer/src/clang/cMethod_trans.ml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/infer/src/IR/QualifiedCppName.ml b/infer/src/IR/QualifiedCppName.ml index 87a5b91dc..cc6e411c0 100644 --- a/infer/src/IR/QualifiedCppName.ml +++ b/infer/src/IR/QualifiedCppName.ml @@ -46,8 +46,8 @@ let of_rev_list = ident let cpp_separator = "::" -let from_field_qualified_name name_decl_info = - match name_decl_info.Clang_ast_t.ni_qual_name with +let from_field_qualified_name qual_name = + match qual_name with | _ :: rest -> rest | _ -> diff --git a/infer/src/IR/QualifiedCppName.mli b/infer/src/IR/QualifiedCppName.mli index 30bba437b..ee0334c3c 100644 --- a/infer/src/IR/QualifiedCppName.mli +++ b/infer/src/IR/QualifiedCppName.mli @@ -47,7 +47,7 @@ val of_list : string list -> t val of_rev_list : string list -> t (** given reversed list of qualifiers, produce qualified name (ie. ["move", "std"] for std::move )*) -val from_field_qualified_name : Clang_ast_t.named_decl_info -> t +val from_field_qualified_name : t -> t val pp : Format.formatter -> t -> unit diff --git a/infer/src/clang/cMethod_trans.ml b/infer/src/clang/cMethod_trans.ml index 52a98f7f8..3b0abc96a 100644 --- a/infer/src/clang/cMethod_trans.ml +++ b/infer/src/clang/cMethod_trans.ml @@ -522,7 +522,8 @@ let get_objc_property_accessor tenv ms = -> ( let class_tname = Typ.Name.Objc.from_qual_name - (QualifiedCppName.from_field_qualified_name name_decl_info) + (QualifiedCppName.from_field_qualified_name + (QualifiedCppName.of_rev_list name_decl_info.ni_qual_name)) in let field_name = CGeneral_utils.mk_class_field_name class_tname name_decl_info.ni_name in match Tenv.lookup tenv class_tname with