blob: 63e00dafbfbaba10123bc6159df3aca4629930d3 [file] [log] [blame]
Reid Spencer5179f052004-08-26 07:41:41 +00001Design Of lib/System
2====================
3
4The software in this directory is designed to completely shield LLVM from any
5and all operating system specific functionality. It is not intended to be a
6complete operating system wrapper (such as ACE), but only to provide the
7functionality necessary to support LLVM.
8
9The software located here, of necessity, has very specific and stringent design
10rules. Violation of these rules means that cracks in the shield could form and
11the primary goal of the library is defeated. By consistently using this library,
Reid Spencerd8f4c8e2004-08-30 02:03:51 +000012LLVM becomes more easily ported to new platforms since the only thing requiring
13porting is this library.
Reid Spencer5179f052004-08-26 07:41:41 +000014
15Complete documentation for the library can be found in the file:
16 llvm/docs/SystemLibrary.html
17or at this URL:
Reid Spencer9dce2b32006-03-14 05:54:52 +000018 http://llvm.org/docs/SystemLibrary.html
Reid Spencer5179f052004-08-26 07:41:41 +000019
Reid Spencerd8f4c8e2004-08-30 02:03:51 +000020While we recommend that you read the more detailed documentation, for the
21impatient, here's a high level summary of the library's requirements.
Reid Spencer5179f052004-08-26 07:41:41 +000022
Reid Spencerd8f4c8e2004-08-30 02:03:51 +000023 1. No system header files are to be exposed through the interface.
24 2. Std C++ and Std C header files are okay to be exposed through the interface.
25 3. No exposed system-specific functions.
26 4. No exposed system-specific data.
27 5. Data in lib/System classes must use only simple C++ intrinsic types.
28 6. Errors are handled by throwing std::string *only*.
29 7. Library must not throw any exceptions except std::string.
30 8. Interface functions must not have throw() specifications.
31 9. No duplicate function impementations are permitted within an operating
32 system class.
Reid Spencer5179f052004-08-26 07:41:41 +000033
Reid Spencerd8f4c8e2004-08-30 02:03:51 +000034To accomplish these requirements, the library has numerous design criteria that
35must be satisfied. Here's a high level summary of the library's design criteria:
Reid Spencer5179f052004-08-26 07:41:41 +000036
Reid Spencerd8f4c8e2004-08-30 02:03:51 +000037 1. No unused functionality (only what LLVM needs)
38 2. High-Level Interfaces
39 3. Use Opaque Classes
40 4. Common Implementations</a></li>
41 5. Multiple Implementations</a></li>
42 6. Minimize Memory Allocation</a></li>
43 7. No Virtual Methods