Reid Spencer | 5179f05 | 2004-08-26 07:41:41 +0000 | [diff] [blame] | 1 | Design Of lib/System |
| 2 | ==================== |
| 3 | |
| 4 | The software in this directory is designed to completely shield LLVM from any |
| 5 | and all operating system specific functionality. It is not intended to be a |
| 6 | complete operating system wrapper (such as ACE), but only to provide the |
| 7 | functionality necessary to support LLVM. |
| 8 | |
| 9 | The software located here, of necessity, has very specific and stringent design |
| 10 | rules. Violation of these rules means that cracks in the shield could form and |
| 11 | the primary goal of the library is defeated. By consistently using this library, |
Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 12 | LLVM becomes more easily ported to new platforms since the only thing requiring |
Reid Spencer | d8f4c8e | 2004-08-30 02:03:51 +0000 | [diff] [blame] | 13 | porting is this library. |
Reid Spencer | 5179f05 | 2004-08-26 07:41:41 +0000 | [diff] [blame] | 14 | |
| 15 | Complete documentation for the library can be found in the file: |
Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 16 | llvm/docs/SystemLibrary.html |
Reid Spencer | 5179f05 | 2004-08-26 07:41:41 +0000 | [diff] [blame] | 17 | or at this URL: |
Reid Spencer | 9dce2b3 | 2006-03-14 05:54:52 +0000 | [diff] [blame] | 18 | http://llvm.org/docs/SystemLibrary.html |
Reid Spencer | 5179f05 | 2004-08-26 07:41:41 +0000 | [diff] [blame] | 19 | |
Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 20 | While we recommend that you read the more detailed documentation, for the |
Reid Spencer | d8f4c8e | 2004-08-30 02:03:51 +0000 | [diff] [blame] | 21 | impatient, here's a high level summary of the library's requirements. |
Reid Spencer | 5179f05 | 2004-08-26 07:41:41 +0000 | [diff] [blame] | 22 | |
Reid Spencer | d8f4c8e | 2004-08-30 02:03:51 +0000 | [diff] [blame] | 23 | 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. |
Reid Spencer | 99655e1 | 2006-08-25 19:54:53 +0000 | [diff] [blame] | 28 | 6. Errors are handled by returning "true" and setting an optional std::string |
| 29 | 7. Library must not throw any exceptions, period. |
Reid Spencer | d8f4c8e | 2004-08-30 02:03:51 +0000 | [diff] [blame] | 30 | 8. Interface functions must not have throw() specifications. |
| 31 | 9. No duplicate function impementations are permitted within an operating |
| 32 | system class. |
Reid Spencer | 5179f05 | 2004-08-26 07:41:41 +0000 | [diff] [blame] | 33 | |
Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 34 | To accomplish these requirements, the library has numerous design criteria that |
Reid Spencer | d8f4c8e | 2004-08-30 02:03:51 +0000 | [diff] [blame] | 35 | must be satisfied. Here's a high level summary of the library's design criteria: |
Reid Spencer | 5179f05 | 2004-08-26 07:41:41 +0000 | [diff] [blame] | 36 | |
Reid Spencer | d8f4c8e | 2004-08-30 02:03:51 +0000 | [diff] [blame] | 37 | 1. No unused functionality (only what LLVM needs) |
| 38 | 2. High-Level Interfaces |
| 39 | 3. Use Opaque Classes |
Michael J. Spencer | 1f6efa3 | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 40 | 4. Common Implementations |
| 41 | 5. Multiple Implementations |
| 42 | 6. Minimize Memory Allocation |
Reid Spencer | d8f4c8e | 2004-08-30 02:03:51 +0000 | [diff] [blame] | 43 | 7. No Virtual Methods |