Skip to content

Commit

Permalink
Local Variables with Handling of Scopes and SSA
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajveer100 committed Apr 29, 2024
1 parent 9f51859 commit 191e215
Show file tree
Hide file tree
Showing 34 changed files with 533 additions and 4,772 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,20 @@ jobs:
#
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
os: [ubuntu-latest, windows-latest]
os: [macos-latest, ubuntu-latest, windows-latest]
build_type: [Release]
c_compiler: [gcc, clang, cl]
c_compiler: [clang, gcc, cl]
cpp_compiler: [clang++, g++, cl]
include:
- os: [macos-latest, ubuntu-latest]
c_compiler: clang
cpp_compiler: clang++
- os: [macos-latest, ubuntu-latest]
c_compiler: gcc
cpp_compiler: g++
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: gcc
Expand Down
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.26)
cmake_minimum_required(VERSION 3.27)
project(eva)

find_package(LLVM REQUIRED CONFIG)
Expand All @@ -10,10 +10,12 @@ include_directories(${LLVM_INCLUDE_DIRS})
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS_LIST})

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)

add_executable(eva Eva.cpp
src/Eva.h
test.cpp
src/parser/EvaParser.h
)
src/Environment.h
src/Logger.h
)
25 changes: 18 additions & 7 deletions Eva.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,30 @@
#include <string>

int main(int argc, char const *argv[]) {
// Program to execute.
/*
* Program to execute.
*/
std::string program = R"(
(var VERSION 42)
(var x 42)
(begin
(var VERSION "Hello")
(printf "Version: %d\n" VERSION)
(printf "Version: %d\n" VERSION)
(var (x string) "Hello")
(printf "X: %s\n\n" x))
(printf "X: %d\n\n" x)
(set x 100)
(printf "X: %d\n\n" x)
)";

// Compiler instance.
/*
* Compiler instance.
*/
Eva vm;

//Generate LLVM IR.
/*
* Generate LLVM IR.
*/
vm.exec(program);

return 0;
Expand Down
Loading

0 comments on commit 191e215

Please sign in to comment.