1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

475 Commits

Author SHA1 Message Date
Mehdi Amini
9f0c09e5bf Remove access to the DataLayout in the TargetMachine
Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

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

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243114
2015-07-24 16:04:22 +00:00
Mehdi Amini
3a4451076e Revert "Remove access to the DataLayout in the TargetMachine"
This reverts commit 0f720d984f419c747709462f7476dff962c0bc41.

It breaks clang too badly, I need to prepare a proper patch for clang
first.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243089
2015-07-24 03:36:55 +00:00
Mehdi Amini
30b6ee8541 Remove access to the DataLayout in the TargetMachine
Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

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

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243083
2015-07-24 01:44:39 +00:00
Mehdi Amini
fa35697f02 Fix Kaleidoscope tuto: ExecutionEngine->getDataLayout() returns a ref
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 242416
2015-07-16 16:47:18 +00:00
Rafael Espindola
72dc307fa0 Simplify the Mangler interface now that DataLayout is mandatory.
We only need to pass in a DataLayout when mangling a raw string, not when
constructing the mangler.

llvm-svn: 240405
2015-06-23 13:59:29 +00:00
NAKAMURA Takumi
455bd31522 BrainF.cpp: Update CreateCall() according to r237624.
llvm-svn: 237669
2015-05-19 06:50:19 +00:00
Lang Hames
a366b4ef77 [Orc] Reapply r236465 with fixes for the MSVC bots.
llvm-svn: 236506
2015-05-05 17:37:18 +00:00
Lang Hames
1ee1ff3529 [Orc] Revert r236465 - It broke the Windows bots.
Looks like the usual missing explicit move-constructor issue with MSVC. I should
have a fix shortly.

llvm-svn: 236472
2015-05-04 23:30:01 +00:00
Lang Hames
63e2fcbb79 [Orc] Refactor the compile-on-demand layer to make module partitioning lazy,
and avoid cloning unused decls into every partition.

Module partitioning showed up as a source of significant overhead when I
profiled some trivial test cases. Avoiding the overhead of partitionging
for uncalled functions helps to mitigate this.

This change also means that it is no longer necessary to have a
LazyEmittingLayer underneath the CompileOnDemand layer, since the
CompileOnDemandLayer will not extract or emit function bodies until they are
called.

llvm-svn: 236465
2015-05-04 22:03:10 +00:00
Duncan P. N. Exon Smith
09b5c9c24d IR: Give 'DI' prefix to debug info metadata
Finish off PR23080 by renaming the debug info IR constructs from `MD*`
to `DI*`.  The last of the `DIDescriptor` classes were deleted in
r235356, and the last of the related typedefs removed in r235413, so
this has all baked for about a week.

Note: If you have out-of-tree code (like a frontend), I recommend that
you get everything compiling and tests passing with the *previous*
commit before updating to this one.  It'll be easier to keep track of
what code is using the `DIDescriptor` hierarchy and what you've already
updated, and I think you're extremely unlikely to insert bugs.  YMMV of
course.

Back to *this* commit: I did this using the rename-md-di-nodes.sh
upgrade script I've attached to PR23080 (both code and testcases) and
filtered through clang-format-diff.py.  I edited the tests for
test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns
were off-by-three.  It should work on your out-of-tree testcases (and
code, if you've followed the advice in the previous paragraph).

Some of the tests are in badly named files now (e.g.,
test/Assembler/invalid-mdcompositetype-missing-tag.ll should be
'dicompositetype'); I'll come back and move the files in a follow-up
commit.

llvm-svn: 236120
2015-04-29 16:38:44 +00:00
Lang Hames
d30cf57acb [Kaleidoscope] Fix incorrect use of reinterpret_cast.
Thanks to Dave Blaikie for catching this.

llvm-svn: 235543
2015-04-22 20:58:34 +00:00
Lang Hames
aab3135993 [Kaleidoscope] Remove RTTI use from chapters 7 and 8.
llvm-svn: 235541
2015-04-22 20:41:34 +00:00
David Blaikie
afc56f0507 Fix up Exception demo from recent opaque pointer type changes to GEP
llvm-svn: 235478
2015-04-22 04:24:43 +00:00
Duncan P. N. Exon Smith
44748b8d14 DebugInfo: Fix Kaleidoscope Ch. 8 after r235327
Pretty sure the build was broken by r235327 (I updated it there, but
apparently didn't check if it compiled).

llvm-svn: 235353
2015-04-20 21:29:44 +00:00
Duncan P. N. Exon Smith
4fbe63c785 DebugInfo: Remove DIScope
Replace uses of `DIScope` with `MDScope*`.  There was one spot where
I've left an `MDScope*` uninitialized (where `DIScope` would have been
default-initialized to `nullptr`) -- this is intentional, since the
if/else that follows should unconditional assign it to a value.

llvm-svn: 235327
2015-04-20 18:32:29 +00:00
Duncan P. N. Exon Smith
6e0f299baf DebugInfo: Remove DIDescriptor from the DIBuilder API
As a step toward killing `DIDescriptor` and its subclasses, remove it
from the `DIBuilder` API.  Replace the subclasses with appropriate
pointers from the new debug info hierarchy.  There are a couple of
possible surprises in type choices for out-of-tree frontends:

  - Subroutine types: `MDSubroutineType`, not `MDCompositeTypeBase`.
  - Composite types: `MDCompositeType`, not `MDCompositeTypeBase`.
  - Scopes: `MDScope`, not `MDNode`.
  - Generic debug info nodes: `DebugNode`, not `MDNode`.

This is part of PR23080.

llvm-svn: 235111
2015-04-16 16:36:23 +00:00
Duncan P. N. Exon Smith
67b84f2e53 DebugInfo: Gut DIDescriptor
PR23080 is almost finished.  With this commit, there's no consequential
API in `DIDescriptor` and its subclasses.  What's left?

  - Default-constructed to `nullptr`.
  - Handy `const_cast<>` (constructed from `const`, but accessors are
    non-`const`).

I think the safe way to catch those is to delete the classes and fix
compile errors.  That'll be my next step, after I delete the `DITypeRef`
(etc.) wrapper around `MDTypeRef`.

llvm-svn: 235069
2015-04-16 01:53:33 +00:00
Duncan P. N. Exon Smith
d5293d3389 DebugInfo: Remove unnecessary API from DIDerivedType and DIType
Remove the accessors of `DIDerivedType` that downcast to
`MDDerivedType`, shifting the `cast<MDDerivedType>` into the callers.
Also remove `DIType::isValid()`, which is really just a check against
`nullptr` at this point.

llvm-svn: 235059
2015-04-15 23:49:09 +00:00
Duncan P. N. Exon Smith
d7810b7970 DebugInfo: Gut DICompileUnit and DIFile
Continuing gutting `DIDescriptor` subclasses; this edition,
`DICompileUnit` and `DIFile`.  In the name of PR23080.

llvm-svn: 235055
2015-04-15 23:19:27 +00:00
Duncan P. N. Exon Smith
74f370958b DebugInfo: Add implicit conversion from DISubprogram to DIScope
As a follow-up to r234850, add an implicit conversion from
`DISubprogram` to `DIScope` to support Kaleidoscope Ch. 8.  This also
reverts that band-aid from r234890.

(/me learns *again* to build Kaleidoscope before commit...)

llvm-svn: 234904
2015-04-14 16:19:44 +00:00
Aaron Ballman
bf27a58630 Fixing a compile error with MSVC 2013 where there is no conversion from DISubprogram to DIScope directly.
llvm-svn: 234890
2015-04-14 14:19:09 +00:00
Alexander Kornienko
71412ece39 Use 'override/final' instead of 'virtual' for overridden methods
The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
    -checks='-*,misc-use-override' -header-filter='llvm|clang' \
    -j=32 -fix -format

http://reviews.llvm.org/D8925

llvm-svn: 234679
2015-04-11 02:11:45 +00:00
Lang Hames
07acccf1a4 [Orc] Update kaleidoscope tutorial for API change in r234669.
llvm-svn: 234673
2015-04-11 00:56:21 +00:00
NAKAMURA Takumi
6c1c2d6143 llvm/examples/BrainF: Give an explicit pointee type to ConstantExpr::getGetElementPtr(ty...), according to r233938.
llvm-svn: 233983
2015-04-02 22:44:00 +00:00
NAKAMURA Takumi
a519426ee0 Rework r233647, "llvm/examples: Suppress building a few JIT examples."
It didn't work with "install".

llvm-svn: 233708
2015-03-31 16:41:25 +00:00
NAKAMURA Takumi
2ecb007a86 llvm/examples: Suppress building a few JIT examples.
examples/ExceptionDemo/CMakeFiles/ExceptionDemo.dir/ExceptionDemo.cpp.o:(.data.rel.ro._ZTIN4llvm18MCJITMemoryManagerE[_ZTIN4llvm18MCJITMemoryManagerE]+0x10): undefined reference to `typeinfo for llvm::RuntimeDyld::MemoryManager'

llvm-svn: 233647
2015-03-31 00:03:43 +00:00
NAKAMURA Takumi
3206497304 llvm/examples: Add RuntimeDyld as libdeps.
llvm-svn: 233646
2015-03-31 00:03:36 +00:00
Lang Hames
27fb68307a [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through
MCJIT.

This patch decouples the two responsibilities of the RTDyldMemoryManager class,
memory management and symbol resolution, into two new classes:
RuntimeDyld::MemoryManager and RuntimeDyld::SymbolResolver.

The symbol resolution interface is modified slightly, from:

  uint64_t getSymbolAddress(const std::string &Name);

to:

  RuntimeDyld::SymbolInfo findSymbol(const std::string &Name);

The latter passes symbol flags along with symbol addresses, allowing RuntimeDyld
and others to reason about non-strong/non-exported symbols.


The memory management interface removes the following method:

  void notifyObjectLoaded(ExecutionEngine *EE,
                          const object::ObjectFile &) {}

as it is not related to memory management. (Note: Backwards compatibility *is*
maintained for this method in MCJIT and OrcMCJITReplacement, see below).


The RTDyldMemoryManager class remains in-tree for backwards compatibility.
It inherits directly from RuntimeDyld::SymbolResolver, and indirectly from
RuntimeDyld::MemoryManager via the new MCJITMemoryManager class, which
just subclasses RuntimeDyld::MemoryManager and reintroduces the
notifyObjectLoaded method for backwards compatibility).

The EngineBuilder class retains the existing method:

  EngineBuilder&
  setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager> mcjmm);

and includes two new methods:

  EngineBuilder&
  setMemoryManager(std::unique_ptr<MCJITMemoryManager> MM);

  EngineBuilder&
  setSymbolResolver(std::unique_ptr<RuntimeDyld::SymbolResolver> SR);

Clients should use EITHER:

A single call to setMCJITMemoryManager with an RTDyldMemoryManager.

OR (exclusive)

One call each to each of setMemoryManager and setSymbolResolver.

This patch should be fully compatible with existing uses of RTDyldMemoryManager.
If it is not it should be considered a bug, and the patch either fixed or
reverted.

If clients find the new API to be an improvement the goal will be to deprecate
and eventually remove the RTDyldMemoryManager class in favor of the new classes.

llvm-svn: 233509
2015-03-30 03:37:06 +00:00
Rafael Espindola
47bac208e7 Fix build.
llvm-svn: 233171
2015-03-25 04:36:20 +00:00
Reid Kleckner
8387c0d5ea CMake: Disable ENABLE_EXPORTS for executables with MSVC
The MSVC linker won't produce a .lib file for an executable that doesn't
export anything, and LLVM doesn't maintain dllexport annotations or .def
files listing all C++ symbols. It also doesn't support exporting all
symbols, like binutils ld.

CMake 3.2 changed the Ninja generator to list both the .exe and .lib
files as outputs of executable build targets. Ninja would always re-link
executables with ENABLE_EXPORTS because the .lib output file was not
present, and therefore the target was out of date.

llvm-svn: 232662
2015-03-18 20:09:13 +00:00
Rafael Espindola
ca14ac8847 Fix the build of the gold-plugin and examples.
llvm-svn: 231279
2015-03-04 19:15:29 +00:00
Mehdi Amini
29ebc2d39f 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
NAKAMURA Takumi
258ea59e5d llvm/examples: Add missing include according to r230907.
llvm-svn: 230926
2015-03-02 01:04:34 +00:00
Lang Hames
e29f8f7e74 [Orc][Kaleidoscope] More tutorial cleanup, a little extra debugging output.
llvm-svn: 230705
2015-02-26 23:52:42 +00:00
Lang Hames
c757b55fe4 [Orc][Kaleidoscope] Fix a missed symbol mangling operation in the fully lazy tutorial.
llvm-svn: 230664
2015-02-26 19:28:37 +00:00
Lang Hames
483f54742e [Orc][Kaleidoscope] More diff-reduction between tutorial versions.
llvm-svn: 230658
2015-02-26 18:36:34 +00:00
Lang Hames
7e98a6d292 [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
9d40391a59 [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
693a73cca4 [Orc][Kaleidoscope] Remove dead AST map in SessionContext.
llvm-svn: 230201
2015-02-23 04:34:43 +00:00
Lang Hames
9d227dc779 [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
45ed1a04e4 [Orc][Kaleidoscope] Fix the orc/kaleidoscope tutorials on linux.
llvm-svn: 229949
2015-02-20 02:03:30 +00:00
David Blaikie
066e56161c [orcjit] Include CMake support for the fully_lazy example and fix the build
Not sure if/how to make the CMake build use C++14 for the examples, so
let's stick to C++11 for now.

llvm-svn: 229888
2015-02-19 19:06:04 +00:00
Lang Hames
ed5c438a1c [Orc][Kaleidoscope] Fix typo in tutorial comment.
llvm-svn: 229821
2015-02-19 05:33:30 +00:00
Lang Hames
d84decd08c [Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.
The new JIT doesn't IRGen stubs until they're referenced.

llvm-svn: 229807
2015-02-19 01:32:43 +00:00
Lang Hames
bf643c2080 [Orc][Kaleidoscope] Fix a fixme - no reason we can't use C++14 in the tutorials.
llvm-svn: 229765
2015-02-18 23:16:09 +00:00
Lang Hames
c5f198ee8f [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
f12dbd8f5c [Orc][Kaleidoscope] Make sure to look for the mangled name when updating the
function body pointer in the fully lazy orc/kaleidoscope tutorial.

llvm-svn: 229760
2015-02-18 23:07:13 +00:00
Lang Hames
01c479cf33 [Orc][Kaleidoscope] Fix misnumbered steps in comments, plus tidy one
explanation up a little.

llvm-svn: 229467
2015-02-17 05:53:28 +00:00
Lang Hames
def9bf6259 [Orc][Kaleidoscope] Add an example of extreme-laziness in Orc.
The version of the tutorial uses the new compile callbacks API to inject stubs
that trigger IRGen & Codegen of their respective function bodies when they are
first called.

llvm-svn: 229466
2015-02-17 05:40:42 +00:00
Lang Hames
a2702210bf [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
NAKAMURA Takumi
0dd5b347b1 [CMake] Add RuntimeDyld to libdeps corresponding to r229343.
llvm-svn: 229351
2015-02-16 02:13:30 +00:00
Aaron Ballman
0b45511a2e Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
llvm-svn: 229340
2015-02-15 22:54:22 +00:00
Chandler Carruth
0eb343bd44 [PM] Update the examples to reflect the removal of the
llvm/PassManager.h wrapper header and its using declarations. These now
directly use the legacy namespace.

I had updated the #include lines in my large commit but forgot that the
examples weren't being built and didn't update the code to use the
correct namespace. Sorry for the noise here.

llvm-svn: 229095
2015-02-13 10:21:05 +00:00
Chandler Carruth
18e8c62883 [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
Chandler Carruth
a89d62b417 Re-sort the #include lines in bindings and examples which I managed to
miss previously.

llvm-svn: 229089
2015-02-13 09:14:30 +00:00
Lang Hames
92f9dd24ac [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
b1d9c1be95 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
518f29b489 Kaleidoscope-Orc: Extract IRGen work into a utility function.
llvm-svn: 228539
2015-02-08 20:29:28 +00:00
David Blaikie
1f9ab7d592 Constify the Orc Kaleidoscope examples IRGen functions.
llvm-svn: 228537
2015-02-08 20:15:01 +00:00
Lang Hames
0d443d6653 [Orc][Kaleidoscope] Build Kaleidoscope/Orc tutorials with warnings.
llvm-svn: 228531
2015-02-08 19:15:33 +00:00
Lang Hames
c5bd46a2c2 [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
fe49ccef6f [CMake] Kaleidoscope-Orc: Update libdeps.
llvm-svn: 228524
2015-02-08 11:15:08 +00:00
David Blaikie
e5a2bce6c8 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
40b2958350 [Orc][Kaleidoscope] Fix method-name think-o. NFC.
llvm-svn: 228519
2015-02-08 04:34:13 +00:00
Lang Hames
ea9398780d [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
Lang Hames
82a7572fd3 [Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-codegen.
This tutorial builds on the initial kaleidoscope/orc tutorial by adding a
LazyEmittingLayer to the custom stack. This extra layer defers compilation
of modules in the JIT until they are statically referenced.

llvm-svn: 228459
2015-02-06 23:04:53 +00:00
Lang Hames
77ed02eb3f [Orc] Add a Kaleidoscope tutorial for Orc demonstrating eager compilation.
This tutorial demonstrates a very basic custom Orc JIT stack that performs eager
compilation: All modules are CodeGen'd immediately upon being added to the JIT.

llvm-svn: 228456
2015-02-06 22:52:04 +00:00
NAKAMURA Takumi
7787b0877e Reorder.
llvm-svn: 226419
2015-01-19 00:35:33 +00:00
NAKAMURA Takumi
ec7567690f [CMake] examples/Kaleidoscope: Prune redundant libdeps.
llvm-svn: 226418
2015-01-19 00:35:25 +00:00
NAKAMURA Takumi
6c00c8f791 [CMake] Update libdeps in examples/Kaleidoscope/Chapter4.
llvm-svn: 226417
2015-01-19 00:35:18 +00:00
Lang Hames
505b7f3a78 [Kaleidoscope] Run clang-format over chapter 4 of kaleidoscope.
I forgot to do this for r226308. Thanks to Eric Christopher for the reminder.

llvm-svn: 226327
2015-01-16 21:42:07 +00:00
Lang Hames
bb8667116b [Kaleidoscope] Fix a bug in Chapter 4 of the Kaleidoscope tutorial where repeat
calls to functions weren't evaluated correctly.

Patch by Charlie Turner. Thanks Charlie!

llvm-svn: 226308
2015-01-16 19:44:46 +00:00
Aaron Ballman
a2e327eb27 Manually specify the folder that Kaleidescope should reside in for CMake-produced solutions that care about such things (like MSVC). This takes the Kaleidescope target out of the root solution folder and places it into the Examples folder where it belongs.
llvm-svn: 225354
2015-01-07 14:26:07 +00:00
Duncan P. N. Exon Smith
3ba8a9e00e Kaleidoscope: Value => Metadata
llvm-svn: 225320
2015-01-06 23:48:22 +00:00
Duncan P. N. Exon Smith
8726c80a5f cmake: Add Kaleidoscope target
llvm-svn: 225318
2015-01-06 23:39:37 +00:00
Eric Christopher
7beeede5da Add a subdirectory in CMake for Chapter 8.
llvm-svn: 225315
2015-01-06 23:23:24 +00:00
Eric Christopher
64c0113ada Once more on the cmake build. nativecodegen->native on the dependencies.
Thanks to Rafael Espindola for testing assistance.

llvm-svn: 223678
2014-12-08 18:24:06 +00:00
Eric Christopher
4559ce406e Attempt to fix the cmake build by requiring mcjit on the cmake
dependencies for the KS tutorials

llvm-svn: 223677
2014-12-08 18:20:50 +00:00
Eric Christopher
d669b5b6fa Fix KS tutorial build failure.
make all doesn't build the examples and it was uniquified since
last build.

llvm-svn: 223675
2014-12-08 18:12:28 +00:00
Eric Christopher
662fb328d7 Add Chapter 8 to the Kaleidoscope tutorial. This chapter adds
a description of how to add debug information using DWARF and
DIBuilder to the language.

Thanks to David Blaikie for his assistance with this tutorial.

llvm-svn: 223671
2014-12-08 18:00:47 +00:00
Eric Christopher
e2cdff517c Fix the JIT code for the Kaleidoscope tutorial.
llvm-svn: 223670
2014-12-08 18:00:38 +00:00
NAKAMURA Takumi
7ce4513859 ExceptionDemo: Let setMCJITMemoryManager() take unique_ptr, since r223183.
llvm-svn: 223188
2014-12-03 02:05:51 +00:00
NAKAMURA Takumi
cc0ddb87d3 [CMake] llvm/examples: Update libdeps for unoptimized builds.
llvm-svn: 220962
2014-10-31 15:27:16 +00:00
Rafael Espindola
4753b87f60 Add doInitialization/doFinalization to DataLayoutPass.
With this a DataLayoutPass can be reused for multiple modules.

Once we have doInitialization/doFinalization, it doesn't seem necessary to pass
a Module to the constructor.

Overall this change seems in line with the idea of making DataLayout a required
part of Module. With it the only way of having a DataLayout used is to add it
to the Module.

llvm-svn: 217548
2014-09-10 21:27:43 +00:00
Iain Sandoe
966a2425c3 Fix configure and make build of llvm examples.
Replaced link component 'jit' with 'mcjit'.

llvm-svn: 217032
2014-09-03 13:12:16 +00:00
Eric Christopher
2f6f860aaa Reinstate "Nuke the old JIT."
Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reinstates commits r215111, 215115, 215116, 215117, 215136.

llvm-svn: 216982
2014-09-02 22:28:02 +00:00
Rafael Espindola
1d5713d9bf Modernize raw_fd_ostream's constructor a bit.
Take a StringRef instead of a "const char *".
Take a "std::error_code &" instead of a "std::string &" for error.

A create static method would be even better, but this patch is already a bit too
big.

llvm-svn: 216393
2014-08-25 18:16:47 +00:00
Rafael Espindola
7721c6470e Make it explicit that ExecutionEngine takes ownership of the modules.
llvm-svn: 215967
2014-08-19 04:04:25 +00:00
Eric Christopher
378bc328f0 Temporarily Revert "Nuke the old JIT." as it's not quite ready to
be deleted. This will be reapplied as soon as possible and before
the 3.6 branch date at any rate.

Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reverts commits r215111, 215115, 215116, 215117, 215136.

llvm-svn: 215154
2014-08-07 22:02:54 +00:00
Rafael Espindola
e9ebbe5559 Nuke the old JIT.
I am sure we will be finding bits and pieces of dead code for years to
come, but this is a good start.

Thanks to Lang Hames for making MCJIT a good replacement!

llvm-svn: 215111
2014-08-07 14:21:18 +00:00
Dan Liew
59dfdd0290 Added LLVM_ENABLE_RTTI and LLVM_ENABLE_EH options that allow RTTI and EH
to globally be controlled. Individual targets (e.g.  ExceptionDemo) can
still override this by using LLVM_REQUIRE_RTTI and LLVM_REQUIRE_EH if
they need to be compiled with RTTI or exception handling respectively.

llvm-svn: 213663
2014-07-22 15:41:18 +00:00
NAKAMURA Takumi
59ba3fdb61 [CMake] Update libdeps.
llvm-svn: 212920
2014-07-14 05:01:53 +00:00
Benjamin Kramer
bcec9153e8 Try to fix the msvc build.
llvm-svn: 207594
2014-04-29 23:37:02 +00:00
Ahmed Charles
0f014a86bf Fix warnings about an variable only used in asserts.
llvm-svn: 203089
2014-03-06 06:35:46 +00:00
Ahmed Charles
52ce0c101e Replace OwningPtr<T> with std::unique_ptr<T>.
This compiles with no changes to clang/lld/lldb with MSVC and includes
overloads to various functions which are used by those projects and llvm
which have OwningPtr's as parameters. This should allow out of tree
projects some time to move. There are also no changes to libs/Target,
which should help out of tree targets have time to move, if necessary.

llvm-svn: 203083
2014-03-06 05:51:42 +00:00
Rafael Espindola
1b07b35205 Use DataLayout from the module when easily available.
Eventually DataLayoutPass should go away, but for now that is the only easy
way to get a DataLayout in some APIs. This patch only changes the ones that
have easy access to a Module.

One interesting issue with sometimes using DataLayoutPass and sometimes
fetching it from the Module is that we have to make sure they are equivalent.
We can get most of the way there by always constructing the pass with a Module.
In fact, the pass could be changed to point to an external DataLayout instead
of owning one to make this stricter.

Unfortunately, the C api passes a DataLayout, so it has to be up to the caller
to make sure the pass and the module are in sync.

llvm-svn: 202204
2014-02-25 23:25:17 +00:00
Rafael Espindola
32da4bdd4b Make DataLayout a plain object, not a pass.
Instead, have a DataLayoutPass that holds one. This will allow parts of LLVM
don't don't handle passes to also use DataLayout.

llvm-svn: 202168
2014-02-25 17:30:31 +00:00
Rafael Espindola
d89ca7eab7 Replace the F_Binary flag with a F_Text one.
After this I will set the default back to F_None. The advantage is that
before this patch forgetting to set F_Binary would corrupt a file on windows.
Forgetting to set F_Text produces one that cannot be read in notepad, which
is a better failure mode :-)

llvm-svn: 202052
2014-02-24 18:20:12 +00:00
Rafael Espindola
aea6192f20 Add back r201608, r201622, r201624 and r201625
r201608 made llvm corretly handle private globals with MachO. r201622 fixed
a bug in it and r201624 and r201625 were changes for using private linkage,
assuming that llvm would do the right thing.

They all got reverted because r201608 introduced a crash in LTO. This patch
includes a fix for that. The issue was that TargetLoweringObjectFile now has
to be initialized before we can mangle names of private globals. This is
trivially true during the normal codegen pipeline (the asm printer does it),
but LTO has to do it manually.

llvm-svn: 201700
2014-02-19 17:23:20 +00:00
Rafael Espindola
5bdf119d0c This reverts commit r201625 and r201624.
Since r201608 got reverted, it is not safe to use private linkage in these cases
until it is committed back.

llvm-svn: 201688
2014-02-19 15:49:46 +00:00
Rafael Espindola
e24a4a66da Use PrivateLinkage now that it is safe.
Now that llvm's codegen knows to use an 'l' prefix when needed, we can just
use PrivateLinkage.

llvm-svn: 201624
2014-02-19 01:46:57 +00:00
Rafael Espindola
2db67019d3 Don't try to build ExceptionDemo on ARM.
The demo uses _Unwind_GetIP which is not available on that platform.

llvm-svn: 201261
2014-02-12 21:47:15 +00:00
Chandler Carruth
20415ba0f4 [cleanup] Re-sort the examples #include lines with my sort_includes
script.

llvm-svn: 199089
2014-01-13 09:58:03 +00:00
Chandler Carruth
9af0f97115 [cleanup] Fix the includes in the examples for r199082.
llvm-svn: 199087
2014-01-13 09:53:45 +00:00
NAKAMURA Takumi
955efe24ce [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.
llvm-svn: 196908
2013-12-10 11:13:32 +00:00
Juergen Ributzka
990c8318f8 [weak vtables] Place class definitions into anonymous namespaces to prevent weak vtables.
This patch places class definitions in implementation files into anonymous
namespaces to prevent weak vtables. This eliminates the need of providing an
out-of-line definition to pin the vtable explicitly to the file.

llvm-svn: 195092
2013-11-19 03:08:35 +00:00
Juergen Ributzka
5357a6d64b [weak vtables] Remove a bunch of weak vtables
This patch removes most of the trivial cases of weak vtables by pinning them to
a single object file. The memory leaks in this version have been fixed. Thanks
Alexey for pointing them out.

Differential Revision: http://llvm-reviews.chandlerc.com/D2068

Reviewed by Andy

llvm-svn: 195064
2013-11-19 00:57:56 +00:00
Alexey Samsonov
3bfef6bdb6 Revert r194865 and r194874.
This change is incorrect. If you delete virtual destructor of both a base class
and a subclass, then the following code:
  Base *foo = new Child();
  delete foo;
will not cause the destructor for members of Child class. As a result, I observe
plently of memory leaks. Notable examples I investigated are:
ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl.

llvm-svn: 194997
2013-11-18 09:31:53 +00:00
Juergen Ributzka
ee3af15269 [weak vtables] Remove a bunch of weak vtables
This patch removes most of the trivial cases of weak vtables by pinning them to
a single object file.

Differential Revision: http://llvm-reviews.chandlerc.com/D2068

Reviewed by Andy

llvm-svn: 194865
2013-11-15 22:34:48 +00:00
Will Dietz
2703980be5 Add missing #include's to cctype when using isdigit/alpha/etc.
llvm-svn: 192519
2013-10-12 00:55:57 +00:00
NAKAMURA Takumi
f0ebe1e004 ExceptionDemo.cpp: Tweak a @param. [-Wdocumentation]
llvm-svn: 187351
2013-07-29 11:03:50 +00:00
Andrew Kaylor
208108a8e0 Adding example source to support MCJIT/Kaleidoscope blog posts.
llvm-svn: 186854
2013-07-22 18:47:24 +00:00
Rafael Espindola
5c3d709972 Remove unused fields.
llvm-svn: 186791
2013-07-21 12:42:16 +00:00
Logan Chien
7360df71c4 Fix exception demo: Add mcjit to link component.
Fix exception demo when we are building the examples with configure/make.
This commit updates the link components in the Makefile.

llvm-svn: 186785
2013-07-21 03:46:55 +00:00
Rafael Espindola
8abfbec9d8 Update the examples for an API change.
llvm-svn: 186453
2013-07-16 20:22:35 +00:00
NAKAMURA Takumi
8365b7affd ExceptionDemo: Corresponding to r181820, SectionMemoryManager should belong to RTDyldMemoryManager.
llvm-svn: 181844
2013-05-14 23:05:00 +00:00
Rafael Espindola
b0598a0361 Remove exception handling support from the old JIT.
llvm-svn: 181354
2013-05-07 20:53:59 +00:00
Rafael Espindola
4ae75aafcb Port ExceptionDemo to MCJIT.
llvm-svn: 181168
2013-05-05 20:57:58 +00:00
Rafael Espindola
c8f540342b Add support for other typeinfo encodings in the ExceptionDemo.
The old jit always uses DW_EH_PE_absptr, but MCJIT can use other encodings.
This is in preparation for adding EH support to MCJIT, but not directly
related, so I am committing it first.

llvm-svn: 180883
2013-05-01 21:05:05 +00:00
Rafael Espindola
bea78af644 The exception demo needs its symbols exported.
llvm-svn: 180622
2013-04-26 19:07:40 +00:00
Dmitri Gribenko
cf73a60f87 Update links to "Itanium C++ ABI: Exception Handling" document
llvm-svn: 172356
2013-01-13 15:53:09 +00:00
Chandler Carruth
0b1298b398 Update the examples for the new header file locations.
Sorry for the fallout here, I forgot the examples aren't built by
default any more.

llvm-svn: 171371
2013-01-02 11:56:33 +00:00
Chandler Carruth
cb969e4938 Sort the #include lines of the examples/... tree.
llvm-svn: 169249
2012-12-04 10:16:57 +00:00
Rafael Espindola
07695ce31f Fix gcc's -Wunused-but-set-variable warnings.
llvm-svn: 168576
2012-11-26 00:56:44 +00:00
Micah Villmow
ce5e56a156 Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this!
llvm-svn: 166596
2012-10-24 17:25:11 +00:00
Micah Villmow
ae5ce80c36 Delete a directory that wasn't supposed to be checked in yet.
llvm-svn: 166591
2012-10-24 17:20:04 +00:00
Quentin Colombet
574305e5fe Test commit access
llvm-svn: 166481
2012-10-23 16:03:18 +00:00
NAKAMURA Takumi
100b5cd40b ExceptionDemo.cpp: Use Function::setDoesNotReturn(). Attributes stuff was updated.
llvm-svn: 165796
2012-10-12 14:11:48 +00:00
NAKAMURA Takumi
ca189ff532 ExceptionDemo.cpp: Whitespace.
llvm-svn: 165795
2012-10-12 14:11:43 +00:00
Micah Villmow
23edd59649 Move TargetData to DataLayout.
llvm-svn: 165401
2012-10-08 16:37:04 +00:00
Chandler Carruth
4b51f99c87 Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.h
This was always part of the VMCore library out of necessity -- it deals
entirely in the IR. The .cpp file in fact was already part of the VMCore
library. This is just a mechanical move.

I've tried to go through and re-apply the coding standard's preferred
header sort, but at 40-ish files, I may have gotten some wrong. Please
let me know if so.

I'll be committing the corresponding updates to Clang and Polly, and
Duncan has DragonEgg.

Thanks to Bill and Eric for giving the green light for this bit of cleanup.

llvm-svn: 159421
2012-06-29 12:38:19 +00:00
Arnaud A. de Grandmaison
7a500ef0b0 Remove trailing whitespaces
llvm-svn: 158943
2012-06-21 22:26:01 +00:00
Benjamin Kramer
bb30e1face Fix typos found by http://github.com/lyda/misspell-check
llvm-svn: 157885
2012-06-02 10:20:22 +00:00
Michael J. Spencer
e6c28a171e Remove llvm-ld and llvm-stub (which is only used by llvm-ld).
llvm-ld is no longer useful and causes confusion and so it is being removed.

* Does not work very well on Windows because it must call a gcc like driver to
  assemble and link.
* Has lots of hard coded paths which are wrong on many systems.
* Does not understand most of ld's options.
* Can be partially replaced by llvm-link | opt | {llc | as, llc -filetype=obj} |
  ld, or fully replaced by Clang.

I know of no production use of llvm-ld, and hacking use should be
replaced by Clang's driver.

llvm-svn: 155147
2012-04-19 19:27:54 +00:00
Chandler Carruth
d4b1931dd9 Switch to a more idiomatic way of silencing unused variable warnings in
release builds. Silences clang's -Wself-assign.

llvm-svn: 150942
2012-02-20 00:02:49 +00:00
Peter Collingbourne
b5e95a7fb3 Update ExceptionDemo to use ConstantDataArray.
llvm-svn: 149867
2012-02-06 14:09:13 +00:00
Bill Wendling
7ef169f2d2 Update to the new EH system...remove OLD EH code.
llvm-svn: 149728
2012-02-04 00:29:12 +00:00
Francois Pichet
81cb90c91f Fix BrainF compilation.
llvm-svn: 149375
2012-01-31 09:35:01 +00:00
Daniel Dunbar
30d6a45140 LLVMBuild: Remove trailing newline, which irked me.
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Peter Collingbourne
7f575840c2 EngineBuilder: support for custom TargetOptions. Fixes the
ExceptionDemo example.

llvm-svn: 146108
2011-12-07 23:58:57 +00:00
Daniel Dunbar
3760ebeebb build: Add initial cut at LLVMBuild.txt files.
llvm-svn: 143634
2011-11-03 18:53:17 +00:00
Garrison Venn
473050b066 Changed comments on foreign C++ exceptions (generated with type info 7),
handling with references to 
http://sourcery.mentor.com/public/cxx-abi/abi-eh.html (r 1.22).

llvm-svn: 140695
2011-09-28 10:53:56 +00:00
Garrison Venn
d0c68eb6c0 Modified demo to use 3.0 resume instruction vs calling _Unwine_Resume.
Also conducted some reformatting. As the LLVM coding standard doc does not
seem to touch on how to align function arguments, and format code longer than
80 cols in general, the confusion persists. There is the golden rule, but as
this code has gone through several styles to deal with this, the golden rule
seems to be ignored. The latest reformatting effort tries to match the other
source files as much as possible.

Tested on OS X 10.7.1 with, and without the OLD_EXC_SYSTEM defined. Have NOT
tested on LINUX.

llvm-svn: 140379
2011-09-23 14:45:10 +00:00
Garrison Venn
f623ea5484 Converted Exception demo over to using new 3.0 landingpad instruction. This
was compiled and tested on OS X 10.7.1. It was not tested on LINUX. In 
addition the defined OLD_EXC_SYSTEM was not tested with this version.

llvm-svn: 140303
2011-09-22 15:45:14 +00:00
Garrison Venn
cce0f439c0 This is a hack to get the demo working with the new 3.0 exception
infrastructure. As this makes the demo no longer a demo, and especially not a 
demo on how to use the llvm exception mechanism, this hack will shortly be 
changed to use the new 3.0 exception infrastructure. However for the time being 
this demo is an example on how to use the AutoUpgrade 
UpgradeExceptionHandling(...) function on < 3.0 exception handling code.                          

llvm-svn: 140301
2011-09-22 14:07:50 +00:00
Evan Cheng
420bf5446c Move TargetRegistry and TargetSelect from Target to Support where they belong.
These are strictly utilities for registering targets and components.

llvm-svn: 138450
2011-08-24 18:08:43 +00:00
Jay Foad
d4458dd707 Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

llvm-svn: 135673
2011-07-21 14:31:17 +00:00
Chris Lattner
568b96b828 update for recent api changes. I have a hard time believing that this is actually a useful example.
llvm-svn: 135374
2011-07-18 04:52:58 +00:00
Chris Lattner
210e9162c9 update this to build with a recent IRBuilder change and de-constify types.
llvm-svn: 135373
2011-07-18 04:52:09 +00:00
Francois Pichet
48fc576f97 Convert CallInst and InvokeInst APIs to use ArrayRef. For the LLVM examples.
llvm-svn: 135266
2011-07-15 10:59:52 +00:00
Benjamin Kramer
a6129829fa Change Intrinsic::getDeclaration and friends to take an ArrayRef.
llvm-svn: 135154
2011-07-14 17:45:39 +00:00
Francois Pichet
fdb8193f76 Remove the const from Type after of Jay deconstify work.
llvm-svn: 135000
2011-07-12 22:04:11 +00:00
Garrison Venn
951f71fb09 Reverted 134901 because of 134959. Did not use svn merge -r but rather:
1,$s/llvm::Type::getInt\(..\)Ty(builder.getContext())/builder.getInt\1Ty()/g
1,$s/builder.getInt\(..*\)Ty()->getPointerTo()/builder.getInt\1PtrTy()/g

vi sub commands (second one was not a reversion but requested by 
Tobias Grosser.

Mod was tested, but other examples have failed to build as they are currently 
being thrashed with the const qualifier removal change.

llvm-svn: 134985
2011-07-12 15:34:42 +00:00
Francois Pichet
5876350a18 Fix the BrainF build.
llvm-svn: 134975
2011-07-12 08:43:36 +00:00
John Wiegley
7c47d39ca1 fix some examples
llvm-svn: 134933
2011-07-11 22:39:46 +00:00
Garrison Venn
3fe7556c3c Modified demo to work with non const Type parameters as is required by new
type system. However most of these modifications were due to IRBuilder
(IRBuilderBase), not having been modified to NOT return such const qualified
free types. If IRBuilder does not change, as can also be seen in its 
instruction creation methods, to use const free types, it may be useful to have
ExceptionDemo drop IRBuilder usage. Modifying builder.getInt32Ty() to
llvm::Type::getInt32Ty(builder.getContext()) is pretty ugly.

llvm-svn: 134901
2011-07-11 16:31:53 +00:00
Johnny Chen
5f63b7b4c1 Modify comment.
llvm-svn: 132800
2011-06-09 20:11:46 +00:00
Eric Christopher
9fb6aad029 Have the JIT tutorial use IRBuilder for the IR.
Patch by Jake Waskett!

llvm-svn: 132770
2011-06-09 05:58:50 +00:00
Chris Lattner
0304b82f80 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Garrison Venn
6944576853 Added new FIXME note
llvm-svn: 129360
2011-04-12 12:30:10 +00:00
Eli Friedman
1ed37a22d6 Get rid of useless comment; if a file uses functions from a given header,
it is obvious that it should be included.

llvm-svn: 129295
2011-04-11 20:16:05 +00:00
Garrison Venn
6cd1933961 Because some systems have reported that this example would not build the
header file cstdio was added as an include.

llvm-svn: 129291
2011-04-11 19:52:49 +00:00
Garrison Venn
a1e02865ff Fixed more best practices, and explicit/implicit style guide issues.
llvm-svn: 129245
2011-04-10 14:06:52 +00:00
Chris Lattner
9ba8d74c34 reindent this whole file and do a variety of stylistic cleanups.
This code is still a long way from following best practices.

llvm-svn: 129140
2011-04-08 18:02:51 +00:00
Chris Lattner
5789afd1a4 fix this to build with the recent StructType changes.
llvm-svn: 129139
2011-04-08 17:56:47 +00:00
Jay Foad
53632b7c03 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Jay Foad
dc5a008237 (Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128535
2011-03-30 11:19:20 +00:00
Erick Tryzelaar
4a621556e4 Fix compiling the ocaml kaleidoscope tutorials
llvm-svn: 125202
2011-02-09 18:32:02 +00:00
Oscar Fuentes
55b9ff9dd9 Do not re-test for the existence of pthread.h.
It was causing problems on the MinGW build. See PR8849.

llvm-svn: 122518
2010-12-23 21:27:22 +00:00
Dan Gohman
d15705f63d Fix missing includes of "llvm/Analysis/Passes.h" in the tutorials. Thanks
for Arnaud Allard de Grandmaison for preparing a patch.

llvm-svn: 119351
2010-11-16 17:28:22 +00:00
Dan Gohman
48daf06935 Update examples and documentation to explicitly add basicaa, now that it's
no longer included by default.

llvm-svn: 119169
2010-11-15 18:41:10 +00:00
Oscar Fuentes
a6ffccab95 Build with RTTI and exceptions disabled. Only in GCC for now.
llvm-svn: 116682
2010-10-17 02:26:16 +00:00
Duncan Sands
f66899560c Convert a bunch of uses of 'bytecode' into 'bitcode'. This
is not everything, but the remaining cases are less trivial.

llvm-svn: 115080
2010-09-29 20:09:55 +00:00
Garrison Venn
e389929186 Removed TracingBrainF from examples Makefile.
llvm-svn: 113970
2010-09-15 14:55:32 +00:00
Michael J. Spencer
90f807fda5 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Michael J. Spencer
98ad3f2ea7 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Chris Lattner
df0d49314e fit in 80 columns and don't crash on exit, fixes PR8080
llvm-svn: 113123
2010-09-05 23:09:30 +00:00
Owen Anderson
24665a1e03 Remove this from the main tree. I'll host it out of tree.
llvm-svn: 112529
2010-08-30 21:34:26 +00:00
Owen Anderson
fd4ce93e17 Add a new example to the LLVM distribution: a trace-based Brainfuck compiler that uses LLVM as its code generator.
llvm-svn: 112465
2010-08-30 07:33:39 +00:00
Mikhail Glushenkov
36df8f356e Trailing whitespace.
llvm-svn: 111552
2010-08-19 20:03:53 +00:00
Chris Lattner
9af00336c5 upgrade to use new intrinsics, patch by Dan Hipschman!
llvm-svn: 110735
2010-08-10 21:45:38 +00:00
Duncan Sands
f7b98e2b1e Convert some tab stops into spaces.
llvm-svn: 108130
2010-07-12 08:16:59 +00:00
Eric Christopher
752cc6f5db Fix up the ocaml kaleidoscope example as well.
Note that the example currently doesn't appear to work.

llvm-svn: 108121
2010-07-12 02:32:44 +00:00
Chris Lattner
c0d70f4edf fix several bugs in the tutorial, patch by Kevin Kelley!
llvm-svn: 106498
2010-06-21 22:51:14 +00:00
Daniel Dunbar
50f8239f37 Remove stray semi-colon.
llvm-svn: 106009
2010-06-15 17:47:24 +00:00
Eric Christopher
c4d6c0dc24 Make kaleidoscope use fp add/sub/mul.
Patch by Patrick Flannery!

llvm-svn: 105932
2010-06-14 06:03:16 +00:00
Duncan Sands
153ad3b903 Remove the -enable-sjlj-eh option, which doesn't do anything.
Remove the -enable-eh option which is only used by the JIT,
and replace it with -jit-enable-eh.

llvm-svn: 102865
2010-05-02 15:36:26 +00:00
Nick Lewycky
7348a24ff9 Use provided llvm-defined variables instead of twisting user-controlled knobs.
No visible change.

llvm-svn: 102240
2010-04-24 05:07:24 +00:00
Benjamin Kramer
9127eadfce Fix -Wcast-qual warning.
llvm-svn: 101894
2010-04-20 11:50:37 +00:00
Erick Tryzelaar
c20300df21 Fix the ocaml kaleidoscope tutorial to fix linking external libraries.
llvm-svn: 99151
2010-03-21 23:15:13 +00:00
Erick Tryzelaar
939801510b Don't always run the ocaml kaleidoscope tutorials.
llvm-svn: 97973
2010-03-08 20:07:32 +00:00
Erick Tryzelaar
0e12fd5fc2 Add OCaml tutorial to the examples.
llvm-svn: 97966
2010-03-08 19:32:27 +00:00
Jeffrey Yasskin
82c2f2fd24 Roll back r96959 again.
llvm-svn: 96981
2010-02-23 20:53:37 +00:00
Jeffrey Yasskin
e653785a3d Roll r96559 forward again, adding libLLVM-2.7svn.so to LLVM. This links 3 of
the examples shared to make sure the shared library keeps working.

llvm-svn: 96959
2010-02-23 18:10:07 +00:00
Garrison Venn
3d6630be49 Modified examples Makefile to only build the ExceptionDemo example for
x86 and x86_64 on UNIX systems. Only OS X 10.6.2 (x86_64) and 32bit CentOS 5.2
with gcc 4.1.2 were tested. ARM UNIX build triggered failure motivating this
modification, as it seems that the ARM ABI does not support _Unwind_GetIP(...),
_Unwind_SetGR(...), and _Unwind_SetIP(...). From doing a quick browse of:
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf,
it seems as if all other exception related apis are supported. Looks like
the port can be done to ARM. Thanks to Xerxes Rånby <xerxes@zafena.se> for
pointing out this error.

llvm-svn: 96949
2010-02-23 16:27:59 +00:00
Jeffrey Yasskin
472348ab92 Make Kaleidoscope not link against the interpreter, since that didn't
work anyway (Interpreter::getPointerToFunction doesn't return a
callable pointer), and improve the error message when an
ExecutionEngine can't be created.

llvm-svn: 95896
2010-02-11 19:15:20 +00:00
Garrison Venn
fc41a88897 Prevented build on WINDOWS using default make system. Stopped WINDOWS build
at eh llvm/examples level using if check on LLVM_ON_UNIX.

llvm-svn: 95763
2010-02-10 03:38:29 +00:00
Garrison Venn
4857ff7ad0 Prevented ExceptionDemo example being built on WINDOWS via if( NOT WIN32 )
check in examples cmake list file. This has NOT been tested.

llvm-svn: 95761
2010-02-10 02:50:08 +00:00
Garrison Venn
bb6a6a6a47 Adds a JIT based exception handling example to the examples directory.
Both zero cost example domain specific, and C++ foreign exception handling are 
shown. The example's documentation fully explains how to run the example.

Notes:

1)   The code uses an extremely simple type info model.
2)   Only a single landing pad is used per unwind edge 
     (one call to llvm.eh.selector)
3)   llvm.eh.selector support for filter arguments is not given.
4)   llvm.eh.typeid.for is not used.
5)   Forced unwind behavior is not supported.
6)   Very little if any error handling is given.
7)   __attribute__((__aligned__)) is used.
8)   The code uses parts from the llvm compiler-rt project and
     the llvm Kaleidoscope example.
9)   The code has not been ported or tested on WINDOWS.
10)  The code was not tested with a cmake build.
11)  The code was tested for a debug build on 32bit X86 CentOS LINUX, 
     and both a debug and release build on OS X 10.6.2 (64bit).

llvm-svn: 95723
2010-02-09 23:22:43 +00:00
Garrison Venn
8fa585cf8c Repository access test commit
llvm-svn: 95221
2010-02-03 12:00:02 +00:00