summaryrefslogtreecommitdiff
path: root/llvm/lib/TableGen/SetTheory.cpp
AgeCommit message (Collapse)Author
2025-05-12[NFC][TableGen] Use StringRef::str() instead of casting (#139332)Rahul Joshi
- Also eliminate unneeded std::string() around some literal strings.
2025-04-24[TableGen] Only store direct superclasses in Record (#123072)Jay Foad
In Record only store the direct superclasses instead of all superclasses. getSuperClasses recurses to find all superclasses when necessary. This gives a small reduction in memory usage. On lib/Target/X86/X86.td I measured about 2.0% reduction in total bytes allocated (measured by valgrind) and 1.3% reduction in peak memory usage (measured by /usr/bin/time -v). --------- Co-authored-by: Min-Yih Hsu <min@myhsu.dev>
2025-03-20[llvm] Use *Set::insert_range (NFC) (#132325)Kazu Hirata
DenseSet, SmallPtrSet, SmallSet, SetVector, and StringSet recently gained C++23-style insert_range. This patch replaces: Dest.insert(Src.begin(), Src.end()); with: Dest.insert_range(Src); This patch does not touch custom begin like succ_begin for now.
2024-10-21[NFC][TableGen] Use auto when initializing variables with cast<> (#113171)Rahul Joshi
Use `auto` when initializing a variable with `cast<>`. Remove some unneeded `const_cast` (since all Init pointers are now const).
2024-10-03[NFC][TableGen] Change `RecordKeeper::getDef()` to return const pointer ↵Rahul Joshi
(#110992) This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-08-22[NFC][SetTheory] Refactor to use const pointers and range loops (#105544)Rahul Joshi
- Refactor SetTheory code to use const pointers when possible. - Use auto for variables initialized using dyn_cast<>. - Use range based for loops and early continue.
2024-07-03[llvm] Avoid 'raw_string_ostream::str' (NFC)Youngsuk Kim
Since `raw_string_ostream` doesn't own the string buffer, it is desirable (in terms of memory safety) for users to directly reference the string buffer rather than use `raw_string_ostream::str()`. Work towards TODO comment to remove `raw_string_ostream::str()`.
2022-11-16Revert "[NFC] Make format() more amenable to format attributes"Muhammad Omair Javaid
This reverts commit cf239c2f1777eb94a4801a086acf1332a7d3cccf. It has broken tools/llvm-dwarfdump/X86/simplified-template-names.s on following buildbot: https://lab.llvm.org/buildbot/#/builders/178/builds/3148
2022-11-02[NFC] Make format() more amenable to format attributesFélix Cloutier
This change modifies the implementation of the format() function so that vendor forks committed to building with compilers that support __attribute__((format)) on non-variadic functions can check the format() function with it. rdar://84571523
2022-10-26Revert "[NFC] Make format() more amenable to format attributes"Félix Cloutier
This reverts commit fb1e90ef07fec0d64a05c0b6d41117a5ea3e8344.
2022-10-26[NFC] Make format() more amenable to format attributesFélix Cloutier
This change modifies the implementation of the format() function so that vendor forks committed to building with compilers that support __attribute__((format)) on non-variadic functions can check the format() function with it. Reviewed By: ahatanak Differential Revision: https://reviews.llvm.org/D132413 rdar://84571523
2022-01-28Cleanup include dependencies for LLVMTableGenserge-sans-paille
Based on the output of include-what-you-use. No other library seems affected by the new forward declaration. $ clang++ -E -Iinclude -I../llvm/include ../llvm/lib/TableGen/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l before: 795231 after: 750654 Related Discourse thread: https://llvm.discourse.group/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D118374
2021-03-06[TableGen] Use range-based for loops (NFC)Kazu Hirata
2020-01-28Make llvm::StringRef to std::string conversions explicit.Benjamin Kramer
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here. This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies. This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2019-08-15[llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere
Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
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
2017-06-16[BinaryFormat, Option, TableGen] Fix some Clang-tidy modernize-use-using and ↵Eugene Zelenko
Include What You Use warnings; other minor fixes (NFC). llvm-svn: 305537
2016-01-18[TableGen] Merge the SuperClass Record and SMRange vector into a single ↵Craig Topper
vector. This removes the state needed to manage the extra vector thus reducing the size of the Record class. NFC llvm-svn: 258065
2015-07-27[TableGen] Emit the correct error message.Davide Italiano
llvm-svn: 243284
2015-07-06[TableGen] Change a couple methods to return an ArrayRef instead of a const ↵Craig Topper
std::vector reference. NFC llvm-svn: 241430
2015-05-26[TableGen] Include header for each cpp file first. NFCCraig Topper
llvm-svn: 238180
2015-04-24[TableGen] Don't leak Expanders and Operators in SetTheory.Craig Topper
llvm-svn: 235697
2014-06-26Revert "Introduce a string_ostream string builder facilty"Alp Toker
Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
2014-06-26Introduce a string_ostream string builder faciltyAlp Toker
string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
2014-06-17Move SetTheory from utils/TableGen into lib/TableGen so Clang can use it.James Molloy
llvm-svn: 211100