Removed LLVM

This commit is contained in:
Pasha Bibko
2025-04-19 11:41:52 +01:00
parent 14b2b36748
commit b3373a858c
12 changed files with 900 additions and 173 deletions

View File

@@ -2,7 +2,6 @@
// Lexer foward declares fstream components so we can use them here //
#include <Lexer.h>
#include <LLVM.h>
#include <memory>
@@ -54,9 +53,6 @@ namespace LX::AST
// Virtual destructor because of polymorphism //
virtual ~Node() = default;
// Function for generating LLVN IR (Intermediate representation) //
virtual llvm::Value* GenIR(llvm::LLVMContext& context, llvm::Module& module, llvm::IRBuilder<>& builder) = 0;
// Function for generating C/C++ code (Currently not implemented) //
//virtual void GenC() = 0;
@@ -70,9 +66,6 @@ namespace LX::AST
// Constructor to set values and automatically set type
NumberLiteral(std::string num);
// Function for generating LLVN IR (Intermediate representation) //
llvm::Value* GenIR(llvm::LLVMContext& context, llvm::Module& module, llvm::IRBuilder<>& builder) override;
private:
// The number it stores
// Yes the number is stored as a string
@@ -87,9 +80,6 @@ namespace LX::AST
// Constructor to set values and automatically set type
Operation(std::unique_ptr<Node> lhs, Token::TokenType op, std::unique_ptr<Node> rhs);
// Function for generating LLVN IR (Intermediate representation) //
llvm::Value* GenIR(llvm::LLVMContext& context, llvm::Module& module, llvm::IRBuilder<>& builder) override;
private:
// The sides of the operation
// Unary operations are handled by a different class
@@ -106,9 +96,6 @@ namespace LX::AST
// Constructor to set values and automatically set type
ReturnStatement(std::unique_ptr<Node> val);
// Function for generating LLVN IR (Intermediate representation) //
llvm::Value* GenIR(llvm::LLVMContext& context, llvm::Module& module, llvm::IRBuilder<>& builder) override;
private:
// What it is returning (can be null)
std::unique_ptr<Node> m_Val;
@@ -138,6 +125,4 @@ namespace LX
};
FileAST TurnTokensIntoAbstractSyntaxTree(std::vector<Token>& tokens, std::ofstream* log);
void GenerateIR(FileAST& ast);
}