{"action":"created","issue":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/2993","repository_url":"https://api.github.com/repos/crystal-lang/crystal","labels_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2993/labels{/name}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2993/comments","events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2993/events","html_url":"https://github.com/crystal-lang/crystal/pull/2993","id":165430675,"number":2993,"title":"Add support for LLVM 3.8","user":{"login":"omarroth","id":14208607,"avatar_url":"https://avatars.githubusercontent.com/u/14208607?v=3","gravatar_id":"","url":"https://api.github.com/users/omarroth","html_url":"https://github.com/omarroth","followers_url":"https://api.github.com/users/omarroth/followers","following_url":"https://api.github.com/users/omarroth/following{/other_user}","gists_url":"https://api.github.com/users/omarroth/gists{/gist_id}","starred_url":"https://api.github.com/users/omarroth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omarroth/subscriptions","organizations_url":"https://api.github.com/users/omarroth/orgs","repos_url":"https://api.github.com/users/omarroth/repos","events_url":"https://api.github.com/users/omarroth/events{/privacy}","received_events_url":"https://api.github.com/users/omarroth/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/compiler","name":"compiler","color":"fef2c0"}],"state":"open","locked":false,"assignee":{"login":"waj","id":22697,"avatar_url":"https://avatars.githubusercontent.com/u/22697?v=3","gravatar_id":"","url":"https://api.github.com/users/waj","html_url":"https://github.com/waj","followers_url":"https://api.github.com/users/waj/followers","following_url":"https://api.github.com/users/waj/following{/other_user}","gists_url":"https://api.github.com/users/waj/gists{/gist_id}","starred_url":"https://api.github.com/users/waj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waj/subscriptions","organizations_url":"https://api.github.com/users/waj/orgs","repos_url":"https://api.github.com/users/waj/repos","events_url":"https://api.github.com/users/waj/events{/privacy}","received_events_url":"https://api.github.com/users/waj/received_events","type":"User","site_admin":false},"assignees":[{"login":"waj","id":22697,"avatar_url":"https://avatars.githubusercontent.com/u/22697?v=3","gravatar_id":"","url":"https://api.github.com/users/waj","html_url":"https://github.com/waj","followers_url":"https://api.github.com/users/waj/followers","following_url":"https://api.github.com/users/waj/following{/other_user}","gists_url":"https://api.github.com/users/waj/gists{/gist_id}","starred_url":"https://api.github.com/users/waj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waj/subscriptions","organizations_url":"https://api.github.com/users/waj/orgs","repos_url":"https://api.github.com/users/waj/repos","events_url":"https://api.github.com/users/waj/events{/privacy}","received_events_url":"https://api.github.com/users/waj/received_events","type":"User","site_admin":false}],"milestone":null,"comments":34,"created_at":"2016-07-13T21:55:11Z","updated_at":"2016-07-17T22:46:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/crystal-lang/crystal/pulls/2993","html_url":"https://github.com/crystal-lang/crystal/pull/2993","diff_url":"https://github.com/crystal-lang/crystal/pull/2993.diff","patch_url":"https://github.com/crystal-lang/crystal/pull/2993.patch"},"body":"Incompatible with 3.7, but is backwards compatible for currently supported versions of LLVM. Closes #1614. It is also necessary for #26, as TLS is now supported on cygwin targets with [emutls](http://llvm.org/releases/3.8.0/docs/ReleaseNotes.html#changes-to-the-x86-target). \r\n\r\nBuild times using 3.8 appear to be slower on average."},"comment":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments/233208725","html_url":"https://github.com/crystal-lang/crystal/pull/2993#issuecomment-233208725","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2993","id":233208725,"user":{"login":"omarroth","id":14208607,"avatar_url":"https://avatars.githubusercontent.com/u/14208607?v=3","gravatar_id":"","url":"https://api.github.com/users/omarroth","html_url":"https://github.com/omarroth","followers_url":"https://api.github.com/users/omarroth/followers","following_url":"https://api.github.com/users/omarroth/following{/other_user}","gists_url":"https://api.github.com/users/omarroth/gists{/gist_id}","starred_url":"https://api.github.com/users/omarroth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omarroth/subscriptions","organizations_url":"https://api.github.com/users/omarroth/orgs","repos_url":"https://api.github.com/users/omarroth/repos","events_url":"https://api.github.com/users/omarroth/events{/privacy}","received_events_url":"https://api.github.com/users/omarroth/received_events","type":"User","site_admin":false},"created_at":"2016-07-17T22:46:37Z","updated_at":"2016-07-17T22:46:37Z","body":"The problem I'm having with macros though is that the generated code only seems to be callable in the same file. Something like this:\r\n```crystal\r\n{% if `(command -v llvm-config-3.6 || command -v llvm-config-36 || command -v llvm-config-3 || command -v llvm-config-35) > /dev/null && printf %s true || printf %s false` == \"true\" %}\r\nlib LibLLVMExt\r\n  HAVE_LLVM_36_OR_LOWER = true\r\nend\r\n{% else %}\r\nlib LibLLVMExt\r\n  HAVE_LLVM_36_OR_LOWER = false\r\nend\r\n{% end %}\r\n```\r\nThrows an `undefined constant` error  or appears to produce nothing when used elsewhere.\r\n```crystal\r\n{% if LibLLVMExt::HAVE_LLVM_36_OR_LOWER %}\r\nfn_metadata = di_builder.create_function(scope, target_def.name, target_def.name, scope,\r\n  location.line_number, fun_metadata_type, 1, 1, location.line_number, 0_u32, 0, context.fun)\r\n{% else %}\r\nfn_metadata = di_builder.create_function(scope, target_def.name, target_def.name, scope,\r\n  location.line_number, fun_metadata_type, true, true, location.line_number, 0_u32, false, context.fun)\r\n{% end %}\r\nfun_metadatas[context.fun] = fn_metadata\r\n```\r\nProduces\r\n```\r\n undefined local variable or method 'fn_metadata' (did you mean 'fun_metadatas'?)\r\n\r\n      fun_metadatas[context.fun] = fn_metadata\r\n                                   ^~~~~~~~~~~\r\n```"}}
{"actor":{"display_login":"omarroth"}}