{"action":"created","comment":{"url":"https://api.github.com/repos/WebAssembly/binaryen/pulls/comments/62888686","id":62888686,"diff_hunk":"@@ -46,6 +46,34 @@ struct BreakSeeker : public PostWalker<BreakSeeker, Visitor<BreakSeeker>> {\n   }\n };\n \n+// Finds all functions that are reachable via direct calls.\n+\n+struct DirectCallGraphAnalyzer : public PostWalker<DirectCallGraphAnalyzer, Visitor<DirectCallGraphAnalyzer>> {\n+  Module *module;\n+  std::vector<Function*> queue;\n+  std::unordered_set<Function*> reachable;\n+\n+  DirectCallGraphAnalyzer(Module* module, std::vector<Function*> root) : module(module) {","path":"src/ast_utils.h","position":null,"original_position":11,"commit_id":"f50839d6f59d5c9fe0d7753f45af8d1b9b514d38","original_commit_id":"e3c5463f26c6bd58cf1b51a090d3baf04d5bb10f","user":{"login":"binji","id":1245315,"avatar_url":"https://avatars.githubusercontent.com/u/1245315?v=3","gravatar_id":"","url":"https://api.github.com/users/binji","html_url":"https://github.com/binji","followers_url":"https://api.github.com/users/binji/followers","following_url":"https://api.github.com/users/binji/following{/other_user}","gists_url":"https://api.github.com/users/binji/gists{/gist_id}","starred_url":"https://api.github.com/users/binji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binji/subscriptions","organizations_url":"https://api.github.com/users/binji/orgs","repos_url":"https://api.github.com/users/binji/repos","events_url":"https://api.github.com/users/binji/events{/privacy}","received_events_url":"https://api.github.com/users/binji/received_events","type":"User","site_admin":false},"body":"That's why some people write `Struct const *var;` instead of `const Struct *var;`, so in general you can just say that const modifies the thing to the left. Of course you can make it more complicated than that... :-)","created_at":"2016-05-11T17:18:43Z","updated_at":"2016-05-11T17:18:43Z","html_url":"https://github.com/WebAssembly/binaryen/pull/463#discussion_r62888686","pull_request_url":"https://api.github.com/repos/WebAssembly/binaryen/pulls/463","_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/binaryen/pulls/comments/62888686"},"html":{"href":"https://github.com/WebAssembly/binaryen/pull/463#discussion_r62888686"},"pull_request":{"href":"https://api.github.com/repos/WebAssembly/binaryen/pulls/463"}}},"pull_request":{"url":"https://api.github.com/repos/WebAssembly/binaryen/pulls/463","id":69597902,"html_url":"https://github.com/WebAssembly/binaryen/pull/463","diff_url":"https://github.com/WebAssembly/binaryen/pull/463.diff","patch_url":"https://github.com/WebAssembly/binaryen/pull/463.patch","issue_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/463","number":463,"state":"open","locked":false,"title":"Add remove unused functions pass.","user":{"login":"mbebenita","id":311082,"avatar_url":"https://avatars.githubusercontent.com/u/311082?v=3","gravatar_id":"","url":"https://api.github.com/users/mbebenita","html_url":"https://github.com/mbebenita","followers_url":"https://api.github.com/users/mbebenita/followers","following_url":"https://api.github.com/users/mbebenita/following{/other_user}","gists_url":"https://api.github.com/users/mbebenita/gists{/gist_id}","starred_url":"https://api.github.com/users/mbebenita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbebenita/subscriptions","organizations_url":"https://api.github.com/users/mbebenita/orgs","repos_url":"https://api.github.com/users/mbebenita/repos","events_url":"https://api.github.com/users/mbebenita/events{/privacy}","received_events_url":"https://api.github.com/users/mbebenita/received_events","type":"User","site_admin":false},"body":"This pass removes functions that are not reachable from a root set of functions. The root set includes the start function, all exported functions and all functions that can be called indirectly.\r\n\r\n(We could make the pass more precise by using a type-based indirect call graph analysis. In large programs, each type is going to be called so it would probably not help much.)","created_at":"2016-05-11T00:13:38Z","updated_at":"2016-05-11T17:18:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b537b1fb7a3fbb5724c8c736c7b6887d9c68f56","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WebAssembly/binaryen/pulls/463/commits","review_comments_url":"https://api.github.com/repos/WebAssembly/binaryen/pulls/463/comments","review_comment_url":"https://api.github.com/repos/WebAssembly/binaryen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/463/comments","statuses_url":"https://api.github.com/repos/WebAssembly/binaryen/statuses/f50839d6f59d5c9fe0d7753f45af8d1b9b514d38","head":{"label":"mbebenita:dce-functions","ref":"dce-functions","sha":"f50839d6f59d5c9fe0d7753f45af8d1b9b514d38","user":{"login":"mbebenita","id":311082,"avatar_url":"https://avatars.githubusercontent.com/u/311082?v=3","gravatar_id":"","url":"https://api.github.com/users/mbebenita","html_url":"https://github.com/mbebenita","followers_url":"https://api.github.com/users/mbebenita/followers","following_url":"https://api.github.com/users/mbebenita/following{/other_user}","gists_url":"https://api.github.com/users/mbebenita/gists{/gist_id}","starred_url":"https://api.github.com/users/mbebenita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbebenita/subscriptions","organizations_url":"https://api.github.com/users/mbebenita/orgs","repos_url":"https://api.github.com/users/mbebenita/repos","events_url":"https://api.github.com/users/mbebenita/events{/privacy}","received_events_url":"https://api.github.com/users/mbebenita/received_events","type":"User","site_admin":false},"repo":{"id":49101182,"name":"binaryen","full_name":"mbebenita/binaryen","owner":{"login":"mbebenita","id":311082,"avatar_url":"https://avatars.githubusercontent.com/u/311082?v=3","gravatar_id":"","url":"https://api.github.com/users/mbebenita","html_url":"https://github.com/mbebenita","followers_url":"https://api.github.com/users/mbebenita/followers","following_url":"https://api.github.com/users/mbebenita/following{/other_user}","gists_url":"https://api.github.com/users/mbebenita/gists{/gist_id}","starred_url":"https://api.github.com/users/mbebenita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbebenita/subscriptions","organizations_url":"https://api.github.com/users/mbebenita/orgs","repos_url":"https://api.github.com/users/mbebenita/repos","events_url":"https://api.github.com/users/mbebenita/events{/privacy}","received_events_url":"https://api.github.com/users/mbebenita/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mbebenita/binaryen","description":"Compiler infrastructure and toolchain library for WebAssembly, in C++","fork":true,"url":"https://api.github.com/repos/mbebenita/binaryen","forks_url":"https://api.github.com/repos/mbebenita/binaryen/forks","keys_url":"https://api.github.com/repos/mbebenita/binaryen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbebenita/binaryen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbebenita/binaryen/teams","hooks_url":"https://api.github.com/repos/mbebenita/binaryen/hooks","issue_events_url":"https://api.github.com/repos/mbebenita/binaryen/issues/events{/number}","events_url":"https://api.github.com/repos/mbebenita/binaryen/events","assignees_url":"https://api.github.com/repos/mbebenita/binaryen/assignees{/user}","branches_url":"https://api.github.com/repos/mbebenita/binaryen/branches{/branch}","tags_url":"https://api.github.com/repos/mbebenita/binaryen/tags","blobs_url":"https://api.github.com/repos/mbebenita/binaryen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbebenita/binaryen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbebenita/binaryen/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbebenita/binaryen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbebenita/binaryen/statuses/{sha}","languages_url":"https://api.github.com/repos/mbebenita/binaryen/languages","stargazers_url":"https://api.github.com/repos/mbebenita/binaryen/stargazers","contributors_url":"https://api.github.com/repos/mbebenita/binaryen/contributors","subscribers_url":"https://api.github.com/repos/mbebenita/binaryen/subscribers","subscription_url":"https://api.github.com/repos/mbebenita/binaryen/subscription","commits_url":"https://api.github.com/repos/mbebenita/binaryen/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbebenita/binaryen/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbebenita/binaryen/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbebenita/binaryen/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbebenita/binaryen/contents/{+path}","compare_url":"https://api.github.com/repos/mbebenita/binaryen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbebenita/binaryen/merges","archive_url":"https://api.github.com/repos/mbebenita/binaryen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbebenita/binaryen/downloads","issues_url":"https://api.github.com/repos/mbebenita/binaryen/issues{/number}","pulls_url":"https://api.github.com/repos/mbebenita/binaryen/pulls{/number}","milestones_url":"https://api.github.com/repos/mbebenita/binaryen/milestones{/number}","notifications_url":"https://api.github.com/repos/mbebenita/binaryen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbebenita/binaryen/labels{/name}","releases_url":"https://api.github.com/repos/mbebenita/binaryen/releases{/id}","deployments_url":"https://api.github.com/repos/mbebenita/binaryen/deployments","created_at":"2016-01-06T00:27:00Z","updated_at":"2016-01-14T04:13:59Z","pushed_at":"2016-05-11T17:16:47Z","git_url":"git://github.com/mbebenita/binaryen.git","ssh_url":"git@github.com:mbebenita/binaryen.git","clone_url":"https://github.com/mbebenita/binaryen.git","svn_url":"https://github.com/mbebenita/binaryen","homepage":"","size":17783,"stargazers_count":0,"watchers_count":0,"language":"Assembly","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"WebAssembly:master","ref":"master","sha":"ee563858b128512c9fa29eb6a66c8dda8313172c","user":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"repo":{"id":45208608,"name":"binaryen","full_name":"WebAssembly/binaryen","owner":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WebAssembly/binaryen","description":"Compiler infrastructure and toolchain library for WebAssembly, in C++","fork":false,"url":"https://api.github.com/repos/WebAssembly/binaryen","forks_url":"https://api.github.com/repos/WebAssembly/binaryen/forks","keys_url":"https://api.github.com/repos/WebAssembly/binaryen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WebAssembly/binaryen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WebAssembly/binaryen/teams","hooks_url":"https://api.github.com/repos/WebAssembly/binaryen/hooks","issue_events_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/events{/number}","events_url":"https://api.github.com/repos/WebAssembly/binaryen/events","assignees_url":"https://api.github.com/repos/WebAssembly/binaryen/assignees{/user}","branches_url":"https://api.github.com/repos/WebAssembly/binaryen/branches{/branch}","tags_url":"https://api.github.com/repos/WebAssembly/binaryen/tags","blobs_url":"https://api.github.com/repos/WebAssembly/binaryen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WebAssembly/binaryen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WebAssembly/binaryen/git/refs{/sha}","trees_url":"https://api.github.com/repos/WebAssembly/binaryen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WebAssembly/binaryen/statuses/{sha}","languages_url":"https://api.github.com/repos/WebAssembly/binaryen/languages","stargazers_url":"https://api.github.com/repos/WebAssembly/binaryen/stargazers","contributors_url":"https://api.github.com/repos/WebAssembly/binaryen/contributors","subscribers_url":"https://api.github.com/repos/WebAssembly/binaryen/subscribers","subscription_url":"https://api.github.com/repos/WebAssembly/binaryen/subscription","commits_url":"https://api.github.com/repos/WebAssembly/binaryen/commits{/sha}","git_commits_url":"https://api.github.com/repos/WebAssembly/binaryen/git/commits{/sha}","comments_url":"https://api.github.com/repos/WebAssembly/binaryen/comments{/number}","issue_comment_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/comments{/number}","contents_url":"https://api.github.com/repos/WebAssembly/binaryen/contents/{+path}","compare_url":"https://api.github.com/repos/WebAssembly/binaryen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WebAssembly/binaryen/merges","archive_url":"https://api.github.com/repos/WebAssembly/binaryen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WebAssembly/binaryen/downloads","issues_url":"https://api.github.com/repos/WebAssembly/binaryen/issues{/number}","pulls_url":"https://api.github.com/repos/WebAssembly/binaryen/pulls{/number}","milestones_url":"https://api.github.com/repos/WebAssembly/binaryen/milestones{/number}","notifications_url":"https://api.github.com/repos/WebAssembly/binaryen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WebAssembly/binaryen/labels{/name}","releases_url":"https://api.github.com/repos/WebAssembly/binaryen/releases{/id}","deployments_url":"https://api.github.com/repos/WebAssembly/binaryen/deployments","created_at":"2015-10-29T20:26:28Z","updated_at":"2016-05-10T16:10:09Z","pushed_at":"2016-05-11T17:16:48Z","git_url":"git://github.com/WebAssembly/binaryen.git","ssh_url":"git@github.com:WebAssembly/binaryen.git","clone_url":"https://github.com/WebAssembly/binaryen.git","svn_url":"https://github.com/WebAssembly/binaryen","homepage":"","size":18513,"stargazers_count":652,"watchers_count":652,"language":"Assembly","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":64,"forks":57,"open_issues":64,"watchers":652,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/binaryen/pulls/463"},"html":{"href":"https://github.com/WebAssembly/binaryen/pull/463"},"issue":{"href":"https://api.github.com/repos/WebAssembly/binaryen/issues/463"},"comments":{"href":"https://api.github.com/repos/WebAssembly/binaryen/issues/463/comments"},"review_comments":{"href":"https://api.github.com/repos/WebAssembly/binaryen/pulls/463/comments"},"review_comment":{"href":"https://api.github.com/repos/WebAssembly/binaryen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WebAssembly/binaryen/pulls/463/commits"},"statuses":{"href":"https://api.github.com/repos/WebAssembly/binaryen/statuses/f50839d6f59d5c9fe0d7753f45af8d1b9b514d38"}}}}