Files
Compiler/ObjectFileGenerator.h
2025-11-16 21:04:02 +08:00

19 lines
590 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef OBJECT_FILE_GENERATOR_H
#define OBJECT_FILE_GENERATOR_H
#include <vector>
#include <cstdint>
#include <string>
/// 把一段 32-bit ARM64 指令流写成一个 Mach-O 64-bit relocatable object (.o) 文件
class ObjectFileGenerator {
public:
/// \param filename 输出文件名,比如 "out.o"
/// \param code 每个元素是一条 32-bit 小端机器指令
/// \return true 成功false 失败
static bool writeObject(const std::string &filename,
const std::vector<uint32_t> &code);
};
#endif // OBJECT_FILE_GENERATOR_H