summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
Commit message (Collapse)AuthorAgeFilesLines
* [demangler] Support for block literals.Erik Pilkington2019-01-171-0/+6
| | | | llvm-svn: 351482
* [demangler] Ignore leading underscores if presentErik Pilkington2019-01-171-2/+2
| | | | | | | On MacOS, symbols start with a leading underscore, so just parse and ignore it if present. llvm-svn: 351481
* NFC: Make the copies of the demangler byte-for-byte identicalErik Pilkington2019-01-177-36/+147
| | | | | | | | | | | | | | With this patch, the copies of the files ItaniumDemangle.h, StringView.h, and Utility.h are kept byte-for-byte in sync between libcxxabi and llvm. All differences (namespaces, fallthrough, and unreachable macros) are defined in each copies' DemanglerConfig.h. This patch also adds a script to copy changes from libcxxabi (cp-to-llvm.sh), and a README.txt explaining the situation. Differential revision: https://reviews.llvm.org/D53538 llvm-svn: 351474
* [libcxx] Remove bad_array_lengthLouis Dionne2018-11-291-30/+0
| | | | | | | | | | | | | | | | Summary: std::bad_array_length was added by n3467, but this never made it into C++. This commit removes the definition of std::bad_array_length from the headers AND from the shared library. See the comments in the ABI changelog for details about the ABI implications of this change. Reviewers: mclow.lists, dexonsmith, howard.hinnant, EricWF Subscribers: christof, jkorous, libcxx-commits Differential Revision: https://reviews.llvm.org/D54804 llvm-svn: 347903
* [Demangle] remove itaniumFindTypesInMangledNamePavel Labath2018-11-271-6/+0
| | | | | | | | | | | | | | | | Summary: This (very specialized) function was added to enable an LLDB use case. Now that a more generic interface (overriding of parser functions - D52992) is available, and LLDB has been converted to use that (D54074), the function is unused and can be removed. Reviewers: erik.pilkington, sgraenitz, rsmith Subscribers: mgorny, hiraditya, christof, libcxx-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D54893 llvm-svn: 347670
* Port LLVM r346606 to libcxxabi.Nico Weber2018-11-112-3/+3
| | | | llvm-svn: 346607
* Use C++11 fallthrough attribute syntax when available and add a breakReid Kleckner2018-11-011-0/+1
| | | | | | | | | | | | | | | | | | | Summary: This silences the two -Wimplicit-fallthrough warnings clang finds in ItaniumDemangle.h in libc++abi. Clang does not have a GNU attribute spelling for this attribute, so this is necessary. I will commit the same change to the LLVM demangler soon. Reviewers: EricWF, ldionne Subscribers: christof, erik.pilkington, cfe-commits Differential Revision: https://reviews.llvm.org/D53985 llvm-svn: 345870
* [libc++abi] Provide __cxa_thread_atexit on FuchsiaPetr Hosek2018-10-291-1/+1
| | | | | | | | Fuchsia already supports this interface. Differential Revision: https://reviews.llvm.org/D53801 llvm-svn: 345534
* cxa_demangle: make demangler's parsing functions overridablePavel Labath2018-10-162-303/+363
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This uses CRTP (for performance reasons) to allow a user the override demangler functions to implement custom parsing logic. The motivation for this is LLDB, which needs to occasionaly modify the mangled names. One such instance is already implemented via the TypeCallback member, but this is very specific functionality which does not help with any other use case. Currently we have a use case for modifying the constructor flavours, which would require adding another callback. This approach does not scale. With CRTP, the user (LLDB) can override any function it needs without any special support from the demangler library. After LLDB is ported to use this instead of the TypeCallback mechanism, the callback can be removed. More context can be found in D50599. Reviewers: erik.pilkington, rsmith Subscribers: christof, ldionne, llvm-commits, libcxx-commits Differential Revision: https://reviews.llvm.org/D52992 llvm-svn: 344607
* NFC: Fix a -Wsign-conversion warningErik Pilkington2018-10-151-5/+11
| | | | llvm-svn: 344564
* Override libcxxabi's .clang-format in the demangle directoryErik Pilkington2018-10-111-0/+2
| | | | | | This directory uses LLVM style. llvm-svn: 344316
* Use C++03 friendly version of alignofEric Fiselier2018-10-111-1/+1
| | | | llvm-svn: 344215
* Update libc++abi's detection of aligned allocation after r344207.Eric Fiselier2018-10-112-4/+4
| | | | llvm-svn: 344208
* [libcxxabi] Allow building with sanitizers enabledLouis Dionne2018-10-101-0/+25
| | | | | | | | | | | | | | | Summary: I copied the sanitizer-related logic in libcxx/lib/CMakeLists.txt. In the future, it would be great to avoid duplicating this logic in the compiler, libc++ and libc++abi. Reviewers: EricWF Subscribers: mgorny, christof, dexonsmith, libcxx-commits, davide Differential Revision: https://reviews.llvm.org/D53028 llvm-svn: 344191
* Blind attempt to fix linker errors when building libc++abit w/o exceptions.Marshall Clow2018-10-101-0/+5
| | | | llvm-svn: 344156
* Make libc++abi work better with gcc's ARM unwind library. Reviewed as ↵Marshall Clow2018-10-105-34/+42
| | | | | | https://reviews.llvm.org/D42242 llvm-svn: 344152
* Port llvm r342166 to libcxxabi demanglerPavel Labath2018-10-101-19/+16
| | | | | | | | | | | | | | | | | | | | Summary: This was committed back in september (D51463), but it seems it never made it into the libcxxabi copy. The original commit message was: The hash computed for an ArrayType was different when first constructed versus when later profiled due to the constructor default argument, and we were not tracking constructor / destructor variant as part of the mangled name AST, leading to incorrect equivalences. Reviewers: erik.pilkington, rsmith, EricWF Subscribers: christof, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D53063 llvm-svn: 344121
* [NFC][unwind] Improve error message when a type has more than one RTTIsLouis Dionne2018-10-091-2/+3
| | | | | | | | | | The "dynamic_cast error 2" error can apparently happen when the same type (with RTTI) is defined in more than one translation unit, and those translation units are linked together. This is technically an ODR violation, but making the error message more obvious is still helpful. llvm-svn: 344052
* Fix incorrectly aligned exceptions in 32 bit builds.Eric Fiselier2018-09-221-0/+3
| | | | | | | | | | | | | | | | | This patch fixes a bug where exceptions in 32 bit builds would be incorrectly aligned because malloc only provides 8 byte aligned memory where 16 byte alignment is needed. This patch makes libc++abi correctly use posix_memalign when it's available. This requires defining _LIBCPP_BUILDING_LIBRARY so that libc++ only defines _LIBCPP_HAS_NO_ALIGNED_ALLOCATION when libc doesn't support it and not when aligned new/delete are disable for other reasons. This bug somehow made it into the 7.0 release, making it a regression. Therefore this patch should be included in the next dot release. llvm-svn: 342815
* [libc++abi] is_strcmp parameter to is_equal is unused for WIN32Pirama Arumuga Nainar2018-09-211-0/+1
| | | | | | | | | | | | Summary: Mark it as unused to avoid -Wunused-parameter. Reviewers: EricWF, srhines, mstorsjo Subscribers: christof, ldionne, libcxx-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D52368 llvm-svn: 342764
* Merge Demangle change in r342330 to libcxxabi.Nico Weber2018-09-152-31/+15
| | | | | | Differential Revision: https://reviews.llvm.org/D52104 llvm-svn: 342331
* Port my recent changes from LLVM copy of the demangler:Richard Smith2018-08-241-24/+74
| | | | | | | | | | | r340663 - Allow Allocator::make to make a node of a different type than that requested. r340664 - Add documentation comment to ForwardTemplateReference. r340665 - Fix ExpandedSpecialSubstitution demangling for Sa and Sb. r340670 - Allow demangler's node allocator to fail, and bail out of the entire demangling process when it does. llvm-svn: 340671
* Port LLVM r340203 (and r340205) to libcxxabi.Richard Smith2018-08-202-4835/+5273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move Itanium demangler implementation into a header file and add visitation support. Summary: This transforms the Itanium demangler into a generic reusable library that can be used to build, traverse, and transform Itanium mangled name trees. This is in preparation for adding a canonicalizing demangler, which cannot live in the Demangle library for layering reasons. In order to keep the diffs simpler, this patch moves more code to the new header than is strictly necessary: in particular, all of the printLeft / printRight implementations can be moved to the implementation file. (And indeed we could make them non-virtual now if we wished, and remove the vptr from Node.) All nodes are now included in the Kind enumeration, rather than omitting some of the Expr nodes, and the three different floating-point literal node types now have distinct Kind values. As a proof of concept for the visitation / matching mechanism, this patch implements a Node dumping facility on top of it, replacing the prior mechanism that produced the pretty-printed output rather than a tree dump. Sample dump output: FunctionEncoding( NameType("int"), NameWithTemplateArgs( NestedName( NameWithTemplateArgs( NameType("A"), TemplateArgs( {NameType("B")})), NameType("f")), TemplateArgs( {NameType("int")})), {}, <null>, QualConst, FunctionRefQual::FrefQualLValue) As a next step, it would make sense to move the LLVM high-level interface to the demangler (the itaniumDemangler function and ItaniumPartialDemangler class) into the Support library, and implement them in terms of the Demangle library. This would allow the libc++abi demangler implementation to be an identical copy of the llvm Demangle library, and would allow the LLVM implementation to reuse LLVM components such as llvm::BumpPtrAllocator, but we'll need to decide how to coordinate that with the MS ABI demangler, so I'm not doing that in this patch. No functionality change intended other than the behavior of dump(). Reviewers: erik.pilkington, zturner, chandlerc, dlj Subscribers: aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D50930 llvm-svn: 340207
* Factor Node creation out of the demangler. No functionality change intended.Richard Smith2018-08-161-72/+94
| | | | | | (This is a port of llvm r339944 to libcxxabi.) llvm-svn: 339952
* [itanium demangler] Add llvm::itaniumFindTypesInMangledName()Erik Pilkington2018-08-131-0/+6
| | | | | | | | | | | | This function calls a callback whenever a <type> is parsed. This is necessary to implement FindAlternateFunctionManglings in LLDB, which uses a similar hack in FastDemangle. Once that function has been updated to use this version, FastDemangle can finally be removed. Differential revision: https://reviews.llvm.org/D50586 llvm-svn: 339580
* Add missing _LIBCXXABI_FUNC_VIS to __gxx_personality_seh0Martin Storsjo2018-08-111-1/+1
| | | | | | This was missed in SVN r337754. llvm-svn: 339503
* [itanium demangler] Support dot suffixes on block invocation functionsErik Pilkington2018-08-021-0/+2
| | | | | | rdar://32378759 llvm-svn: 338747
* [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since ↵Louis Dionne2018-08-012-2/+0
| | | | | | | | | | | | | | _LIBCPP_BUILDING_LIBRARY Summary: As suggested by Marshall in https://reviews.llvm.org/D49914 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50008 llvm-svn: 338475
* [demangler] Fix an oss-fuzz bug from r338138Erik Pilkington2018-07-281-0/+8
| | | | | | | | Stack overflow on invalid. While collapsing references, we were skipping over a cycle check in ForwardTemplateReference leading to a stack overflow. This commit fixes the problem by duplicating the cycle check in ReferenceType. llvm-svn: 338190
* [demangler] Support for reference collapsingErik Pilkington2018-07-271-45/+56
| | | | | | llvm.org/PR38323 llvm-svn: 338138
* [CMake] Option to control whether shared/static library is installedPetr Hosek2018-07-241-6/+10
| | | | | | | | | | | | | Currently it's only possible to control whether shared or static library build of libc++, libc++abi and libunwind is enabled or disabled and whether to install everything we've built or not. However, it'd be useful to have more fine grained control, e.g. when static libraries are merged together into libc++.a we don't need to install libc++abi.a and libunwind.a. This change adds this option. Differential Revision: https://reviews.llvm.org/D49573 llvm-svn: 337867
* Reland "[CMake] Support statically linking dependencies only to shared or ↵Petr Hosek2018-07-241-8/+15
| | | | | | | | static library" This is a reland of commit r337668. llvm-svn: 337814
* [demangler] call terminate() if allocation failedErik Pilkington2018-07-232-4/+17
| | | | | | | | | | We really should set *status to memory_alloc_failure, but we need to refactor the demangler a bit to properly propagate the failure up the stack. Until then, its better to explicitly terminate then rely on a null dereference crash. rdar://31240372 llvm-svn: 337759
* Implement a GCC compatible SEH unwinding personality, __gxx_personality_seh0Martin Storsjo2018-07-231-0/+25
| | | | | | | | | This allows handling SEH based exceptions, with unwind functions provided by libgcc. Differential Revision: https://reviews.llvm.org/D49638 llvm-svn: 337754
* Revert "[CMake] Support statically linking dependencies only to shared or ↵Petr Hosek2018-07-231-17/+9
| | | | | | | | static library" This reverts commit r337668: broke the cxxabi build when using Make. llvm-svn: 337670
* [CMake] Support statically linking dependencies only to shared or static libraryPetr Hosek2018-07-231-9/+17
| | | | | | | | | | | | | | Currently it's possible to select whether to statically link unwinder or the C++ ABI library, but this option applies to both the shared and static library. However, in some scenarios it may be desirable to only statically link unwinder and C++ ABI library into static C++ library since for shared C++ library we can rely on dynamic linking and linker scripts. This change enables selectively enabling or disabling statically linking only to shared or static library. Differential Revision: https://reviews.llvm.org/D49502 llvm-svn: 337668
* Merge changes to ItaniumDemangle over to libcxxabi.Zachary Turner2018-07-204-155/+343
| | | | | | | | | | | ItaniumDemangle had a small NFC refactor to make some of its code reusable by the newly added Microsoft demangler. To keep the libcxxabi demangler as close as possible to the master copy this refactor is being merged over. Differential Revision: https://reviews.llvm.org/D49575 llvm-svn: 337582
* [demangler] Avoid alignment warningSerge Pavlov2018-07-051-1/+1
| | | | | | | | | | | | | | The alignment specified by a constant for the field `BumpPointerAllocator::InitialBuffer` exceeded the alignment guaranteed by `malloc` and `new` on Windows. This change set the alignment value to that of `long double`, which is defined by the used platform. It fixes https://bugs.llvm.org/show_bug.cgi?id=37944. Differential Revision: https://reviews.llvm.org/D48889 llvm-svn: 336312
* Revert r336159, r336157. Some bots failed on qualified std::max_align_t, and ↵Erik Pilkington2018-07-031-2/+1
| | | | | | | | | | | other on unqualified max_align_t. I'll take another stab at this tomorrow. Any ideas for fixing this would be appreciated! http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/23071/steps/build_Lld/logs/stdio http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/11185/steps/build-stage1-compiler/logs/stdio llvm-svn: 336162
* Some buildbots were choking on std::max_align_t, try using the global alias.Erik Pilkington2018-07-031-1/+1
| | | | llvm-svn: 336159
* [demangler] Fix a MSVC alignment warning.Erik Pilkington2018-07-031-1/+2
| | | | | | This should fix llvm.org/PR37944 llvm-svn: 336157
* private_typeinfo: limit is_dst_type_derived_from_static_type optimizationEric Fiselier2018-05-181-32/+33
| | | | | | | | | | | | | | | | Patch by Ryan Prichard If the destination type does not derive from the static type, we can skip the search_above_dst call, but we still need to run the !does_dst_type_point_to_our_static_type block of code. That block of code will increment info->number_to_dst_ptr to 2, and because dest isn't derived from static, the cast will ultimately fail. Fixes PR33439 Reviewed as https://reviews.llvm.org/D36447 llvm-svn: 332767
* private_typeinfo: propagate static flags in vmi search_above_dst methodEric Fiselier2018-05-181-0/+4
| | | | | | | | | | | | | Patch by Ryan Prichard Propagate the found_our_static_ptr and found_any_static_type flags from __vmi_class_type_info::search_above_dst to its caller. Fixes PR33425 and PR33487 Reviewed as https://reviews.llvm.org/D36446 llvm-svn: 332763
* Move _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS macro to build systemNico Weber2018-04-291-2/+0
| | | | | | | | | | | | | | | _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS is currently used to bring back std::unexpected, which is removed in C++17, but still needed for libc++abi for backward compatibility. This macro used to define in cxa_exception.cpp only, but actually needed for all sources that touches exceptions. So, a build-system-level macro is better fit to define this macro. https://reviews.llvm.org/D46056 Patch from Taiju Tsuiku <tzik@chromium.org>! llvm-svn: 331150
* [libc++abi] Replace __sync_* functions with __libcpp_atomic_* functions.Eli Friedman2018-04-165-35/+199
| | | | | | | | | | | This is basically part 2 of r313694. It's a little unfortunate that I had to copy-paste atomic_support.h, but I don't really see any alternative. The refstring.h changes are the same as the libcxx changes in r313694. llvm-svn: 330162
* [demangler] NFC: Some refactoring to support partial demangling.Erik Pilkington2018-04-121-42/+97
| | | | | | | I'm committing this to libcxxabi too so that the two demanglers remain as simular as possible. llvm-svn: 329950
* [CFI] Disable CFI checks for __cxa_decrement_exception_refcountVlad Tsyrklevich2018-04-091-2/+2
| | | | | | | | | | | | | | | | | Summary: exception_header->exceptionDestructor is a void(*)(void*) function pointer; however, it can point to destructors like std:: exception::~exception that don't match that type signature. Reviewers: pcc, vitalybuka Reviewed By: vitalybuka Subscribers: kcc, christof, cfe-commits Differential Revision: https://reviews.llvm.org/D45455 llvm-svn: 329629
* [demangler] Support for fold expressions.Erik Pilkington2018-04-091-3/+126
| | | | llvm-svn: 329601
* [demangler] Support for <data-member-prefix>.Erik Pilkington2018-04-091-0/+9
| | | | llvm-svn: 329600
* [demangler] Support for partially substituted sizeof....Erik Pilkington2018-04-091-1/+24
| | | | llvm-svn: 329599
OpenPOWER on IntegriCloud