{"action":"created","comment":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments/49760111","id":49760111,"diff_hunk":"@@ -0,0 +1,62 @@\n+// Copyright (c) 2015-2016 The Khronos Group Inc.\n+//\n+// Permission is hereby granted, free of charge, to any person obtaining a\n+// copy of this software and/or associated documentation files (the\n+// \"Materials\"), to deal in the Materials without restriction, including\n+// without limitation the rights to use, copy, modify, merge, publish,\n+// distribute, sublicense, and/or sell copies of the Materials, and to\n+// permit persons to whom the Materials are furnished to do so, subject to\n+// the following conditions:\n+//\n+// The above copyright notice and this permission notice shall be included\n+// in all copies or substantial portions of the Materials.\n+//\n+// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS\n+// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS\n+// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT\n+//    https://www.khronos.org/registry/\n+//\n+// THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n+// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n+// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n+\n+// Performs validation on instructions that appear inside of a SPIR-V block.\n+\n+#include \"validate_passes.h\"\n+#include \"validate_types.h\"\n+\n+namespace libspirv {\n+\n+spv_result_t InstructionPass(ValidationState_t& _,\n+                             const spv_parsed_instruction_t* inst) {\n+  if (_.is_enabled(SPV_VALIDATE_INSTRUCTION_BIT)) {\n+    SpvOp opcode = inst->opcode;\n+    switch (opcode) {\n+      case SpvOpVariable: {\n+        const uint32_t storage_class = inst->words[inst->operands[2].offset];","path":"source/validate_instruction.cpp","position":40,"original_position":40,"commit_id":"32d190fc79860afbf46df20be49a0a63a34195c9","original_commit_id":"32d190fc79860afbf46df20be49a0a63a34195c9","user":{"login":"dekimir","id":1635074,"avatar_url":"https://avatars.githubusercontent.com/u/1635074?v=3","gravatar_id":"","url":"https://api.github.com/users/dekimir","html_url":"https://github.com/dekimir","followers_url":"https://api.github.com/users/dekimir/followers","following_url":"https://api.github.com/users/dekimir/following{/other_user}","gists_url":"https://api.github.com/users/dekimir/gists{/gist_id}","starred_url":"https://api.github.com/users/dekimir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dekimir/subscriptions","organizations_url":"https://api.github.com/users/dekimir/orgs","repos_url":"https://api.github.com/users/dekimir/repos","events_url":"https://api.github.com/users/dekimir/events{/privacy}","received_events_url":"https://api.github.com/users/dekimir/received_events","type":"User","site_admin":false},"body":"Might be safer to rely on the operand_type == SPV_OPERAND_TYPE_STORAGE_CLASS than to hard-code 2 here.","created_at":"2016-01-14T17:58:25Z","updated_at":"2016-01-14T17:58:25Z","html_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/72#discussion_r49760111","pull_request_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments/49760111"},"html":{"href":"https://github.com/KhronosGroup/SPIRV-Tools/pull/72#discussion_r49760111"},"pull_request":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/72","id":56048851,"html_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/72","diff_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/72.diff","patch_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/72.patch","issue_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/72","number":72,"state":"open","locked":false,"title":"Validation refactor","user":{"login":"umar456","id":457510,"avatar_url":"https://avatars.githubusercontent.com/u/457510?v=3","gravatar_id":"","url":"https://api.github.com/users/umar456","html_url":"https://github.com/umar456","followers_url":"https://api.github.com/users/umar456/followers","following_url":"https://api.github.com/users/umar456/following{/other_user}","gists_url":"https://api.github.com/users/umar456/gists{/gist_id}","starred_url":"https://api.github.com/users/umar456/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umar456/subscriptions","organizations_url":"https://api.github.com/users/umar456/orgs","repos_url":"https://api.github.com/users/umar456/repos","events_url":"https://api.github.com/users/umar456/events{/privacy}","received_events_url":"https://api.github.com/users/umar456/received_events","type":"User","site_admin":false},"body":"* Organize passes into seperate files\r\n* Remove module layout logic from Cfg pass\r\n* Remove module layout logic from Functions class\r\n* Refactor ModuleLayoutPass for readability\r\n* Adapt consistent naming of layout sections (Stage/Section -> Section)","created_at":"2016-01-14T15:25:14Z","updated_at":"2016-01-14T17:58:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f498ff2d7abb43392c9462ea99cbedf42b51978b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/72/commits","review_comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/72/comments","review_comment_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/72/comments","statuses_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/32d190fc79860afbf46df20be49a0a63a34195c9","head":{"label":"umar456:refactor","ref":"refactor","sha":"32d190fc79860afbf46df20be49a0a63a34195c9","user":{"login":"umar456","id":457510,"avatar_url":"https://avatars.githubusercontent.com/u/457510?v=3","gravatar_id":"","url":"https://api.github.com/users/umar456","html_url":"https://github.com/umar456","followers_url":"https://api.github.com/users/umar456/followers","following_url":"https://api.github.com/users/umar456/following{/other_user}","gists_url":"https://api.github.com/users/umar456/gists{/gist_id}","starred_url":"https://api.github.com/users/umar456/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umar456/subscriptions","organizations_url":"https://api.github.com/users/umar456/orgs","repos_url":"https://api.github.com/users/umar456/repos","events_url":"https://api.github.com/users/umar456/events{/privacy}","received_events_url":"https://api.github.com/users/umar456/received_events","type":"User","site_admin":false},"repo":{"id":46513608,"name":"SPIRV-Tools","full_name":"umar456/SPIRV-Tools","owner":{"login":"umar456","id":457510,"avatar_url":"https://avatars.githubusercontent.com/u/457510?v=3","gravatar_id":"","url":"https://api.github.com/users/umar456","html_url":"https://github.com/umar456","followers_url":"https://api.github.com/users/umar456/followers","following_url":"https://api.github.com/users/umar456/following{/other_user}","gists_url":"https://api.github.com/users/umar456/gists{/gist_id}","starred_url":"https://api.github.com/users/umar456/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umar456/subscriptions","organizations_url":"https://api.github.com/users/umar456/orgs","repos_url":"https://api.github.com/users/umar456/repos","events_url":"https://api.github.com/users/umar456/events{/privacy}","received_events_url":"https://api.github.com/users/umar456/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/umar456/SPIRV-Tools","description":"","fork":true,"url":"https://api.github.com/repos/umar456/SPIRV-Tools","forks_url":"https://api.github.com/repos/umar456/SPIRV-Tools/forks","keys_url":"https://api.github.com/repos/umar456/SPIRV-Tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umar456/SPIRV-Tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umar456/SPIRV-Tools/teams","hooks_url":"https://api.github.com/repos/umar456/SPIRV-Tools/hooks","issue_events_url":"https://api.github.com/repos/umar456/SPIRV-Tools/issues/events{/number}","events_url":"https://api.github.com/repos/umar456/SPIRV-Tools/events","assignees_url":"https://api.github.com/repos/umar456/SPIRV-Tools/assignees{/user}","branches_url":"https://api.github.com/repos/umar456/SPIRV-Tools/branches{/branch}","tags_url":"https://api.github.com/repos/umar456/SPIRV-Tools/tags","blobs_url":"https://api.github.com/repos/umar456/SPIRV-Tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umar456/SPIRV-Tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umar456/SPIRV-Tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/umar456/SPIRV-Tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umar456/SPIRV-Tools/statuses/{sha}","languages_url":"https://api.github.com/repos/umar456/SPIRV-Tools/languages","stargazers_url":"https://api.github.com/repos/umar456/SPIRV-Tools/stargazers","contributors_url":"https://api.github.com/repos/umar456/SPIRV-Tools/contributors","subscribers_url":"https://api.github.com/repos/umar456/SPIRV-Tools/subscribers","subscription_url":"https://api.github.com/repos/umar456/SPIRV-Tools/subscription","commits_url":"https://api.github.com/repos/umar456/SPIRV-Tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/umar456/SPIRV-Tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/umar456/SPIRV-Tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/umar456/SPIRV-Tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/umar456/SPIRV-Tools/contents/{+path}","compare_url":"https://api.github.com/repos/umar456/SPIRV-Tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umar456/SPIRV-Tools/merges","archive_url":"https://api.github.com/repos/umar456/SPIRV-Tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umar456/SPIRV-Tools/downloads","issues_url":"https://api.github.com/repos/umar456/SPIRV-Tools/issues{/number}","pulls_url":"https://api.github.com/repos/umar456/SPIRV-Tools/pulls{/number}","milestones_url":"https://api.github.com/repos/umar456/SPIRV-Tools/milestones{/number}","notifications_url":"https://api.github.com/repos/umar456/SPIRV-Tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umar456/SPIRV-Tools/labels{/name}","releases_url":"https://api.github.com/repos/umar456/SPIRV-Tools/releases{/id}","created_at":"2015-11-19T18:58:25Z","updated_at":"2016-01-13T16:20:41Z","pushed_at":"2016-01-14T17:50:42Z","git_url":"git://github.com/umar456/SPIRV-Tools.git","ssh_url":"git@github.com:umar456/SPIRV-Tools.git","clone_url":"https://github.com/umar456/SPIRV-Tools.git","svn_url":"https://github.com/umar456/SPIRV-Tools","homepage":null,"size":1081,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"KhronosGroup:master","ref":"master","sha":"fa3b8781190e4d38df90008fae8fccab57f5acb0","user":{"login":"KhronosGroup","id":1608701,"avatar_url":"https://avatars.githubusercontent.com/u/1608701?v=3","gravatar_id":"","url":"https://api.github.com/users/KhronosGroup","html_url":"https://github.com/KhronosGroup","followers_url":"https://api.github.com/users/KhronosGroup/followers","following_url":"https://api.github.com/users/KhronosGroup/following{/other_user}","gists_url":"https://api.github.com/users/KhronosGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KhronosGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhronosGroup/subscriptions","organizations_url":"https://api.github.com/users/KhronosGroup/orgs","repos_url":"https://api.github.com/users/KhronosGroup/repos","events_url":"https://api.github.com/users/KhronosGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KhronosGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":45981801,"name":"SPIRV-Tools","full_name":"KhronosGroup/SPIRV-Tools","owner":{"login":"KhronosGroup","id":1608701,"avatar_url":"https://avatars.githubusercontent.com/u/1608701?v=3","gravatar_id":"","url":"https://api.github.com/users/KhronosGroup","html_url":"https://github.com/KhronosGroup","followers_url":"https://api.github.com/users/KhronosGroup/followers","following_url":"https://api.github.com/users/KhronosGroup/following{/other_user}","gists_url":"https://api.github.com/users/KhronosGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KhronosGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhronosGroup/subscriptions","organizations_url":"https://api.github.com/users/KhronosGroup/orgs","repos_url":"https://api.github.com/users/KhronosGroup/repos","events_url":"https://api.github.com/users/KhronosGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KhronosGroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KhronosGroup/SPIRV-Tools","description":"","fork":false,"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools","forks_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/forks","keys_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/teams","hooks_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/hooks","issue_events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/events{/number}","events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/events","assignees_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/assignees{/user}","branches_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/branches{/branch}","tags_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tags","blobs_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/{sha}","languages_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/languages","stargazers_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/stargazers","contributors_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/contributors","subscribers_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/subscribers","subscription_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/subscription","commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/contents/{+path}","compare_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/merges","archive_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/downloads","issues_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues{/number}","pulls_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls{/number}","milestones_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/milestones{/number}","notifications_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/labels{/name}","releases_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/releases{/id}","created_at":"2015-11-11T12:56:25Z","updated_at":"2016-01-14T16:44:19Z","pushed_at":"2016-01-14T17:50:42Z","git_url":"git://github.com/KhronosGroup/SPIRV-Tools.git","ssh_url":"git@github.com:KhronosGroup/SPIRV-Tools.git","clone_url":"https://github.com/KhronosGroup/SPIRV-Tools.git","svn_url":"https://github.com/KhronosGroup/SPIRV-Tools","homepage":null,"size":1139,"stargazers_count":49,"watchers_count":49,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":8,"forks":10,"open_issues":8,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/72"},"html":{"href":"https://github.com/KhronosGroup/SPIRV-Tools/pull/72"},"issue":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/72"},"comments":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/32d190fc79860afbf46df20be49a0a63a34195c9"}}}}