{"action":"created","comment":{"url":"https://api.github.com/repos/ldc-developers/ldc/pulls/comments/28643814","id":28643814,"diff_hunk":"@@ -226,6 +229,40 @@ static void ensureDecl(DECL *decl, const char *msg)\n     }\n }\n \n+static LLFunction *LLVM_D_BuildFunctionFwdDecl(Type *returntype,\n+                                               llvm::StringRef fname,\n+                                               std::vector<LLType *> params,\n+                                               bool isVarArg,\n+                                               llvm::Module *M,\n+                                               LINK linkage = LINKc)\n+{\n+    LLType *rt = DtoType(returntype);\n+    bool sret = gABI->returnInArg(returntype, linkage);\n+    LLFunctionType *fty; // Initialized below\n+    if (sret)\n+    {\n+        params.insert(params.begin(), rt->getPointerTo());\n+        LLType* voidTy = DtoType(Type::tvoid);\n+        fty = LLFunctionType::get(voidTy, params, isVarArg);\n+    }\n+    else if (!params.empty())\n+    {\n+        fty = LLFunctionType::get(rt, params, isVarArg);\n+    }\n+    else\n+    {\n+        fty = LLFunctionType::get(rt, isVarArg);\n+    }\n+\n+    LLFunction *fn = LLFunction::Create(fty, LLGlobalValue::ExternalLinkage, fname, M);\n+    if (sret) {\n+        fn->addAttribute(1, LDC_ATTRIBUTE(StructRet));\n+        fn->addAttribute(1, LDC_ATTRIBUTE(NoAlias));\n+    }\n+    fn->setCallingConv(gABI->callingConv(linkage));\n+    return fn;\n+}\n+","path":"gen/runtime.cpp","position":79,"original_position":47,"commit_id":"9e8dc0e01554d4cb585851cad20cf7e45a821b40","original_commit_id":"f183936c92948655ef91d46ce003f285682cc9f7","user":{"login":"JohanEngelen","id":10983051,"avatar_url":"https://avatars.githubusercontent.com/u/10983051?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanEngelen","html_url":"https://github.com/JohanEngelen","followers_url":"https://api.github.com/users/JohanEngelen/followers","following_url":"https://api.github.com/users/JohanEngelen/following{/other_user}","gists_url":"https://api.github.com/users/JohanEngelen/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanEngelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanEngelen/subscriptions","organizations_url":"https://api.github.com/users/JohanEngelen/orgs","repos_url":"https://api.github.com/users/JohanEngelen/repos","events_url":"https://api.github.com/users/JohanEngelen/events{/privacy}","received_events_url":"https://api.github.com/users/JohanEngelen/received_events","type":"User","site_admin":false},"body":"@kinke Not sure what you mean here. Can you give a D code example?","created_at":"2015-04-18T12:54:33Z","updated_at":"2015-04-18T12:54:33Z","html_url":"https://github.com/ldc-developers/ldc/pull/901#discussion_r28643814","pull_request_url":"https://api.github.com/repos/ldc-developers/ldc/pulls/901","_links":{"self":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/comments/28643814"},"html":{"href":"https://github.com/ldc-developers/ldc/pull/901#discussion_r28643814"},"pull_request":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/901"}}},"pull_request":{"url":"https://api.github.com/repos/ldc-developers/ldc/pulls/901","id":33401817,"html_url":"https://github.com/ldc-developers/ldc/pull/901","diff_url":"https://github.com/ldc-developers/ldc/pull/901.diff","patch_url":"https://github.com/ldc-developers/ldc/pull/901.patch","issue_url":"https://api.github.com/repos/ldc-developers/ldc/issues/901","number":901,"state":"open","locked":false,"title":"WIP: enable sret for dynamic arrays","user":{"login":"JohanEngelen","id":10983051,"avatar_url":"https://avatars.githubusercontent.com/u/10983051?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanEngelen","html_url":"https://github.com/JohanEngelen","followers_url":"https://api.github.com/users/JohanEngelen/followers","following_url":"https://api.github.com/users/JohanEngelen/following{/other_user}","gists_url":"https://api.github.com/users/JohanEngelen/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanEngelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanEngelen/subscriptions","organizations_url":"https://api.github.com/users/JohanEngelen/orgs","repos_url":"https://api.github.com/users/JohanEngelen/repos","events_url":"https://api.github.com/users/JohanEngelen/events{/privacy}","received_events_url":"https://api.github.com/users/JohanEngelen/received_events","type":"User","site_admin":false},"body":"Work In Progress!\r\n\r\nThe goal is to enable dynarray sret for Win64 and other platforms that wish it.\r\nMaking a PR to have Travis check the code on other platforms.\r\nAll comments are welcome.","created_at":"2015-04-15T22:11:14Z","updated_at":"2015-04-18T12:54:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8c53a45061493bfb8e23710bd25b55b661194c8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ldc-developers/ldc/pulls/901/commits","review_comments_url":"https://api.github.com/repos/ldc-developers/ldc/pulls/901/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/901/comments","statuses_url":"https://api.github.com/repos/ldc-developers/ldc/statuses/9e8dc0e01554d4cb585851cad20cf7e45a821b40","head":{"label":"JohanEngelen:abi-sret-win64","ref":"abi-sret-win64","sha":"9e8dc0e01554d4cb585851cad20cf7e45a821b40","user":{"login":"JohanEngelen","id":10983051,"avatar_url":"https://avatars.githubusercontent.com/u/10983051?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanEngelen","html_url":"https://github.com/JohanEngelen","followers_url":"https://api.github.com/users/JohanEngelen/followers","following_url":"https://api.github.com/users/JohanEngelen/following{/other_user}","gists_url":"https://api.github.com/users/JohanEngelen/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanEngelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanEngelen/subscriptions","organizations_url":"https://api.github.com/users/JohanEngelen/orgs","repos_url":"https://api.github.com/users/JohanEngelen/repos","events_url":"https://api.github.com/users/JohanEngelen/events{/privacy}","received_events_url":"https://api.github.com/users/JohanEngelen/received_events","type":"User","site_admin":false},"repo":{"id":31165992,"name":"ldc","full_name":"JohanEngelen/ldc","owner":{"login":"JohanEngelen","id":10983051,"avatar_url":"https://avatars.githubusercontent.com/u/10983051?v=3","gravatar_id":"","url":"https://api.github.com/users/JohanEngelen","html_url":"https://github.com/JohanEngelen","followers_url":"https://api.github.com/users/JohanEngelen/followers","following_url":"https://api.github.com/users/JohanEngelen/following{/other_user}","gists_url":"https://api.github.com/users/JohanEngelen/gists{/gist_id}","starred_url":"https://api.github.com/users/JohanEngelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohanEngelen/subscriptions","organizations_url":"https://api.github.com/users/JohanEngelen/orgs","repos_url":"https://api.github.com/users/JohanEngelen/repos","events_url":"https://api.github.com/users/JohanEngelen/events{/privacy}","received_events_url":"https://api.github.com/users/JohanEngelen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JohanEngelen/ldc","description":"The LLVM-based D compiler.","fork":true,"url":"https://api.github.com/repos/JohanEngelen/ldc","forks_url":"https://api.github.com/repos/JohanEngelen/ldc/forks","keys_url":"https://api.github.com/repos/JohanEngelen/ldc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JohanEngelen/ldc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JohanEngelen/ldc/teams","hooks_url":"https://api.github.com/repos/JohanEngelen/ldc/hooks","issue_events_url":"https://api.github.com/repos/JohanEngelen/ldc/issues/events{/number}","events_url":"https://api.github.com/repos/JohanEngelen/ldc/events","assignees_url":"https://api.github.com/repos/JohanEngelen/ldc/assignees{/user}","branches_url":"https://api.github.com/repos/JohanEngelen/ldc/branches{/branch}","tags_url":"https://api.github.com/repos/JohanEngelen/ldc/tags","blobs_url":"https://api.github.com/repos/JohanEngelen/ldc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JohanEngelen/ldc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JohanEngelen/ldc/git/refs{/sha}","trees_url":"https://api.github.com/repos/JohanEngelen/ldc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JohanEngelen/ldc/statuses/{sha}","languages_url":"https://api.github.com/repos/JohanEngelen/ldc/languages","stargazers_url":"https://api.github.com/repos/JohanEngelen/ldc/stargazers","contributors_url":"https://api.github.com/repos/JohanEngelen/ldc/contributors","subscribers_url":"https://api.github.com/repos/JohanEngelen/ldc/subscribers","subscription_url":"https://api.github.com/repos/JohanEngelen/ldc/subscription","commits_url":"https://api.github.com/repos/JohanEngelen/ldc/commits{/sha}","git_commits_url":"https://api.github.com/repos/JohanEngelen/ldc/git/commits{/sha}","comments_url":"https://api.github.com/repos/JohanEngelen/ldc/comments{/number}","issue_comment_url":"https://api.github.com/repos/JohanEngelen/ldc/issues/comments{/number}","contents_url":"https://api.github.com/repos/JohanEngelen/ldc/contents/{+path}","compare_url":"https://api.github.com/repos/JohanEngelen/ldc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JohanEngelen/ldc/merges","archive_url":"https://api.github.com/repos/JohanEngelen/ldc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JohanEngelen/ldc/downloads","issues_url":"https://api.github.com/repos/JohanEngelen/ldc/issues{/number}","pulls_url":"https://api.github.com/repos/JohanEngelen/ldc/pulls{/number}","milestones_url":"https://api.github.com/repos/JohanEngelen/ldc/milestones{/number}","notifications_url":"https://api.github.com/repos/JohanEngelen/ldc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JohanEngelen/ldc/labels{/name}","releases_url":"https://api.github.com/repos/JohanEngelen/ldc/releases{/id}","created_at":"2015-02-22T14:46:29Z","updated_at":"2015-04-14T20:14:02Z","pushed_at":"2015-04-18T12:27:03Z","git_url":"git://github.com/JohanEngelen/ldc.git","ssh_url":"git@github.com:JohanEngelen/ldc.git","clone_url":"https://github.com/JohanEngelen/ldc.git","svn_url":"https://github.com/JohanEngelen/ldc","homepage":"http://wiki.dlang.org/LDC","size":17337,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"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":"e44c402f063f7825d4ed1af5186fe8addd7f5ce8","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}","created_at":"2011-08-08T17:10:27Z","updated_at":"2015-04-17T21:40:10Z","pushed_at":"2015-04-18T12:27:04Z","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":24440,"stargazers_count":353,"watchers_count":353,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":83,"mirror_url":null,"open_issues_count":137,"forks":83,"open_issues":137,"watchers":353,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/901"},"html":{"href":"https://github.com/ldc-developers/ldc/pull/901"},"issue":{"href":"https://api.github.com/repos/ldc-developers/ldc/issues/901"},"comments":{"href":"https://api.github.com/repos/ldc-developers/ldc/issues/901/comments"},"review_comments":{"href":"https://api.github.com/repos/ldc-developers/ldc/pulls/901/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/901/commits"},"statuses":{"href":"https://api.github.com/repos/ldc-developers/ldc/statuses/9e8dc0e01554d4cb585851cad20cf7e45a821b40"}}}}