hanchenye-llvm-project/llvm/examples/Kaleidoscope/Orc/lazy_irgen
Mehdi Amini 46a43556db Make DataLayout Non-Optional in the Module
Summary:
DataLayout keeps the string used for its creation.

As a side effect it is no longer needed in the Module.
This is "almost" NFC, the string is no longer
canonicalized, you can't rely on two "equals" DataLayout
having the same string returned by getStringRepresentation().

Get rid of DataLayoutPass: the DataLayout is in the Module

The DataLayout is "per-module", let's enforce this by not
duplicating it more than necessary.
One more step toward non-optionality of the DataLayout in the
module.

Make DataLayout Non-Optional in the Module

Module->getDataLayout() will never returns nullptr anymore.

Reviewers: echristo

Subscribers: resistor, llvm-commits, jholewinski

Differential Revision: http://reviews.llvm.org/D7992

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231270
2015-03-04 18:43:29 +00:00
..
CMakeLists.txt [CMake] Kaleidoscope-Orc: Update libdeps. 2015-02-08 11:15:08 +00:00
Makefile [Orc][Kaleidoscope] Fix the orc/kaleidoscope tutorials on linux. 2015-02-20 02:03:30 +00:00
README.txt
toy.cpp Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00

README.txt

//===----------------------------------------------------------------------===/
//                 Kaleidoscope with Orc - Lazy IRGen Version
//===----------------------------------------------------------------------===//

This version of Kaleidoscope with Orc demonstrates lazy IR-generation.
Building on the lazy-codegen version of the tutorial, this version reduces the
amount of up-front work that must be done by lazily IRgen'ing ASTs. When a
function definition is entered, its AST is added to a map of available
definitions. No IRGen is performed at this point and nothing is added to the JIT.
When attempting to resolve symbol addresses, the lambda in
KaleidoscopeJIT::getSymbolAddress will scan the AST map and generate IR on the
fly.

This directory contains a Makefile that allows the code to be built in a
standalone manner, independent of the larger LLVM build infrastructure. To build
the program you will need to have 'clang++' and 'llvm-config' in your path.