mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-04 18:09:03 +00:00
Removed LLVM
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// Helper file for including all neccesarry parts of LLVM //
|
||||
#ifdef _MSC_VER
|
||||
|
||||
// Disables all warnings as LLVM files have a lot of Data-loss casts that won't cause issues //
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4244)
|
||||
#pragma warning(disable : 4267)
|
||||
#pragma warning(disable : 4624)
|
||||
#pragma warning(disable : 4800)
|
||||
|
||||
// Includes the LLVM files //
|
||||
|
||||
#include <llvm/IR/IRBuilder.h>
|
||||
#include <llvm/IR/LLVMContext.h>
|
||||
#include <llvm/IR/Module.h>
|
||||
#include <llvm/IR/Verifier.h>
|
||||
|
||||
// Re-enables all warnings //
|
||||
#pragma warning(pop)
|
||||
|
||||
#else
|
||||
#error This code only works with MSVC / VS22
|
||||
#endif // _MSC_VER
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user