summaryrefslogtreecommitdiff
path: root/libbindgen/src/codegen
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2016-11-15 10:26:26 -0800
committerNick Fitzgerald <fitzgen@gmail.com>2016-11-15 11:33:05 -0800
commit3bb07b6ea4e60a30a774d41819b63a85de096a1e (patch)
tree72dcfcc53bbbb4f98fbe9e6296241fa34764ce55 /libbindgen/src/codegen
parent6b285e617ede6d3dbd6d2d0129ac81bc992a1593 (diff)
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.
Diffstat (limited to 'libbindgen/src/codegen')
-rw-r--r--libbindgen/src/codegen/mod.rs7
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);