aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/InterfaceStub
AgeCommit message (Collapse)AuthorFilesLines
2025-03-26[llvm-ifs] Handle more e_machine values for --target (#128559)Roland McGrath1-13/+4
This adds ELF::convertTripleArchTypeToEMachine and uses it in llvm-ifs. It handles many more Triple::ArchType values than the old code, though not all since I couldn't quickly discern what all the mappings are.
2024-03-28[Object,ELFType] Rename TargetEndianness to Endianness (#86604)Fangrui Song1-1/+1
`TargetEndianness` is long and unwieldy. "Target" in the name is confusing. Rename it to "Endianness". I cannot find noticeable out-of-tree users of `TargetEndianness`, but keep `TargetEndianness` to make this patch safer. `TargetEndianness` will be removed by a subsequent change.
2024-01-11[llvm-ifs] Treat unknown symbol types as error. (#75872)Haowei2-1/+8
Before this patch, when an unknown symbol type is used in IFS stub, it will be treated as a NO_TYPE and parsed without error. This patch makes llvm-ifs throw an error when this scenario happens.
2023-12-11[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)Kazu Hirata1-1/+1
This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with in C++20. I'm planning to deprecate and eventually remove StringRef::{starts,ends}with.
2023-10-12Use llvm::endianness::{big,little,native} (NFC)Kazu Hirata1-1/+1
Note that llvm::support::endianness has been renamed to llvm::endianness while becoming an enum class as opposed to an enum. This patch replaces support::{big,little,native} with llvm::endianness::{big,little,native}.
2023-04-10[ifs] Print an error when llvm-ifs is supplied with an unknown archHaowei Wu1-1/+6
This patch makes llvm-ifs print an error when the arch string from '--arch' flag or the IFS file 'Arch' field is unknown. Differential Revision: https://reviews.llvm.org/D146672
2023-02-07[NFC][TargetParser] Remove llvm/ADT/Triple.hArchibald Elliott1-1/+1
I also ran `git clang-format` to get the headers in the right order for the new location, which has changed the order of other headers in two files.
2023-01-31[llvm-ifs] Add support for --target=riscvAlex Brachet1-0/+3
2022-12-20[Support] Move TargetParsers to new componentArchibald Elliott1-0/+1
This is a fairly large changeset, but it can be broken into a few pieces: - `llvm/Support/*TargetParser*` are all moved from the LLVM Support component into a new LLVM Component called "TargetParser". This potentially enables using tablegen to maintain this information, as is shown in https://reviews.llvm.org/D137517. This cannot currently be done, as llvm-tblgen relies on LLVM's Support component. - This also moves two files from Support which use and depend on information in the TargetParser: - `llvm/Support/Host.{h,cpp}` which contains functions for inspecting the current Host machine for info about it, primarily to support getting the host triple, but also for `-mcpu=native` support in e.g. Clang. This is fairly tightly intertwined with the information in `X86TargetParser.h`, so keeping them in the same component makes sense. - `llvm/ADT/Triple.h` and `llvm/Support/Triple.cpp`, which contains the target triple parser and representation. This is very intertwined with the Arm target parser, because the arm architecture version appears in canonical triples on arm platforms. - I moved the relevant unittests to their own directory. And so, we end up with a single component that has all the information about the following, which to me seems like a unified component: - Triples that LLVM Knows about - Architecture names and CPUs that LLVM knows about - CPU detection logic for LLVM Given this, I have also moved `RISCVISAInfo.h` into this component, as it seems to me to be part of that same set of functionality. If you get link errors in your components after this patch, you likely need to add TargetParser into LLVM_LINK_COMPONENTS in CMake. Differential Revision: https://reviews.llvm.org/D137838
2022-12-16[CodeGen] std::optional::value => operator*/operator->Fangrui Song1-5/+4
value() has undesired exception checking semantics and calls __throw_bad_optional_access in libc++. Moreover, the API is unavailable without _LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). This fixes LLVMMIRParser, LLVMGlobalISel, LLVMAsmPrinter, LLVMSelectionDAG.
2022-12-16std::optional::value => operator*/operator->Fangrui Song1-10/+9
value() has undesired exception checking semantics and calls __throw_bad_optional_access in libc++. Moreover, the API is unavailable without _LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). This commit fixes LLVMAnalysis and its dependencies.
2022-12-06[YAML] Convert Optional to std::optionalKrzysztof Parzyszek1-4/+6
2022-11-25[InterfaceStub] Use std::optional in ELFObjHandler.cpp (NFC)Kazu Hirata1-3/+4
This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-07-13[llvm] Use value instead of getValue (NFC)Kazu Hirata1-11/+10
2022-06-25Revert "Don't use Optional::hasValue (NFC)"Kazu Hirata1-10/+13
This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
2022-06-25Don't use Optional::hasValue (NFC)Kazu Hirata1-13/+10
2022-06-20[llvm] Don't use Optional::getValue (NFC)Kazu Hirata2-6/+5
2022-06-20[llvm] Don't use Optional::hasValue (NFC)Kazu Hirata1-2/+2
2022-06-18[llvm] Use value_or instead of getValueOr (NFC)Kazu Hirata1-1/+1
2022-06-11Use getValueOr (NFC)Kazu Hirata1-1/+1
2022-05-14[ifs] Add --strip-size flagAlex Brachet2-6/+8
st_size may not be of importance to the abi if you are not using copy relocations. This is helpful when you want to check the abi of a shared object both when instrumented and not because asan will increase the size of objects to include the redzone. Differential revision: https://reviews.llvm.org/D124792
2022-05-14Revert "[ifs] Add --strip-size flag"Alex Brachet2-8/+6
This reverts commit b6b0fd6a940b7006ced344736decccffaa583b8a.
2022-05-14[ifs] Add --strip-size flagAlex Brachet2-6/+8
st_size may not be of importance to the abi if you are not using copy relocations. This is helpful when you want to check the abi of a shared object both when instrumented and not because asan will increase the size of objects to include the redzone. Differential revision: https://reviews.llvm.org/D124792
2022-03-12Cleanup includes: DebugInfo & CodeGenserge-sans-paille2-2/+1
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D121332
2022-02-18[ifs] Add --exclude flagAlex Brachet1-7/+26
Use to remove certain symbols which match the glob pattern. Can be used with --strip-undefined Reviewed By: haowei, mcgrathr Differential Revision: https://reviews.llvm.org/D119962
2022-02-13[ifs] Allow llvm-ifs to generate text stub from elf stubHaowei Wu1-32/+91
ELF stubs generated from llvm-ifs lacks program headers, which prevents llvm-ifs from parsing them properly as program headers are required by llvm's own ELF libraries. This patch adds a few workaround bypass this limitation. Differential Revision: https://reviews.llvm.org/D116769
2022-02-13[ifs] Added missing DT_STRSZ to the .dynamic sectionHaowei Wu1-0/+1
This patch adds DT_STRSZ into the dynamic section, which was absent previously. This was a bug and caused failures in other tools. Differential Revision: https://reviews.llvm.org/D117058
2022-01-07[llvm] Remove redundant member initialization (NFC)Kazu Hirata1-1/+1
Identified with readability-redundant-member-init.
2022-01-03Revert "[llvm] Remove redundant member initialization (NFC)"Kazu Hirata1-2/+2
This reverts commit fd4808887ee47f3ec8a030e9211169ef4fb094c3. This patch causes gcc to issue a lot of warnings like: warning: base class ‘class llvm::MCParsedAsmOperand’ should be explicitly initialized in the copy constructor [-Wextra]
2022-01-02Remove unused "using" (NFC)Kazu Hirata1-1/+0
Identified by misc-unused-using-decls.
2022-01-01[llvm] Remove redundant member initialization (NFC)Kazu Hirata1-2/+2
Identified with readability-redundant-member-init.
2021-12-28[llvm] Use nullptr instead of 0 (NFC)Kazu Hirata1-1/+1
Identified with modernize-use-nullptr.
2021-11-24[LLVM][NFC]Inclusive language: remove occurances of sanity check/test from llvmZarko Todorovski1-1/+1
Part of work to use more inclusive language in clang/llvm. Rewording some comments and change function and variable names.
2021-10-23[llvm] Use StringRef::contains (NFC)Kazu Hirata1-1/+1
2021-08-30[llvm] Remove redundant calls to str() and c_str() (NFC)Kazu Hirata1-1/+1
Identified with readability-redundant-string-cstr.
2021-08-27[ifs] Add option to hide undefined symbolsHaowei Wu1-0/+10
This change add an option to llvm-ifs to hide undefined symbols from its output. Differential Revision: https://reviews.llvm.org/D108428
2021-08-13[IFS] Fix the copy constructor warning in IFSStub.cppHaowei Wu1-2/+2
This change fixes the gcc warning on copy constructor in IFSStub.cpp file. Differential Revision: https://reviews.llvm.org/D108000
2021-07-21IFSStub.cpp - consistently use default case to silence 'not all control ↵Simon Pilgrim1-3/+3
paths return' MSVC warnings. NFCI.
2021-07-19[ifs][elfabi] Merge llvm-ifs/elfabi toolsHaowei Wu3-21/+21
This change merges llvm-elfabi and llvm-ifs tools. Differential Revision: https://reviews.llvm.org/D100139
2021-07-19[ifs] Prepare llvm-ifs for elfabi/ifs merging.Haowei Wu5-169/+228
This diff changes llvm-ifs to use unified IFS file format and perform other renaming changes in preparation for the merging between elfabi/ifs. Differential Revision: https://reviews.llvm.org/D99810
2021-07-19[elfabi] Prepare elfabi/ifs merging.Haowei Wu4-56/+281
This change implements unified text stub format and command line interface proposed in the elfabi/ifs merge plan. Differential Revision: https://reviews.llvm.org/D99399
2021-02-19[elfabi] Fix a bug when .dynsym contains no non-local symbolHaowei Wu1-1/+4
This patch fixed a bug when elbabi was supplied with a tbe file contains no non-local symbol. Before this patch, it wrote 0 to sh_info of the .dynsym section, making the ELF stub file invalid. This patch fixed this issue. Differential Revision: https://reviews.llvm.org/D96930
2021-01-26[llvm-elfabi] Support ELF file that lacks .gnu.hash sectionHaowei Wu1-57/+1
Before this change, when reading ELF file, elfabi determines number of entries in .dynsym by reading the .gnu.hash section. This change makes elfabi read section headers directly first. This change allows elfabi works on ELF files which do not have .gnu.hash sections. Differential Revision: https://reviews.llvm.org/D93362
2020-12-29[llvm-elfabi] Add flag to preserve timestamp when output is the sameHaowei Wu1-12/+27
This change adds '--write-if-changed' flag to llvm-elfabi tool. When enabled, llvm-elfabi will not overwrite the existing file if the content of the file will not be changed, which preserves the timestamp. Differential Revision: https://reviews.llvm.org/D92902
2020-12-29Revert "[llvm-elfabi] Add flag to preserve timestamp when output is the same"Haowei Wu1-27/+12
This reverts commit fddb41744958d21635a60622cfb4067122810bcc. which causes test failures on Mac builders.
2020-12-29[llvm-elfabi] Add flag to preserve timestamp when output is the sameHaowei Wu1-12/+27
This change adds '--write-if-changed' flag to llvm-elfabi tool. When enabled, llvm-elfabi will not overwrite the existing file if the content of the file will not be changed, which preserves the timestamp. Differential Revision: https://reviews.llvm.org/D92902
2020-12-04[lib/Object, tools] - Make ELFObjectFile::getELFFile return reference.Georgii Rymar1-8/+7
We always have an object, so we don't have to return a pointer. Differential revision: https://reviews.llvm.org/D92560
2020-11-24[llvm-elfabi] Emit ELF .dynsym, .dynamic sectionsHaowei Wu1-5/+144
This change makes llvm-elfabi tool to emit .dynsym and .dynamic sections. Differential Revision: https://reviews.llvm.org/D89432
2020-11-23[llvm-elfabi] Emit ELF header and string table sectionsHaowei Wu2-1/+197
This change serves to create the initial framework for outputting ELF files from llvm-elfabi. Differential Revision: https://reviews.llvm.org/D61767
2020-11-23Revert "[llvm-elfabi] Emit ELF header and string table sections"Haowei Wu1-196/+1
This reverts commit 53c5fdd59a5cf7fbb4dcb7a7e84c9c4a40d32a84. Reason of revert: Some builders failed to build with ld.