Commit Graph

76 Commits

Author SHA1 Message Date
David Blaikie
337b35ae29 Fix up Exception demo from recent opaque pointer type changes to GEP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235478 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-22 04:24:43 +00:00
Alexander Kornienko
c16fc54851 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11 02:11:45 +00:00
NAKAMURA Takumi
15ce777898 Rework r233647, "llvm/examples: Suppress building a few JIT examples."
It didn't work with "install".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 16:41:25 +00:00
NAKAMURA Takumi
6dd9e8563b 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'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233647 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 00:03:43 +00:00
NAKAMURA Takumi
d5285ead92 llvm/examples: Add RuntimeDyld as libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31 00:03:36 +00:00
Reid Kleckner
85ab1e7fe7 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232662 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 20:09:13 +00:00
Rafael Espindola
671944ff8f Fix the build of the gold-plugin and examples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 19:15:29 +00:00
Mehdi Amini
c94da20917 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 18:43:29 +00:00
NAKAMURA Takumi
a757af993f llvm/examples: Add missing include according to r230907.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230926 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 01:04:34 +00:00
Chandler Carruth
7ea33e53c7 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229095 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 10:21:05 +00:00
Chandler Carruth
417c5c172c [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".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229094 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-13 10:01:29 +00:00
NAKAMURA Takumi
8cc929ea00 ExceptionDemo: Let setMCJITMemoryManager() take unique_ptr, since r223183.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223188 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 02:05:51 +00:00
NAKAMURA Takumi
65e4532b78 [CMake] llvm/examples: Update libdeps for unoptimized builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220962 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-31 15:27:16 +00:00
Rafael Espindola
3b670550ad 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217548 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10 21:27:43 +00:00
Iain Sandoe
b449c2885f Fix configure and make build of llvm examples.
Replaced link component 'jit' with 'mcjit'.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 13:12:16 +00:00
Eric Christopher
d5dd8ce2a5 Reinstate "Nuke the old JIT."
Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216982 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 22:28:02 +00:00
Rafael Espindola
3f4ed32b43 Make it explicit that ExecutionEngine takes ownership of the modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215967 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 04:04:25 +00:00
Eric Christopher
aa5b9c0f6f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215154 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 22:02:54 +00:00
Rafael Espindola
875710a2fd 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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215111 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-07 14:21:18 +00:00
Dan Liew
976824a7a4 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213663 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-22 15:41:18 +00:00
Rafael Espindola
356deb5ecd 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202204 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 23:25:17 +00:00
Rafael Espindola
57edc9d4ff 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202168 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 17:30:31 +00:00
Rafael Espindola
737c9f6005 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201700 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 17:23:20 +00:00
Rafael Espindola
3e0d3a45e5 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201688 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 15:49:46 +00:00
Rafael Espindola
f2ce8f7874 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201624 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 01:46:57 +00:00
Chandler Carruth
098dd808c1 [cleanup] Fix the includes in the examples for r199082.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199087 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13 09:53:45 +00:00
NAKAMURA Takumi
3aabdebde2 [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196908 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10 11:13:32 +00:00
Juergen Ributzka
ba0f991a78 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195092 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 03:08:35 +00:00
Juergen Ributzka
354362524a [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195064 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 00:57:56 +00:00
Alexey Samsonov
b21ab43cfc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18 09:31:53 +00:00
Juergen Ributzka
5a364c5561 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194865 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 22:34:48 +00:00
NAKAMURA Takumi
c16babf693 ExceptionDemo.cpp: Tweak a @param. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187351 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 11:03:50 +00:00
Logan Chien
3659fd3552 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186785 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-21 03:46:55 +00:00
NAKAMURA Takumi
3c2b0e171f ExceptionDemo: Corresponding to r181820, SectionMemoryManager should belong to RTDyldMemoryManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181844 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-14 23:05:00 +00:00
Rafael Espindola
e449654815 Remove exception handling support from the old JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181354 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 20:53:59 +00:00
Rafael Espindola
c8b9551a8f Port ExceptionDemo to MCJIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181168 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-05 20:57:58 +00:00
Rafael Espindola
58c3aa2049 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180883 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01 21:05:05 +00:00
Rafael Espindola
fbb2c7adc2 The exception demo needs its symbols exported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180622 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26 19:07:40 +00:00
Dmitri Gribenko
a6f10317bf Update links to "Itanium C++ ABI: Exception Handling" document
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172356 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-13 15:53:09 +00:00
Chandler Carruth
0a08460599 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171371 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 11:56:33 +00:00
Chandler Carruth
4ca7e09b7c Sort the #include lines of the examples/... tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 10:16:57 +00:00
Rafael Espindola
250ab62a62 Fix gcc's -Wunused-but-set-variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168576 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-26 00:56:44 +00:00
Micah Villmow
b8bce928f4 Back out r166591, not sure why this made it through since I cancelled the command. Bleh, sorry about this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166596 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 17:25:11 +00:00
Micah Villmow
2f87640b86 Delete a directory that wasn't supposed to be checked in yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166591 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 17:20:04 +00:00
NAKAMURA Takumi
4c856ee1f8 ExceptionDemo.cpp: Use Function::setDoesNotReturn(). Attributes stuff was updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165796 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12 14:11:48 +00:00
NAKAMURA Takumi
9f469a0ca3 ExceptionDemo.cpp: Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165795 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12 14:11:43 +00:00
Micah Villmow
2b4b44e0d2 Move TargetData to DataLayout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165401 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 16:37:04 +00:00
Chandler Carruth
06cb8ed006 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159421 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-29 12:38:19 +00:00
Benjamin Kramer
d9b0b02561 Fix typos found by http://github.com/lyda/misspell-check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 10:20:22 +00:00
Peter Collingbourne
793a32dfb6 Update ExceptionDemo to use ConstantDataArray.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149867 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 14:09:13 +00:00