summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-abi-throw.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [MS] Don't reference deleted copy ctors from catchable typesReid Kleckner2019-10-301-0/+27
| | | | | | | | | | | When throwing objects with deleted copy constructors, the copy ctor field of the catchable type should remain null and the mangle name changes. This already worked in simple cases, but in cases involving non-trivial subobjects, sometimes LookupCopyingConstructor could return a non-null but deleted constructor decl. Skip those and don't reference them. Fixes PR43680
* Revert "[CodeGenCXX] Treat 'this' as noalias in constructors"Sean Fertile2018-10-151-1/+1
| | | | | | | This reverts commit https://reviews.llvm.org/rL344150 which causes MachineOutliner related failures on the ppc64le multistage buildbot. llvm-svn: 344526
* [CodeGenCXX] Treat 'this' as noalias in constructorsAnton Bikineev2018-10-101-1/+1
| | | | | | | | | This is currently a clang extension and a resolution of the defect report in the C++ Standard. Differential Revision: https://reviews.llvm.org/D46441 llvm-svn: 344150
* [MS] Mangle a hash of the main file path into anonymous namespacesReid Kleckner2018-08-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is needed to avoid conflicts in mangled names for codeview types in anonymous namespaces. In CodeView, types refer to each other typically through forward declarations, which contain mangled names. These names have to be unique, otherwise the debugger will look up the mangled name and find the wrong definition. Furthermore, ThinLTO will deduplicate the types, and debug info verification can fail when the types have the wrong sizes. This is PR38608. Fixes PR38609. Reviewers: majnemer, inglorion, hans Subscribers: mehdi_amini, aprantl, JDevlieghere, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50877 llvm-svn: 340079
* [MS] Make sure __GetExceptionInfo works on types with no linkageReid Kleckner2018-06-201-0/+10
| | | | | | Fixes PR36327 llvm-svn: 335175
* [MS] Don't escape MS C++ names with \01Reid Kleckner2018-03-161-25/+25
| | | | | | | It is not needed after LLVM r327734. Now it will be easier to copy-paste IR symbol names from Clang. llvm-svn: 327738
* [MS ABI] Correctly mangling vbase destructorsDavid Majnemer2017-02-141-1/+1
| | | | | | | | | | | | | They are a little bit of a special case in the mangling. They are always mangled without taking into account their virtual-ness of the destructor. They are also mangled to return void, unlike the actual destructor. This fixes PR31931. Differential Revision: https://reviews.llvm.org/D29912 llvm-svn: 295010
* [MS ABI] Support throwing/catching __unaligned typesDavid Majnemer2016-07-121-0/+8
| | | | | | | | We need to mark the appropriate bits in ThrowInfo and HandlerType so that the personality routine can correctly handle qualification conversions. llvm-svn: 275154
* [MS Compat] Don't crash if __GetExceptionInfo is in global scopeDavid Majnemer2016-01-261-2/+9
| | | | | | | | | | | __GetExceptionInfo triggered Sema::LazilyCreateBuiltin which tries to create a non-templated function decl. This is unnecessary and ill-advised, there is no need for us to create a declaration for such a builtin. This fixes PR26298. llvm-svn: 258762
* [MS ABI] A pointer-to-function cannot be caught as a pointer-to-voidDavid Majnemer2015-04-041-0/+9
| | | | | | | | Don't assume that all pointers are convertible to void pointer. Instead correctly respect [conv.ptr]p2; only allow pointer types with an object pointee type to be caught as pointer-to-void. llvm-svn: 234090
* MS ABI: Implement __GetExceptionInfo for std::make_exception_ptrDavid Majnemer2015-03-131-1/+13
| | | | | | | | | std::make_exception_ptr calls std::__GetExceptionInfo in order to figure out how to properly copy the exception object. Differential Revision: http://reviews.llvm.org/D8280 llvm-svn: 232188
* MS ABI: Allow a nullptr_t exception to be caught by void * catch handlerDavid Majnemer2015-03-121-0/+5
| | | | | | | | | A nullptr exception object can be caught by any pointer type catch handler. However, it is not possible to express this in the exception info for the MS ABI. As a middle ground, allow such exception objects to be caught with pointer-to-void catch handlers. llvm-svn: 232069
* Don't overconstrain a FileCheck patternDavid Majnemer2015-03-111-1/+1
| | | | llvm-svn: 231971
* MS ABI: Implement copy-ctor closures, finish implementing throwDavid Majnemer2015-03-111-1/+53
| | | | | | | | | | | | | | | This adds support for copy-constructor closures. These are generated when the C++ runtime has to call a copy-constructor with a particular calling convention or with default arguments substituted in to the call. Because the runtime has no mechanism to call the function with a different calling convention or know-how to evaluate the default arguments at run-time, we create a thunk which will do all the appropriate work and package it in a way the runtime can use. Differential Revision: http://reviews.llvm.org/D8225 llvm-svn: 231952
* MS ABI: Mangle the location of the catchable type into it's nameDavid Majnemer2015-03-101-4/+4
| | | | | | | | Because the catchable type has a reference to its name, mangle the location to ensure that two catchable types with different locations are distinct. llvm-svn: 231819
* MS ABI: Stick throw-related data into the .xdata sectionDavid Majnemer2015-03-061-7/+7
| | | | | | | This is a little nicer as it keeps the contents of .xdata away from normal .rdata; we expect .xdata to be far colder than .rdata. llvm-svn: 231534
* MS ABI: Correctly generate throw-info for pointer to const qual typesDavid Majnemer2015-03-061-1/+7
| | | | | | | We didn't create type info based on the unqualified pointee type, causing RTTI mismatches. llvm-svn: 231533
* MS ABI: Insert copy-constructors into the CatchableTypeDavid Majnemer2015-03-061-3/+3
| | | | | | | | | | | | | | | | Find all unambiguous public classes of the exception object's class type and reference all of their copy constructors. Yes, this is not conforming but it is necessary in order to implement their ABI. This is because the copy constructor is actually referenced by the metadata describing which catch handlers are eligible to handle the exception object. N.B. This doesn't yet handle the copy constructor closure case yet, that work is ongoing. Differential Revision: http://reviews.llvm.org/D8101 llvm-svn: 231499
* MS ABI: Implement support for throwing a C++ exceptionDavid Majnemer2015-03-051-0/+31
Throwing a C++ exception, under the MS ABI, is implemented using three components: - ThrowInfo structure which contains information like CV qualifiers, what destructor to call and a pointer to the CatchableTypeArray. - In a significant departure from the Itanium ABI, copying by-value occurs in the runtime and not at the catch site. This means we need to enumerate all possible types that this exception could be caught as and encode the necessary information to convert from the exception object's type to the catch handler's type. This includes complicated derived to base conversions and the execution of copy-constructors. N.B. This implementation doesn't support the execution of a copy-constructor from within the runtime for now. Adding support for that functionality is quite difficult due to things like default argument expressions which may evaluate arbitrary code hiding in the copy-constructor's parameters. Differential Revision: http://reviews.llvm.org/D8066 llvm-svn: 231328
OpenPOWER on IntegriCloud