Commit Graph

18 Commits

Author SHA1 Message Date
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
Lang Hames bee2099c49 [Orc][Kaleidoscope] More tutorial cleanup, a little extra debugging output.
llvm-svn: 230705
2015-02-26 23:52:42 +00:00
Lang Hames 0db567f2ad [Orc][Kaleidoscope] Clean up the Orc/Kaleidoscope tutorials to minimize the diffs
between them.

llvm-svn: 230542
2015-02-25 20:58:28 +00:00
Lang Hames 203540f2d6 [Orc][Kaleidoscope] Tidy up the lazy_irgen tutorial, touch up a couple of
comments in the fully_lazy tutorial to minimize the diff between the two.

llvm-svn: 230202
2015-02-23 04:45:05 +00:00
Lang Hames e738061c49 [Orc] Move Orc code into a namespace (llvm::orc), update Kaleidoscope code.
NFC.

llvm-svn: 230143
2015-02-21 20:44:36 +00:00
Lang Hames c75a932df3 [Orc][Kaleidoscope] Fix the orc/kaleidoscope tutorials on linux.
llvm-svn: 229949
2015-02-20 02:03:30 +00:00
Lang Hames 1028dcb1d0 [Orc][Kaleidoscope] Make the Orc/Kaleidoscope tutorials easier to build on
Darwin.

llvm-svn: 229761
2015-02-18 23:08:56 +00:00
Lang Hames 31ab495e4e [Orc][Kaleidoscope] Update the MainLoop code of the orc/kaleidoscope tutorials
to get rid of the duplicate prompt. NFC.

llvm-svn: 229465
2015-02-17 05:36:59 +00:00
Chandler Carruth 30d69c2e36 [PM] Remove the old 'PassManager.h' header file at the top level of
LLVM's include tree and the use of using declarations to hide the
'legacy' namespace for the old pass manager.

This undoes the primary modules-hostile change I made to keep
out-of-tree targets building. I sent an email inquiring about whether
this would be reasonable to do at this phase and people seemed fine with
it, so making it a reality. This should allow us to start bootstrapping
with modules to a certain extent along with making it easier to mix and
match headers in general.

The updates to any code for users of LLVM are very mechanical. Switch
from including "llvm/PassManager.h" to "llvm/IR/LegacyPassManager.h".
Qualify the types which now produce compile errors with "legacy::". The
most common ones are "PassManager", "PassManagerBase", and
"FunctionPassManager".

llvm-svn: 229094
2015-02-13 10:01:29 +00:00
Lang Hames 114b4f324b [Orc] Add a JITSymbol class to the Orc APIs, refactor APIs, update clients.
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
2015-02-09 01:20:51 +00:00
David Blaikie 9c4c23b32e Kaleidoscope-Orc: Reuse the IRGen utility function in later chapters, and remove an unused parameter.
llvm-svn: 228543
2015-02-08 21:03:30 +00:00
David Blaikie 055811ef72 Constify the Orc Kaleidoscope examples IRGen functions.
llvm-svn: 228537
2015-02-08 20:15:01 +00:00
Lang Hames d3bffbc2b3 [Orc][Kaleidoscope] Build Kaleidoscope/Orc tutorials with warnings.
llvm-svn: 228531
2015-02-08 19:15:33 +00:00
Lang Hames be9df34795 [Orc][Kaleidoscope] Remove fixed sized buffers from string conversion code and
further c++ify the Kaleidoscope/Orc tutorials.

llvm-svn: 228530
2015-02-08 19:14:56 +00:00
NAKAMURA Takumi b928d4c2fc [CMake] Kaleidoscope-Orc: Update libdeps.
llvm-svn: 228524
2015-02-08 11:15:08 +00:00
David Blaikie c38e5245c5 Add CMake build support for Orc examples (& fix some clang -Werror build
breaks due to unused variables).

llvm-svn: 228520
2015-02-08 07:20:04 +00:00
Lang Hames dac276ecaf [Orc][Kaleidoscope] Fix method-name think-o. NFC.
llvm-svn: 228519
2015-02-08 04:34:13 +00:00
Lang Hames e1d10711d1 [Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-irgen.
This tutorial builds on the lazy_codegen kaleidoscope/orc tutorial by making
a small set of changes (~75 lines diff) to defer ir-generation for function
definitions until functions are actually referenced.

llvm-svn: 228466
2015-02-06 23:26:33 +00:00