mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
Added "Emitter" functor to allow easy emitting of elements of a container
using std::for_each. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44589 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dd86ce3d57
commit
7da75c5a40
@ -37,6 +37,17 @@ public:
|
||||
template <typename T>
|
||||
inline void Emit(const T& X) { SerializeTrait<T>::Emit(*this,X); }
|
||||
|
||||
template <typename T>
|
||||
struct Emitter {
|
||||
Serializer &S;
|
||||
|
||||
Emitter(Serializer& s) : S(s) {}
|
||||
void operator()(const T& x) const { S.Emit(x); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
Emitter<T> MakeEmitter() { return Emitter<T>(*this); }
|
||||
|
||||
void EmitInt(uint64_t X);
|
||||
void EmitSInt(int64_t X);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user