clang
æ°ãã¤ããã LLVM 3.5 ããªãªã¼ã¹ããã¦ã¾ããã LLVM 3.5 Release Notes â LLVM 3.5 documentation LLVM Download Page C++1z ã®æ©è½ã«é¢ãã¦ã¯ Clang 3.5 ã§ã¯ã¾ã çµã¿è¾¼ã¾ãã¦ãªãæãã½ãã§ããã C++14 ã®æ©è½ã¯ãã§ã« 3.4 ã§ãã¹ã¦å®è£ ããã¦ããã®ã§â¦
The LLVM Compiler Infrastructure Project LLVM 3.5 ã®ãªãªã¼ã¹ã¹ã±ã¸ã¥ã¼ã«ãããããã¼ã¸ã«è¨è¿°ããã¦ãã¾ããã ãªãªã¼ã¹ã¾ã§ã®ã¹ã±ã¸ã¥ã¼ã«ã¯ä»¥ä¸ã®éãã§ãã 7æ21æ¥: Branch for 3.5 release 7æ21æ¥ã27æ¥: Testing Phase I 7æ28æ¥ã8æ03æ¥: Fix â¦
å°ãåã«ãªããã§ãã LLVM 3.4.1 ããªãªã¼ã¹ããã¾ããã LLVM 3.4.1 Release Notes â LLVM 3.4 documentation LLVM Download Page
ææã§æãã¦ããã£ããã§ãããMinGW ã§ã®ãã«ãæ¸ã¿ LLVM/Clang ã®ãã¤ããªã bitbucket ã§é å¸ããã¦ãããããã Haroogan / LLVM for Windows 2000 ã XP ã«ã対å¿ãã¦ããã£ã½ãã®ã§ããããã®ç°å¢ã§ã試ãã¦ã¿ããã§ããããã¾ãåä½ããªãã£ãâ¦ã ä»â¦
ååã¯ã«ã¼ã½ã«ä½ç½®ã®ååãåå¾ããæ¹æ³ã«ã¤ãã¦æ¸ãã¾ããã ä»åã¯è©³ç´°ãªååãåå¾ããæ¹æ³ã«ã¤ãã¦æ¸ãã¾ãã ãã¦ãåå使ç¨ããæ¹æ³ã§ã¯ä¾ãã°ä»¥ä¸ã®ããã« typedef ããã¦ããå ´åãtypedef ããååãåå¾ãã¾ãã typedef int hoge; hoge h; // h â¦
åå㯠Type ã«ã¤ãã¦ç°¡åã«æ¸ãã¾ããã ä»åã¯ãã® Type ã®ååãåå¾ããæ¹æ³ã«ã¤ãã¦æ¸ãã¾ãã [注æ] ä»å使ç¨ãã¦ãã clang_getTypeSpelling ãªã®ã§ãããClang 3.3 以åã® python binding ã使ç¨ãã¦ããå ´åã¯ã¦ã¼ã¶å´ã§åçã©ã¤ãã©ãªããå¼ã³åºâ¦
ååãããã£ããæéãããã¦ãã¾ãã¾ãããã¾ã ç¶ãã¾ããã 決ãã¦å¿ãã¦ããããã§ã¯ãªã ååã¾ã§ã¯ Cursor ã«ã¤ãã¦æ¸ãã¦ãã¾ããããä»åã¯åæ å ±ã«ã¤ãã¦ç°¡åã«æ¸ãã¾ãã Cursor ãããã®ä½ç½®ã®åæ å ±ãåå¾ããäºãã§ãã¾ãã [ã½ã¼ã¹] # -*- codâ¦
ååããå°ãæéãããã¾ããã åå㯠definition ã«é¢ããè¨äºãæ¸ãã¾ããã ä»å㯠referenced ã«ã¤ãã¦æ¸ãã¾ãã referenced ã¯ååç´¹ä»ãã definition ã¨ä¼¼ã¦ããå®ç¾©ä½ç½®ãè¿ãã¾ãã definition ã¨ã®éã㯠definition ã宣è¨ã®ã¿ã®å ´å㯠None â¦
åå㯠Cursor ã«é¢ããè¨äºãæ¸ãã¾ããã 次ã¯åæ å ±ã«ã¤ãã¦æ¸ãäºå®ã ã£ãã®ã§ãããå ã« definition å¨ãã«ã¤ãã¦æ¸ãã¾ãã ãã¦ãå®ç¾©ä½ç½®ã¯ Cursor ã® get_definition() ã¡ã½ããã使ç¨ãã¦åå¾ããäºãã§ãã¾ãã [ã½ã¼ã¹] # -*- coding: utf-8 -* â¦
åå㯠SourceLocation ã«é¢ããè¨äºãæ¸ãã¾ããã ä»å㯠Cursor ã«ã¤ãã¦ç°¡åã«æ¸ãã¾ãã Cursor ã¯æå®ãããã¡ã¤ã«ä½ç½®ã®æ å ±ãåå¾ããäºãã§ãã¾ãã [ã½ã¼ã¹] # -*- coding: utf-8 -* import clang.cindex from clang.cindex import Cursor # sourcâ¦
åå㯠diagnostics ã«é¢ããè¨äºãæ¸ãã¾ããã ä»å㯠SourceLocation ã«ã¤ãã¦ç°¡åã«æ¸ãã¾ãã SourceLocation ã¯ãã¡ã¤ã«ã®ä½ç½®æ å ±ãä¿æãããã¼ã¿ã«ãªãã¾ãã ä»»æã®ãã¡ã¤ã«ã®ä½ç½®ã®æ å ±ãåå¾ããå ´åãªã©ã«ä½¿ç¨ãã¾ãã åå使ç¨ãã diagnosticâ¦
åå㯠unsave_files ã«é¢ããè¨äºãæ¸ãã¾ããã ä»å㯠diagnostics ã«ã¤ãã¦ç°¡åã«æ¸ãã¾ãã diagnostics ã¯ãã¼ã¹ããçµæã®ã¨ã©ã¼ãè¦åãªã©ãåå¾ããäºãã§ãã¾ãã [ã½ã¼ã¹] import clang.cindex # source code source = """\ struct X{ const int â¦
åå㯠Index ã«é¢ããè¨äºãæ¸ãã¾ããã ä»åã¯åå¨ããªããã¡ã¤ã«ããã¼ã¹ããæ¹æ³ã«ã¤ãã¦æ¸ãã¾ãã Vim ãªã©ã使ç¨ãã¦ããã¨ãããããããã§ããããã¡ã¤ã«ã¯åå¨ãã¦ããªããã©ç·¨éä¸ã®ã½ã¼ã¹ãã¡ã¤ã«ããã¼ã¹ããããã¨ããäºã¯ããã¨æãã¾ãã â¦
åå㯠Config ã«é¢ããè¨äºãæ¸ãã¾ããã ä»å㯠Index å¨ãã«ã¤ãã¦ç°¡åã«æ¸ãã¾ãã libclang ã§ã¯ Index ã使ç¨ãã¦ã½ã¼ã¹ã³ã¼ãããã¼ã¹ããTranslationUnit ã®çæãè¡ãã¾ãã [test.cpp] struct X{ int value1 = 0; float value2 = 0.0f; }; int maâ¦
åå㯠Python binding ãå°å ¥ããè¨äºãæ¸ãã¾ããã ä»å㯠Config å¨ãã«ã¤ãã¦æ¸ãã¾ãã libclang ã® Python bindingï¼ä»¥ä¸ãcindex.pyï¼ã§ã¯ Config ã¯ã©ã¹ã§èªã¿è¾¼ãåçã©ã¤ãã©ãªï¼ä»¥ä¸ libclangï¼ã®ç®¡çãè¡ãã¾ãã Config ã§ã¯ä»¥ä¸ã®ãããªè¨å®â¦
æè¿ libclang ã® Python binding ã使ç¨ããããã Vim ãã©ã°ã¤ã³ãä½æãã¦ããã®ã§ãã®è¦æ¸ã¨ãã¦ããããæ¸ãã¦ããããã¨æãã¾ãã ibclang ã¨ã¯ Clang ãæä¾ãã¦ããæ§æ解æãã¼ã«ã«ãªãã¾ãã ãã®æ§æ解æå¨ã¯ Clang ããæä¾ããã¦ãã Python â¦
LLVM 3.4 ããªãªã¼ã¹ããã¾ããã Download LLVM 3.4 LLVM 3.4 Release Notes Clang 3.4 Release Notes Clang Language Extensions â Clang 3.4 documentation Clang Compiler Userâs Manual â Clang 3.4 documentation LLVM 3.4 ãªãªã¼ã¹ãã¼ãã®è¨³ - Boostâ¦
ããããã°ãClang ã§æ¢ã«å®è£ ããã¦ãããªã¼ã¨æã£ã¦è©¦ãã¦ã¿ã¾ããã [ã½ã¼ã¹] #include <iostream> int main(){ // ä»»æã®å ´æ㧠' ãããã int n = 1'000'000; int m = 1'23'456'7; std::cout << n << std::endl; std::cout << m << std::endl; // 10é²æ°ä»¥å¤ã i</iostream>â¦
ãã®è¨äºã¯ C++ Advent Calendar 2013 ã® 19æ¥ç®ã®åç·¨ã®è¨äºã«ãªãã¾ãã æ¬è¨äºã¯ 2011 å¹´ã«æ¸ãã Vim 㧠C++ ã®ã³ã¼ãã£ã³ã°ãè¡ããªãç¥ã£ã¦ãããã10ã®ã㨠㮠2013 å¹´çã«ãªãã¾ãã 2013 å¹´çã¨ããã¤ã¤å ¨ç¶ 10åãããªããã§ããâ¦ã ãã¼ Vim æ¬ä½â¦
ãã®è¨äºã¯ C++ Advent Calendar 2013 ã® 19æ¥ç®ã®å¾ç·¨ã®è¨äºã«ãªãã¾ãã ãã¦ãClang ãªã®ã§ãã C++er ã§ã¯ç¥ããªã人ã¯ããªãã¨æãã¾ãã Clang ã¨ã¯ LLVM ãããã¯ã¨ã³ãã¨ãã C++ ã®ã³ã³ãã¤ã©ã§ãã æè¿ã§ã¯ Clang ã C++14 ã®æ©è½ãå ¨ã¦å®è£ ãã¦â¦
è¦æ¸ã ã¨ãããããæå ã®ç°å¢ã§ã¯ libcall() ã§åå¾ããäºã¯å¯è½ã§ããã echo libcall("libclang", "clang_getClangVersion", "") " => clang version 3.5 ä»ã®ç°å¢ã§ãåä½ããããªã
The LLVM Compiler Infrastructure LLVM 3.4 ã®ãªãªã¼ã¹ã¹ã±ã¸ã¥ã¼ã«ãããããã¼ã¸ã«è¨è¿°ããã¦ãã¾ããã ãªãªã¼ã¹ã¾ã§ã®ã¹ã±ã¸ã¥ã¼ã«ã¯ä»¥ä¸ã®éãã§ãã 11æ19æ¥ - Phase I Testing 11æ25æ¥ ã 12æ01æ¥ - Fix bugs from Phase I 12æ02æ¥ ã 12æ08æ¥ â¦
åå試ããã¨ã㯠Generic lambda ã§ãã£ããã£ãåºæ¥ãªãã£ããã§ãããä»åãã¹ã¦ãå®è£ ããããããªã®ã§å度試ãã¦ã¿ã¾ããã [ã½ã¼ã¹] #include <iostream> template<typename F, typename T> auto bind1st(F func, T t){ return [=](auto... args){ return func(t, args...); }; } int plu</typename></iostream>â¦
C++14 ã®ä»æ§ã¯ãã¾ã追ãã¦ããªãã®ã§ãããç¾å¨ã®ãã©ããï¼n3797ï¼ã®ææ¡ã¯ãã¹ã¦ svn ã«çµã¿è¾¼ã¾ããããã§ãã http://clang.llvm.org/cxx_status.html#cxx14 Generic Lambdas ããããå ¨é¨å®è£ ããããããªã®ã§ããããã¨éãã§ã¿ããã åæ¥ã«ã§ããâ¦
Clang 3.4(svn) ã§è©¦ãã¦ã¿ã¾ããã [ã½ã¼ã¹] #include <iostream> #include <string> int main(){ auto sum = [](auto x, auto&&... args){ for(auto&& n : {args...}){ x += n; } return x; }; std::cout << sum(1, 2, 3) << std::endl; std::cout << sum(std::string("homu"</string></iostream>â¦
çµæ§åã«å®è£ ãããã®ã§ãããã£ã¨ãã試ãã¦ã¿ã¾ããã ã¨ãããããç°¡åã«ã [ã½ã¼ã¹] #include <iostream> #include <string> int main(){ auto twice = [](auto n){ return n + n; }; std::cout << twice(10) << std::endl; std::cout << twice(0.52) << std::endl; std::c</string></iostream>â¦
ãã®è¨äºã¯ Vim Advent Calendar 2012 316æ¥ç®ã®è¨äºã«ãªãã¾ãã ã¡ãªã¿ã«ãã Twitter ã¨ã㧠ã2012å¹´ã¨2013å¹´ã® Vim Advent Calendar ã並走ããã®ãã ã¿ãããªçºè¨ãè¦ããã¾ãã Vim Advent Calendar 2012 ã¯11ææ«ã§çµäºãã¾ãã ã§ãã®ã§ãåå ããâ¦
å®è£ ããã¦ãã¾ããã C++98, C++11, and C++14 Support in Clang ãã㧠C++14 ã®æ©è½ã¯å ¨é¨æãä»ããããã®ããªã ï¼é¨åçã§ã¯ãããã©ï¼Generic lambdas ã¤ãã«æ¥ããâ¦ã¨ããæãã ä¸å¿ããã«ãã¯ãããã§ããã¾ã 試ãã¦ãªãã®ã§ã¡ãã£ã¨è§¦ã£ã¦ã¿ããâ¦
clang 3.4(svn) ã« C++1y ã§å®è£ ãããäºå®ã® Variable templates ãé¨åçã«å®è£ ããã¦ããã®ã§å°ã試ãã¦ã¿ã¾ããã C++1y ã§ã¯ä»¥ä¸ã®ããã«ã³ã¼ããè¨è¿°ãããã¨ãã§ããã¿ããã§ãã [ã½ã¼ã¹] #include <iostream> #include <limits> #include <iomanip> #include <array> template<typename T> constex</typename></array></iomanip></limits></iostream>â¦
å¤åãå ææ«ã ã¨æããã§ãã Clang ã« Relaxing constraints on constexpr functions ãå®è£ ããã¾ããã C++11 ã® constexpr é¢æ°ã¯ããããã¨å¶éããã£ããã§ãããC++14 ã§ã¯ãããç·©åãããä¸è¬ã¦ã¼ã¶ã¼ï¼éä¸3女åï¼ã«ãæ±ãããããªãã¾ãã ä¾ãâ¦