diff --git a/infer/models/cpp/src/folly_split.cpp b/infer/models/cpp/src/folly_split.cpp deleted file mode 100644 index a40c9e02c..000000000 --- a/infer/models/cpp/src/folly_split.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2017 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -#include - -namespace folly { - -#define TYPEVAR(Name) \ - struct __attribute__((annotate("__infer_type_var"))) Name {}; - -TYPEVAR(a1); -TYPEVAR(a2); -TYPEVAR(a3); - -template -void split(const Delim& delimiter, - const String& input, - std::vector& out, - bool ignoreEmpty = false) { - out.resize(1); - return; -} - -template __attribute__((annotate("__infer_generic_model"))) void -split(const a1& delimiter, - const a2& input, - std::vector& out, - const bool ignoreEmpty); -} diff --git a/infer/src/clang/CType_decl.ml b/infer/src/clang/CType_decl.ml index 398563eef..7849b4b8d 100644 --- a/infer/src/clang/CType_decl.ml +++ b/infer/src/clang/CType_decl.ml @@ -240,19 +240,13 @@ let rec get_struct_fields tenv decl = (** For a record declaration it returns/constructs the type *) and get_record_declaration_type tenv decl = let definition_decl = get_record_definition decl in - match get_record_custom_type tenv definition_decl with + match get_record_friend_decl_type tenv definition_decl with | Some t -> t.Typ.desc | None -> get_record_struct_type tenv definition_decl -and get_record_custom_type tenv definition_decl = - let result = get_record_friend_decl_type tenv definition_decl in - let result = if Option.is_none result then get_record_as_typevar definition_decl else result in - result - - and get_record_friend_decl_type tenv definition_decl = let open Clang_ast_t in match definition_decl with @@ -263,24 +257,6 @@ and get_record_friend_decl_type tenv definition_decl = None -and get_record_as_typevar (definition_decl: Clang_ast_t.decl) = - let open Clang_ast_t in - match definition_decl with - | CXXRecordDecl (decl_info, name_info, _, _, _, _, _, _) -> - let is_infer_typevar = function - | AnnotateAttr {ai_parameters= [_; name; _]} when String.equal name "__infer_type_var" -> - true - | _ -> - false - in - if List.exists ~f:is_infer_typevar decl_info.di_attributes then - let tname = CAst_utils.get_qualified_name name_info |> QualifiedCppName.to_qual_string in - Some (Typ.mk (TVar tname)) - else None - | _ -> - None - - (* We need to take the name out of the type as the struct can be anonymous If tenv is not passed, then template instantiaion information may be incorrect, as it defaults to Typ.NoTemplate *)