{"action":"created","comment":{"url":"https://api.github.com/repos/Ericsson/clang/pulls/comments/223631900","pull_request_review_id":162803507,"id":223631900,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzYzMTkwMA==","diff_hunk":"@@ -0,0 +1,47 @@\n+//===- ASTImporterLookupTable.h - ASTImporter specific lookup--*- C++ -*---===//\n+//\n+//                     The LLVM Compiler Infrastructure\n+//\n+// This file is distributed under the University of Illinois Open Source\n+// License. See LICENSE.TXT for details.\n+//\n+//===----------------------------------------------------------------------===//\n+//\n+//  This file defines the ASTImporterLookupTable class which implements a\n+//  lookup procedure for the import mechanism.\n+//\n+//===----------------------------------------------------------------------===//\n+\n+#ifndef LLVM_CLANG_AST_ASTIMPORTERLOOKUPTABLE_H\n+#define LLVM_CLANG_AST_ASTIMPORTERLOOKUPTABLE_H\n+\n+#include \"clang/AST/DeclBase.h\" // lookup_result\n+#include \"clang/AST/DeclarationName.h\"\n+#include \"llvm/ADT/DenseMap.h\"\n+#include \"llvm/ADT/SmallPtrSet.h\"\n+\n+namespace clang {\n+\n+class ASTContext;\n+class NamedDecl;\n+class DeclContext;\n+\n+class ASTImporterLookupTable {\n+  using DeclList = llvm::SmallPtrSet<NamedDecl *, 2>;\n+  using NameMap = llvm::SmallDenseMap<DeclarationName, DeclList, 4>;\n+  using DCMap = llvm::DenseMap<DeclContext *, NameMap>;\n+  DCMap lookupTable;\n+\n+public:\n+  ASTImporterLookupTable(TranslationUnitDecl &TU);\n+  void add(NamedDecl *ND);\n+  void remove(NamedDecl *ND);","path":"include/clang/AST/ASTImporterLookupTable.h","position":38,"original_position":38,"commit_id":"c9f1f78be6fc5702b367fc828c3f769204a7d2c4","original_commit_id":"c9f1f78be6fc5702b367fc828c3f769204a7d2c4","user":{"login":"Xazax-hun","id":922897,"node_id":"MDQ6VXNlcjkyMjg5Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/922897?v=4","gravatar_id":"","url":"https://api.github.com/users/Xazax-hun","html_url":"https://github.com/Xazax-hun","followers_url":"https://api.github.com/users/Xazax-hun/followers","following_url":"https://api.github.com/users/Xazax-hun/following{/other_user}","gists_url":"https://api.github.com/users/Xazax-hun/gists{/gist_id}","starred_url":"https://api.github.com/users/Xazax-hun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xazax-hun/subscriptions","organizations_url":"https://api.github.com/users/Xazax-hun/orgs","repos_url":"https://api.github.com/users/Xazax-hun/repos","events_url":"https://api.github.com/users/Xazax-hun/events{/privacy}","received_events_url":"https://api.github.com/users/Xazax-hun/received_events","type":"User","site_admin":false},"body":"Why do we ever need to remove a Decl from the lookup table?","created_at":"2018-10-09T09:54:32Z","updated_at":"2018-10-09T09:54:33Z","html_url":"https://github.com/Ericsson/clang/pull/505#discussion_r223631900","pull_request_url":"https://api.github.com/repos/Ericsson/clang/pulls/505","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Ericsson/clang/pulls/comments/223631900"},"html":{"href":"https://github.com/Ericsson/clang/pull/505#discussion_r223631900"},"pull_request":{"href":"https://api.github.com/repos/Ericsson/clang/pulls/505"}}},"pull_request":{"url":"https://api.github.com/repos/Ericsson/clang/pulls/505","id":221186426,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxMTg2NDI2","html_url":"https://github.com/Ericsson/clang/pull/505","diff_url":"https://github.com/Ericsson/clang/pull/505.diff","patch_url":"https://github.com/Ericsson/clang/pull/505.patch","issue_url":"https://api.github.com/repos/Ericsson/clang/issues/505","number":505,"state":"open","locked":false,"title":"[ASTImporter] Add importer specific lookup","user":{"login":"martong","id":5887427,"node_id":"MDQ6VXNlcjU4ODc0Mjc=","avatar_url":"https://avatars0.githubusercontent.com/u/5887427?v=4","gravatar_id":"","url":"https://api.github.com/users/martong","html_url":"https://github.com/martong","followers_url":"https://api.github.com/users/martong/followers","following_url":"https://api.github.com/users/martong/following{/other_user}","gists_url":"https://api.github.com/users/martong/gists{/gist_id}","starred_url":"https://api.github.com/users/martong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martong/subscriptions","organizations_url":"https://api.github.com/users/martong/orgs","repos_url":"https://api.github.com/users/martong/repos","events_url":"https://api.github.com/users/martong/events{/privacy}","received_events_url":"https://api.github.com/users/martong/received_events","type":"User","site_admin":false},"body":"There are certain cases when normal C/C++ lookup (localUncachedLookup)\r\ndoes not find AST nodes. E.g.:\r\nExample 1:\r\n```\r\n  template <class T>\r\n  struct X {\r\n    friend void foo(); // this is never found in the DC of the TU.\r\n  };\r\n```\r\nExample 2:\r\n```\r\n  // The fwd decl to Foo is not found in the lookupPtr of the DC of the\r\n  // translation unit decl.\r\n  struct A { struct Foo *p; };\r\n```\r\nIn these cases we create a new node instead of returning with the old one.\r\nTo fix it we create a new lookup table which holds every node and we are\r\nnot interested in any C++ specific visibility considerations.\r\nSimply, we must know if there is an existing Decl in a given DC.","created_at":"2018-10-08T17:09:45Z","updated_at":"2018-10-09T09:54:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0c0c56ff0a69affaaaed8f0a3ef5f5b007e0686","assignee":null,"assignees":[],"requested_reviewers":[{"login":"gamesh411","id":3802256,"node_id":"MDQ6VXNlcjM4MDIyNTY=","avatar_url":"https://avatars1.githubusercontent.com/u/3802256?v=4","gravatar_id":"","url":"https://api.github.com/users/gamesh411","html_url":"https://github.com/gamesh411","followers_url":"https://api.github.com/users/gamesh411/followers","following_url":"https://api.github.com/users/gamesh411/following{/other_user}","gists_url":"https://api.github.com/users/gamesh411/gists{/gist_id}","starred_url":"https://api.github.com/users/gamesh411/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamesh411/subscriptions","organizations_url":"https://api.github.com/users/gamesh411/orgs","repos_url":"https://api.github.com/users/gamesh411/repos","events_url":"https://api.github.com/users/gamesh411/events{/privacy}","received_events_url":"https://api.github.com/users/gamesh411/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ericsson/clang/pulls/505/commits","review_comments_url":"https://api.github.com/repos/Ericsson/clang/pulls/505/comments","review_comment_url":"https://api.github.com/repos/Ericsson/clang/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ericsson/clang/issues/505/comments","statuses_url":"https://api.github.com/repos/Ericsson/clang/statuses/c9f1f78be6fc5702b367fc828c3f769204a7d2c4","head":{"label":"martong:astimporter_lookup_table","ref":"astimporter_lookup_table","sha":"c9f1f78be6fc5702b367fc828c3f769204a7d2c4","user":{"login":"martong","id":5887427,"node_id":"MDQ6VXNlcjU4ODc0Mjc=","avatar_url":"https://avatars0.githubusercontent.com/u/5887427?v=4","gravatar_id":"","url":"https://api.github.com/users/martong","html_url":"https://github.com/martong","followers_url":"https://api.github.com/users/martong/followers","following_url":"https://api.github.com/users/martong/following{/other_user}","gists_url":"https://api.github.com/users/martong/gists{/gist_id}","starred_url":"https://api.github.com/users/martong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martong/subscriptions","organizations_url":"https://api.github.com/users/martong/orgs","repos_url":"https://api.github.com/users/martong/repos","events_url":"https://api.github.com/users/martong/events{/privacy}","received_events_url":"https://api.github.com/users/martong/received_events","type":"User","site_admin":false},"repo":{"id":24257443,"node_id":"MDEwOlJlcG9zaXRvcnkyNDI1NzQ0Mw==","name":"clang","full_name":"martong/clang","private":false,"owner":{"login":"martong","id":5887427,"node_id":"MDQ6VXNlcjU4ODc0Mjc=","avatar_url":"https://avatars0.githubusercontent.com/u/5887427?v=4","gravatar_id":"","url":"https://api.github.com/users/martong","html_url":"https://github.com/martong","followers_url":"https://api.github.com/users/martong/followers","following_url":"https://api.github.com/users/martong/following{/other_user}","gists_url":"https://api.github.com/users/martong/gists{/gist_id}","starred_url":"https://api.github.com/users/martong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martong/subscriptions","organizations_url":"https://api.github.com/users/martong/orgs","repos_url":"https://api.github.com/users/martong/repos","events_url":"https://api.github.com/users/martong/events{/privacy}","received_events_url":"https://api.github.com/users/martong/received_events","type":"User","site_admin":false},"html_url":"https://github.com/martong/clang","description":"Experimenting with new lingual elements.","fork":true,"url":"https://api.github.com/repos/martong/clang","forks_url":"https://api.github.com/repos/martong/clang/forks","keys_url":"https://api.github.com/repos/martong/clang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martong/clang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martong/clang/teams","hooks_url":"https://api.github.com/repos/martong/clang/hooks","issue_events_url":"https://api.github.com/repos/martong/clang/issues/events{/number}","events_url":"https://api.github.com/repos/martong/clang/events","assignees_url":"https://api.github.com/repos/martong/clang/assignees{/user}","branches_url":"https://api.github.com/repos/martong/clang/branches{/branch}","tags_url":"https://api.github.com/repos/martong/clang/tags","blobs_url":"https://api.github.com/repos/martong/clang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martong/clang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martong/clang/git/refs{/sha}","trees_url":"https://api.github.com/repos/martong/clang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martong/clang/statuses/{sha}","languages_url":"https://api.github.com/repos/martong/clang/languages","stargazers_url":"https://api.github.com/repos/martong/clang/stargazers","contributors_url":"https://api.github.com/repos/martong/clang/contributors","subscribers_url":"https://api.github.com/repos/martong/clang/subscribers","subscription_url":"https://api.github.com/repos/martong/clang/subscription","commits_url":"https://api.github.com/repos/martong/clang/commits{/sha}","git_commits_url":"https://api.github.com/repos/martong/clang/git/commits{/sha}","comments_url":"https://api.github.com/repos/martong/clang/comments{/number}","issue_comment_url":"https://api.github.com/repos/martong/clang/issues/comments{/number}","contents_url":"https://api.github.com/repos/martong/clang/contents/{+path}","compare_url":"https://api.github.com/repos/martong/clang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martong/clang/merges","archive_url":"https://api.github.com/repos/martong/clang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martong/clang/downloads","issues_url":"https://api.github.com/repos/martong/clang/issues{/number}","pulls_url":"https://api.github.com/repos/martong/clang/pulls{/number}","milestones_url":"https://api.github.com/repos/martong/clang/milestones{/number}","notifications_url":"https://api.github.com/repos/martong/clang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martong/clang/labels{/name}","releases_url":"https://api.github.com/repos/martong/clang/releases{/id}","deployments_url":"https://api.github.com/repos/martong/clang/deployments","created_at":"2014-09-20T08:07:58Z","updated_at":"2016-02-13T22:25:04Z","pushed_at":"2018-10-08T17:09:22Z","git_url":"git://github.com/martong/clang.git","ssh_url":"git@github.com:martong/clang.git","clone_url":"https://github.com/martong/clang.git","svn_url":"https://github.com/martong/clang","homepage":"","size":419268,"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":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"out-of-class_friend_attr"}},"base":{"label":"Ericsson:ctu-clang7","ref":"ctu-clang7","sha":"0f5f1bf6f17f02600c7c7e826c7a7a39dbe38fa8","user":{"login":"Ericsson","id":4161311,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxNjEzMTE=","avatar_url":"https://avatars3.githubusercontent.com/u/4161311?v=4","gravatar_id":"","url":"https://api.github.com/users/Ericsson","html_url":"https://github.com/Ericsson","followers_url":"https://api.github.com/users/Ericsson/followers","following_url":"https://api.github.com/users/Ericsson/following{/other_user}","gists_url":"https://api.github.com/users/Ericsson/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericsson/subscriptions","organizations_url":"https://api.github.com/users/Ericsson/orgs","repos_url":"https://api.github.com/users/Ericsson/repos","events_url":"https://api.github.com/users/Ericsson/events{/privacy}","received_events_url":"https://api.github.com/users/Ericsson/received_events","type":"Organization","site_admin":false},"repo":{"id":68711149,"node_id":"MDEwOlJlcG9zaXRvcnk2ODcxMTE0OQ==","name":"clang","full_name":"Ericsson/clang","private":false,"owner":{"login":"Ericsson","id":4161311,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxNjEzMTE=","avatar_url":"https://avatars3.githubusercontent.com/u/4161311?v=4","gravatar_id":"","url":"https://api.github.com/users/Ericsson","html_url":"https://github.com/Ericsson","followers_url":"https://api.github.com/users/Ericsson/followers","following_url":"https://api.github.com/users/Ericsson/following{/other_user}","gists_url":"https://api.github.com/users/Ericsson/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericsson/subscriptions","organizations_url":"https://api.github.com/users/Ericsson/orgs","repos_url":"https://api.github.com/users/Ericsson/repos","events_url":"https://api.github.com/users/Ericsson/events{/privacy}","received_events_url":"https://api.github.com/users/Ericsson/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Ericsson/clang","description":"Cross Translation Unit analysis capability for Clang Static Analyzer. (Fork of official clang at http://llvm.org/git/clang)","fork":true,"url":"https://api.github.com/repos/Ericsson/clang","forks_url":"https://api.github.com/repos/Ericsson/clang/forks","keys_url":"https://api.github.com/repos/Ericsson/clang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ericsson/clang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ericsson/clang/teams","hooks_url":"https://api.github.com/repos/Ericsson/clang/hooks","issue_events_url":"https://api.github.com/repos/Ericsson/clang/issues/events{/number}","events_url":"https://api.github.com/repos/Ericsson/clang/events","assignees_url":"https://api.github.com/repos/Ericsson/clang/assignees{/user}","branches_url":"https://api.github.com/repos/Ericsson/clang/branches{/branch}","tags_url":"https://api.github.com/repos/Ericsson/clang/tags","blobs_url":"https://api.github.com/repos/Ericsson/clang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ericsson/clang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ericsson/clang/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ericsson/clang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ericsson/clang/statuses/{sha}","languages_url":"https://api.github.com/repos/Ericsson/clang/languages","stargazers_url":"https://api.github.com/repos/Ericsson/clang/stargazers","contributors_url":"https://api.github.com/repos/Ericsson/clang/contributors","subscribers_url":"https://api.github.com/repos/Ericsson/clang/subscribers","subscription_url":"https://api.github.com/repos/Ericsson/clang/subscription","commits_url":"https://api.github.com/repos/Ericsson/clang/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ericsson/clang/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ericsson/clang/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ericsson/clang/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ericsson/clang/contents/{+path}","compare_url":"https://api.github.com/repos/Ericsson/clang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ericsson/clang/merges","archive_url":"https://api.github.com/repos/Ericsson/clang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ericsson/clang/downloads","issues_url":"https://api.github.com/repos/Ericsson/clang/issues{/number}","pulls_url":"https://api.github.com/repos/Ericsson/clang/pulls{/number}","milestones_url":"https://api.github.com/repos/Ericsson/clang/milestones{/number}","notifications_url":"https://api.github.com/repos/Ericsson/clang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ericsson/clang/labels{/name}","releases_url":"https://api.github.com/repos/Ericsson/clang/releases{/id}","deployments_url":"https://api.github.com/repos/Ericsson/clang/deployments","created_at":"2016-09-20T12:47:53Z","updated_at":"2018-09-20T10:51:56Z","pushed_at":"2018-10-08T17:09:45Z","git_url":"git://github.com/Ericsson/clang.git","ssh_url":"git@github.com:Ericsson/clang.git","clone_url":"https://github.com/Ericsson/clang.git","svn_url":"https://github.com/Ericsson/clang","homepage":"http://clang.llvm.org/","size":417896,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":44,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":10,"open_issues":44,"watchers":7,"default_branch":"ctu-clang6"}},"_links":{"self":{"href":"https://api.github.com/repos/Ericsson/clang/pulls/505"},"html":{"href":"https://github.com/Ericsson/clang/pull/505"},"issue":{"href":"https://api.github.com/repos/Ericsson/clang/issues/505"},"comments":{"href":"https://api.github.com/repos/Ericsson/clang/issues/505/comments"},"review_comments":{"href":"https://api.github.com/repos/Ericsson/clang/pulls/505/comments"},"review_comment":{"href":"https://api.github.com/repos/Ericsson/clang/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ericsson/clang/pulls/505/commits"},"statuses":{"href":"https://api.github.com/repos/Ericsson/clang/statuses/c9f1f78be6fc5702b367fc828c3f769204a7d2c4"}},"author_association":"NONE"}}
{"actor":{"display_login":"Xazax-hun"}}