Skip to content

ruvi-d/llvm_codegen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test app to generate LLVM IR

This demo C++ uses LLVM Core libs to generate a basic main function.

Building

  • Install LLVM core libs to your system (llvm-dev package in Ubuntu) and update CMakeLists.txt file accordingly

  • Run the following commands to build

      mkdir build
      cd build
      cmake ../
      make
    
  • Generate IR and save

      ./codegen > main.ll 
    
  • Compile and run LLVM IR. Then check return code

      clang main.ll -o main.out
      ./main.out
      echo $?
    

About

Sample app that generates LLVM IR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published