forked from OSchip/llvm-project
114b4f324b
This patch refactors a key piece of the Orc APIs: It removes the *::getSymbolAddress and *::lookupSymbolAddressIn methods, which returned target addresses (uint64_ts), and replaces them with *::findSymbol and *::findSymbolIn respectively, which return instances of the new JITSymbol type. Unlike the old methods, calling findSymbol or findSymbolIn does not cause the symbol to be immediately materialized when found. Instead, the symbol will be materialized if/when the getAddress method is called on the returned JITSymbol. This allows us to query for the existence of symbols without actually materializing them. In the future I expect more information to be attached to the JITSymbol class, for example whether the returned symbol is a weak or strong definition. This will allow us to properly handle weak symbols and multiple definitions. llvm-svn: 228557 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
Makefile | ||
README.txt | ||
toy.cpp |
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.