summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Set the debug location for landing pad code to the canonical EH location.Adrian Prantl2013-05-161-0/+7
| | | | | | | | | It used to point to the first call that caused the landing pad to be generated. rdar://problem/13888152 llvm-svn: 181958
* Don't crash in IRGen if a conditional with 'throw' in one of its branches isRichard Smith2013-05-071-4/+8
| | | | | | used as a branch condition. llvm-svn: 181368
* Change hasAggregateLLVMType, which conflates complex andJohn McCall2013-03-071-14/+19
| | | | | | | | | | | | | | | aggregate types in a profoundly wrong way that has to be worked around in every call site, to getEvaluationKind, which classifies and distinguishes between all of these cases. Also, normalize the API for loading and storing complexes. I'm working on a larger patch and wanted to pull these changes out, but it would have be annoying to detangle them from each other. llvm-svn: 176656
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-281-51/+33
| | | | | | | | | | | | | | | | | | | | | | calls and declarations. LLVM has a default CC determined by the target triple. This is not always the actual default CC for the ABI we've been asked to target, and so we sometimes find ourselves annotating all user functions with an explicit calling convention. Since these calling conventions usually agree for the simple set of argument types passed to most runtime functions, using the LLVM-default CC in principle has no effect. However, the LLVM optimizer goes into histrionics if it sees this kind of formal CC mismatch, since it has no concept of CC compatibility. Therefore, if this module happens to define the "runtime" function, or got LTO'ed with such a definition, we can miscompile; so it's quite important to get this right. Defining runtime functions locally is quite common in embedded applications. llvm-svn: 176286
* Call __cxa_begin_catch with the current exception beforeJohn McCall2013-02-121-3/+69
| | | | | | calling std::terminate(). rdar://11904428 llvm-svn: 174940
* Change some CGF parameters to CGMs.John McCall2013-02-121-49/+49
| | | | llvm-svn: 174939
* Re-sort all the headers. Lots of regressions have crept in here.Chandler Carruth2013-01-191-1/+1
| | | | | | | | | | Manually fix the order of UnwrappedLineParser.cpp as that one didn't have its associated header as the first header. This also uncovered a subtle inclusion order dependency as CLog.h didn't include LLVM.h to pick up using declarations it relied upon. llvm-svn: 172892
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Enable the new (more C++-like, less broken) EH model when targeting the GNUstepDavid Chisnall2013-01-111-0/+6
| | | | | | Objective-C runtime 1.7 or greater. llvm-svn: 172207
* objectiveC++: When throwing c++ exception of Fariborz Jahanian2013-01-101-0/+12
| | | | | | | an objectiveC object, use objc_exception_throw to raise the exception. // rdar://12605907 llvm-svn: 172091
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-1/+1
| | | | | | | | reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
* The ObjC++-to-C++ personality trick is only necessary on NeXT runtimes,John McCall2012-11-141-4/+5
| | | | | | | which is not coincidentally the only place it works, either (because of how it tests for EH_TYPE symbols). llvm-svn: 167935
* Fix the Objective-C exception rethrow from cleanups (GNU runtimes). Note thatDavid Chisnall2012-11-071-4/+4
| | | | | | | a bug in the inliner still causes the wrong thing to happen at -O2 and above (PR14116). llvm-svn: 167534
* Add the ObjFW runtime. Patch by Jonathan Schleifer!John McCall2012-07-121-0/+2
| | | | llvm-svn: 160102
* Rename the GCC Objective-C runtime to gcc from gnu-fragile and the GNUstepDavid Chisnall2012-07-031-5/+6
| | | | | | runtime to gnustep from gnu. Fix EH for the GCC runtime. llvm-svn: 159684
* Restructure how the driver communicates information about theJohn McCall2012-06-201-14/+23
| | | | | | | | | | | | | | | | | | | | | | | | target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. llvm-svn: 158793
* It turns out that implementing the rethrow-on-fallthroughJohn McCall2012-06-151-18/+20
| | | | | | | | | | semantics of a ctor/dtor function-try-block catch handler by pushing a normal cleanup is not just overkill but actually actively wrong when the handler contains an explicit return (which is only legal in a dtor). Just emit the rethrow as ordinary code at the fallthrough point. Fixes PR13102. llvm-svn: 158488
* Revert r153613 as it's causing large compile-time regressions on the nightly ↵Chad Rosier2012-03-291-5/+4
| | | | | | testers. llvm-svn: 153660
* When we can't prove that the target of an aggregate copy isJohn McCall2012-03-281-4/+5
| | | | | | | a complete object, the memcpy needs to use the data size of the structure instead of its sizeof() value. Fixes PR12204. llvm-svn: 153613
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-13/+13
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Remove dead code.Ahmed Charles2012-02-191-6/+2
| | | | llvm-svn: 150919
* CodeGen: Move EHPersonality from CGException.h into the cpp file, it has no ↵Benjamin Kramer2012-02-081-23/+43
| | | | | | | | other users. While at it make it value-initializable to get rid of static ctors. llvm-svn: 150070
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-3/+1
| | | | | | CodeGenModule. llvm-svn: 149943
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-2/+1
| | | | llvm-svn: 148577
* When initializing a catch variable in ARC, be sure to emit retainsJohn McCall2012-01-171-2/+17
| | | | | | | | | or whatever else is required for the initialization instead of assuming it can be done with a simple store. Fixes PR11732. llvm-svn: 148325
* Don't get the exception obj from the slot more than once.Bill Wendling2011-12-081-4/+3
| | | | llvm-svn: 146202
* Switch the Alignment argument on AggValueSlot over to CharUnits, per John's ↵Eli Friedman2011-12-031-1/+1
| | | | | | review comment. llvm-svn: 145741
* Track alignment in AggValueSlot. No functional change in this patch, but ↵Eli Friedman2011-12-031-4/+6
| | | | | | I'll be introducing uses of the specified alignment soon. llvm-svn: 145736
* Whenever explicitly activating or deactivating a cleanup, weJohn McCall2011-11-101-1/+1
| | | | | | | | | | need to provide a 'dominating IP' which is guaranteed to dominate the (de)activation point but which cannot be avoided along any execution path from the (de)activation point to the push-point of the cleanup. Using the entry block is bad mojo. llvm-svn: 144276
* Don't remove filters.Bill Wendling2011-09-221-7/+3
| | | | | | | | | It's not valid to remove filters from landingpad instructions, even if we catch the type. The metadata won't be set up correctly. Testcase is projects/llvm-test/SingleSource/UnitTests/EH/filter-2.cpp. llvm-svn: 140335
* Don't assume that the clause is a GlobalVariable. It could be a constant.Bill Wendling2011-09-201-13/+11
| | | | llvm-svn: 140123
* The eh.selector intrinsic isn't used anymore. Replace the check here with aBill Wendling2011-09-191-16/+30
| | | | | | | | | check for the landingpad instruction instead. This check looks at each of the clauses in the landingpad instruction. If it's a catch clause, it compares the name directly with the global. If it's a filter clause, it has to look through each value in the filer to see if any have the prefix. llvm-svn: 140075
* Throw the switch to convert clang to the new exception handling model!Bill Wendling2011-09-191-59/+54
| | | | | | | | | | | | | This model uses the 'landingpad' instruction, which is pinned to the top of the landing pad. (A landing pad is defined as the destination of the unwind branch of an invoke instruction.) All of the information needed to generate the correct exception handling metadata during code generation is encoded into the landingpad instruction. The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic call. It's lowered in much the same way as the intrinsic is. llvm-svn: 140049
* Refactor the load of the exception pointer and the exception selector from theirBill Wendling2011-09-151-13/+18
| | | | | | storage slot into helper functions. llvm-svn: 139826
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-1/+1
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Remove unused variables noticed by GCC.Benjamin Kramer2011-08-271-1/+0
| | | | llvm-svn: 138707
* The allocated exception slot does not alias anything; should fix self-host.John McCall2011-08-261-1/+2
| | | | llvm-svn: 138615
* Use stronger typing for the flags on AggValueSlot and requireJohn McCall2011-08-251-2/+3
| | | | | | | creators to tell us whether something needs GC barriers. No functionality change. llvm-svn: 138581
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-111-211/+268
| | | | | | | | | | | | | | | hierarchy of delegation, and that EH selector values are meaningful function-wide (good thing, too, or inlining wouldn't work). 2,3d 1a hierarchy of delegation and that EH selector values have the same meaning everywhere in the function instead of being meaningful only in the context of a specific selector. This removes the need for routing edges through EH cleanups, since a cleanup simply always branches to its enclosing scope. llvm-svn: 137293
* Remove some unnecessary single element array temporaries.Jay Foad2011-07-291-16/+8
| | | | llvm-svn: 136461
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-6/+6
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-19/+19
| | | | llvm-svn: 135370
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-8/+7
| | | | llvm-svn: 135265
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-121-5/+5
| | | | | | of flags. No functionality change. llvm-svn: 134997
* Do full-expression cleanups in a much more sensible way that still letsJohn McCall2011-07-121-3/+4
| | | | | | people write useful cleanup classes. llvm-svn: 134942
* Use cached types; no functionality change.John McCall2011-07-101-35/+18
| | | | llvm-svn: 134880
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-16/+24
| | | | llvm-svn: 134831
* Call objc_terminate() instead of abort() when a cleanup throws anJohn McCall2011-07-061-2/+11
| | | | | | | exception in Objective-C; in Objective-C++ we still use std::terminate(). This is only available in very recent runtimes. llvm-svn: 134456
* Support for catching objc pointer objects in c++ catch-statementFariborz Jahanian2011-06-231-1/+1
| | | | | | in fragile abi mode and some other cleanups. // rdar://8940528 llvm-svn: 133747
* Alloa catching Objective-C id's being thrown with C++ throwFariborz Jahanian2011-06-221-1/+1
| | | | | | in Darwin's fragile abi mode. // rdar://8940528 llvm-svn: 133639
OpenPOWER on IntegriCloud