Comments (6)
I am agree. If people want to start use c2mir compiler as interface language to their JITs, we need to provide it as library, remove global state, and improve error processing.
I am only going to provide this as a separate layer. I think in some cases, people will want only MIR layer because of faster compilation and smaller size.
This work will also require decoupling c2mir driver and defining what options should be used by driver and library itself. I don't know when it will be done (right now I am busy with another project until April) but I hope it will be done before the year end.
from mir.
I removed the global state from C2MIR and added error processing to remove all allocated memory in case of compilation errors. I also separated C2MIR driver to use C2MIR as a separate program.
So I am moving to the direction to make C2MIR a library. Probably the current interface (c2mir.h
) is not final and it will change but not radically.
Removing the global state slows down the compiler by 10%. So I am going to work to decrease this compilation speed degradation.
from mir.
wow, amazing!
from mir.
Thanks a lot for looking at this so soon. Really appreciated.
I have a few questions:
- What is the purpose of module_num?
- I presume each call to c2mir_compile() results in a single module?
- How can we get hold of the module just compiled?
Thank you
from mir.
Thanks a lot for looking at this so soon. Really appreciated.
I have a few questions:
1. What is the purpose of module_num?
Module has a name M<number>
, where <number>
is value of module_num
2. I presume each call to c2mir_compile() results in a single module?
Yes, it translates what could be considered one C file and generate one MIR module.
3. How can we get hold of the module just compiled?
It is the last module in the context module list. To reach it you can use DLIST_TAIL (MIR_module_t, *MIR_get_module_list (ctx))
. If unique numbers are used for modules, you could find them by the name in the module list.
The current interface is just first version of separation of compiler itself and the driver. If you have questions about c2mir compiler interface, c2mir-driver.c
would be the first place to look at.
from mir.
Closing as library api now available
from mir.
Related Issues (20)
- How to add static info into a function?
- Incomplete preprocessor tokens at end of file lead to heap-use-after-free HOT 4
- Usage of undeclared variables leads to null-pointer dereference HOT 2
- Segfault in update_last_qword_type HOT 2
- Add `void*` params to callbacks, for caller context
- Segfault in `update_call_arg_area_offset` HOT 1
- Segfault in `target_get_blk_type` HOT 1
- Segfault in `classify_node` HOT 1
- Segfault in `get_enum_basic_type` HOT 1
- Segfault in `get_enum_basic_type` HOT 1
- heap-buffer-overflow in `def_symbol` HOT 1
- heap-buffer-overflow in `VARR_token_tpush` and `VARR_token_tpop` HOT 3
- Assertion failed: (0), function out_op, file mir2c.c, line 65 HOT 8
- Supplying custom allocation/deallocation routines HOT 2
- Building with zig and failing at runtime on `mir_hash_1`
- Support for system calls? HOT 11
- Issue 361 test case failed HOT 2
- Shebang support for Mir files? HOT 13
- Awk has a syntax error in the benchmarks HOT 16
- Allow MIR text to be mixed in with C API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mir.