]> git.lizzy.rs Git - rust.git/blob - src/librustc_allocator/lib.rs
Pass cflags rather than cxxflags to LLVM as CMAKE_C_FLAGS
[rust.git] / src / librustc_allocator / lib.rs
1 #![feature(nll)]
2 #![feature(rustc_private)]
3
4 #![deny(rust_2018_idioms)]
5 #![deny(internal)]
6
7 pub mod expand;
8
9 pub static ALLOCATOR_METHODS: &[AllocatorMethod] = &[
10     AllocatorMethod {
11         name: "alloc",
12         inputs: &[AllocatorTy::Layout],
13         output: AllocatorTy::ResultPtr,
14     },
15     AllocatorMethod {
16         name: "dealloc",
17         inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout],
18         output: AllocatorTy::Unit,
19     },
20     AllocatorMethod {
21         name: "realloc",
22         inputs: &[AllocatorTy::Ptr, AllocatorTy::Layout, AllocatorTy::Usize],
23         output: AllocatorTy::ResultPtr,
24     },
25     AllocatorMethod {
26         name: "alloc_zeroed",
27         inputs: &[AllocatorTy::Layout],
28         output: AllocatorTy::ResultPtr,
29     },
30 ];
31
32 pub struct AllocatorMethod {
33     pub name: &'static str,
34     pub inputs: &'static [AllocatorTy],
35     pub output: AllocatorTy,
36 }
37
38 pub enum AllocatorTy {
39     Layout,
40     Ptr,
41     ResultPtr,
42     Unit,
43     Usize,
44 }