summaryrefslogtreecommitdiffstats
path: root/llvm/examples/ExceptionDemo
Commit message (Collapse)AuthorAgeFilesLines
* [llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-151-1/+1
| | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix broken links to the Itanium CXX ABIVlad Tsyrklevich2017-09-121-8/+8
| | | | llvm-svn: 312985
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-071-2/+2
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* ExceptionDemo: remove some undefined behaviourSaleem Abdulrasool2016-11-201-14/+17
| | | | | | | | The casting based reading of the LSDA could attempt to read unsuitably aligned data. Avoid that case by explicitly using a memcpy. A similar approach is used in libc++abi to address the same UB. llvm-svn: 287479
* ExceptionDemo: prefer headers over redeclarationsSaleem Abdulrasool2016-11-201-63/+9
| | | | | | | | | | | Rather than redeclaring the interfaces for exceptions, prefer using the `unwind.h` header. This is vended by at least gcc and clang, and can also be found by an external unwinding library (e.g. libunwind). Doing this simplifies the example to the exception handling itself. Minor tweaks are the result of _Unwind_Context_t not being defined, which is just a typedef for struct _Unwind_Context *. NFC. llvm-svn: 287478
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-021-1/+1
| | | | | | | | | | Reviewers: beanz, lattner, jlebar Subscribers: jholewinski, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D26235 llvm-svn: 285832
* Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini2016-04-141-3/+3
| | | | | | | | | | | At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
* Remove autoconf supportChris Bieneman2016-01-261-16/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Fix typo and test commitLuke Larson2015-09-181-1/+1
| | | | llvm-svn: 248042
* [CMake] Let ExceptionDemo buildable with ENABLE_EH.NAKAMURA Takumi2015-08-271-4/+4
| | | | llvm-svn: 246152
* Update ExceptionDemo for exception handling API changes (personality ↵David Blaikie2015-08-141-1/+1
| | | | | | | | | function call->function move) The ExceptionDemo now compiles, but doesn't link... undefined type references to various typeinfo. llvm-svn: 244997
* Fix -Wformat warnings in ExceptionDemoDavid Blaikie2015-08-141-6/+7
| | | | llvm-svn: 244995
* Fix up the ExceptionDemo for some API changes over the past <time>David Blaikie2015-08-141-2/+2
| | | | | | | This still doesn't build -Werror clean, but other than that it should at least build. llvm-svn: 244994
* Fix up Exception demo from recent opaque pointer type changes to GEPDavid Blaikie2015-04-221-6/+7
| | | | llvm-svn: 235478
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-1/+1
| | | | | | | | | | | | | | 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
* Rework r233647, "llvm/examples: Suppress building a few JIT examples."NAKAMURA Takumi2015-03-311-1/+1
| | | | | | It didn't work with "install". llvm-svn: 233708
* llvm/examples: Suppress building a few JIT examples.NAKAMURA Takumi2015-03-311-0/+2
| | | | | | 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
* llvm/examples: Add RuntimeDyld as libdeps.NAKAMURA Takumi2015-03-311-0/+1
| | | | llvm-svn: 233646
* CMake: Disable ENABLE_EXPORTS for executables with MSVCReid Kleckner2015-03-181-1/+1
| | | | | | | | | | | | | | 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
* Fix the build of the gold-plugin and examples.Rafael Espindola2015-03-041-1/+1
| | | | llvm-svn: 231279
* Make DataLayout Non-Optional in the ModuleMehdi Amini2015-03-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* llvm/examples: Add missing include according to r230907.NAKAMURA Takumi2015-03-021-0/+1
| | | | llvm-svn: 230926
* [PM] Update the examples to reflect the removal of theChandler Carruth2015-02-131-20/+15
| | | | | | | | | | | 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
* [PM] Remove the old 'PassManager.h' header file at the top level ofChandler Carruth2015-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* ExceptionDemo: Let setMCJITMemoryManager() take unique_ptr, since r223183.NAKAMURA Takumi2014-12-031-2/+2
| | | | llvm-svn: 223188
* [CMake] llvm/examples: Update libdeps for unoptimized builds.NAKAMURA Takumi2014-10-311-0/+1
| | | | llvm-svn: 220962
* Add doInitialization/doFinalization to DataLayoutPass.Rafael Espindola2014-09-101-1/+1
| | | | | | | | | | | | | 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
* Fix configure and make build of llvm examples.Iain Sandoe2014-09-031-1/+1
| | | | | | Replaced link component 'jit' with 'mcjit'. llvm-svn: 217032
* Reinstate "Nuke the old JIT."Eric Christopher2014-09-021-2/+0
| | | | | | | | Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reinstates commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 216982
* Make it explicit that ExecutionEngine takes ownership of the modules.Rafael Espindola2014-08-191-2/+4
| | | | llvm-svn: 215967
* Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher2014-08-071-0/+2
| | | | | | | | | | | 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
* Nuke the old JIT.Rafael Espindola2014-08-071-2/+0
| | | | | | | | | 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
* Added LLVM_ENABLE_RTTI and LLVM_ENABLE_EH options that allow RTTI and EHDan Liew2014-07-221-0/+2
| | | | | | | | 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
* Use DataLayout from the module when easily available.Rafael Espindola2014-02-251-1/+2
| | | | | | | | | | | | | | | | | 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
* Make DataLayout a plain object, not a pass.Rafael Espindola2014-02-251-1/+1
| | | | | | | 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
* Add back r201608, r201622, r201624 and r201625Rafael Espindola2014-02-191-2/+2
| | | | | | | | | | | | | | 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
* This reverts commit r201625 and r201624.Rafael Espindola2014-02-191-2/+2
| | | | | | | Since r201608 got reverted, it is not safe to use private linkage in these cases until it is committed back. llvm-svn: 201688
* Use PrivateLinkage now that it is safe.Rafael Espindola2014-02-191-2/+2
| | | | | | | Now that llvm's codegen knows to use an 'l' prefix when needed, we can just use PrivateLinkage. llvm-svn: 201624
* [cleanup] Fix the includes in the examples for r199082.Chandler Carruth2014-01-131-1/+1
| | | | llvm-svn: 199087
* [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi2013-12-101-1/+8
| | | | llvm-svn: 196908
* [weak vtables] Place class definitions into anonymous namespaces to prevent ↵Juergen Ributzka2013-11-191-5/+3
| | | | | | | | | | 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
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-191-1/+3
| | | | | | | | | | | | 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
* Revert r194865 and r194874.Alexey Samsonov2013-11-181-3/+1
| | | | | | | | | | | | 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
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-151-1/+3
| | | | | | | | | | | 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
* ExceptionDemo.cpp: Tweak a @param. [-Wdocumentation]NAKAMURA Takumi2013-07-291-1/+1
| | | | llvm-svn: 187351
* Fix exception demo: Add mcjit to link component.Logan Chien2013-07-211-1/+1
| | | | | | | Fix exception demo when we are building the examples with configure/make. This commit updates the link components in the Makefile. llvm-svn: 186785
* ExceptionDemo: Corresponding to r181820, SectionMemoryManager should belong ↵NAKAMURA Takumi2013-05-141-2/+2
| | | | | | to RTDyldMemoryManager. llvm-svn: 181844
* Remove exception handling support from the old JIT.Rafael Espindola2013-05-071-1/+0
| | | | llvm-svn: 181354
* Port ExceptionDemo to MCJIT.Rafael Espindola2013-05-052-3/+10
| | | | llvm-svn: 181168
OpenPOWER on IntegriCloud