summaryrefslogtreecommitdiff
path: root/llvm/lib/Support/InitLLVM.cpp
AgeCommit message (Collapse)Author
2025-06-11[SystemZ][z/OS] Refactor AutoConvert.h to remove large MVS guard (#143174)Abhina Sree
This AutoConvert.h header frequently gets mislabeled as an unused include because it is guarded by MVS internally and every usage is also guarded. This refactors the change to remove this guard and instead make these functions a noop on other non-z/OS platforms.
2024-11-21[SystemZ][z/OS] Add back removed AutoConvert.h headers that were incorrectly ↵Abhina Sreeskantharajan
identified as unused to fix a build error on z/OS
2024-11-20[Support] Remove unused includes (NFC) (#116752)Kazu Hirata
Identified with misc-include-cleaner.
2024-09-05[NFC][SystemZ][z/OS] Rename autoconversion-related functions to be less ↵Abhina Sree
generic (#107399) This patch renames the functions in AutoConvert.h/cpp to have a less generic name because they are z/OS specific.
2024-01-11[llvm-driver] Fix usage of `InitLLVM` on Windows (#76306)Alexandre Ganea
Previously, some tools such as `clang` or `lld` which require strict order for certain command-line options, such as `clang -cc1` or `lld -flavor`, would not longer work on Windows, when these tools were linked as part of `llvm-driver`. This was caused by `InitLLVM` which was part of the `*_main()` function of these tools, which in turn calls `windows::GetCommandLineArguments`. That function completly replaces argc/argv by new UTF-8 contents, so any ajustements to argc/argv made by `llvm-driver` prior to calling these tools was reset. `InitLLVM` is now called by the `llvm-driver`. Any tool that participates in (or is part of) the `llvm-driver` doesn't call `InitLLVM` anymore.
2023-12-13[SystemZ][z/OS] Complete EBCDIC I/O support (#75212)Abhina Sree
This patch completes the support for EBCDIC I/O support on z/OS using the autoconversion functions.
2022-01-21Add ms-specific missing header in Support/InitLLVM.cppserge-sans-paille
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-07[Support] [Debuginfod] Move HTTPClient to Debuginfod library.Noah Shutty
Following the discussion in D112753, this moves the HTTPClient from Support to Debuginfod library so that tools depending on Support do not automatically depend on Curl as well. This also removes `HTTPClient::initialize()` and `HTTPClient::cleanup()` from `InitLLVM` so these steps should be implemented by user tools instead. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D115131
2021-12-02[llvm] [Support] Add CURL HTTP Client.Noah Shutty
Provides an implementation of `HTTPClient` that wraps libcurl. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D112753
2021-01-08[InitLLVM] Ensure SIGPIPE handler installed before sigaction()Vedant Kumar
The pipe signal handler must be installed before any other handlers are registered. This is because the Unix RegisterHandlers function does not perform a sigaction() for SIGPIPE unless a one-shot handler is present, to allow long-lived processes (like lldb) to fully opt-out of llvm's SIGPIPE handling and ignore the signal safely. Fixes a bug introduced in D70277. Tested by running Nick's test case: % xcrun ./bin/clang -E -fno-integrated-cc1 x.c | tee foo.txt | head I verified that child cc1 process exits with IO_ERR, and that the parent recognizes the error code, exiting cleanly. Differential Revision: https://reviews.llvm.org/D94324
2020-02-28llvm-ar: Fix MinGW compilationHans Wennborg
llvm-ar is using CompareStringOrdinal which is available only starting with Windows Vista (WINVER 0x600). Fix this by hoising WindowsSupport.h, which sets _WIN32_WINNT to 0x0601, up to llvm/include/llvm/Support and use it in llvm-ar. Patch by Cristian Adam! Differential revision: https://reviews.llvm.org/D74599
2019-11-18[Signal] Allow llvm clients to opt into one-shot SIGPIPE handlingVedant Kumar
Allow clients of the llvm library to opt-in to one-shot SIGPIPE handling, instead of forcing them to undo llvm's SIGPIPE handler registration (which is brittle). The current behavior is preserved for all llvm-derived tools (except lldb) by means of a default-`true` flag in the InitLLVM constructor. This prevents "IO error" crashes in long-lived processes (lldb is the motivating example) which both a) load llvm as a dynamic library and b) *really* need to ignore SIGPIPE. As llvm signal handlers can be installed when calling into libclang (say, via RemoveFileOnSignal), thereby overriding a previous SIG_IGN for SIGPIPE, there is no clean way to opt-out of "exit-on-SIGPIPE" in the current model. Differential Revision: https://reviews.llvm.org/D70277
2019-07-12[Support] Move the static initializer install_out_memory_new_handler to InitLLVMFangrui Song
An application linking against LLVMSupport should not get the gratuitous set::std_new_handler call. Reviewed By: jfb Differential Revision: https://reviews.llvm.org/D64505 llvm-svn: 365915
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-04-17Rename sys::Process::GetArgumentVector -> sys::windows::GetCommandLineArgumentsRui Ueyama
GetArgumentVector (or GetCommandLineArguments) is very Windows-specific. I think it doesn't make much sense to provide that function from sys::Process. I also made a change so that the function takes a BumpPtrAllocator instead of a SpecificBumpPtrAllocator. The latter is the class to call dtors, but since char * is trivially destructible, we should use the former class. Differential Revision: https://reviews.llvm.org/D45641 llvm-svn: 330216
2018-04-13Define InitLLVM to do common initialization all at once.Rui Ueyama
We have a few functions that virtually all command wants to run on process startup/shutdown. This patch adds InitLLVM class to do that all at once, so that we don't need to copy-n-paste boilerplate code to each llvm command's main() function. Differential Revision: https://reviews.llvm.org/D45602 llvm-svn: 330046