clang ã®ã©ã¤ãã©ãªã®æ¹ã§éãã§ã¿ã
clang ã®ã³ã³ãã¤ã©ã§ã¯ãªããã©ã¤ãã©ãªã®æ¹ã§éãã§ã¿ãã使ç¨ãã clang(+LLVM) ã®ãã¼ã¸ã§ã³ã¯ Subversion ã¬ãã¸ããªããåå¾ãã r127064 ãã¡ãã£ã¨å¤ããæ°ã«ããªãã
clangã®ã©ã¤ãã©ãªã®æ¹ã®ããã¥ã¡ã³ããè¦ã¤ããããªãã£ãã®ã§ã主ã«clang tutorialãåèã«ãããããããªãããclang tutorialãæ¸ãããã®ã¯2008å¹´ã§ãããç¾å¨ã® clang ã§ã¯ã³ã³ãã¤ã«ã¨ã©ã¼ã«ãªãã³ã¼ããããã
ä»åä½æããã®ã¯ãmainé¢æ°ãå¼æ°ãåããåããªãããåºåããããã°ã©ã ã§ãã (clang::FunctionDecl::isMainé¢æ°ã使ãã°ãããé¢æ°ãmainé¢æ°ã§ãããã©ããå¤å®ã§ããã®ã§æ¥½ã§ãã)ãclang::CompilerInstanceã®ä½¿ãæ¹ãããã§ããã®ããããªãèªä¿¡ããªãã以ä¸ã½ã¼ã¹ã³ã¼ãã
ã³ã³ãã¤ã«ã¯ä»¥ä¸ã®ããã«ãã*1ã ãã ãã$(LLVMDIR)ã¯LLVMãã¤ã³ã¹ãã¼ã«ããã¦ãããã£ã¬ã¯ããªã表ãã
$ clang -std=c++0x -fno-rtti -Wall -I$(LLVMDIR)/include \ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -o maintype maintype.cpp $(LLVMDIR)/lib/lib*.a
*1:ã©ã®ã©ã¤ãã©ãªããªã³ã¯ããã°ããã®ãã調ã¹ãã®ãããã©ãã£ãã®ã§ãå ¨é¨ãªã³ã¯ããã°ããããã£ã¦ãã(ry