26void CleanupStdHandles(
void *Cookie) {
30 llvm::restoreStdHandleAutoConversion(STDIN_FILENO);
31 llvm::restoreStdHandleAutoConversion(STDOUT_FILENO);
32 llvm::restoreStdHandleAutoConversion(STDERR_FILENO);
40 bool InstallPipeSignalExitHandler) {
42 static std::atomic<bool> Initialized{
false};
43 assert(!Initialized &&
"InitLLVM was already initialized!");
50 if (InstallPipeSignalExitHandler)
59 StackPrinter.emplace(Argc, Argv);
68 std::string Banner = std::string(Argv[0]) +
": ";
87 std::string Banner = std::string(Argv[0]) +
": ";
96 Argc = Args.
size() - 1;
103 CleanupStdHandles(
nullptr);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Helper for check-and-exit error handling.
InitLLVM(int &Argc, const char **&Argv, bool InstallPipeSignalExitHandler=true)
void push_back(const T &Elt)
pointer data()
Return a pointer to the vector's buffer, even if empty().
This class implements an extremely fast bulk output stream that can only output to a stream.
std::error_code GetCommandLineArguments(SmallVectorImpl< const char * > &Args, BumpPtrAllocator &Alloc)
void SetOneShotPipeSignalFunction(void(*Handler)())
Registers a function to be called in a "one-shot" manner when a pipe signal is delivered to the proce...
void DefaultOneShotPipeSignalHandler()
On Unix systems and Windows, this function exits with an "IO error" exit code.
void AddSignalHandler(SignalHandlerCallback FnPtr, void *Cookie)
Add a function to be called when an abort/kill signal is delivered to the process.
void PrintStackTraceOnErrorSignal(StringRef Argv0, bool DisableCrashReporting=false)
When an error signal (such as SIGABRT or SIGSEGV) is delivered to the process, print a stack trace an...
This is an optimization pass for GlobalISel generic memory operations.
raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.
void install_out_of_memory_new_handler()
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
void llvm_shutdown()
llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.