{"action":"created","comment":{"url":"https://api.github.com/repos/root-mirror/root/pulls/comments/37294537","id":37294537,"diff_hunk":"@@ -457,26 +221,31 @@ static std::string getCastValueString(const Value &V) {\n   return strm.str();\n }\n \n-\n static std::string printEnumValue(const Value &V){\n   std::stringstream enumString;\n   clang::ASTContext& C = V.getASTContext();\n   clang::QualType Ty = V.getType().getDesugaredType(C);\n-  clang::EnumDecl* ED = Ty.getNonReferenceType()->getAs<clang::EnumType>()->getDecl();\n-  uint64_t value = *(const uint64_t*)&V;\n-  bool IsFirst = true;\n-  llvm::APSInt ValAsAPSInt = C.MakeIntValue(value, Ty);\n-  for (clang::EnumDecl::enumerator_iterator I = ED->enumerator_begin(),\n-           E = ED->enumerator_end(); I != E; ++I) {\n-    if (I->getInitVal() == ValAsAPSInt) {\n-      if (!IsFirst) {\n-        enumString << \" ? \";\n+  const clang::EnumType *EnumTy = Ty.getNonReferenceType()->getAs<clang::EnumType>();\n+  if(EnumTy != 0) {","path":"interpreter/cling/lib/Interpreter/ValuePrinter.cpp","position":399,"original_position":399,"commit_id":"a86db5f8442a0b2f339df5212d9a49247f8d5e68","original_commit_id":"a86db5f8442a0b2f339df5212d9a49247f8d5e68","user":{"login":"karies","id":144675,"avatar_url":"https://avatars.githubusercontent.com/u/144675?v=3","gravatar_id":"","url":"https://api.github.com/users/karies","html_url":"https://github.com/karies","followers_url":"https://api.github.com/users/karies/followers","following_url":"https://api.github.com/users/karies/following{/other_user}","gists_url":"https://api.github.com/users/karies/gists{/gist_id}","starred_url":"https://api.github.com/users/karies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karies/subscriptions","organizations_url":"https://api.github.com/users/karies/orgs","repos_url":"https://api.github.com/users/karies/repos","events_url":"https://api.github.com/users/karies/events{/privacy}","received_events_url":"https://api.github.com/users/karies/received_events","type":"User","site_admin":false},"body":"`getAs` above will assert if this is not an `EnumType`. No need for the `if`.","created_at":"2015-08-18T13:01:45Z","updated_at":"2015-08-18T13:01:45Z","html_url":"https://github.com/root-mirror/root/pull/76#discussion_r37294537","pull_request_url":"https://api.github.com/repos/root-mirror/root/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/root-mirror/root/pulls/comments/37294537"},"html":{"href":"https://github.com/root-mirror/root/pull/76#discussion_r37294537"},"pull_request":{"href":"https://api.github.com/repos/root-mirror/root/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/root-mirror/root/pulls/76","id":42581999,"html_url":"https://github.com/root-mirror/root/pull/76","diff_url":"https://github.com/root-mirror/root/pull/76.diff","patch_url":"https://github.com/root-mirror/root/pull/76.patch","issue_url":"https://api.github.com/repos/root-mirror/root/issues/76","number":76,"state":"closed","locked":false,"title":"Print value fixes and removal of the old code","user":{"login":"perovic","id":6682968,"avatar_url":"https://avatars.githubusercontent.com/u/6682968?v=3","gravatar_id":"","url":"https://api.github.com/users/perovic","html_url":"https://github.com/perovic","followers_url":"https://api.github.com/users/perovic/followers","following_url":"https://api.github.com/users/perovic/following{/other_user}","gists_url":"https://api.github.com/users/perovic/gists{/gist_id}","starred_url":"https://api.github.com/users/perovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perovic/subscriptions","organizations_url":"https://api.github.com/users/perovic/orgs","repos_url":"https://api.github.com/users/perovic/repos","events_url":"https://api.github.com/users/perovic/events{/privacy}","received_events_url":"https://api.github.com/users/perovic/received_events","type":"User","site_admin":false},"body":"Print value fixes introduced based on comments after the first pull request.\r\nRemoved the old code and made various changes to make the code simpler.","created_at":"2015-08-17T12:22:06Z","updated_at":"2015-08-18T13:01:45Z","closed_at":"2015-08-18T12:26:06Z","merged_at":null,"merge_commit_sha":"4cbfde2f8670c242b69867f3dc30514608b36267","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/root-mirror/root/pulls/76/commits","review_comments_url":"https://api.github.com/repos/root-mirror/root/pulls/76/comments","review_comment_url":"https://api.github.com/repos/root-mirror/root/pulls/comments{/number}","comments_url":"https://api.github.com/repos/root-mirror/root/issues/76/comments","statuses_url":"https://api.github.com/repos/root-mirror/root/statuses/a86db5f8442a0b2f339df5212d9a49247f8d5e68","head":{"label":"perovic:PrintValueFixes","ref":"PrintValueFixes","sha":"a86db5f8442a0b2f339df5212d9a49247f8d5e68","user":{"login":"perovic","id":6682968,"avatar_url":"https://avatars.githubusercontent.com/u/6682968?v=3","gravatar_id":"","url":"https://api.github.com/users/perovic","html_url":"https://github.com/perovic","followers_url":"https://api.github.com/users/perovic/followers","following_url":"https://api.github.com/users/perovic/following{/other_user}","gists_url":"https://api.github.com/users/perovic/gists{/gist_id}","starred_url":"https://api.github.com/users/perovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perovic/subscriptions","organizations_url":"https://api.github.com/users/perovic/orgs","repos_url":"https://api.github.com/users/perovic/repos","events_url":"https://api.github.com/users/perovic/events{/privacy}","received_events_url":"https://api.github.com/users/perovic/received_events","type":"User","site_admin":false},"repo":{"id":40651720,"name":"root","full_name":"perovic/root","owner":{"login":"perovic","id":6682968,"avatar_url":"https://avatars.githubusercontent.com/u/6682968?v=3","gravatar_id":"","url":"https://api.github.com/users/perovic","html_url":"https://github.com/perovic","followers_url":"https://api.github.com/users/perovic/followers","following_url":"https://api.github.com/users/perovic/following{/other_user}","gists_url":"https://api.github.com/users/perovic/gists{/gist_id}","starred_url":"https://api.github.com/users/perovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perovic/subscriptions","organizations_url":"https://api.github.com/users/perovic/orgs","repos_url":"https://api.github.com/users/perovic/repos","events_url":"https://api.github.com/users/perovic/events{/privacy}","received_events_url":"https://api.github.com/users/perovic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/perovic/root","description":"Mirror of official ROOT git repository","fork":true,"url":"https://api.github.com/repos/perovic/root","forks_url":"https://api.github.com/repos/perovic/root/forks","keys_url":"https://api.github.com/repos/perovic/root/keys{/key_id}","collaborators_url":"https://api.github.com/repos/perovic/root/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/perovic/root/teams","hooks_url":"https://api.github.com/repos/perovic/root/hooks","issue_events_url":"https://api.github.com/repos/perovic/root/issues/events{/number}","events_url":"https://api.github.com/repos/perovic/root/events","assignees_url":"https://api.github.com/repos/perovic/root/assignees{/user}","branches_url":"https://api.github.com/repos/perovic/root/branches{/branch}","tags_url":"https://api.github.com/repos/perovic/root/tags","blobs_url":"https://api.github.com/repos/perovic/root/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/perovic/root/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/perovic/root/git/refs{/sha}","trees_url":"https://api.github.com/repos/perovic/root/git/trees{/sha}","statuses_url":"https://api.github.com/repos/perovic/root/statuses/{sha}","languages_url":"https://api.github.com/repos/perovic/root/languages","stargazers_url":"https://api.github.com/repos/perovic/root/stargazers","contributors_url":"https://api.github.com/repos/perovic/root/contributors","subscribers_url":"https://api.github.com/repos/perovic/root/subscribers","subscription_url":"https://api.github.com/repos/perovic/root/subscription","commits_url":"https://api.github.com/repos/perovic/root/commits{/sha}","git_commits_url":"https://api.github.com/repos/perovic/root/git/commits{/sha}","comments_url":"https://api.github.com/repos/perovic/root/comments{/number}","issue_comment_url":"https://api.github.com/repos/perovic/root/issues/comments{/number}","contents_url":"https://api.github.com/repos/perovic/root/contents/{+path}","compare_url":"https://api.github.com/repos/perovic/root/compare/{base}...{head}","merges_url":"https://api.github.com/repos/perovic/root/merges","archive_url":"https://api.github.com/repos/perovic/root/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/perovic/root/downloads","issues_url":"https://api.github.com/repos/perovic/root/issues{/number}","pulls_url":"https://api.github.com/repos/perovic/root/pulls{/number}","milestones_url":"https://api.github.com/repos/perovic/root/milestones{/number}","notifications_url":"https://api.github.com/repos/perovic/root/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/perovic/root/labels{/name}","releases_url":"https://api.github.com/repos/perovic/root/releases{/id}","created_at":"2015-08-13T09:56:27Z","updated_at":"2015-08-13T09:57:20Z","pushed_at":"2015-08-18T09:03:52Z","git_url":"git://github.com/perovic/root.git","ssh_url":"git@github.com:perovic/root.git","clone_url":"https://github.com/perovic/root.git","svn_url":"https://github.com/perovic/root","homepage":"http://root.cern.ch","size":497903,"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":"root-mirror:master","ref":"master","sha":"83a1e002180c69be25bd28b63d6131c9dd6e9445","user":{"login":"root-mirror","id":4849136,"avatar_url":"https://avatars.githubusercontent.com/u/4849136?v=3","gravatar_id":"","url":"https://api.github.com/users/root-mirror","html_url":"https://github.com/root-mirror","followers_url":"https://api.github.com/users/root-mirror/followers","following_url":"https://api.github.com/users/root-mirror/following{/other_user}","gists_url":"https://api.github.com/users/root-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/root-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/root-mirror/subscriptions","organizations_url":"https://api.github.com/users/root-mirror/orgs","repos_url":"https://api.github.com/users/root-mirror/repos","events_url":"https://api.github.com/users/root-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/root-mirror/received_events","type":"Organization","site_admin":false},"repo":{"id":10994345,"name":"root","full_name":"root-mirror/root","owner":{"login":"root-mirror","id":4849136,"avatar_url":"https://avatars.githubusercontent.com/u/4849136?v=3","gravatar_id":"","url":"https://api.github.com/users/root-mirror","html_url":"https://github.com/root-mirror","followers_url":"https://api.github.com/users/root-mirror/followers","following_url":"https://api.github.com/users/root-mirror/following{/other_user}","gists_url":"https://api.github.com/users/root-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/root-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/root-mirror/subscriptions","organizations_url":"https://api.github.com/users/root-mirror/orgs","repos_url":"https://api.github.com/users/root-mirror/repos","events_url":"https://api.github.com/users/root-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/root-mirror/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/root-mirror/root","description":"Mirror of official ROOT git repository","fork":false,"url":"https://api.github.com/repos/root-mirror/root","forks_url":"https://api.github.com/repos/root-mirror/root/forks","keys_url":"https://api.github.com/repos/root-mirror/root/keys{/key_id}","collaborators_url":"https://api.github.com/repos/root-mirror/root/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/root-mirror/root/teams","hooks_url":"https://api.github.com/repos/root-mirror/root/hooks","issue_events_url":"https://api.github.com/repos/root-mirror/root/issues/events{/number}","events_url":"https://api.github.com/repos/root-mirror/root/events","assignees_url":"https://api.github.com/repos/root-mirror/root/assignees{/user}","branches_url":"https://api.github.com/repos/root-mirror/root/branches{/branch}","tags_url":"https://api.github.com/repos/root-mirror/root/tags","blobs_url":"https://api.github.com/repos/root-mirror/root/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/root-mirror/root/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/root-mirror/root/git/refs{/sha}","trees_url":"https://api.github.com/repos/root-mirror/root/git/trees{/sha}","statuses_url":"https://api.github.com/repos/root-mirror/root/statuses/{sha}","languages_url":"https://api.github.com/repos/root-mirror/root/languages","stargazers_url":"https://api.github.com/repos/root-mirror/root/stargazers","contributors_url":"https://api.github.com/repos/root-mirror/root/contributors","subscribers_url":"https://api.github.com/repos/root-mirror/root/subscribers","subscription_url":"https://api.github.com/repos/root-mirror/root/subscription","commits_url":"https://api.github.com/repos/root-mirror/root/commits{/sha}","git_commits_url":"https://api.github.com/repos/root-mirror/root/git/commits{/sha}","comments_url":"https://api.github.com/repos/root-mirror/root/comments{/number}","issue_comment_url":"https://api.github.com/repos/root-mirror/root/issues/comments{/number}","contents_url":"https://api.github.com/repos/root-mirror/root/contents/{+path}","compare_url":"https://api.github.com/repos/root-mirror/root/compare/{base}...{head}","merges_url":"https://api.github.com/repos/root-mirror/root/merges","archive_url":"https://api.github.com/repos/root-mirror/root/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/root-mirror/root/downloads","issues_url":"https://api.github.com/repos/root-mirror/root/issues{/number}","pulls_url":"https://api.github.com/repos/root-mirror/root/pulls{/number}","milestones_url":"https://api.github.com/repos/root-mirror/root/milestones{/number}","notifications_url":"https://api.github.com/repos/root-mirror/root/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/root-mirror/root/labels{/name}","releases_url":"https://api.github.com/repos/root-mirror/root/releases{/id}","created_at":"2013-06-27T10:46:59Z","updated_at":"2015-08-18T10:10:04Z","pushed_at":"2015-08-18T12:25:59Z","git_url":"git://github.com/root-mirror/root.git","ssh_url":"git@github.com:root-mirror/root.git","clone_url":"https://github.com/root-mirror/root.git","svn_url":"https://github.com/root-mirror/root","homepage":"http://root.cern.ch","size":631165,"stargazers_count":106,"watchers_count":106,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":14,"forks":97,"open_issues":14,"watchers":106,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/root-mirror/root/pulls/76"},"html":{"href":"https://github.com/root-mirror/root/pull/76"},"issue":{"href":"https://api.github.com/repos/root-mirror/root/issues/76"},"comments":{"href":"https://api.github.com/repos/root-mirror/root/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/root-mirror/root/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/root-mirror/root/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/root-mirror/root/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/root-mirror/root/statuses/a86db5f8442a0b2f339df5212d9a49247f8d5e68"}}}}