From eeb7c3323084df58d32d43536abb09875f5917c8 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Tue, 8 Dec 2015 05:19:37 -0800 Subject: [PATCH] Update fcp Summary: public Update fcp, changes: 1. decl_ref from ObjcPropertyDecl to IvarDecl 2. Export location information in macro expansion, not macro definition Reviewed By: dulmarod, jvillard Differential Revision: D2733967 fb-gh-sync-id: 7d8ce00 --- facebook-clang-plugins | 2 +- .../c/frontend/booleans/bool_example.c.dot | 2 +- .../frontend/assertions/NSAssert_example.dot | 36 +++++++++---------- .../objc/frontend/block/dispatch.dot | 4 +-- .../objc/frontend/block/dispatch_examples.dot | 4 +-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/facebook-clang-plugins b/facebook-clang-plugins index b329dde55..545b4f6e2 160000 --- a/facebook-clang-plugins +++ b/facebook-clang-plugins @@ -1 +1 @@ -Subproject commit b329dde55a6dfe5cb58c861a5d702f3a99fd91e9 +Subproject commit 545b4f6e27473523ad624e9a6305d7fa234946d4 diff --git a/infer/tests/codetoanalyze/c/frontend/booleans/bool_example.c.dot b/infer/tests/codetoanalyze/c/frontend/booleans/bool_example.c.dot index 00d131896..c25623458 100644 --- a/infer/tests/codetoanalyze/c/frontend/booleans/bool_example.c.dot +++ b/infer/tests/codetoanalyze/c/frontend/booleans/bool_example.c.dot @@ -6,7 +6,7 @@ digraph iCFG { 2 [label="2: Exit revert \n " color=yellow style=filled] -1 [label="1: Start revert\nFormals: e:_Bool \nLocals: \n DECLARE_LOCALS(&return); [line -1]\n " color=yellow style=filled] +1 [label="1: Start revert\nFormals: e:_Bool \nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] 1 -> 3 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot b/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot index 31bdd605f..d074d6707 100644 --- a/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot +++ b/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot @@ -61,27 +61,27 @@ digraph iCFG { 94 -> 81 ; -93 [label="93: Prune (false branch) \n n$3=*&SIL_temp_conditional___87:int [line 38]\n NULLIFY(&SIL_temp_conditional___87,true); [line 38]\n PRUNE((n$3 == 0), false); [line 38]\n REMOVE_TEMPS(n$3); [line 38]\n " shape="invhouse"] +93 [label="93: Prune (false branch) \n n$3=*&SIL_temp_conditional___87:int [line 36]\n NULLIFY(&SIL_temp_conditional___87,true); [line 36]\n PRUNE((n$3 == 0), false); [line 36]\n REMOVE_TEMPS(n$3); [line 36]\n " shape="invhouse"] 93 -> 86 ; -92 [label="92: Prune (true branch) \n n$3=*&SIL_temp_conditional___87:int [line 38]\n NULLIFY(&SIL_temp_conditional___87,true); [line 38]\n PRUNE((n$3 != 0), true); [line 38]\n REMOVE_TEMPS(n$3); [line 38]\n NULLIFY(&target,false); [line 38]\n " shape="invhouse"] +92 [label="92: Prune (true branch) \n n$3=*&SIL_temp_conditional___87:int [line 36]\n NULLIFY(&SIL_temp_conditional___87,true); [line 36]\n PRUNE((n$3 != 0), true); [line 36]\n REMOVE_TEMPS(n$3); [line 36]\n NULLIFY(&target,false); [line 36]\n " shape="invhouse"] 92 -> 108 ; -91 [label="91: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___87); [line 38]\n *&SIL_temp_conditional___87:int =1 [line 38]\n APPLY_ABSTRACTION; [line 38]\n " shape="box"] +91 [label="91: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___87); [line 36]\n *&SIL_temp_conditional___87:int =1 [line 36]\n APPLY_ABSTRACTION; [line 36]\n " shape="box"] 91 -> 87 ; -90 [label="90: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___87); [line 38]\n *&SIL_temp_conditional___87:int =0 [line 38]\n APPLY_ABSTRACTION; [line 38]\n " shape="box"] +90 [label="90: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___87); [line 36]\n *&SIL_temp_conditional___87:int =0 [line 36]\n APPLY_ABSTRACTION; [line 36]\n " shape="box"] 90 -> 87 ; -89 [label="89: Prune (false branch) \n n$2=*&target:class A * [line 38]\n PRUNE((n$2 == 0), false); [line 38]\n REMOVE_TEMPS(n$2); [line 38]\n " shape="invhouse"] +89 [label="89: Prune (false branch) \n n$2=*&target:class A * [line 36]\n PRUNE((n$2 == 0), false); [line 36]\n REMOVE_TEMPS(n$2); [line 36]\n " shape="invhouse"] 89 -> 91 ; -88 [label="88: Prune (true branch) \n n$2=*&target:class A * [line 38]\n PRUNE((n$2 != 0), true); [line 38]\n REMOVE_TEMPS(n$2); [line 38]\n " shape="invhouse"] +88 [label="88: Prune (true branch) \n n$2=*&target:class A * [line 36]\n PRUNE((n$2 != 0), true); [line 36]\n REMOVE_TEMPS(n$2); [line 36]\n " shape="invhouse"] 88 -> 90 ; @@ -181,19 +181,19 @@ digraph iCFG { 65 -> 51 ; -64 [label="64: Prune (false branch) \n n$3=*&SIL_temp_conditional___57:int [line 33]\n NULLIFY(&SIL_temp_conditional___57,true); [line 33]\n PRUNE((n$3 == 0), false); [line 33]\n REMOVE_TEMPS(n$3); [line 33]\n " shape="invhouse"] +64 [label="64: Prune (false branch) \n n$3=*&SIL_temp_conditional___57:int [line 31]\n NULLIFY(&SIL_temp_conditional___57,true); [line 31]\n PRUNE((n$3 == 0), false); [line 31]\n REMOVE_TEMPS(n$3); [line 31]\n " shape="invhouse"] 64 -> 56 ; -63 [label="63: Prune (true branch) \n n$3=*&SIL_temp_conditional___57:int [line 33]\n NULLIFY(&SIL_temp_conditional___57,true); [line 33]\n PRUNE((n$3 != 0), true); [line 33]\n REMOVE_TEMPS(n$3); [line 33]\n NULLIFY(&target,false); [line 33]\n " shape="invhouse"] +63 [label="63: Prune (true branch) \n n$3=*&SIL_temp_conditional___57:int [line 31]\n NULLIFY(&SIL_temp_conditional___57,true); [line 31]\n PRUNE((n$3 != 0), true); [line 31]\n REMOVE_TEMPS(n$3); [line 31]\n NULLIFY(&target,false); [line 31]\n " shape="invhouse"] 63 -> 79 ; -62 [label="62: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___57); [line 33]\n *&SIL_temp_conditional___57:int =1 [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] +62 [label="62: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___57); [line 31]\n *&SIL_temp_conditional___57:int =1 [line 31]\n APPLY_ABSTRACTION; [line 31]\n " shape="box"] 62 -> 57 ; -61 [label="61: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___57); [line 33]\n *&SIL_temp_conditional___57:int =0 [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] +61 [label="61: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___57); [line 31]\n *&SIL_temp_conditional___57:int =0 [line 31]\n APPLY_ABSTRACTION; [line 31]\n " shape="box"] 61 -> 57 ; @@ -287,19 +287,19 @@ digraph iCFG { 39 -> 25 ; -38 [label="38: Prune (false branch) \n n$18=*&SIL_temp_conditional___31:int [line 26]\n NULLIFY(&SIL_temp_conditional___31,true); [line 26]\n PRUNE((n$18 == 0), false); [line 26]\n REMOVE_TEMPS(n$18); [line 26]\n " shape="invhouse"] +38 [label="38: Prune (false branch) \n n$18=*&SIL_temp_conditional___31:int [line 24]\n NULLIFY(&SIL_temp_conditional___31,true); [line 24]\n PRUNE((n$18 == 0), false); [line 24]\n REMOVE_TEMPS(n$18); [line 24]\n " shape="invhouse"] 38 -> 30 ; -37 [label="37: Prune (true branch) \n n$18=*&SIL_temp_conditional___31:int [line 26]\n NULLIFY(&SIL_temp_conditional___31,true); [line 26]\n PRUNE((n$18 != 0), true); [line 26]\n REMOVE_TEMPS(n$18); [line 26]\n NULLIFY(&a,false); [line 26]\n " shape="invhouse"] +37 [label="37: Prune (true branch) \n n$18=*&SIL_temp_conditional___31:int [line 24]\n NULLIFY(&SIL_temp_conditional___31,true); [line 24]\n PRUNE((n$18 != 0), true); [line 24]\n REMOVE_TEMPS(n$18); [line 24]\n NULLIFY(&a,false); [line 24]\n " shape="invhouse"] 37 -> 46 ; -36 [label="36: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___31); [line 26]\n *&SIL_temp_conditional___31:int =1 [line 26]\n APPLY_ABSTRACTION; [line 26]\n " shape="box"] +36 [label="36: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___31); [line 24]\n *&SIL_temp_conditional___31:int =1 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] 36 -> 31 ; -35 [label="35: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___31); [line 26]\n *&SIL_temp_conditional___31:int =0 [line 26]\n APPLY_ABSTRACTION; [line 26]\n " shape="box"] +35 [label="35: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___31); [line 24]\n *&SIL_temp_conditional___31:int =0 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] 35 -> 31 ; @@ -382,19 +382,19 @@ digraph iCFG { 16 -> 2 ; -15 [label="15: Prune (false branch) \n n$3=*&SIL_temp_conditional___8:int [line 21]\n NULLIFY(&SIL_temp_conditional___8,true); [line 21]\n PRUNE((n$3 == 0), false); [line 21]\n REMOVE_TEMPS(n$3); [line 21]\n " shape="invhouse"] +15 [label="15: Prune (false branch) \n n$3=*&SIL_temp_conditional___8:int [line 19]\n NULLIFY(&SIL_temp_conditional___8,true); [line 19]\n PRUNE((n$3 == 0), false); [line 19]\n REMOVE_TEMPS(n$3); [line 19]\n " shape="invhouse"] 15 -> 7 ; -14 [label="14: Prune (true branch) \n n$3=*&SIL_temp_conditional___8:int [line 21]\n NULLIFY(&SIL_temp_conditional___8,true); [line 21]\n PRUNE((n$3 != 0), true); [line 21]\n REMOVE_TEMPS(n$3); [line 21]\n NULLIFY(&target,false); [line 21]\n " shape="invhouse"] +14 [label="14: Prune (true branch) \n n$3=*&SIL_temp_conditional___8:int [line 19]\n NULLIFY(&SIL_temp_conditional___8,true); [line 19]\n PRUNE((n$3 != 0), true); [line 19]\n REMOVE_TEMPS(n$3); [line 19]\n NULLIFY(&target,false); [line 19]\n " shape="invhouse"] 14 -> 23 ; -13 [label="13: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___8); [line 21]\n *&SIL_temp_conditional___8:int =1 [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] +13 [label="13: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___8); [line 19]\n *&SIL_temp_conditional___8:int =1 [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] 13 -> 8 ; -12 [label="12: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___8); [line 21]\n *&SIL_temp_conditional___8:int =0 [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] +12 [label="12: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___8); [line 19]\n *&SIL_temp_conditional___8:int =0 [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] 12 -> 8 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot b/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot index 807378c29..c9571e0e1 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot @@ -80,7 +80,7 @@ digraph iCFG { 9 -> 16 ; -8 [label="8: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_sharedInstance______1); [line 27]\n n$5=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_sharedInstance______1 ):unsigned long ) [line 27]\n *&__objc_anonymous_block_A_sharedInstance______1:class __objc_anonymous_block_A_sharedInstance______1 =n$5 [line 27]\n n$6=*&#GB$A_sharedInstance_sharedInstance:struct objc_object * [line 27]\n *n$5.A_sharedInstance_sharedInstance:struct objc_object *=n$6 [line 27]\n *&infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*)=(_fun___objc_anonymous_block_A_sharedInstance______1) [line 29]\n REMOVE_TEMPS(n$5,n$6); [line 29]\n " shape="box"] +8 [label="8: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_sharedInstance______1); [line 27]\n n$5=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_sharedInstance______1 ):unsigned long ) [line 27]\n *&__objc_anonymous_block_A_sharedInstance______1:class __objc_anonymous_block_A_sharedInstance______1 =n$5 [line 27]\n n$6=*&#GB$A_sharedInstance_sharedInstance:struct objc_object * [line 27]\n *n$5.A_sharedInstance_sharedInstance:struct objc_object *=n$6 [line 27]\n *&infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*)=(_fun___objc_anonymous_block_A_sharedInstance______1) [line 27]\n REMOVE_TEMPS(n$5,n$6); [line 27]\n " shape="box"] 8 -> 4 ; @@ -95,7 +95,7 @@ digraph iCFG { 5 -> 7 ; -4 [label="4: Call n$1 \n n$1=*&infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*) [line 29]\n n$2=n$1() [line 29]\n REMOVE_TEMPS(n$1,n$2); [line 29]\n NULLIFY(&infer___objc_anonymous_block_A_sharedInstance______1,false); [line 29]\n " shape="box"] +4 [label="4: Call n$1 \n n$1=*&infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*) [line 27]\n n$2=n$1() [line 27]\n REMOVE_TEMPS(n$1,n$2); [line 27]\n NULLIFY(&infer___objc_anonymous_block_A_sharedInstance______1,false); [line 27]\n " shape="box"] 4 -> 3 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot b/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot index 5999973ab..27be0d0a6 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot @@ -193,7 +193,7 @@ digraph iCFG { 10 -> 9 ; -9 [label="9: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_once_example______1); [line 24]\n n$7=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_once_example______1 ):unsigned long ) [line 24]\n *&__objc_anonymous_block_A_dispatch_once_example______1:class __objc_anonymous_block_A_dispatch_once_example______1 =n$7 [line 24]\n n$8=*&#GB$A_dispatch_once_example_a:class A * [line 24]\n *n$7.A_dispatch_once_example_a:class A *=n$8 [line 24]\n *&infer___objc_anonymous_block_A_dispatch_once_example______1:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_once_example______1) [line 23]\n REMOVE_TEMPS(n$7,n$8); [line 23]\n " shape="box"] +9 [label="9: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_once_example______1); [line 24]\n n$7=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_once_example______1 ):unsigned long ) [line 24]\n *&__objc_anonymous_block_A_dispatch_once_example______1:class __objc_anonymous_block_A_dispatch_once_example______1 =n$7 [line 24]\n n$8=*&#GB$A_dispatch_once_example_a:class A * [line 24]\n *n$7.A_dispatch_once_example_a:class A *=n$8 [line 24]\n *&infer___objc_anonymous_block_A_dispatch_once_example______1:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_once_example______1) [line 24]\n REMOVE_TEMPS(n$7,n$8); [line 24]\n " shape="box"] 9 -> 4 ; @@ -212,7 +212,7 @@ digraph iCFG { 5 -> 8 ; -4 [label="4: Call n$2 \n n$2=*&infer___objc_anonymous_block_A_dispatch_once_example______1:_fn_ (*) [line 23]\n n$3=n$2() [line 23]\n REMOVE_TEMPS(n$2,n$3); [line 23]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_once_example______1,false); [line 23]\n " shape="box"] +4 [label="4: Call n$2 \n n$2=*&infer___objc_anonymous_block_A_dispatch_once_example______1:_fn_ (*) [line 24]\n n$3=n$2() [line 24]\n REMOVE_TEMPS(n$2,n$3); [line 24]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_once_example______1,false); [line 24]\n " shape="box"] 4 -> 3 ;