Go to file
Adrian McCarthy ffa857c7a6 Fix and simplify PrepareCommandsForSourcing
Spotted some problems in the Driver's PrepareCommandsForSourcing while
helping a colleague track another problem.

1. One error case was not handled because there was no else clause.
Fixed by switching to llvm's early-out style instead of nested
`if (succes) { } else { }` cases.  This keeps error handling close
to the actual error.

2. One call-site failed to call the clean-up function.  I solved this
by simplifying the API.  PrepareCommandsForSourcing no longer requires
the caller to provide a buffer for the pipe's file descriptors and to
call a separate clean-up function later.  PrepareCommandsForSourcing
now ensures the file descriptors are handled before returning.
(The read end of the pipe is held open by the returned FILE * as
before.)

I also eliminated an unnecessary local, shorted the lifetime of another,
and tried to improve the comments.

I wrapped the call to open the pipe to get the `#ifdef`s out of the
mainline.  I replaced the `close`/`_close` calls with a platform-neutral
helper from `llvm::sys` for the same reason.  Per discussion on the
review, I'm leaving the `fdopen` call to use the spelling that Windows
has officially deprecated because it still works it avoids more `#ifdef`s.

Differential Revision: https://reviews.llvm.org/D60152

llvm-svn: 357626
2019-04-03 19:49:14 +00:00
clang [OPENMP]Add codegen for lastprivate vars with allocate clause, NFC. 2019-04-03 19:12:47 +00:00
clang-tools-extra [clang-tidy] Remove the old ClangTidyCheck::registerPPCallbacks method 2019-04-03 14:03:43 +00:00
compiler-rt Fix typos in tests. NFC. 2019-04-03 13:15:09 +00:00
debuginfo-tests Set config.lit_tools_dir, which is needed by lit.llvm.initialize. 2018-11-06 21:54:27 +00:00
libclc travis: Add LLVM-8 build 2019-03-27 21:28:31 +00:00
libcxx libcxx: Add _LIBCPP_NODISCARD_EXT to 38 more functions 2019-04-03 18:13:08 +00:00
libcxxabi [libc++abi] Add LIBCXXABI_ENABLE_PIC cmake option 2019-04-03 00:34:12 +00:00
libunwind [libunwind] Do not share an object library to create the static/shared libraries 2019-04-03 16:59:33 +00:00
lld [LLD] - Update the test cases after yaml2obj change. 2019-04-03 14:54:22 +00:00
lldb Fix and simplify PrepareCommandsForSourcing 2019-04-03 19:49:14 +00:00
llgo IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
llvm gn build: Add build file for dexp 2019-04-03 19:09:15 +00:00
openmp [OpenMP][Stats] Fix stats gathering for distribute and team clause 2019-04-03 18:53:26 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly Apply include-what-you-use #include removal suggestions. NFC. 2019-03-28 20:19:49 +00:00
pstl [pstl] Improve the parallel version of std::equal 2019-04-03 17:34:57 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

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