Added code builder

This commit is contained in:
Rafał Grodziński
2025-05-31 19:02:42 +09:00
parent cafcbd467f
commit c6f2156e3b
3 changed files with 73 additions and 42 deletions

25
src/CodeGenerator.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef CODE_GENERATOR_H
#define CODE_GENERATOR_H
#include <iostream>
#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/TargetParser/Host.h"
using namespace std;
class CodeGenerator {
private:
shared_ptr<llvm::Module> module;
public:
CodeGenerator(shared_ptr<llvm::Module> module);
void generateObjectFile(string fileName);
};
#endif