{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift/pulls/comments/206330748","pull_request_review_id":141727279,"id":206330748,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjMzMDc0OA==","diff_hunk":"@@ -188,6 +188,28 @@ SILValue SILPHIArgument::getIncomingValue(SILBasicBlock *BB) {\n   return getIncomingValueForPred(Parent, BB, Index);\n }\n \n+const SILPHIArgument *BranchInst::getArgForOperand(const Operand *oper) const {\n+  assert(oper->getUser() == this);\n+  return cast<SILPHIArgument>(\n+      getDestBB()->getArgument(oper->getOperandNumber()));\n+}\n+\n+const SILPHIArgument *\n+CondBranchInst::getArgForOperand(const Operand *oper) const {\n+  assert(oper->getUser() == this);\n+\n+  unsigned operIdx = oper->getOperandNumber();\n+  if (isTrueOperandIndex(operIdx)) {\n+    return cast<SILPHIArgument>(getTrueBB()->getArgument(\n+        operIdx - getTrueOperands().front().getOperandNumber()));\n+  }\n+  if (isFalseOperandIndex(operIdx)) {\n+    return cast<SILPHIArgument>(getFalseBB()->getArgument(\n+        operIdx - getFalseOperands().front().getOperandNumber()));\n+  }\n+  return nullptr;","path":"lib/SIL/SILArgument.cpp","position":23,"original_position":23,"commit_id":"9df6f0c9653e5882c753812b2acb7c301469076a","original_commit_id":"9df6f0c9653e5882c753812b2acb7c301469076a","user":{"login":"atrick","id":2165663,"node_id":"MDQ6VXNlcjIxNjU2NjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2165663?v=4","gravatar_id":"","url":"https://api.github.com/users/atrick","html_url":"https://github.com/atrick","followers_url":"https://api.github.com/users/atrick/followers","following_url":"https://api.github.com/users/atrick/following{/other_user}","gists_url":"https://api.github.com/users/atrick/gists{/gist_id}","starred_url":"https://api.github.com/users/atrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atrick/subscriptions","organizations_url":"https://api.github.com/users/atrick/orgs","repos_url":"https://api.github.com/users/atrick/repos","events_url":"https://api.github.com/users/atrick/events{/privacy}","received_events_url":"https://api.github.com/users/atrick/received_events","type":"User","site_admin":false},"body":"In the doc comment:\r\n```\r\n  /// Returns nullptr for an operand with no block argument\r\n  /// (i.e the branch condition).\r\n```","created_at":"2018-07-30T21:38:14Z","updated_at":"2018-07-30T21:38:14Z","html_url":"https://github.com/apple/swift/pull/18234#discussion_r206330748","pull_request_url":"https://api.github.com/repos/apple/swift/pulls/18234","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/comments/206330748"},"html":{"href":"https://github.com/apple/swift/pull/18234#discussion_r206330748"},"pull_request":{"href":"https://api.github.com/repos/apple/swift/pulls/18234"}},"in_reply_to_id":206315831},"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/18234","id":203985122,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzOTg1MTIy","html_url":"https://github.com/apple/swift/pull/18234","diff_url":"https://github.com/apple/swift/pull/18234.diff","patch_url":"https://github.com/apple/swift/pull/18234.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/18234","number":18234,"state":"open","locked":false,"title":"[Exclusivity] fix diagnostics for conditional noescape closures.","user":{"login":"atrick","id":2165663,"node_id":"MDQ6VXNlcjIxNjU2NjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2165663?v=4","gravatar_id":"","url":"https://api.github.com/users/atrick","html_url":"https://github.com/atrick","followers_url":"https://api.github.com/users/atrick/followers","following_url":"https://api.github.com/users/atrick/following{/other_user}","gists_url":"https://api.github.com/users/atrick/gists{/gist_id}","starred_url":"https://api.github.com/users/atrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atrick/subscriptions","organizations_url":"https://api.github.com/users/atrick/orgs","repos_url":"https://api.github.com/users/atrick/repos","events_url":"https://api.github.com/users/atrick/events{/privacy}","received_events_url":"https://api.github.com/users/atrick/received_events","type":"User","site_admin":false},"body":"Add support to static diagnostics for tracking noescape closures through block\r\narguments.\r\n\r\nImprove the noescape closure SIL verification logic to match. Cleanup noescape\r\nclosure handling in both diagnostics and SIL verification to be more\r\nrobust--they must perfectly match each other.\r\n\r\nFixes <rdar://problem/42560459> [Exclusivity] Failure to statically diagnose a\r\nconflict when passing conditional noescape closures.\r\n\r\nInitially reported in [SR-8266] Compiler crash when checking exclusivity of\r\ninout alias.\r\n\r\nExample:\r\n\r\nstruct S {\r\n  var x: Int\r\n\r\n  mutating func takeNoescapeClosure(_ f: ()->()) { f() }\r\n\r\n  mutating func testNoescapePartialApplyPhiUse(z : Bool) {\r\n    func f1() {\r\n      x = 1 // expected-note {{conflicting access is here}}\r\n    }\r\n    func f2() {\r\n      x = 1 // expected-note {{conflicting access is here}}\r\n    }\r\n    takeNoescapeClosure(z ? f1 : f2)\r\n    // expected-error@-1 2 {{overlapping accesses to 'self', but modification requires exclusive access; consider copying to a local variable}}\r\n  }\r\n}","created_at":"2018-07-25T22:52:30Z","updated_at":"2018-07-30T21:38:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"feaf69c0f045f4328cd3225a9285019cd101f3f4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/18234/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/18234/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/18234/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/9df6f0c9653e5882c753812b2acb7c301469076a","head":{"label":"atrick:exclusivity-pa-phi-use","ref":"exclusivity-pa-phi-use","sha":"9df6f0c9653e5882c753812b2acb7c301469076a","user":{"login":"atrick","id":2165663,"node_id":"MDQ6VXNlcjIxNjU2NjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2165663?v=4","gravatar_id":"","url":"https://api.github.com/users/atrick","html_url":"https://github.com/atrick","followers_url":"https://api.github.com/users/atrick/followers","following_url":"https://api.github.com/users/atrick/following{/other_user}","gists_url":"https://api.github.com/users/atrick/gists{/gist_id}","starred_url":"https://api.github.com/users/atrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atrick/subscriptions","organizations_url":"https://api.github.com/users/atrick/orgs","repos_url":"https://api.github.com/users/atrick/repos","events_url":"https://api.github.com/users/atrick/events{/privacy}","received_events_url":"https://api.github.com/users/atrick/received_events","type":"User","site_admin":false},"repo":{"id":47422455,"node_id":"MDEwOlJlcG9zaXRvcnk0NzQyMjQ1NQ==","name":"swift","full_name":"atrick/swift","owner":{"login":"atrick","id":2165663,"node_id":"MDQ6VXNlcjIxNjU2NjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2165663?v=4","gravatar_id":"","url":"https://api.github.com/users/atrick","html_url":"https://github.com/atrick","followers_url":"https://api.github.com/users/atrick/followers","following_url":"https://api.github.com/users/atrick/following{/other_user}","gists_url":"https://api.github.com/users/atrick/gists{/gist_id}","starred_url":"https://api.github.com/users/atrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atrick/subscriptions","organizations_url":"https://api.github.com/users/atrick/orgs","repos_url":"https://api.github.com/users/atrick/repos","events_url":"https://api.github.com/users/atrick/events{/privacy}","received_events_url":"https://api.github.com/users/atrick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/atrick/swift","description":"The Swift Programming Language","fork":true,"url":"https://api.github.com/repos/atrick/swift","forks_url":"https://api.github.com/repos/atrick/swift/forks","keys_url":"https://api.github.com/repos/atrick/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atrick/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atrick/swift/teams","hooks_url":"https://api.github.com/repos/atrick/swift/hooks","issue_events_url":"https://api.github.com/repos/atrick/swift/issues/events{/number}","events_url":"https://api.github.com/repos/atrick/swift/events","assignees_url":"https://api.github.com/repos/atrick/swift/assignees{/user}","branches_url":"https://api.github.com/repos/atrick/swift/branches{/branch}","tags_url":"https://api.github.com/repos/atrick/swift/tags","blobs_url":"https://api.github.com/repos/atrick/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atrick/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atrick/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/atrick/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atrick/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/atrick/swift/languages","stargazers_url":"https://api.github.com/repos/atrick/swift/stargazers","contributors_url":"https://api.github.com/repos/atrick/swift/contributors","subscribers_url":"https://api.github.com/repos/atrick/swift/subscribers","subscription_url":"https://api.github.com/repos/atrick/swift/subscription","commits_url":"https://api.github.com/repos/atrick/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/atrick/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/atrick/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/atrick/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/atrick/swift/contents/{+path}","compare_url":"https://api.github.com/repos/atrick/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atrick/swift/merges","archive_url":"https://api.github.com/repos/atrick/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atrick/swift/downloads","issues_url":"https://api.github.com/repos/atrick/swift/issues{/number}","pulls_url":"https://api.github.com/repos/atrick/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/atrick/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/atrick/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atrick/swift/labels{/name}","releases_url":"https://api.github.com/repos/atrick/swift/releases{/id}","deployments_url":"https://api.github.com/repos/atrick/swift/deployments","created_at":"2015-12-04T18:42:22Z","updated_at":"2017-02-01T18:53:27Z","pushed_at":"2018-07-28T07:06:06Z","git_url":"git://github.com/atrick/swift.git","ssh_url":"git@github.com:atrick/swift.git","clone_url":"https://github.com/atrick/swift.git","svn_url":"https://github.com/atrick/swift","homepage":"","size":289999,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"26790d0c724b26de0d7dafcd4e5ef0707390c465","user":{"login":"apple","id":10639145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjM5MTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/10639145?v=4","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"node_id":"MDEwOlJlcG9zaXRvcnk0NDgzODk0OQ==","name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjM5MTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/10639145?v=4","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift/deployments","created_at":"2015-10-23T21:15:07Z","updated_at":"2018-07-30T20:02:07Z","pushed_at":"2018-07-30T21:20:14Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":319787,"stargazers_count":44687,"watchers_count":44687,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7046,"mirror_url":null,"archived":false,"open_issues_count":360,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":7046,"open_issues":360,"watchers":44687,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/18234"},"html":{"href":"https://github.com/apple/swift/pull/18234"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/18234"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/18234/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/18234/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/18234/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/9df6f0c9653e5882c753812b2acb7c301469076a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"atrick"}}