System Library
Warning: This document is a work in progress.

Written by the Reid Spencer

Abstract

This document describes the requirements, design, and implementation details of LLVM's System Library. The library is composed of the header files in llvm/include/llvm/System and the source files in llvm/lib/System. The goal of this library is to completely shield LLVM from the variations in operating system interfaces. By centralizing LLVM's use of operating system interfaces, we make it possible for the LLVM tool chain and runtime libraries to be more easily ported to new platforms. The library also unclutters the rest of LLVM from #ifdef use and special cases for specific operating systems.

The System Library was donated to LLVM by Reid Spencer who formulated the original design as part of the eXtensible Programming System (XPS) which is based, in part, on LLVM.

System Library Requirements

The System library's requirements are aimed at shielding LLVM from the variations in operating system interfaces. The following sections define the requirements needed to fulfill this objective.

Hide System Header Files

To be written.

No Exposed Functions

To be written.

No Exposed Data

To be written.

No Exceptions

To be written.

Standard Error Codes

To be written.

Minimize Overhead

To be written.

System Library Design

In order to fulfill the requirements of the system library, strict design objectives must be maintained in the library as it evolves. The goal here is to provide interfaces to operating system concepts (files, memory maps, sockets, signals, locking, etc) efficiently and in such a way that the remainder of LLVM is completely operating system agnostic.

Use Opaque Classes

no public data

onlyprimitive typed private/protected data

data size is "right" for platform, not max of all platforms

each class corresponds to O/S concept

Common Implementations

To be written.

Multiple Implementations

To be written.

Use Low Level Interfaces

To be written.

No Memory Allocation

To be written.

No Virtual Methods

To be written.

System Library Details

To be written.

Bug 251

See bug 351 for further details on the progress of this work

Reference Implementation

The linux implementation of the system library will always be the reference implementation. This means that (a) the concepts defined by the linux must be identically replicated in the other implementations and (b) the linux implementation must always be complete (provide implementations for all concepts).


Valid CSS! Valid HTML 4.01! Reid Spencer
LLVM Compiler Infrastructure
Last modified: $Date$