Please see C2Lang.org for more info about C2!
The C2 project attempts to create a new language, strongly based on C.In a nutshell, the main differences with C are:
Below are the instructions for building and using the C2Compiler.
Have fun! (and code..)
C2 is based on LLVM 7.0 and some parts of Clang 7.0. The design of C2C'sParser and ASTBuilder classes are heavily based on clang's Parser and Sema class,so hereby my thanks to the Clang folks!
A short list of open items (the full list would probably fill-up GitHub) withtheir priority:
Read the installation document for installation on Linux or OSX. ForWindows installation, see windows installation document.
By default, c2c will only parse and analyse the targets. Generating C-codeshould work on all examples, but generating LLVM's IR code is work inprogress. In the examples directory: (or add -d examples/)
c2c multi
c2c hello
c2c puzzle
c2c -I working_ir
It's also possible to manually compile a single .c2 file without a recipefile with:
c2c -f <file.c2>
To generate ANSI-C code, use:
c2c -C <target>
The C2 compiler is able to generate a package dependency file in dot format. Thisfile can be converted into a png as follows:
c2c --deps <target>
dot -T png output/target/deps.dot > image.png
To see all available options, run:
c2c -h
c2tags is C2's version of ctags. This tool is used by vim (e.a.) to "jump todefinition". See the installation document on how to install.
How it works is as follows:
Just like c2c itself, c2tags can be called from any (sub)directory in theproject tree.
一、描述:异常线程的堆栈如下: "C2 CompilerThread9" #48 daemon prio=9 os_prio=0 tid=0x00007f45f0b80000 nid=0x188 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE 补充描述:我的应用类型为后台接口服务,系统秒级调用峰值在10W+,JR
from : https://community.atlassian.com/t5/Jira-questions/c1-c2-compiler-thread-eats-a-lot-of-cpu/qaq-p/51641 Aleksey Shirokih Jul 26, 2015 hi. My JIRA instalation eats alot of cpu time during "not so
"C2 CompilerThread0" #5 daemon prio=9 os_prio=0 tid=0x00007f20c80b3800 nid=0x57c0 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE 转载于:https://www.cnblogs.com/AmilyWilly/p/7134356.html
我在java进程(oracle jdk1.7_072)上运行jstack并找到了这些行 "C2 CompilerThread1" daemon prio=10 tid=0x00007f1a8415d000 nid=0x7d72 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 Compile