]> git.lizzy.rs Git - rust.git/blob - src/librustc_trans/mir/mod.rs
Rollup merge of #39604 - est31:i128_tests, r=alexcrichton
[rust.git] / src / librustc_trans / mir / mod.rs
1 // Copyright 2012-2014 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 use libc::c_uint;
12 use llvm::{self, ValueRef, BasicBlockRef};
13 use llvm::debuginfo::DIScope;
14 use rustc::ty::{self, layout};
15 use rustc::mir::{self, Mir};
16 use rustc::mir::tcx::LvalueTy;
17 use rustc::ty::subst::Substs;
18 use rustc::infer::TransNormalize;
19 use rustc::ty::TypeFoldable;
20 use session::config::FullDebugInfo;
21 use base;
22 use builder::Builder;
23 use common::{self, CrateContext, C_null, Funclet};
24 use debuginfo::{self, declare_local, VariableAccess, VariableKind, FunctionDebugContext};
25 use monomorphize::{self, Instance};
26 use abi::FnType;
27 use type_of;
28
29 use syntax_pos::{DUMMY_SP, NO_EXPANSION, COMMAND_LINE_EXPN, BytePos, Span};
30 use syntax::symbol::keywords;
31 use syntax::abi::Abi;
32
33 use std::iter;
34
35 use rustc_data_structures::bitvec::BitVector;
36 use rustc_data_structures::indexed_vec::{IndexVec, Idx};
37
38 pub use self::constant::trans_static_initializer;
39
40 use self::analyze::CleanupKind;
41 use self::lvalue::{Alignment, LvalueRef};
42 use rustc::mir::traversal;
43
44 use self::operand::{OperandRef, OperandValue};
45
46 /// Master context for translating MIR.
47 pub struct MirContext<'a, 'tcx:'a> {
48     mir: &'a mir::Mir<'tcx>,
49
50     debug_context: debuginfo::FunctionDebugContext,
51
52     llfn: ValueRef,
53
54     ccx: &'a CrateContext<'a, 'tcx>,
55
56     fn_ty: FnType,
57
58     /// When unwinding is initiated, we have to store this personality
59     /// value somewhere so that we can load it and re-use it in the
60     /// resume instruction. The personality is (afaik) some kind of
61     /// value used for C++ unwinding, which must filter by type: we
62     /// don't really care about it very much. Anyway, this value
63     /// contains an alloca into which the personality is stored and
64     /// then later loaded when generating the DIVERGE_BLOCK.
65     llpersonalityslot: Option<ValueRef>,
66
67     /// A `Block` for each MIR `BasicBlock`
68     blocks: IndexVec<mir::BasicBlock, BasicBlockRef>,
69
70     /// The funclet status of each basic block
71     cleanup_kinds: IndexVec<mir::BasicBlock, analyze::CleanupKind>,
72
73     /// This stores the landing-pad block for a given BB, computed lazily on GNU
74     /// and eagerly on MSVC.
75     landing_pads: IndexVec<mir::BasicBlock, Option<BasicBlockRef>>,
76
77     /// Cached unreachable block
78     unreachable_block: Option<BasicBlockRef>,
79
80     /// The location where each MIR arg/var/tmp/ret is stored. This is
81     /// usually an `LvalueRef` representing an alloca, but not always:
82     /// sometimes we can skip the alloca and just store the value
83     /// directly using an `OperandRef`, which makes for tighter LLVM
84     /// IR. The conditions for using an `OperandRef` are as follows:
85     ///
86     /// - the type of the local must be judged "immediate" by `type_is_immediate`
87     /// - the operand must never be referenced indirectly
88     ///     - we should not take its address using the `&` operator
89     ///     - nor should it appear in an lvalue path like `tmp.a`
90     /// - the operand must be defined by an rvalue that can generate immediate
91     ///   values
92     ///
93     /// Avoiding allocs can also be important for certain intrinsics,
94     /// notably `expect`.
95     locals: IndexVec<mir::Local, LocalRef<'tcx>>,
96
97     /// Debug information for MIR scopes.
98     scopes: IndexVec<mir::VisibilityScope, debuginfo::MirDebugScope>,
99
100     /// If this function is being monomorphized, this contains the type substitutions used.
101     param_substs: &'tcx Substs<'tcx>,
102 }
103
104 impl<'a, 'tcx> MirContext<'a, 'tcx> {
105     pub fn monomorphize<T>(&self, value: &T) -> T
106         where T: TransNormalize<'tcx> {
107         monomorphize::apply_param_substs(self.ccx.shared(), self.param_substs, value)
108     }
109
110     pub fn set_debug_loc(&mut self, bcx: &Builder, source_info: mir::SourceInfo) {
111         let (scope, span) = self.debug_loc(source_info);
112         debuginfo::set_source_location(&self.debug_context, bcx, scope, span);
113     }
114
115     pub fn debug_loc(&mut self, source_info: mir::SourceInfo) -> (DIScope, Span) {
116         // Bail out if debug info emission is not enabled.
117         match self.debug_context {
118             FunctionDebugContext::DebugInfoDisabled |
119             FunctionDebugContext::FunctionWithoutDebugInfo => {
120                 return (self.scopes[source_info.scope].scope_metadata, source_info.span);
121             }
122             FunctionDebugContext::RegularContext(_) =>{}
123         }
124
125         // In order to have a good line stepping behavior in debugger, we overwrite debug
126         // locations of macro expansions with that of the outermost expansion site
127         // (unless the crate is being compiled with `-Z debug-macros`).
128         if source_info.span.expn_id == NO_EXPANSION ||
129             source_info.span.expn_id == COMMAND_LINE_EXPN ||
130             self.ccx.sess().opts.debugging_opts.debug_macros {
131
132             let scope = self.scope_metadata_for_loc(source_info.scope, source_info.span.lo);
133             (scope, source_info.span)
134         } else {
135             let cm = self.ccx.sess().codemap();
136             // Walk up the macro expansion chain until we reach a non-expanded span.
137             let mut span = source_info.span;
138             while span.expn_id != NO_EXPANSION && span.expn_id != COMMAND_LINE_EXPN {
139                 if let Some(callsite_span) = cm.with_expn_info(span.expn_id,
140                                                     |ei| ei.map(|ei| ei.call_site.clone())) {
141                     span = callsite_span;
142                 } else {
143                     break;
144                 }
145             }
146             let scope = self.scope_metadata_for_loc(source_info.scope, span.lo);
147             // Use span of the outermost call site, while keeping the original lexical scope
148             (scope, span)
149         }
150     }
151
152     // DILocations inherit source file name from the parent DIScope.  Due to macro expansions
153     // it may so happen that the current span belongs to a different file than the DIScope
154     // corresponding to span's containing visibility scope.  If so, we need to create a DIScope
155     // "extension" into that file.
156     fn scope_metadata_for_loc(&self, scope_id: mir::VisibilityScope, pos: BytePos)
157                                -> llvm::debuginfo::DIScope {
158         let scope_metadata = self.scopes[scope_id].scope_metadata;
159         if pos < self.scopes[scope_id].file_start_pos ||
160            pos >= self.scopes[scope_id].file_end_pos {
161             let cm = self.ccx.sess().codemap();
162             debuginfo::extend_scope_to_file(self.ccx, scope_metadata, &cm.lookup_char_pos(pos).file)
163         } else {
164             scope_metadata
165         }
166     }
167 }
168
169 enum LocalRef<'tcx> {
170     Lvalue(LvalueRef<'tcx>),
171     Operand(Option<OperandRef<'tcx>>),
172 }
173
174 impl<'tcx> LocalRef<'tcx> {
175     fn new_operand<'a>(ccx: &CrateContext<'a, 'tcx>,
176                          ty: ty::Ty<'tcx>) -> LocalRef<'tcx> {
177         if common::type_is_zero_size(ccx, ty) {
178             // Zero-size temporaries aren't always initialized, which
179             // doesn't matter because they don't contain data, but
180             // we need something in the operand.
181             let llty = type_of::type_of(ccx, ty);
182             let val = if common::type_is_imm_pair(ccx, ty) {
183                 let fields = llty.field_types();
184                 OperandValue::Pair(C_null(fields[0]), C_null(fields[1]))
185             } else {
186                 OperandValue::Immediate(C_null(llty))
187             };
188             let op = OperandRef {
189                 val: val,
190                 ty: ty
191             };
192             LocalRef::Operand(Some(op))
193         } else {
194             LocalRef::Operand(None)
195         }
196     }
197 }
198
199 ///////////////////////////////////////////////////////////////////////////
200
201 pub fn trans_mir<'a, 'tcx: 'a>(
202     ccx: &'a CrateContext<'a, 'tcx>,
203     llfn: ValueRef,
204     fn_ty: FnType,
205     mir: &'a Mir<'tcx>,
206     instance: Instance<'tcx>,
207     sig: &ty::FnSig<'tcx>,
208     abi: Abi,
209 ) {
210     debug!("fn_ty: {:?}", fn_ty);
211     let debug_context =
212         debuginfo::create_function_debug_context(ccx, instance, sig, abi, llfn, mir);
213     let bcx = Builder::new_block(ccx, llfn, "entry-block");
214
215     let cleanup_kinds = analyze::cleanup_kinds(&mir);
216
217     // Allocate a `Block` for every basic block
218     let block_bcxs: IndexVec<mir::BasicBlock, BasicBlockRef> =
219         mir.basic_blocks().indices().map(|bb| {
220             if bb == mir::START_BLOCK {
221                 bcx.build_sibling_block("start").llbb()
222             } else {
223                 bcx.build_sibling_block(&format!("{:?}", bb)).llbb()
224             }
225         }).collect();
226
227     // Compute debuginfo scopes from MIR scopes.
228     let scopes = debuginfo::create_mir_scopes(ccx, mir, &debug_context);
229
230     let mut mircx = MirContext {
231         mir: mir,
232         llfn: llfn,
233         fn_ty: fn_ty,
234         ccx: ccx,
235         llpersonalityslot: None,
236         blocks: block_bcxs,
237         unreachable_block: None,
238         cleanup_kinds: cleanup_kinds,
239         landing_pads: IndexVec::from_elem(None, mir.basic_blocks()),
240         scopes: scopes,
241         locals: IndexVec::new(),
242         debug_context: debug_context,
243         param_substs: {
244             assert!(!instance.substs.needs_infer());
245             instance.substs
246         },
247     };
248
249     let lvalue_locals = analyze::lvalue_locals(&mircx);
250
251     // Allocate variable and temp allocas
252     mircx.locals = {
253         let args = arg_local_refs(&bcx, &mircx, &mircx.scopes, &lvalue_locals);
254
255         let mut allocate_local = |local| {
256             let decl = &mir.local_decls[local];
257             let ty = mircx.monomorphize(&decl.ty);
258
259             if let Some(name) = decl.name {
260                 // User variable
261                 let source_info = decl.source_info.unwrap();
262                 let debug_scope = mircx.scopes[source_info.scope];
263                 let dbg = debug_scope.is_valid() && bcx.sess().opts.debuginfo == FullDebugInfo;
264
265                 if !lvalue_locals.contains(local.index()) && !dbg {
266                     debug!("alloc: {:?} ({}) -> operand", local, name);
267                     return LocalRef::new_operand(bcx.ccx, ty);
268                 }
269
270                 debug!("alloc: {:?} ({}) -> lvalue", local, name);
271                 assert!(!ty.has_erasable_regions());
272                 let lvalue = LvalueRef::alloca(&bcx, ty, &name.as_str());
273                 if dbg {
274                     let (scope, span) = mircx.debug_loc(source_info);
275                     declare_local(&bcx, &mircx.debug_context, name, ty, scope,
276                         VariableAccess::DirectVariable { alloca: lvalue.llval },
277                         VariableKind::LocalVariable, span);
278                 }
279                 LocalRef::Lvalue(lvalue)
280             } else {
281                 // Temporary or return pointer
282                 if local == mir::RETURN_POINTER && mircx.fn_ty.ret.is_indirect() {
283                     debug!("alloc: {:?} (return pointer) -> lvalue", local);
284                     let llretptr = llvm::get_param(llfn, 0);
285                     LocalRef::Lvalue(LvalueRef::new_sized(llretptr, LvalueTy::from_ty(ty),
286                                                           Alignment::AbiAligned))
287                 } else if lvalue_locals.contains(local.index()) {
288                     debug!("alloc: {:?} -> lvalue", local);
289                     assert!(!ty.has_erasable_regions());
290                     LocalRef::Lvalue(LvalueRef::alloca(&bcx, ty,  &format!("{:?}", local)))
291                 } else {
292                     // If this is an immediate local, we do not create an
293                     // alloca in advance. Instead we wait until we see the
294                     // definition and update the operand there.
295                     debug!("alloc: {:?} -> operand", local);
296                     LocalRef::new_operand(bcx.ccx, ty)
297                 }
298             }
299         };
300
301         let retptr = allocate_local(mir::RETURN_POINTER);
302         iter::once(retptr)
303             .chain(args.into_iter())
304             .chain(mir.vars_and_temps_iter().map(allocate_local))
305             .collect()
306     };
307
308     // Branch to the START block
309     let start_bcx = mircx.blocks[mir::START_BLOCK];
310     bcx.br(start_bcx);
311
312     // Up until here, IR instructions for this function have explicitly not been annotated with
313     // source code location, so we don't step into call setup code. From here on, source location
314     // emitting should be enabled.
315     debuginfo::start_emitting_source_locations(&mircx.debug_context);
316
317     let funclets: IndexVec<mir::BasicBlock, Option<Funclet>> =
318     mircx.cleanup_kinds.iter_enumerated().map(|(bb, cleanup_kind)| {
319         if let CleanupKind::Funclet = *cleanup_kind {
320             let bcx = mircx.get_builder(bb);
321             unsafe {
322                 llvm::LLVMSetPersonalityFn(mircx.llfn, mircx.ccx.eh_personality());
323             }
324             if base::wants_msvc_seh(ccx.sess()) {
325                 return Some(Funclet::new(bcx.cleanup_pad(None, &[])));
326             }
327         }
328
329         None
330     }).collect();
331
332     let rpo = traversal::reverse_postorder(&mir);
333     let mut visited = BitVector::new(mir.basic_blocks().len());
334
335     // Translate the body of each block using reverse postorder
336     for (bb, _) in rpo {
337         visited.insert(bb.index());
338         mircx.trans_block(bb, &funclets);
339     }
340
341     // Remove blocks that haven't been visited, or have no
342     // predecessors.
343     for bb in mir.basic_blocks().indices() {
344         // Unreachable block
345         if !visited.contains(bb.index()) {
346             debug!("trans_mir: block {:?} was not visited", bb);
347             unsafe {
348                 llvm::LLVMDeleteBasicBlock(mircx.blocks[bb]);
349             }
350         }
351     }
352 }
353
354 /// Produce, for each argument, a `ValueRef` pointing at the
355 /// argument's value. As arguments are lvalues, these are always
356 /// indirect.
357 fn arg_local_refs<'a, 'tcx>(bcx: &Builder<'a, 'tcx>,
358                             mircx: &MirContext<'a, 'tcx>,
359                             scopes: &IndexVec<mir::VisibilityScope, debuginfo::MirDebugScope>,
360                             lvalue_locals: &BitVector)
361                             -> Vec<LocalRef<'tcx>> {
362     let mir = mircx.mir;
363     let tcx = bcx.tcx();
364     let mut idx = 0;
365     let mut llarg_idx = mircx.fn_ty.ret.is_indirect() as usize;
366
367     // Get the argument scope, if it exists and if we need it.
368     let arg_scope = scopes[mir::ARGUMENT_VISIBILITY_SCOPE];
369     let arg_scope = if arg_scope.is_valid() && bcx.sess().opts.debuginfo == FullDebugInfo {
370         Some(arg_scope.scope_metadata)
371     } else {
372         None
373     };
374
375     mir.args_iter().enumerate().map(|(arg_index, local)| {
376         let arg_decl = &mir.local_decls[local];
377         let arg_ty = mircx.monomorphize(&arg_decl.ty);
378
379         if Some(local) == mir.spread_arg {
380             // This argument (e.g. the last argument in the "rust-call" ABI)
381             // is a tuple that was spread at the ABI level and now we have
382             // to reconstruct it into a tuple local variable, from multiple
383             // individual LLVM function arguments.
384
385             let tupled_arg_tys = match arg_ty.sty {
386                 ty::TyTuple(ref tys, _) => tys,
387                 _ => bug!("spread argument isn't a tuple?!")
388             };
389
390             let lvalue = LvalueRef::alloca(bcx, arg_ty, &format!("arg{}", arg_index));
391             for (i, &tupled_arg_ty) in tupled_arg_tys.iter().enumerate() {
392                 let dst = bcx.struct_gep(lvalue.llval, i);
393                 let arg = &mircx.fn_ty.args[idx];
394                 idx += 1;
395                 if common::type_is_fat_ptr(bcx.ccx, tupled_arg_ty) {
396                     // We pass fat pointers as two words, but inside the tuple
397                     // they are the two sub-fields of a single aggregate field.
398                     let meta = &mircx.fn_ty.args[idx];
399                     idx += 1;
400                     arg.store_fn_arg(bcx, &mut llarg_idx, base::get_dataptr(bcx, dst));
401                     meta.store_fn_arg(bcx, &mut llarg_idx, base::get_meta(bcx, dst));
402                 } else {
403                     arg.store_fn_arg(bcx, &mut llarg_idx, dst);
404                 }
405             }
406
407             // Now that we have one alloca that contains the aggregate value,
408             // we can create one debuginfo entry for the argument.
409             arg_scope.map(|scope| {
410                 let variable_access = VariableAccess::DirectVariable {
411                     alloca: lvalue.llval
412                 };
413                 declare_local(
414                     bcx,
415                     &mircx.debug_context,
416                     arg_decl.name.unwrap_or(keywords::Invalid.name()),
417                     arg_ty, scope,
418                     variable_access,
419                     VariableKind::ArgumentVariable(arg_index + 1),
420                     DUMMY_SP
421                 );
422             });
423
424             return LocalRef::Lvalue(lvalue);
425         }
426
427         let arg = &mircx.fn_ty.args[idx];
428         idx += 1;
429         let llval = if arg.is_indirect() && bcx.sess().opts.debuginfo != FullDebugInfo {
430             // Don't copy an indirect argument to an alloca, the caller
431             // already put it in a temporary alloca and gave it up, unless
432             // we emit extra-debug-info, which requires local allocas :(.
433             // FIXME: lifetimes
434             if arg.pad.is_some() {
435                 llarg_idx += 1;
436             }
437             let llarg = llvm::get_param(bcx.llfn(), llarg_idx as c_uint);
438             llarg_idx += 1;
439             llarg
440         } else if !lvalue_locals.contains(local.index()) &&
441                   !arg.is_indirect() && arg.cast.is_none() &&
442                   arg_scope.is_none() {
443             if arg.is_ignore() {
444                 return LocalRef::new_operand(bcx.ccx, arg_ty);
445             }
446
447             // We don't have to cast or keep the argument in the alloca.
448             // FIXME(eddyb): We should figure out how to use llvm.dbg.value instead
449             // of putting everything in allocas just so we can use llvm.dbg.declare.
450             if arg.pad.is_some() {
451                 llarg_idx += 1;
452             }
453             let llarg = llvm::get_param(bcx.llfn(), llarg_idx as c_uint);
454             llarg_idx += 1;
455             let val = if common::type_is_fat_ptr(bcx.ccx, arg_ty) {
456                 let meta = &mircx.fn_ty.args[idx];
457                 idx += 1;
458                 assert_eq!((meta.cast, meta.pad), (None, None));
459                 let llmeta = llvm::get_param(bcx.llfn(), llarg_idx as c_uint);
460                 llarg_idx += 1;
461                 OperandValue::Pair(llarg, llmeta)
462             } else {
463                 OperandValue::Immediate(llarg)
464             };
465             let operand = OperandRef {
466                 val: val,
467                 ty: arg_ty
468             };
469             return LocalRef::Operand(Some(operand.unpack_if_pair(bcx)));
470         } else {
471             let lltemp = LvalueRef::alloca(bcx, arg_ty, &format!("arg{}", arg_index));
472             if common::type_is_fat_ptr(bcx.ccx, arg_ty) {
473                 // we pass fat pointers as two words, but we want to
474                 // represent them internally as a pointer to two words,
475                 // so make an alloca to store them in.
476                 let meta = &mircx.fn_ty.args[idx];
477                 idx += 1;
478                 arg.store_fn_arg(bcx, &mut llarg_idx, base::get_dataptr(bcx, lltemp.llval));
479                 meta.store_fn_arg(bcx, &mut llarg_idx, base::get_meta(bcx, lltemp.llval));
480             } else  {
481                 // otherwise, arg is passed by value, so make a
482                 // temporary and store it there
483                 arg.store_fn_arg(bcx, &mut llarg_idx, lltemp.llval);
484             }
485             lltemp.llval
486         };
487         arg_scope.map(|scope| {
488             // Is this a regular argument?
489             if arg_index > 0 || mir.upvar_decls.is_empty() {
490                 declare_local(
491                     bcx,
492                     &mircx.debug_context,
493                     arg_decl.name.unwrap_or(keywords::Invalid.name()),
494                     arg_ty,
495                     scope,
496                     VariableAccess::DirectVariable { alloca: llval },
497                     VariableKind::ArgumentVariable(arg_index + 1),
498                     DUMMY_SP
499                 );
500                 return;
501             }
502
503             // Or is it the closure environment?
504             let (closure_ty, env_ref) = if let ty::TyRef(_, mt) = arg_ty.sty {
505                 (mt.ty, true)
506             } else {
507                 (arg_ty, false)
508             };
509             let upvar_tys = if let ty::TyClosure(def_id, substs) = closure_ty.sty {
510                 substs.upvar_tys(def_id, tcx)
511             } else {
512                 bug!("upvar_decls with non-closure arg0 type `{}`", closure_ty);
513             };
514
515             // Store the pointer to closure data in an alloca for debuginfo
516             // because that's what the llvm.dbg.declare intrinsic expects.
517
518             // FIXME(eddyb) this shouldn't be necessary but SROA seems to
519             // mishandle DW_OP_plus not preceded by DW_OP_deref, i.e. it
520             // doesn't actually strip the offset when splitting the closure
521             // environment into its components so it ends up out of bounds.
522             let env_ptr = if !env_ref {
523                 let alloc = bcx.alloca(common::val_ty(llval), "__debuginfo_env_ptr");
524                 bcx.store(llval, alloc, None);
525                 alloc
526             } else {
527                 llval
528             };
529
530             let layout = bcx.ccx.layout_of(closure_ty);
531             let offsets = match *layout {
532                 layout::Univariant { ref variant, .. } => &variant.offsets[..],
533                 _ => bug!("Closures are only supposed to be Univariant")
534             };
535
536             for (i, (decl, ty)) in mir.upvar_decls.iter().zip(upvar_tys).enumerate() {
537                 let byte_offset_of_var_in_env = offsets[i].bytes();
538
539                 let ops = unsafe {
540                     [llvm::LLVMRustDIBuilderCreateOpDeref(),
541                      llvm::LLVMRustDIBuilderCreateOpPlus(),
542                      byte_offset_of_var_in_env as i64,
543                      llvm::LLVMRustDIBuilderCreateOpDeref()]
544                 };
545
546                 // The environment and the capture can each be indirect.
547
548                 // FIXME(eddyb) see above why we have to keep
549                 // a pointer in an alloca for debuginfo atm.
550                 let mut ops = if env_ref || true { &ops[..] } else { &ops[1..] };
551
552                 let ty = if let (true, &ty::TyRef(_, mt)) = (decl.by_ref, &ty.sty) {
553                     mt.ty
554                 } else {
555                     ops = &ops[..ops.len() - 1];
556                     ty
557                 };
558
559                 let variable_access = VariableAccess::IndirectVariable {
560                     alloca: env_ptr,
561                     address_operations: &ops
562                 };
563                 declare_local(
564                     bcx,
565                     &mircx.debug_context,
566                     decl.debug_name,
567                     ty,
568                     scope,
569                     variable_access,
570                     VariableKind::CapturedVariable,
571                     DUMMY_SP
572                 );
573             }
574         });
575         LocalRef::Lvalue(LvalueRef::new_sized(llval, LvalueTy::from_ty(arg_ty),
576                                               Alignment::AbiAligned))
577     }).collect()
578 }
579
580 mod analyze;
581 mod block;
582 mod constant;
583 pub mod lvalue;
584 mod operand;
585 mod rvalue;
586 mod statement;