summaryrefslogtreecommitdiff
path: root/llvm/lib/Support/NativeFormatting.cpp
AgeCommit message (Collapse)Author
2024-11-20[Support] Remove unused includes (NFC) (#116752)Kazu Hirata
Identified with misc-include-cleaner.
2023-01-26[llvm] Do not zero out write_unsigned_impl internal bufferserge-sans-paille
Current implementation uselessly calls memset on its internal buffer while it does not read the non overwritten part. Differential Revision: https://reviews.llvm.org/D142464
2023-01-23[Support] revert accidentally removed "std::" specifiersSanjay Patel
This snuck into e76c95fb40b1 but wasn't intended. Note: for some reason, these prefixes are causing build failures on a macOS XCode project of LLVM.
2023-01-23[InstCombine] add tests for signbit compares; NFCSanjay Patel
2023-01-21[llvm] Use llvm::bit_width (NFC)Kazu Hirata
2022-12-16[Support] llvm::Optional => std::optionalFangrui Song
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-08Reland "[llvm][NFC] Use c++17 style variable type traits"Nathan James
This reverts commit 632a389f96355cbe7ed8fa7b8d2ed6267c92457c. This relands commit 1834a310d060d55748ca38d4ae0482864c2047d8. Differential Revision: https://reviews.llvm.org/D137493
2022-11-08Revert "[llvm][NFC] Use c++17 style variable type traits"Nathan James
This reverts commit 1834a310d060d55748ca38d4ae0482864c2047d8.
2022-11-08[llvm][NFC] Use c++17 style variable type traitsNathan James
This was done as a test for D137302 and it makes sense to push these changes Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D137493
2022-09-28[iwyu] Move <cmath> out of llvm/Support/MathExtras.hserge-sans-paille
Interestingly, MathExtras.h doesn't use <cmath> declaration, so move it out of that header and include it when needed. No functional change intended, but there's no longer a transitive include fromMathExtras.h to cmath.
2022-09-08[llvm] Use std::size instead of llvm::array_lengthofJoe Loser
LLVM contains a helpful function for getting the size of a C-style array: `llvm::array_lengthof`. This is useful prior to C++17, but not as helpful for C++17 or later: `std::size` already has support for C-style arrays. Change call sites to use `std::size` instead. Differential Revision: https://reviews.llvm.org/D133429
2022-07-26Revert "[Support] Workaround compiler bug in MSVC"Tom Stellard
This reverts commit ec8f4fd68cd401a0ba41bb160d6acce670486fab. This caused a failure in the mlir-windows bot.
2022-07-26[Support] Workaround compiler bug in MSVCTom Stellard
https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317 This was causing unittest failures on Windows for the GitHub actions based CI we use in the release branches. Failed Tests (2): LLVM-Unit :: Support/./SupportTests.exe/FormatVariadicTest.BigTest LLVM-Unit :: Support/./SupportTests.exe/NativeFormatTest.BoundaryTests Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D129822
2022-07-01[Build][NFC] Fixes for building on Windows with libc++Andrew Ng
Differential Revision: https://reviews.llvm.org/D128514
2022-06-18[llvm] Use value_or instead of getValueOr (NFC)Kazu Hirata
2022-02-06[Support] Use llvm_unreachable instead of LLVM_BUILTIN_UNREACHABLE internal ↵Simon Pilgrim
define
2022-01-26Revert "Rename llvm::array_lengthof into llvm::size to match std::size from ↵Benjamin Kramer
C++17" This reverts commit ef8206320769ad31422a803a0d6de6077fd231d2. - It conflicts with the existing llvm::size in STLExtras, which will now never be called. - Calling it without llvm:: breaks C++17 compat
2022-01-26Rename llvm::array_lengthof into llvm::size to match std::size from C++17serge-sans-paille
As a conquence move llvm::array_lengthof from STLExtras.h to STLForwardCompat.h (which is included by STLExtras.h so no build breakage expected).
2022-01-21[llvm] Cleanup header dependencies in ADT and Supportserge-sans-paille
The cleanup was manual, but assisted by "include-what-you-use". It consists in 1. Removing unused forward declaration. No impact expected. 2. Removing unused headers in .cpp files. No impact expected. 3. Removing unused headers in .h files. This removes implicit dependencies and is generally considered a good thing, but this may break downstream builds. I've updated llvm, clang, lld, lldb and mlir deps, and included a list of the modification in the second part of the commit. 4. Replacing header inclusion by forward declaration. This has the same impact as 3. Notable changes: - llvm/Support/TargetParser.h no longer includes llvm/Support/AArch64TargetParser.h nor llvm/Support/ARMTargetParser.h - llvm/Support/TypeSize.h no longer includes llvm/Support/WithColor.h - llvm/Support/YAMLTraits.h no longer includes llvm/Support/Regex.h - llvm/ADT/SmallVector.h no longer includes llvm/Support/MemAlloc.h nor llvm/Support/ErrorHandling.h You may need to add some of these headers in your compilation units, if needs be. As an hint to the impact of the cleanup, running clang++ -E -Iinclude -I../llvm/include ../llvm/lib/Support/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l before: 8000919 lines after: 7917500 lines Reduced dependencies also helps incremental rebuilds and is more ccache friendly, something not shown by the above metric :-) Discourse thread on the topic: https://llvm.discourse.group/t/include-what-you-use-include-cleanup/5831
2021-12-14Print the sign of negative infinityLogan Chien
Differential Revision: https://reviews.llvm.org/D111917
2021-06-05NativeFormatting.cpp - add missing implicit MathExtras.h header dependency. ↵Simon Pilgrim
NFCI. Noticed while investigating if we can remove an unnecessary MathExtras.h include from SmallVector.h
2020-05-09NativeFormatting.h - reduce raw_ostream.h include to forward declaration. NFC.Simon Pilgrim
2020-02-11Use std::foo_t rather than std::foo in LLVM.Justin Lebar
Summary: C++14 migration. No functional change. Reviewers: bkramer, JDevlieghere, lebedev.ri Subscribers: MatzeB, hiraditya, jkorous, dexonsmith, arphaman, kadircet, lebedev.ri, usaxena95, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D74384
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
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
2018-01-18Support: Add missing #include.Peter Collingbourne
This #include is necessary to provide the definitions of _fpclass and _FPCLASS_NZ when building with libc++. llvm-svn: 322885
2017-01-04Remove dead variable Len.Eric Christopher
Fixes PR31528 llvm-svn: 290995
2016-11-11[Support] Introduce llvm::formatv() function.Zachary Turner
This introduces a new type-safe general purpose formatting library. It provides compile-time type safety, does not require a format specifier (since the type is deduced), and provides mechanisms for extending the format capability to user defined types, and overriding the formatting behavior for existing types. This patch additionally adds documentation for the API to the LLVM programmer's manual. Mailing List Thread: http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html Differential Revision: https://reviews.llvm.org/D25587 llvm-svn: 286682
2016-10-29NativeFormatting.cpp: Fix build for mingw. Where would writePadding() be?NAKAMURA Takumi
llvm-svn: 285509
2016-10-29Resubmit "Add support for advanced number formatting."Zachary Turner
This resubmits r284436 and r284437, which were reverted in r284462 as they were breaking the AArch64 buildbot. The breakage on AArch64 turned out to be a miscompile which is still not fixed, but is actively tracked at llvm.org/pr30748. This resubmission re-writes the code in a way so as to make the miscompile not happen. llvm-svn: 285483
2016-10-18Revert "Resubmit "Add support for advanced number formatting.""Renato Golin
This reverts commits 284436 and 284437 because they still break AArch64 bots: Value of: format_number(-10, IntegerStyle::Integer, 1) Actual: "-0" Expected: "-10" llvm-svn: 284462
2016-10-17Rename HexStyle -> HexFormatStyle, and remove a constexpr.Zachary Turner
This should fix the remaining broken builds. llvm-svn: 284437
2016-10-17Resubmit "Add support for advanced number formatting."Zachary Turner
This resubmits commits 284425 and r284428, which were reverted in r284429 due to some infinite recursion caused by an incorrect selection of function overloads. Reproduced the failure on Linux using GCC 4.8.4, and confirmed that with the new patch the tests path on GCC as well as MSVC. So hopefully this fixes everything. llvm-svn: 284436
2016-10-17Revert formatting changes.Zachary Turner
This reverts r288425 and r284428 as they are causing test crashes on some systems. llvm-svn: 284429
2016-10-17Try to fix build after invalid pointer conversion.Zachary Turner
llvm-svn: 284428
2016-10-17[Support] Add support for "advanced" number formatting.Zachary Turner
raw_ostream has not afforded a lot of flexibility in terms of how to format numbers when outputting. Wrap this all up into a set of low level helper functions that can be used to output numbers with arbitrary precision, alignment, format, etc and then update raw_ostream to use these functions. This will be useful for upcoming improvements to llvm's string formatting libraries, but are still useful independently. Differential Revision: https://reviews.llvm.org/D25497 llvm-svn: 284425
2016-10-11Fix build error on LP64 platforms.Rui Ueyama
llvm-svn: 283922
2016-10-11[raw_ostream] Raise some helper functions out of raw_ostream.Zachary Turner
Low level functionality to format numbers were embedded in the implementation of raw_ostream. I have need to use these through an interface other than the overloaded stream operators, so they need to be raised to a level that they can be used from either raw_ostream operators or other code. llvm-svn: 283921