History log of /external/llvm/lib/Support/Unix/Process.inc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ebe69fe11e48d322045d5949c83283927a0d790b 23-Mar-2015 Stephen Hines <srhines@google.com> Update aosp/master LLVM for rebase to r230699.

Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
/external/llvm/lib/Support/Unix/Process.inc
37ed9c199ca639565f6ce88105f9e39e898d82d0 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master LLVM for rebase to r222494.

Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
/external/llvm/lib/Support/Unix/Process.inc
c6a4f5e819217e1e12c458aed8e7b122e23a3a58 21-Jul-2014 Stephen Hines <srhines@google.com> Update LLVM for rebase to r212749.

Includes a cherry-pick of:
r212948 - fixes a small issue with atomic calls

Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
/external/llvm/lib/Support/Unix/Process.inc
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
/external/llvm/lib/Support/Unix/Process.inc
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/Support/Unix/Process.inc
6a971bb8f59f4e20c953a2cc360cab7bae8642e4 07-Oct-2013 David Majnemer <david.majnemer@gmail.com> Revert "Revert "Windows: Add support for unicode command lines""

This reverts commit r192070 which reverted r192069, I forgot to
regenerate the configure scripts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
b262556c45bb7b3add826bc3f050c99db6990c37 06-Oct-2013 David Majnemer <david.majnemer@gmail.com> Revert "Windows: Add support for unicode command lines"

This is causing MinGW bots to fail.
This reverts commit r192069.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
5a1a1856a4dfa1335d937437fade5c0bbab06560 06-Oct-2013 David Majnemer <david.majnemer@gmail.com> Windows: Add support for unicode command lines

Summary:
The MSVCRT deliberately sends main() code-page specific characters.
This isn't too useful to LLVM as we end up converting the arguments to
UTF-16 and subsequently attempt to use the result as, for example, a
file name. Instead, we need to have the ability to access the Unicode
command line and transform it to UTF-8.

This has the distinct advantage over using the MSVC-specific wmain()
function as our entry point because:
- It doesn't work on cygwin.
- It only work on MinGW with caveats and only then on certain versions.
- We get to keep our entry point as main(). :)

N.B. This patch includes fixes to other parts of lib/Support/Windows
s.t. we would be able to take advantage of getting the Unicode paths.
E.G. clang spawning clang -cc1 would want to give it Unicode arguments.

Reviewers: aaron.ballman, Bigcheese, rnk, ruiu

Reviewed By: rnk

CC: llvm-commits, ygao

Differential Revision: http://llvm-reviews.chandlerc.com/D1834

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
44a61bde15d456527156ee2080f0964344b939fe 11-Sep-2013 Nico Rieck <nico.rieck@gmail.com> Support ANSI escape code on Windows

In some cases (e.g. when a build system pipes stderr) the Windows console
API cannot be used to color output. For these, provide a way to switch to
ANSI escape codes. This is required for Clang's -fansi-escape-codes option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
f42d4247ae1138c6deed50f92dcd1a4f34e07dec 10-Sep-2013 Rui Ueyama <ruiu@google.com> Add getenv() wrapper that works on multibyte environment variable.

On Windows, character encoding of multibyte environment variable varies
depending on settings. The only reliable way to handle it I think is to use
GetEnvironmentVariableW().

GetEnvironmentVariableW() works on wchar_t string, which is on Windows UTF16
string. That's not ideal because we use UTF-8 as the internal encoding in LLVM.
This patch defines a wrapper function which takes and returns UTF-8 string for
GetEnvironmentVariableW().

The wrapper function does not do any conversion and just forwards the argument
to getenv() on Unix.

Differential Revision: http://llvm-reviews.chandlerc.com/D1612

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
16eedf0ba03a751e98f4b57d528344c5fc83e6da 04-Sep-2013 NAKAMURA Takumi <geek4civic@gmail.com> Support/Process: Add comments about PageSize and AllocationGranularity on Cygwin and Win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
8fea8f2d822a38daa5438a9be7938b3f93ac8da0 21-Aug-2013 NAKAMURA Takumi <geek4civic@gmail.com> Unix/Process.inc: Revert r72332, "Work around a page size issue on Cygwin."

Offset in mmap(3) should be aligned to gepagesize(), 64k, or mmap(3) would fail.

TODO: Invetigate places where 4096 would be required as pagesize, or 4096 would satisfy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
d485e7bd7639cd6b39c6113a30fbc3cdc8c41c4c 18-Aug-2013 Chandler Carruth <chandlerc@gmail.com> Go through the really awkward dance required to delete the memory
allocated by setupterm. Without this, some folks are seeing leaked
memory whenever this routine is called more than once. Thanks to Craig
Topper for the report.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
0009850524f72183c49b506f3eb4c3bdc5f3a0d4 16-Aug-2013 Aaron Ballman <aaron@aaronballman.com> Removing unused functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
d89266dd82747f646e21061df56cdd4378aa0b30 13-Aug-2013 Benjamin Kramer <benny.kra@googlemail.com> GCC warns about removing const with a c-style cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
3729d7d62b9973baa60d253fe0463d6d607dd815 12-Aug-2013 Chandler Carruth <chandlerc@gmail.com> Remove all checking for the various terminfo headers (term.h and
curses.h). Finding these headers is next to impossible. For example, on
Debian systems libtinfo-dev provides the terminfo reading library we
want, but *not* term.h. For the header, you have to use libncurses-dev.
And libncursesw-dev provides a *different* term.h in a different
location!

These headers aren't worth it. We want two functions the signatures of
which are clearly spec'ed in sys-v and other documentation. Just declare
them ourselves and call them. This should fix some debian builders and
provide better support for "minimal" debian systems that do want color
autodetection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
8d8bdff6d7eccb05bf16e18141263ee72ea8296b 12-Aug-2013 Chandler Carruth <chandlerc@gmail.com> Target a minimal terminfo library rather than necessarily a full curses
library for color support detection. This still will use a curses
library if that is all we have available on the system. This change
tries to use a smaller subset of the curses library, specifically the
subset that is on some systems split off into a separate library. For
example, if you install ncurses configured --with-tinfo, a 'libtinfo' is
install that provides just the terminfo querying functionality. That
library is now used instead of curses when it is available.

This happens to fix a build error on systems with that library because
when we tried to link ncurses into the binary, we didn't pull tinfo in
as well. =]

It should also provide an easy path for supporting the NetBSD
libterminfo library, but as I don't have access to a NetBSD system I'm
leaving adding that support to those folks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
f7364d5833f700eefd7919326bfa5724da1461c3 07-Aug-2013 Chandler Carruth <chandlerc@gmail.com> Add support for linking against a curses library when available and
using it to detect whether or not a terminal supports colors. This
replaces a particularly egregious hack that merely compared the TERM
environment variable to "dumb". That doesn't really translate to
a reasonable experience for users that have actually ensured their
terminal's capabilities are accurately reflected.

This makes testing a terminal for color support somewhat more expensive,
but it is called very rarely anyways. The important fast path when the
output is being piped somewhere is already in place.

The global lock may seem excessive, but the spec for calling into curses
is *terrible*. The whole library is terrible, and I spent quite a bit of
time looking for a better way of doing this before convincing myself
that this was the fundamentally correct way to behave. The damage of the
curses library is very narrowly confined, and we continue to use raw
escape codes for actually manipulating the colors which is a much sane
system than directly using curses here (IMO).

If this causes trouble for folks, please let me know. I've tested it on
Linux and will watch the bots carefully. I've also worked to account for
the variances of curses interfaces that I could finde documentation for,
but that may not have been sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
dd1b7c9685324beb385c33b8dfd5628c4836670f 20-Jun-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Remove MSan hack that is no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
79e8429e41c98d42e9e4d13de8276b8de24ddc83 14-Feb-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Workaround an MSan false positive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
6a40db40eea4f3103cc05610949f5fe217739eea 05-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Eric thought that Darwin was right to use -1 consistently rather than
leaving this undefined, and despite the sentence in the standard that
seems to require it, I'll cede the point and assume its a bug in the
wording. Other parts of POSIX regularly allow for things to be -1
instead of undefined, this should too. Makes things more consistent too.

This should have to real impact for folks though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
4cff412ecc4c760f0bbade18da02169967dc5ccf 05-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Try to suppress the use of clock_gettime on Darwin which apparantly
defines _POSIX_CPUTIME but doesn't support the clock_* functions.

I don't test the value of _POSIX_CPUTIME because the spec merely says
that if it is defined, the CPU-specific timers are available, whereas it
says that _POSIX_TIMERS must be defined and defined to a value greater
than zero. However, this may not work, as the POSIX spec clearly states:

"If the symbolic constant _POSIX_CPUTIME is defined, then the symbolic
constant _POSIX_TIMERS shall also be defined by the implementation to
have the value 200112L."

If this doesn't work, I'll add more hacks for Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
73c35d86b9d5236be5b3f49bc8df11008b96636e 05-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Add time getters to the process interface for requesting the elapsed
wall time, user time, and system time since a process started.

For walltime, we currently use TimeValue's interface and a global
initializer to compute a close approximation of total process runtime.

For user time, this adds support for an somewhat more precise timing
mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock
selected.

For system time, we have to do a full getrusage call to extract the
system time from the OS. This is expensive but unavoidable.

In passing, clean up the implementation of the old APIs and fix some
latent bugs in the Windows code. This might have manifested on Windows
ARM systems or other systems with strange 64-bit integer behavior.

The old API for this both user time and system time simultaneously from
a single getrusage call. While this results in fewer system calls, it
also results in a lower precision user time and if only user time is
desired, it introduces a higher overhead. It may be worthwhile to switch
some of the pass timers to not track system time and directly track user
and wall time. The old API also tracked walltime in a confusing way --
it just set it to the current walltime rather than providing any measure
of wall time since the process started the way buth user and system time
are tracked. The new API is more consistent here.

The plan is to eventually implement these methods for a *child* process
by using the wait3(2) system call to populate an rusage struct
representing the whole subprocess execution. That way, after waiting on
a child process its stats will become accurate and cheap to query.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
814afe91ccad0e5e1f767303d780fa0318fa5212 01-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Flesh out a page size accessor in the new API.

Implement the old API in terms of the new one. This simplifies the
implementation on Windows which can now re-use the self_process's once
initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
e0e1985b3b71f21cd1d6c1e4924abf0f5b499a73 31-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Remove an unused function in the old Process interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
9b4aba85a89f9347212e00f80953f2a685ffeb36 31-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Switch this code to a more idiomatic double using namespace directive.

Fix a truly odd namespace qualifier that was flat out wrong in the
process. The fully qualified namespace would have been
llvm::sys::TimeValue, llvm::TimeValue makes no sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
0184a841d3914bb78c7c6fa87ce9da86a2d5992a 31-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Begin sketching out the process interface.

The coding style used here is not LLVM's style because this is modeled
after a Boost interface and thus done in the style of a candidate C++
standard library interface. I'll probably end up proposing it as
a standard C++ library if it proves to be reasonably portable and
useful.

This is just the most basic parts of the interface -- getting the
process ID out of it. However, it helps sketch out some of the boiler
plate such as the base class, derived class, shared code, and static
factory function. It also introduces a unittest so that I can
incrementally ensure this stuff works.

However, I've not even compiled this code for Windows yet. I'll try to
fix any Windows fallout from the bots, and if I can't fix it I'll revert
and get someone on Windows to help out. There isn't a lot more that is
mandatory, so soon I'll switch to just stubbing out the Windows side and
get Michael Spencer to help with implementation as he can test it
directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
b0f6759ab93b42570d71665b13d24ca2c4a5f276 06-Aug-2012 Eric Christopher <echristo@apple.com> Add support for the OpenBSD for Bitrig.

Patch by David Hill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
7d83658140cb99871a43a08715a45c84aa66f3cc 20-Jul-2012 Daniel Dunbar <daniel@zuster.org> Process: Add sys::Process::FileDescriptorHasColors().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
2b8f3ba8434fe7a847823c4f11d3a0cdb9c2e2ca 08-May-2012 Daniel Dunbar <daniel@zuster.org> [Support] Fix sys::GetRandomNumber() to always use a high quality seed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156414 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
dc736b0a3e02f2470d7c580e1f3c2d4654170597 06-May-2012 NAKAMURA Takumi <geek4civic@gmail.com> Unix/Process.inc: Give more useful random seed to srand. Workaround for PR12743.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
24cddd5c9a7622e06e7ae0e0887e5e0d48326606 06-May-2012 NAKAMURA Takumi <geek4civic@gmail.com> Support/Process: Move llvm::sys::Process::GetRandomNumber() from Process.cpp to Unix/Process.inc.

FIXME: GetRandomNumber() is not implemented in Win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
246de858e37a989a9cdf9b80d7434453b2c52e70 16-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Reapply 'Add reverseColor to raw_ostream'.

To be used in printing unprintable source in clang diagnostics.
Patch by Seth Cantrell, with a minor fix for mingw by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
c9413c745bec9707064211bc5fd02cdfb153c92d 16-Apr-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r154800 which breaks windows builders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
7d31d75a77bb7a5a47f21d4c311ba13be86caa6f 16-Apr-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add reverseColor to raw_ostream.

To be used in printing unprintable source in clang diagnostics.
Patch by Seth Cantrell!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
6fc30c26b7fa9e89c4e9ab99b7feab11389cc3f4 11-Apr-2012 Sylvestre Ledru <sylvestre@debian.org> Fix the build under Debian GNU/Hurd.
Thanks to Pino Toscano for the patch



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
4aab4ab340863d87f9c566b69099ce60dd8762be 15-Jan-2012 Chandler Carruth <chandlerc@gmail.com> Remove SetWorkingDirectory from the Process interface. Nothing in LLVM
or Clang is using this, and it would be hard to use it correctly given
the thread hostility of the function. Also, it never checked the return
which is rather dangerous with chdir. If someone was in fact using this,
please let me know, as well as what the usecase actually is so that
I can add it back and make it more correct and secure to use. (That
said, it's never going to be "safe" per-se, but we could at least
document the risks...)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
bb0a6126cf1372e3ba90f0f6ff16f7f4d0381105 24-Sep-2011 Daniel Dunbar <daniel@zuster.org> sys::Process: Add a SetWorkingDirectory method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc
1f6efa3996dd1929fbc129203ce5009b620e6969 29-Nov-2010 Michael J. Spencer <bigcheesegs@gmail.com> Merge System into Support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/Unix/Process.inc