aboutsummaryrefslogtreecommitdiff
path: root/llvm/examples/ExceptionDemo/ExceptionDemo.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-12-03ExceptionDemo: Let setMCJITMemoryManager() take unique_ptr, since r223183.NAKAMURA Takumi1-2/+2
llvm-svn: 223188
2014-09-10Add doInitialization/doFinalization to DataLayoutPass.Rafael Espindola1-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
2014-09-02Reinstate "Nuke the old JIT."Eric Christopher1-2/+0
Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reinstates commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 216982
2014-08-19Make it explicit that ExecutionEngine takes ownership of the modules.Rafael Espindola1-2/+4
llvm-svn: 215967
2014-08-07Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher1-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
2014-08-07Nuke the old JIT.Rafael Espindola1-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
2014-02-25Use DataLayout from the module when easily available.Rafael Espindola1-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
2014-02-25Make DataLayout a plain object, not a pass.Rafael Espindola1-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
2014-02-19Add back r201608, r201622, r201624 and r201625Rafael Espindola1-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
2014-02-19This reverts commit r201625 and r201624.Rafael Espindola1-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
2014-02-19Use PrivateLinkage now that it is safe.Rafael Espindola1-2/+2
Now that llvm's codegen knows to use an 'l' prefix when needed, we can just use PrivateLinkage. llvm-svn: 201624
2014-01-13[cleanup] Fix the includes in the examples for r199082.Chandler Carruth1-1/+1
llvm-svn: 199087
2013-11-19[weak vtables] Place class definitions into anonymous namespaces to prevent ↵Juergen Ributzka1-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
2013-11-19[weak vtables] Remove a bunch of weak vtablesJuergen Ributzka1-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
2013-11-18Revert r194865 and r194874.Alexey Samsonov1-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
2013-11-15[weak vtables] Remove a bunch of weak vtablesJuergen Ributzka1-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
2013-07-29ExceptionDemo.cpp: Tweak a @param. [-Wdocumentation]NAKAMURA Takumi1-1/+1
llvm-svn: 187351
2013-05-14ExceptionDemo: Corresponding to r181820, SectionMemoryManager should belong ↵NAKAMURA Takumi1-2/+2
to RTDyldMemoryManager. llvm-svn: 181844
2013-05-07Remove exception handling support from the old JIT.Rafael Espindola1-1/+0
llvm-svn: 181354
2013-05-05Port ExceptionDemo to MCJIT.Rafael Espindola1-2/+9
llvm-svn: 181168
2013-05-01Add support for other typeinfo encodings in the ExceptionDemo.Rafael Espindola1-9/+41
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-01-13Update links to "Itanium C++ ABI: Exception Handling" documentDmitri Gribenko1-9/+9
llvm-svn: 172356
2013-01-02Update the examples for the new header file locations.Chandler Carruth1-6/+6
Sorry for the fallout here, I forgot the examples aren't built by default any more. llvm-svn: 171371
2012-12-04Sort the #include lines of the examples/... tree.Chandler Carruth1-6/+6
llvm-svn: 169249
2012-11-26Fix gcc's -Wunused-but-set-variable warnings.Rafael Espindola1-5/+0
llvm-svn: 168576
2012-10-24Back out r166591, not sure why this made it through since I cancelled the ↵Micah Villmow1-1/+1
command. Bleh, sorry about this! llvm-svn: 166596
2012-10-24Delete a directory that wasn't supposed to be checked in yet.Micah Villmow1-1/+1
llvm-svn: 166591
2012-10-12ExceptionDemo.cpp: Use Function::setDoesNotReturn(). Attributes stuff was ↵NAKAMURA Takumi1-2/+2
updated. llvm-svn: 165796
2012-10-12ExceptionDemo.cpp: Whitespace.NAKAMURA Takumi1-587/+586
llvm-svn: 165795
2012-10-08Move TargetData to DataLayout.Micah Villmow1-2/+2
llvm-svn: 165401
2012-06-29Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth1-1/+1
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-02Fix typos found by http://github.com/lyda/misspell-checkBenjamin Kramer1-1/+1
llvm-svn: 157885
2012-02-06Update ExceptionDemo to use ConstantDataArray.Peter Collingbourne1-2/+3
llvm-svn: 149867
2012-02-04Update to the new EH system...remove OLD EH code.Bill Wendling1-88/+4
llvm-svn: 149728
2011-12-07EngineBuilder: support for custom TargetOptions. Fixes thePeter Collingbourne1-1/+3
ExceptionDemo example. llvm-svn: 146108
2011-09-28Changed comments on foreign C++ exceptions (generated with type info 7), Garrison Venn1-8/+9
handling with references to http://sourcery.mentor.com/public/cxx-abi/abi-eh.html (r 1.22). llvm-svn: 140695
2011-09-23Modified demo to use 3.0 resume instruction vs calling _Unwine_Resume.Garrison Venn1-93/+116
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-22Converted Exception demo over to using new 3.0 landingpad instruction. ThisGarrison Venn1-22/+59
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-22This is a hack to get the demo working with the new 3.0 exception Garrison Venn1-4/+18
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-08-24Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng1-1/+1
These are strictly utilities for registering targets and components. llvm-svn: 138450
2011-07-18update this to build with a recent IRBuilder change and de-constify types.Chris Lattner1-10/+6
llvm-svn: 135373
2011-07-12Reverted 134901 because of 134959. Did not use svn merge -r but rather:Garrison Venn1-24/+24
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-11Modified demo to work with non const Type parameters as is required by newGarrison Venn1-15/+16
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-04-15Fix a ton of comment typos found by codespell. Patch byChris Lattner1-1/+1
Luis Felipe Strano Moraes! llvm-svn: 129558
2011-04-12Added new FIXME noteGarrison Venn1-0/+9
llvm-svn: 129360
2011-04-11Get rid of useless comment; if a file uses functions from a given header,Eli Friedman1-4/+0
it is obvious that it should be included. llvm-svn: 129295
2011-04-11Because some systems have reported that this example would not build theGarrison Venn1-0/+5
header file cstdio was added as an include. llvm-svn: 129291
2011-04-10Fixed more best practices, and explicit/implicit style guide issues.Garrison Venn1-131/+128
llvm-svn: 129245
2011-04-08reindent this whole file and do a variety of stylistic cleanups.Chris Lattner1-1422/+1400
This code is still a long way from following best practices. llvm-svn: 129140
2011-04-08fix this to build with the recent StructType changes.Chris Lattner1-6/+6
llvm-svn: 129139