1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Go to file
Lang Hames 034e76c90d [Support] Add ExitOnError utility to support tools that use the exit-on-error
idiom.

Most LLVM tool code exits immediately when an error is encountered and prints an
error message to stderr. The ExitOnError class supports this by providing two
call operators - one for Errors, and one for Expected<T>s. Calls to code that
can return Errors (or Expected<T>s) can use these calls to bail out on error,
and otherwise continue as if the operation had succeeded. E.g.

Error foo();
Expected<int> bar();

int main(int argc, char *argv[]) {
  ExitOnError ExitOnErr;

  ExitOnErr.setBanner(std::string("Error in ") + argv[0] + ":");

  // Exit if foo returns an error. No need to manually check error return.
  ExitOnErr(foo());

  // Exit if bar returns an error, otherwise unwrap the contained int and
  // continue.
  int X = ExitOnErr(bar());

  // ...

  return 0;
}

llvm-svn: 263749
2016-03-17 21:28:49 +00:00
bindings bindings/go: reinstate TargetMachine.TargetData 2016-03-15 05:04:06 +00:00
cmake cmake: include what you use 2016-03-08 18:56:00 +00:00
docs Remove obselete reference to TypeResolve from the tutorial. 2016-03-17 10:20:58 +00:00
examples [PM] Update Kaleidoscope with the new header file. 2016-03-11 12:10:15 +00:00
include [Support] Add ExitOnError utility to support tools that use the exit-on-error 2016-03-17 21:28:49 +00:00
lib [LoopVectorize] Annotate versioned loop with noalias metadata 2016-03-17 20:32:37 +00:00
projects Remove autoconf support 2016-01-26 21:29:08 +00:00
resources In MSVC builds embed a VERSIONINFO resource in our exe and DLL files. 2015-06-12 15:58:29 +00:00
test [LoopVectorize] Annotate versioned loop with noalias metadata 2016-03-17 20:32:37 +00:00
tools [llvm-objdump] Add '0x' prefix to a target displacement number to accent its hex format 2016-03-17 10:43:44 +00:00
unittests [Support] Add ExitOnError utility to support tools that use the exit-on-error 2016-03-17 21:28:49 +00:00
utils [lit] Enqueue tests on a separate thread to not hit limits on parallel queues 2016-03-17 18:27:33 +00:00
.arcconfig
.clang-format
.clang-tidy adding readability-identifier-naming to llvm clang-tidy configuration. 2015-12-08 17:44:51 +00:00
.gitignore Minor updates to gitignore so that symlinks are ignored in the projects dir. 2015-07-07 20:24:58 +00:00
CMakeLists.txt llvm-shlib: Remove the option to override __cxa_atexit 2016-03-14 21:54:45 +00:00
CODE_OWNERS.TXT Add self to CODE_OWNERS 2016-03-08 19:01:15 +00:00
configure Remove autoconf support 2016-01-26 21:29:08 +00:00
CREDITS.TXT [WebAssembly] Initial WebAssembly backend 2015-06-29 23:51:55 +00:00
LICENSE.TXT
llvm.spec.in [Sparc] Implement i64 load/store support for 32-bit sparc. 2015-08-10 19:11:39 +00:00
LLVMBuild.txt
README.txt Revert previous test commit. 2016-01-04 19:13:29 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.