Commit Graph

3179 Commits

Author SHA1 Message Date
Davide Italiano
0caf385833 [ADT] Add a generic breadth-first-search graph iterator.
This will be used in LCSSA to speed up the canonicalization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299660 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 17:03:04 +00:00
Lang Hames
d6028a160d [Orc] Add missing header include for r299611.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299623 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 04:12:47 +00:00
Lang Hames
456e01a064 [Orc] Break QueueChannel out into its own header and add a utility,
createPairedQueueChannels, to simplify channel creation in the RPC unit tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299611 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 01:49:21 +00:00
Lang Hames
9be01ddb13 [RuntimeDyld] Remove an unused static member left over from r299449.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299497 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 01:43:59 +00:00
Yi Kong
4dd33e6269 Implement host CPU detection for AArch64
This shares detection logic with ARM(32), since AArch64 capable CPUs may
also run in 32-bit system mode.

We observe weird /proc/cpuinfo output for MSM8992 and MSM8994, where
they report all CPU cores as one single model, depending on which CPU
core the kernel is running on. As a workaround, we hardcode the known
CPU part name for these SoCs.

For big.LITTLE systems, this patch would only return the part name of
the first core (usually the little core). Proper support will be added
in a follow-up change.

Differential Revision: D31675

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299458 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 19:06:04 +00:00
Lang Hames
e65aa1c44e [RuntimeDyld] Make RuntimeDyld honor the ProcessAllSections flag.
When the ProcessAllSections flag (introduced in r204398) is set RuntimeDyld is
supposed to make a call to the client's memory manager for every section in each
object that is loaded. Due to some missing checks, this was not happening in all
cases. This patch adds the missing cases, and fixes the Orc unit test that
verifies correct behavior for ProcessAllSections (The unit test had been
silently bailing out due to an ordering issue: a change in the test order meant
that this unit-test was running before the native target was registered. This
issue has also been fixed in this patch).

This fixes <rdar://problem/22789965>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299449 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 17:03:49 +00:00
Jonas Hahnfeld
ba1514c219 Align all scalar numbers to LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR
Otherwise, yamlize in YAMLTraits.h might be wrongly defined.
This makes some AMDGPU tests fail when LLVM_LINK_LLVM_DYLIB is set.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299415 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 06:02:32 +00:00
Craig Topper
68149f546e [APInt] Move isMask and isShiftedMask out of APIntOps and into the APInt class. Implement them without memory allocation for multiword
This moves the isMask and isShiftedMask functions to be class methods. They now use the MathExtras.h function for single word size and leading/trailing zeros/ones or countPopulation for the multiword size. The previous implementation made multiple temorary memory allocations to do the bitwise arithmetic operations to match the MathExtras.h implementation.

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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299362 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-03 16:34:59 +00:00
Craig Topper
6b60db9e91 [APInt] Add a public typedef for the internal type of APInt use it instead of integerPart. Make APINT_BITS_PER_WORD and APINT_WORD_SIZE public.
This patch is one step to attempt to unify the main APInt interface and the tc functions used by APFloat.

This patch adds a WordType to APInt and uses that in all the tc functions. I've added temporary typedefs to APFloat to alias it to integerPart to keep the patch size down. I'll work on removing that in a future patch.

In future patches I hope to reuse the tc functions to implement some of the main APInt functionality.

I may remove APINT_ from BITS_PER_WORD and WORD_SIZE constants so that we don't have the repetitive APInt::APINT_ externally.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299341 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-02 19:17:22 +00:00
Craig Topper
a9c17af0f6 [APInt] Fix bugs in isShiftedMask to match behavior of the similar function in MathExtras.h
This removes a parameter from the routine that was responsible for a lot of the issue. It was a bit count that had to be set to the BitWidth of the APInt and would get passed to getLowBitsSet. This guaranteed the call to getLowBitsSet would create an all ones value. This was then compared to (V | (V-1)). So the only shifted masks we detected had to have the MSB set.

The one in tree user is a transform in InstCombine that never fires due to earlier transforms covering the case better. I've submitted a patch to remove it completely, but for now I've just adapted it to the new interface for isShiftedMask.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299273 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 22:23:42 +00:00
Stephen Canon
2215b7d1b2 Fix 80-column violation in previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 20:35:02 +00:00
Stephen Canon
872b505b04 Fix APFloat mod (committing for simonbyrne)
The previous version was prone to intermediate rounding or overflow.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 20:31:33 +00:00
Craig Topper
406105d95e [APInt] Rewrite getLoBits in a way that will do one less memory allocation in the multiword case. Rewrite getHiBits to use the class method version of lshr instead of the one in APIntOps. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299243 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 18:48:14 +00:00
Kristof Beyls
5f4e285a08 Make naming in Host.h in line with coding standards.
Based on post-commit review comments by Chandler Carruth on
https://reviews.llvm.org/D31236. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299211 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 13:06:40 +00:00
Simon Pilgrim
8d28e34276 Spelling mistakes in comments. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299197 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 10:59:37 +00:00
Craig Topper
dbf64c9e97 [APInt] Add unittests that demonstrate how very broken APIntOps::isShiftedMask is.
Did you know that 0 is a shifted mask? But 0x0000ff00 and 0x000000ff aren't? At least we get 0xff000000 right.

I only see one usage of this function in the code base today and its in InstCombine. I think its protected against 0 being misreported as a mask. I guess we just don't have tests for the missed cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299187 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 06:30:25 +00:00
Kristof Beyls
d897ffbad4 Revert "Make naming in Host.h in line with coding standards."
This reverts r299062, which caused build failures on Windows.
It also reverts the attempts to fix the windows builds in r299064 and r299065.
The introduction of namespace llvm::sys::detail makes MSVC, and seemingly also
mingw, complain about ambiguity with the existing namespace llvm::detail.
E.g.:
C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/MathExtras.h(184): error C2872: 'detail': ambiguous symbol
C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/PointerLikeTypeTraits.h(31): note: could be 'llvm::detail'
C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/Host.h(80): note: or       'llvm::sys::detail'

In r299064 and r299065 I tried to fix these ambiguities, based on the errors
reported in the log files. It seems however that the build stops early when
this kind of error is encountered, and many build-then-fix-iterations on
Windows may be needed to fix this. Therefore reverting r299062 for now to
get the build working again on Windows.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299066 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 11:06:25 +00:00
Kristof Beyls
f68acdfc6c Make naming in Host.h in line with coding standards.
Based on post-commit review comments by Chandler Carruth on
https://reviews.llvm.org/D31236. Thanks!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299062 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 09:31:59 +00:00
Kristof Beyls
f1d06b8e0a Refactor getHostCPUName to allow testing on non-native hardware.
This refactors getHostCPUName so that for the architectures that get the
host cpu info on linux from /proc/cpuinfo, the /proc/cpuinfo parsing
logic is present in the build, even if it wasn't built on a linux system
for that architecture.

Since the code is present in the build, we can then test that code also
on other systems, i.e. we don't need to have buildbots setup for all
architectures on linux to be able to test this. Instead, developers will
test this as part of the regression test run.

As an example, a few unit tests are added to test getHostCPUName for ARM
running linux. A unit test is preferred over a lit-based test, since the
expectation is that in the future, the functionality here will grow over
what can be tested with "llc -mcpu=native".

This is a preparation step to enable implementing the range of
improvements discussed on PR30516, such as adding AArch64 support,
support for big.LITTLE systems, reducing code duplication.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299060 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 07:24:49 +00:00
Adam Nemet
5c57c1108e [IR] Add AllowContract to FastMathFlags
-ffp-contract=fast does not currently work with LTO because it's passed as a
TargetOption to the backend rather than in the IR. This adds it to
FastMathFlags.

This is toward fixing PR25721

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298939 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 20:11:52 +00:00
Craig Topper
31355ac435 [APInt] Use memset in setAllBits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 17:50:54 +00:00
Justin Bogner
acec6edc61 ADT: Add range helpers for pointer_ and pointee_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298841 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-27 12:56:12 +00:00
Zachary Turner
c5caccf493 Make the home_directory test a little more resilient.
It's possible (albeit strange) for $HOME to intentionally
point somewhere other than the user's home directory as
reported by the password database.  Our test shouldn't fail
in this case.  This patch updates the test to pull directly
from the password database before unsetting $HOME, rather
than comparing the return value of home_directory() to the
original value of the environment variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-22 16:30:06 +00:00
Zachary Turner
2811bb8f72 Make home_directory look in the password database in addition to $HOME.
This is something of an edge case, but when the $HOME environment
variable is not set, we can still look in the password database
to get the current user's home directory.

Added a test for this by getting the value of $HOME, then unsetting
it, then calling home_directory() and verifying that it succeeds
and that the value is the same as what we originally read from
the environment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298513 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-22 15:24:59 +00:00
Adam Nemet
5fead02594 Make test more robust
Set the flags on FAdd locally rather than assuming nothing will change it from
way earlier in the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298462 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 23:50:52 +00:00
Zachary Turner
d10b8de6de Resubmit "Improve StringMap iterator support."
The issue was trying to advance past the end of the iterator
when computing the end() iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298461 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 23:45:03 +00:00
Zachary Turner
123d0b8e82 Revert "Improve StringMap iterator support."
This is causing crashes in clang, so reverting until the problem
is figured out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298440 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 21:23:57 +00:00
Zachary Turner
26bdd1d112 Improve StringMap iterator support.
StringMap's iterators did not support LLVM's
iterator_facade_base, which made it unusable in various
STL algorithms or with some of our range adapters.
This patch makes both StringMapConstIterator as well as
StringMapIterator support iterator_facade_base.

With this in place, it is easy to make an iterator adapter
that iterates over only keys, and whose value_type is
StringRef.  So I add StringMapKeyIterator as well, and
provide the method StringMap::keys() that returns a
range that can be iterated.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298436 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 20:27:36 +00:00
Zachary Turner
700f6ad142 [ADT] Add a version of llvm::join() that takes a range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298427 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 19:35:05 +00:00
Reid Kleckner
6707770d48 Rename AttributeSet to AttributeList
Summary:
This class is a list of AttributeSetNodes corresponding the function
prototype of a call or function declaration. This class used to be
called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is
typically accessed by parameter and return value index, so
"AttributeList" seems like a more intuitive name.

Rename AttributeSetImpl to AttributeListImpl to follow suit.

It's useful to rename this class so that we can rename AttributeSetNode
to AttributeSet later. AttributeSet is the set of attributes that apply
to a single function, argument, or return value.

Reviewers: sanjoy, javed.absar, chandlerc, pete

Reviewed By: pete

Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 16:57:19 +00:00
Zachary Turner
e40105539c Add a function to MD5 a file's contents.
In doing so, clean up the MD5 interface a little.  Most
existing users only care about the lower 8 bytes of an MD5,
but for some users that care about the upper and lower,
there wasn't a good interface.  Furthermore, consumers
of the MD5 checksum were required to handle endianness
details on their own, so it seems reasonable to abstract
this into a nicer interface that just gives you the right
value.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298322 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-20 23:33:18 +00:00
Zachary Turner
bb8d9fb401 SmallString doesn't have implicit conversion from const char*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298019 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-17 00:28:23 +00:00
Zachary Turner
0a965f8ecd Don't rely on an implicit std::tuple constructor.
Apparently it doesn't have one, so using an initializer list
doesn't work correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298018 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-17 00:16:21 +00:00
Zachary Turner
8f4fdbe01a Fix unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 23:19:40 +00:00
Reid Kleckner
1c19be8a98 Remove getArgumentList() in favor of arg_begin(), args(), etc
Users often call getArgumentList().size(), which is a linear way to get
the number of function arguments. arg_size(), on the other hand, is
constant time.

In general, the fact that arguments are stored in an iplist is an
implementation detail, so I've removed it from the Function interface
and moved all other users to the argument container APIs (arg_begin(),
arg_end(), args(), arg_size()).

Reviewed By: chandlerc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298010 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 22:59:15 +00:00
Zachary Turner
c33642eea7 [Support] Support both Windows and Posix paths on both platforms.
Previously which path syntax we supported dependend on what
platform we were compiling LLVM on.  While this is normally
desirable, there are situations where we need to be able to
handle a path that we know was generated on a remote host.
Remote debugging, for example, or parsing debug info.

99% of the code in LLVM for handling paths was platform
agnostic and literally just a few branches were gated behind
pre-processor checks, so this changes those sites to use
runtime checks instead, and adds a flag to every path
API that allows one to override the host native syntax.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298004 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 22:28:04 +00:00
James Henderson
8276800d3c [Support] Add support for getting file system permissions on Windows and implement sys::fs::set/getPermissions to work with them
This change adds support for functions to set and get file permissions, in a similar manner to the C++17 permissions() function in <filesystem>. The setter uses chmod on Unix systems and SetFileAttributes on Windows, setting the permissions as passed in. The getter simply uses the existing status() function.

Prior to this change, status() would always return an unknown value for the permissions on a Windows file, making it impossible to test the new function on Windows. I have therefore added support for this as well. On Linux, prior to this change, the permissions included the file type, which should actually be accessed via a different member of the file_status class.

Note that on Windows, only the *_write permission bits have any affect - if any are set, the file is writable, and if not, the file is read-only. This is in common with what MSDN describes for their behaviour of std::filesystem::permissions(), and also what boost::filesystem does.

The motivation behind this change is so that we can easily test behaviour on read-only files in LLVM unit tests, but I am sure that others may find it useful in some situations.

Reviewers: zturner, amccarth, aaron.ballman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297945 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 11:22:09 +00:00
Peter Collingbourne
2995c258a5 Support: Add a cache pruning policy parser.
The idea is that the policy string fully specifies the policy and is portable
between clients.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297927 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 03:42:00 +00:00
Eric Liu
c19a1fb7d0 [Support][CommandLine] Make it possible to get error messages from ParseCommandLineOptions when ignoring errors.
Summary:
Previously, ParseCommandLineOptions returns false and ignores error messages
when IgnoreErrors. It would be useful to also return error messages if users
decide to check parsing result instead of having the program exit on error.

Reviewers: chandlerc, mehdi_amini, rnk

Reviewed By: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 08:41:00 +00:00
Juergen Ributzka
c4630f9d5b [Support] Make the SystemZ bot happy by using make_error_code.
This should fix the last issue on the SystemZ bot related to the broken symlink
test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297767 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14 18:37:44 +00:00
David Blaikie
bc67646a35 Fix llvm-symbolizer to navigate both DW_AT_abstract_origin and DW_AT_specification in a single chain
In a recent refactoring (r291959) this regressed to only following one
or the other, not both, in a single chain.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297676 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 21:46:37 +00:00
David Blaikie
9812b90e2e Fix sign compare warning in unit test by using an explicit unsigned literal suffix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297674 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 21:46:12 +00:00
Juergen Ributzka
aa68cfd46c [Support] Follow-up for "Test directory iterators and recursive directory iterators with broken symlinks."
Fix the test by sorting the result vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297672 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 21:40:20 +00:00
Juergen Ributzka
bea1e20cb9 [Support] Test directory iterators and recursive directory iterators with broken symlinks.
This commit adds a unit test to the file system tests to verify the behavior of
the directory iterator and recursive directory iterator with broken symlinks.

This test is Unix only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297669 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 21:34:07 +00:00
Rafael Espindola
37e8db6fe5 Bring back r297624.
The issues was just a missing REQUIRES in the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297661 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 20:00:25 +00:00
Rafael Espindola
5682e3ee66 Revert "Fix crash when multiple raw_fd_ostreams to stdout are created."
This reverts commit r297624.
It was failing on the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297657 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 19:38:32 +00:00
Zachary Turner
39e53ee48c [ADT] Improve the genericity of llvm::enumerate().
There were some issues in the implementation of enumerate()
preventing it from being used in various contexts.  These were
all related to the fact that it did not supporter llvm's
iterator_facade_base class.  So this patch adds support for that
and additionally exposes a new helper method to_vector() that
will evaluate an entire range and store the results in a
vector.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297633 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 16:24:10 +00:00
Rafael Espindola
b8ff3dcbf6 Fix crash when multiple raw_fd_ostreams to stdout are created.
If raw_fd_ostream is constructed with the path of "-", it claims
ownership of the stdout file descriptor. This means that it closes
stdout when it is destroyed. If there are multiple users of
raw_fd_ostream wrapped around stdout, then a crash can occur because
of operations on a closed stream.

An example of this would be running something like "clang -S -o - -MD
-MF - test.cpp". Alternatively, using outs() (which creates a local
version of raw_fd_stream to stdout) anywhere combined with such a
stream usage would cause the crash.

The fix duplicates the stdout file descriptor when used within
raw_fd_ostream, so that only that particular descriptor is closed when
the stream is destroyed.

Patch by James Henderson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297624 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 14:45:06 +00:00
Aaron Ballman
61d9d49df6 Reverting r297617 because it broke some bots:
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/49970

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297618 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 12:24:51 +00:00
Aaron Ballman
565edc0441 Add support for getting file system permissions and implement sys::fs::permissions to set them.
Patch by James Henderson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 12:17:14 +00:00