From 4dac490e8d08e8006e7d9c557456120eeecba585 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Fri, 18 Sep 2015 11:00:53 -0100 Subject: [PATCH] Update fcp to have newer clang Summary: Make infer run with clang 3.7.0. Small changes are due to differences in output of clang NOTE: this diff will require recompiling clang (it takes time) --- facebook-clang-plugins | 2 +- infer/src/clang/cFrontend_config.ml | 2 +- infer/src/clang/cFrontend_utils.ml | 2 +- infer/src/clang/cType_to_sil_type.ml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/facebook-clang-plugins b/facebook-clang-plugins index 331accb43..18f2b1d27 160000 --- a/facebook-clang-plugins +++ b/facebook-clang-plugins @@ -1 +1 @@ -Subproject commit 331accb43f98e4c567a925def3c6e3b5302c781d +Subproject commit 18f2b1d27208f42cb9a845ef917be84e8253fb92 diff --git a/infer/src/clang/cFrontend_config.ml b/infer/src/clang/cFrontend_config.ml index 6a257237e..e5b1f7f5f 100644 --- a/infer/src/clang/cFrontend_config.ml +++ b/infer/src/clang/cFrontend_config.ml @@ -136,7 +136,7 @@ let handleFailureInFunction = "handleFailureInFunction:file:lineNumber:descripti let fbAssertWithSignalAndLogFunctionHelper = "FBAssertWithSignalAndLogFunctionHelper" -let nonnull_attribute = "__nonnull" +let nonnull_attribute = "_Nonnull" let pseudo_object_type = "" diff --git a/infer/src/clang/cFrontend_utils.ml b/infer/src/clang/cFrontend_utils.ml index 158be6f56..adccfd536 100644 --- a/infer/src/clang/cFrontend_utils.ml +++ b/infer/src/clang/cFrontend_utils.ml @@ -243,7 +243,7 @@ struct (*TODO: take the attributes into account too. To be done after we get the attribute's arguments. *) let is_type_nonnull qt attributes = - Utils.string_is_prefix CFrontend_config.nonnull_attribute qt.Clang_ast_t.qt_raw + Utils.string_contains CFrontend_config.nonnull_attribute qt.Clang_ast_t.qt_raw let pointer_counter = ref 0 diff --git a/infer/src/clang/cType_to_sil_type.ml b/infer/src/clang/cType_to_sil_type.ml index ece15bcb5..3bed05943 100644 --- a/infer/src/clang/cType_to_sil_type.ml +++ b/infer/src/clang/cType_to_sil_type.ml @@ -113,7 +113,7 @@ and sil_type_of_c_type translate_decl tenv c_type = | LValueReferenceType (type_info, type_ptr) -> let typ = qual_type_ptr_to_sil_type translate_decl tenv type_ptr in Sil.Tptr (typ, Sil.Pk_reference) - | AttributedType type_info -> + | AttributedType (type_info, _) -> (match type_info.Clang_ast_t.ti_desugared_type with | Some type_ptr -> (match Ast_utils.get_type type_ptr with