Giter Site home page Giter Site logo

gericom / llvm-leg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frasercrmck/llvm-leg

0.0 1.0 0.0 319.81 MB

License: Other

CMake 0.27% Makefile 0.23% Shell 0.11% C++ 46.38% OCaml 0.28% Python 0.46% C 0.30% Objective-C 0.38% Assembly 10.71% LLVM 40.37% Perl 0.03% Emacs Lisp 0.01% Vim Script 0.02% Go 0.12% SourcePawn 0.01% Mirah 0.23% Groff 0.01% M4 0.10% Batchfile 0.01%

llvm-leg's Introduction

LEG Example Backend
===================

This is a simple example LLVM backend for an ARM-like architecture: 'LEG'.

Check out the slides from the tutorial given at Euro LLVM Developers' Conference 2014, Edinburgh:
    http://llvm.org/devmtg/2014-04/PDFs/Talks/Building%20an%20LLVM%20backend.pdf

Look out for us at the USA LLVM Developers' Conference, October 28-29, San Jose:
    http://llvm.org/devmtg/2014-10/


Fraser Cormack & Pierre-André Saulais, Codeplay Software

Getting Started
===============

The LEG repositories (llvm-leg, clang-leg) both track tip, and aren't tied to any specific revision of LLVM/Clang.

Tried & tested build systems:
*  CMake
Tried & tested compilers:
*  gcc 4.9.1
*  clang 3.5

Building with in-tree clang (optional)
--------------------------------------

    cd llvm-leg
    git clone [email protected]:codeplaysoftware/clang-leg.git tools/clang

Building with make
------------------

    cd llvm-leg
    mkdir build && cd build
    cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=DEBUG(/RELEASE) -DLLVM_TARGETS_TO_BUILD:STRING=LEG(,X86,...) ../
    make -j9

Building with ninja
-------------------

    cd llvm-leg
    mkdir build && cd build
    cmake -G "Ninja" -DCMAKE_BUILD_TYPE:STRING=DEBUG(/RELEASE) -DLLVM_TARGETS_TO_BUILD:STRING=LEG(,X86,...) ../
    ninja


Compiling some code
-------------------

    cd llvm-leg

    ### Compile IR -> Assembly ###
    ./build/bin/llc -march leg -o ex1.s docs/Codeplay/examples/ex1.ll
    cat ex1.s

    ### Compile IR -> ELF Object File ###
    ./build/bin/llc -march leg -filetype=obj -o ex1.o docs/Codeplay/examples/ex1.ll
    xxd ex1.o

    ### Compile Source -> Assembly with in-tree clang (via clang-leg) ###
    ./build/bin/clang -cc1 -triple leg-unknown-unknown -S -o ex1.s docs/Codeplay/example/ex1.c
    cat ex1.s

    ### Compile Source -> Assembly with in-tree clang (via clang-leg) ###
    ./build/bin/clang -cc1 -triple leg-unknown-unknown -o ex1.o docs/Codeplay/example/ex1.c
    xxd ex1.0

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.

llvm-leg's People

Contributors

ahatanak avatar arsenm avatar asl avatar atrick avatar bcardosolopes avatar bob-wilson avatar chandlerc avatar chapuni avatar cunningbaldrick avatar d0k avatar ddunbar avatar dexonsmith avatar dsandersllvm avatar dwblaikie avatar echristo avatar eefriedman avatar espindola avatar isanbard avatar lattner avatar lhames avatar majnemer avatar mbrukman avatar nadavrot avatar nlewycky avatar resistor avatar rotateright avatar sampo3k avatar stoklund avatar topperc avatar tstellaramd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.