{"action":"created","comment":{"url":"https://api.github.com/repos/ldc-developers/ldc/pulls/comments/72910765","id":72910765,"diff_hunk":"@@ -351,14 +351,18 @@ class ScopeStack {\n \n template <typename T>\n llvm::CallSite ScopeStack::callOrInvoke(llvm::Value *callee, const T &args,\n-                                        const char *name) {\n+                                        const char *name, bool isNothrow) {\n   // If this is a direct call, we might be able to use the callee attributes\n   // to our advantage.\n   llvm::Function *calleeFn = llvm::dyn_cast<llvm::Function>(callee);\n \n   // Intrinsics don't support invoking and 'nounwind' functions don't need it.\n-  const bool doesNotThrow =\n-      calleeFn && (calleeFn->isIntrinsic() || calleeFn->doesNotThrow());\n+  const bool isIntrinsic = calleeFn && calleeFn->isIntrinsic();\n+  if (!isNothrow)\n+    isNothrow = (calleeFn && calleeFn->doesNotThrow());\n+\n+  // ignore \"nothrow\" inside a try/catch block to allow catching Errors\n+  const bool doesNotThrow = isIntrinsic || (isNothrow && catchScopes.empty());","path":"ir/irfunction.h","position":27,"original_position":27,"commit_id":"bbdd3385167e9f7c5ae53ee735727d3f373a3f01","original_commit_id":"bbdd3385167e9f7c5ae53ee735727d3f373a3f01","user":{"login":"kinke","id":1889215,"avatar_url":"https://avatars.githubusercontent.com/u/1889215?v=3","gravatar_id":"","url":"https://api.github.com/users/kinke","html_url":"https://github.com/kinke","followers_url":"https://api.github.com/users/kinke/followers","following_url":"https://api.github.com/users/kinke/following{/other_user}","gists_url":"https://api.github.com/users/kinke/gists{/gist_id}","starred_url":"https://api.github.com/users/kinke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinke/subscriptions","organizations_url":"https://api.github.com/users/kinke/orgs","repos_url":"https://api.github.com/users/kinke/repos","events_url":"https://api.github.com/users/kinke/events{/privacy}","received_events_url":"https://api.github.com/users/kinke/received_events","type":"User","site_admin":false},"body":"Yes, I think the hardcoded druntime functions should be the only ones featuring `nounwind`. So let's just assume the attribute is set appropriately, i.e., only for functions which really never throw. We've been calling them directly for quite a while now.","created_at":"2016-07-31T21:00:48Z","updated_at":"2016-07-31T21:00:48Z","html_url":"https://github.com/ldc-developers/ldc/pull/1202#discussion_r72910765","pull_request_url":"https://api.github.com/repos/ldc-developers/ldc/pulls/1202","_links":{"self":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/comments/72910765"},"html":{"href":"https://github.com/ldc-developers/ldc/pull/1202#discussion_r72910765"},"pull_request":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/1202"}}},"pull_request":{"url":"https://api.github.com/repos/ldc-developers/ldc/pulls/1202","id":50060027,"html_url":"https://github.com/ldc-developers/ldc/pull/1202","diff_url":"https://github.com/ldc-developers/ldc/pull/1202.diff","patch_url":"https://github.com/ldc-developers/ldc/pull/1202.patch","issue_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1202","number":1202,"state":"open","locked":false,"title":"propagate \"nothrow\" to LLVM IR","user":{"login":"rainers","id":702284,"avatar_url":"https://avatars.githubusercontent.com/u/702284?v=3","gravatar_id":"","url":"https://api.github.com/users/rainers","html_url":"https://github.com/rainers","followers_url":"https://api.github.com/users/rainers/followers","following_url":"https://api.github.com/users/rainers/following{/other_user}","gists_url":"https://api.github.com/users/rainers/gists{/gist_id}","starred_url":"https://api.github.com/users/rainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainers/subscriptions","organizations_url":"https://api.github.com/users/rainers/orgs","repos_url":"https://api.github.com/users/rainers/repos","events_url":"https://api.github.com/users/rainers/events{/privacy}","received_events_url":"https://api.github.com/users/rainers/received_events","type":"User","site_admin":false},"body":"I noticed that \"nothrow\" was never propageted to the LLVM function object, causing these function to still be \"invoked\" instead of \"called\". I guess adding this can reduce code bloat quite a bit for functions with cleanup code.\r\n\r\nMaybe omitting it was a deliberate choice? It can change the way exceptions are caught, because no landing pads are generated if the try block is known to be \"nothrow\". This shows in the unittest of lifetime.d: https://github.com/ldc-developers/druntime/blob/ldc/src/rt/lifetime.d#L2439 which now fails. I think the test is wrong here.","created_at":"2015-11-08T13:15:15Z","updated_at":"2016-07-31T21:00:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e90291ce677768b1989b74e53249cf9c5d78838","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ldc-developers/ldc/pulls/1202/commits","review_comments_url":"https://api.github.com/repos/ldc-developers/ldc/pulls/1202/comments","review_comment_url":"https://api.github.com/repos/ldc-developers/ldc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ldc-developers/ldc/issues/1202/comments","statuses_url":"https://api.github.com/repos/ldc-developers/ldc/statuses/bbdd3385167e9f7c5ae53ee735727d3f373a3f01","head":{"label":"rainers:doesNotThrow","ref":"doesNotThrow","sha":"bbdd3385167e9f7c5ae53ee735727d3f373a3f01","user":{"login":"rainers","id":702284,"avatar_url":"https://avatars.githubusercontent.com/u/702284?v=3","gravatar_id":"","url":"https://api.github.com/users/rainers","html_url":"https://github.com/rainers","followers_url":"https://api.github.com/users/rainers/followers","following_url":"https://api.github.com/users/rainers/following{/other_user}","gists_url":"https://api.github.com/users/rainers/gists{/gist_id}","starred_url":"https://api.github.com/users/rainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainers/subscriptions","organizations_url":"https://api.github.com/users/rainers/orgs","repos_url":"https://api.github.com/users/rainers/repos","events_url":"https://api.github.com/users/rainers/events{/privacy}","received_events_url":"https://api.github.com/users/rainers/received_events","type":"User","site_admin":false},"repo":{"id":44043472,"name":"ldc","full_name":"rainers/ldc","owner":{"login":"rainers","id":702284,"avatar_url":"https://avatars.githubusercontent.com/u/702284?v=3","gravatar_id":"","url":"https://api.github.com/users/rainers","html_url":"https://github.com/rainers","followers_url":"https://api.github.com/users/rainers/followers","following_url":"https://api.github.com/users/rainers/following{/other_user}","gists_url":"https://api.github.com/users/rainers/gists{/gist_id}","starred_url":"https://api.github.com/users/rainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainers/subscriptions","organizations_url":"https://api.github.com/users/rainers/orgs","repos_url":"https://api.github.com/users/rainers/repos","events_url":"https://api.github.com/users/rainers/events{/privacy}","received_events_url":"https://api.github.com/users/rainers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rainers/ldc","description":"The LLVM-based D compiler.","fork":true,"url":"https://api.github.com/repos/rainers/ldc","forks_url":"https://api.github.com/repos/rainers/ldc/forks","keys_url":"https://api.github.com/repos/rainers/ldc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rainers/ldc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rainers/ldc/teams","hooks_url":"https://api.github.com/repos/rainers/ldc/hooks","issue_events_url":"https://api.github.com/repos/rainers/ldc/issues/events{/number}","events_url":"https://api.github.com/repos/rainers/ldc/events","assignees_url":"https://api.github.com/repos/rainers/ldc/assignees{/user}","branches_url":"https://api.github.com/repos/rainers/ldc/branches{/branch}","tags_url":"https://api.github.com/repos/rainers/ldc/tags","blobs_url":"https://api.github.com/repos/rainers/ldc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rainers/ldc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rainers/ldc/git/refs{/sha}","trees_url":"https://api.github.com/repos/rainers/ldc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rainers/ldc/statuses/{sha}","languages_url":"https://api.github.com/repos/rainers/ldc/languages","stargazers_url":"https://api.github.com/repos/rainers/ldc/stargazers","contributors_url":"https://api.github.com/repos/rainers/ldc/contributors","subscribers_url":"https://api.github.com/repos/rainers/ldc/subscribers","subscription_url":"https://api.github.com/repos/rainers/ldc/subscription","commits_url":"https://api.github.com/repos/rainers/ldc/commits{/sha}","git_commits_url":"https://api.github.com/repos/rainers/ldc/git/commits{/sha}","comments_url":"https://api.github.com/repos/rainers/ldc/comments{/number}","issue_comment_url":"https://api.github.com/repos/rainers/ldc/issues/comments{/number}","contents_url":"https://api.github.com/repos/rainers/ldc/contents/{+path}","compare_url":"https://api.github.com/repos/rainers/ldc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rainers/ldc/merges","archive_url":"https://api.github.com/repos/rainers/ldc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rainers/ldc/downloads","issues_url":"https://api.github.com/repos/rainers/ldc/issues{/number}","pulls_url":"https://api.github.com/repos/rainers/ldc/pulls{/number}","milestones_url":"https://api.github.com/repos/rainers/ldc/milestones{/number}","notifications_url":"https://api.github.com/repos/rainers/ldc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rainers/ldc/labels{/name}","releases_url":"https://api.github.com/repos/rainers/ldc/releases{/id}","deployments_url":"https://api.github.com/repos/rainers/ldc/deployments","created_at":"2015-10-11T07:40:53Z","updated_at":"2015-10-11T07:40:59Z","pushed_at":"2016-06-28T06:30:05Z","git_url":"git://github.com/rainers/ldc.git","ssh_url":"git@github.com:rainers/ldc.git","clone_url":"https://github.com/rainers/ldc.git","svn_url":"https://github.com/rainers/ldc","homepage":"http://wiki.dlang.org/LDC","size":24920,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ldc-developers:master","ref":"master","sha":"5efb6bd1eb53e3b5a02d1368b32211a3ac71880c","user":{"login":"ldc-developers","id":960112,"avatar_url":"https://avatars.githubusercontent.com/u/960112?v=3","gravatar_id":"","url":"https://api.github.com/users/ldc-developers","html_url":"https://github.com/ldc-developers","followers_url":"https://api.github.com/users/ldc-developers/followers","following_url":"https://api.github.com/users/ldc-developers/following{/other_user}","gists_url":"https://api.github.com/users/ldc-developers/gists{/gist_id}","starred_url":"https://api.github.com/users/ldc-developers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldc-developers/subscriptions","organizations_url":"https://api.github.com/users/ldc-developers/orgs","repos_url":"https://api.github.com/users/ldc-developers/repos","events_url":"https://api.github.com/users/ldc-developers/events{/privacy}","received_events_url":"https://api.github.com/users/ldc-developers/received_events","type":"Organization","site_admin":false},"repo":{"id":2174666,"name":"ldc","full_name":"ldc-developers/ldc","owner":{"login":"ldc-developers","id":960112,"avatar_url":"https://avatars.githubusercontent.com/u/960112?v=3","gravatar_id":"","url":"https://api.github.com/users/ldc-developers","html_url":"https://github.com/ldc-developers","followers_url":"https://api.github.com/users/ldc-developers/followers","following_url":"https://api.github.com/users/ldc-developers/following{/other_user}","gists_url":"https://api.github.com/users/ldc-developers/gists{/gist_id}","starred_url":"https://api.github.com/users/ldc-developers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldc-developers/subscriptions","organizations_url":"https://api.github.com/users/ldc-developers/orgs","repos_url":"https://api.github.com/users/ldc-developers/repos","events_url":"https://api.github.com/users/ldc-developers/events{/privacy}","received_events_url":"https://api.github.com/users/ldc-developers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ldc-developers/ldc","description":"The LLVM-based D compiler.","fork":false,"url":"https://api.github.com/repos/ldc-developers/ldc","forks_url":"https://api.github.com/repos/ldc-developers/ldc/forks","keys_url":"https://api.github.com/repos/ldc-developers/ldc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ldc-developers/ldc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ldc-developers/ldc/teams","hooks_url":"https://api.github.com/repos/ldc-developers/ldc/hooks","issue_events_url":"https://api.github.com/repos/ldc-developers/ldc/issues/events{/number}","events_url":"https://api.github.com/repos/ldc-developers/ldc/events","assignees_url":"https://api.github.com/repos/ldc-developers/ldc/assignees{/user}","branches_url":"https://api.github.com/repos/ldc-developers/ldc/branches{/branch}","tags_url":"https://api.github.com/repos/ldc-developers/ldc/tags","blobs_url":"https://api.github.com/repos/ldc-developers/ldc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ldc-developers/ldc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ldc-developers/ldc/git/refs{/sha}","trees_url":"https://api.github.com/repos/ldc-developers/ldc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ldc-developers/ldc/statuses/{sha}","languages_url":"https://api.github.com/repos/ldc-developers/ldc/languages","stargazers_url":"https://api.github.com/repos/ldc-developers/ldc/stargazers","contributors_url":"https://api.github.com/repos/ldc-developers/ldc/contributors","subscribers_url":"https://api.github.com/repos/ldc-developers/ldc/subscribers","subscription_url":"https://api.github.com/repos/ldc-developers/ldc/subscription","commits_url":"https://api.github.com/repos/ldc-developers/ldc/commits{/sha}","git_commits_url":"https://api.github.com/repos/ldc-developers/ldc/git/commits{/sha}","comments_url":"https://api.github.com/repos/ldc-developers/ldc/comments{/number}","issue_comment_url":"https://api.github.com/repos/ldc-developers/ldc/issues/comments{/number}","contents_url":"https://api.github.com/repos/ldc-developers/ldc/contents/{+path}","compare_url":"https://api.github.com/repos/ldc-developers/ldc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ldc-developers/ldc/merges","archive_url":"https://api.github.com/repos/ldc-developers/ldc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ldc-developers/ldc/downloads","issues_url":"https://api.github.com/repos/ldc-developers/ldc/issues{/number}","pulls_url":"https://api.github.com/repos/ldc-developers/ldc/pulls{/number}","milestones_url":"https://api.github.com/repos/ldc-developers/ldc/milestones{/number}","notifications_url":"https://api.github.com/repos/ldc-developers/ldc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ldc-developers/ldc/labels{/name}","releases_url":"https://api.github.com/repos/ldc-developers/ldc/releases{/id}","deployments_url":"https://api.github.com/repos/ldc-developers/ldc/deployments","created_at":"2011-08-08T17:10:27Z","updated_at":"2016-07-31T20:19:48Z","pushed_at":"2016-07-31T16:39:18Z","git_url":"git://github.com/ldc-developers/ldc.git","ssh_url":"git@github.com:ldc-developers/ldc.git","clone_url":"https://github.com/ldc-developers/ldc.git","svn_url":"https://github.com/ldc-developers/ldc","homepage":"http://wiki.dlang.org/LDC","size":29347,"stargazers_count":477,"watchers_count":477,"language":"D","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":100,"mirror_url":null,"open_issues_count":178,"forks":100,"open_issues":178,"watchers":477,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/1202"},"html":{"href":"https://github.com/ldc-developers/ldc/pull/1202"},"issue":{"href":"https://api.github.com/repos/ldc-developers/ldc/issues/1202"},"comments":{"href":"https://api.github.com/repos/ldc-developers/ldc/issues/1202/comments"},"review_comments":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/1202/comments"},"review_comment":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/1202/commits"},"statuses":{"href":"https://api.github.com/repos/ldc-developers/ldc/statuses/bbdd3385167e9f7c5ae53ee735727d3f373a3f01"}}}}
{"actor":{"display_login":"kinke"}}