4 #include <llvm/IR/IntrinsicInst.h> 5 #include <llvm/Support/Host.h> 19 if (llvm::sys::IsLittleEndianHost)
21 if (
auto constant = llvm::dyn_cast<llvm::ConstantInt>(_value))
22 return _builder.getInt(constant->getValue().byteSwap());
25 auto bswapFunc = llvm::Intrinsic::getDeclaration(_builder.GetInsertBlock()->getParent()->getParent(), llvm::Intrinsic::bswap, _value->getType());
26 return _builder.CreateCall(bswapFunc, _value);
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
static llvm::Value * bswapIfLE(IRBuilder &_builder, llvm::Value *_word)
llvm::IRBuilder<> IRBuilder