This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/tpisto | |
// Nearly 1:1 translation of /llvm/examples/OrcV2Examples/OrcV2CBindingsBasicUsage/OrcV2CBindingsBasicUsage.c | |
// to Rust. In order to keep it even more 1:1 readable, I kept variable names as they are in the C -file. | |
extern crate llvm_sys as llvm; | |
use libc::*; | |
use llvm::core::{ | |
LLVMAddFunction, LLVMAppendBasicBlock, LLVMBuildAdd, LLVMBuildRet, LLVMCreateBuilder, | |
LLVMFunctionType, LLVMGetGlobalPassRegistry, LLVMGetParam, LLVMInt32Type, | |
LLVMModuleCreateWithNameInContext, LLVMPositionBuilderAtEnd, LLVMShutdown, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on dbasedow/KeyboardHandler.js | |
/** | |
* Based on http://stackoverflow.com/a/33585501/1783214 | |
* | |
* Handle resizing enclosed View and scrolling to input | |
* Usage: | |
* <KeyboardHandler ref='kh' offset={50} > | |
* <View> | |
* ... | |
* <TextInput ref='username' |