Browse Source

Reimplement InsertPointGuard to avoid LLVM ABI incompatibility.

In general, the NDEBUG flag should match cpp-ethereum and LLVM builds. But this is hard to satisfy as we usually have one system-wide build of LLVM and different builds of cpp-ethereum. This ABI incompatibility hit OSX only in release builds as LLVM is built by homebrew with assertions by default.
cl-refactor
Paweł Bylica 10 years ago
parent
commit
b8e969093e
  1. 10
      evmjit/libevmjit/CompilerHelper.h

10
evmjit/libevmjit/CompilerHelper.h

@ -49,7 +49,15 @@ private:
RuntimeManager& m_runtimeManager;
};
using InsertPointGuard = llvm::IRBuilderBase::InsertPointGuard;
struct InsertPointGuard
{
explicit InsertPointGuard(llvm::IRBuilderBase& _builder): m_builder(_builder), m_insertPoint(_builder.saveIP()) {}
~InsertPointGuard() { m_builder.restoreIP(m_insertPoint); }
private:
llvm::IRBuilderBase& m_builder;
decltype(m_builder.saveIP()) m_insertPoint;
};
}
}

Loading…
Cancel
Save