]> git.proxmox.com Git - rustc.git/blob - src/librustc_trans/lib.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / librustc_trans / lib.rs
1 // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 //! The Rust compiler.
12 //!
13 //! # Note
14 //!
15 //! This API is completely unstable and subject to change.
16
17 #![crate_name = "rustc_trans"]
18 #![unstable(feature = "rustc_private", issue = "27812")]
19 #![crate_type = "dylib"]
20 #![crate_type = "rlib"]
21 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
22 html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
23 html_root_url = "https://doc.rust-lang.org/nightly/")]
24 #![cfg_attr(not(stage0), deny(warnings))]
25
26 #![feature(box_patterns)]
27 #![feature(box_syntax)]
28 #![feature(const_fn)]
29 #![feature(custom_attribute)]
30 #![allow(unused_attributes)]
31 #![feature(iter_arith)]
32 #![feature(libc)]
33 #![feature(quote)]
34 #![feature(rustc_diagnostic_macros)]
35 #![feature(rustc_private)]
36 #![feature(slice_patterns)]
37 #![feature(staged_api)]
38 #![feature(unicode)]
39 #![feature(question_mark)]
40
41 extern crate arena;
42 extern crate flate;
43 extern crate getopts;
44 extern crate graphviz;
45 extern crate libc;
46 #[macro_use] extern crate rustc;
47 extern crate rustc_back;
48 extern crate rustc_data_structures;
49 extern crate rustc_incremental;
50 pub extern crate rustc_llvm as llvm;
51 extern crate rustc_mir;
52 extern crate rustc_platform_intrinsics as intrinsics;
53 extern crate serialize;
54 extern crate rustc_const_math;
55 extern crate rustc_const_eval;
56
57 #[macro_use] extern crate log;
58 #[macro_use] extern crate syntax;
59
60 pub use rustc::session;
61 pub use rustc::middle;
62 pub use rustc::lint;
63 pub use rustc::util;
64
65 pub use base::trans_crate;
66 pub use disr::Disr;
67
68 pub mod back {
69 pub use rustc_back::rpath;
70 pub use rustc::hir::svh;
71
72 pub mod archive;
73 pub mod linker;
74 pub mod link;
75 pub mod lto;
76 pub mod symbol_names;
77 pub mod write;
78 pub mod msvc;
79 }
80
81 pub mod diagnostics;
82
83 #[macro_use]
84 mod macros;
85
86 mod abi;
87 mod adt;
88 mod asm;
89 mod attributes;
90 mod base;
91 mod basic_block;
92 mod build;
93 mod builder;
94 mod cabi_aarch64;
95 mod cabi_arm;
96 mod cabi_asmjs;
97 mod cabi_mips;
98 mod cabi_powerpc;
99 mod cabi_powerpc64;
100 mod cabi_x86;
101 mod cabi_x86_64;
102 mod cabi_x86_win64;
103 mod callee;
104 mod cleanup;
105 mod closure;
106 mod common;
107 mod consts;
108 mod context;
109 mod controlflow;
110 mod datum;
111 mod debuginfo;
112 mod declare;
113 mod disr;
114 mod expr;
115 mod glue;
116 mod inline;
117 mod intrinsic;
118 mod machine;
119 mod _match;
120 mod meth;
121 mod mir;
122 mod monomorphize;
123 mod collector;
124 mod symbol_names_test;
125 mod tvec;
126 mod type_;
127 mod type_of;
128 mod value;
129
130 #[derive(Copy, Clone)]
131 pub struct ModuleTranslation {
132 pub llcx: llvm::ContextRef,
133 pub llmod: llvm::ModuleRef,
134 }
135
136 unsafe impl Send for ModuleTranslation { }
137 unsafe impl Sync for ModuleTranslation { }
138
139 pub struct CrateTranslation {
140 pub modules: Vec<ModuleTranslation>,
141 pub metadata_module: ModuleTranslation,
142 pub link: middle::cstore::LinkMeta,
143 pub metadata: Vec<u8>,
144 pub reachable: Vec<String>,
145 pub no_builtins: bool,
146 }
147
148 __build_diagnostic_array! { librustc_trans, DIAGNOSTICS }