Browse Source

Get endianess from LLVM

cl-refactor
Paweł Bylica 10 years ago
parent
commit
be368ba871
  1. 9
      libevmjit/Endianness.cpp

9
libevmjit/Endianness.cpp

@ -2,6 +2,7 @@
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include <llvm/Support/Host.h>
#include "preprocessor/llvm_includes_end.h"
#include "Type.h"
@ -15,13 +16,7 @@ namespace jit
llvm::Value* Endianness::bswapIfLE(llvm::IRBuilder<>& _builder, llvm::Value* _word)
{
union tester
{
unsigned int x;
unsigned char isLE;
};
if (tester{1}.isLE)
if (llvm::sys::IsLittleEndianHost)
{
// FIXME: Disabled because of problems with BYTE
//if (auto constant = llvm::dyn_cast<llvm::ConstantInt>(_word))

Loading…
Cancel
Save