diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-11-15 15:07:36 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-15 15:07:36 -0600 |
commit | 8f4912852f48fbfbd557eff3834bdd365cf3159c (patch) | |
tree | aa95bcd9ea49f726be47fd9e518abba07cf1f3ab /libbindgen/src/codegen/mod.rs | |
parent | 09dc05c8188bc63f4a30456901d0ff1eeeac5fc5 (diff) | |
parent | 1256345ab0939622a19200834587ac8b64dc355d (diff) |
Auto merge of #264 - fitzgen:emit-ir, r=emilio
Add an option to emit our ir for debugging
Similar to our ability to emit the clang AST, this adds an option to
emit our IR for debugging purposes.
This can wait to land until after #204 is merged.
r? @emilio
Diffstat (limited to 'libbindgen/src/codegen/mod.rs')
-rw-r--r-- | libbindgen/src/codegen/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libbindgen/src/codegen/mod.rs b/libbindgen/src/codegen/mod.rs index 8e04fd7c..009d8819 100644 --- a/libbindgen/src/codegen/mod.rs +++ b/libbindgen/src/codegen/mod.rs @@ -1892,6 +1892,13 @@ pub fn codegen(context: &mut BindgenContext) -> Vec<P<ast::Item>> { let whitelisted_items: ItemSet = context.whitelisted_items().collect(); + if context.options().emit_ir { + for &id in whitelisted_items.iter() { + let item = context.resolve_item(id); + println!("ir: {:?} = {:#?}", id, item); + } + } + for &id in whitelisted_items.iter() { let item = context.resolve_item(id); |