10 #include <llvm/Support/raw_ostream.h>
11 #include <llvm/Support/MemoryBuffer.h>
13 #include "core/util.h"
14 #include "core/inst.h"
41 std::unique_ptr<Prog>
Read();
52 template<
typename T> T ReadData();
54 template<
typename T> std::optional<T> ReadOptional();
56 std::string ReadString();
60 std::vector<std::tuple<PhiInst *, Block *, unsigned>> &fixups
89 std::vector<Global *> globals_;
141 void Write(Type type);
148 void Emit(llvm::StringRef str);
150 void Emit(
const std::string &str) {
return Emit(llvm::StringRef(str)); }
152 template<
typename T>
void Emit(T t);
156 std::unordered_map<const Global *, unsigned> symbols_;
158 llvm::raw_pwrite_stream &os_;