Commit Graph

778 Commits

Author SHA1 Message Date
Chad Rosier
eb47aeba1e [AArch64] Add support for Qualcomm's Falkor CPU.
Differential Revision: https://reviews.llvm.org/D26673

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 21:34:12 +00:00
Chad Rosier
17fd000f82 [AArch64] Refactor test per Matthias' request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 21:18:18 +00:00
Zachary Turner
97dac2b41d [Support] Introduce llvm::formatv() function.
This introduces a new type-safe general purpose formatting
library.  It provides compile-time type safety, does not require
a format specifier (since the type is deduced), and provides
mechanisms for extending the format capability to user defined
types, and overriding the formatting behavior for existing types.

This patch additionally adds documentation for the API to the
LLVM programmer's manual.

Mailing List Thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 23:57:40 +00:00
Mehdi Amini
5652444405 Prevent at compile time converting from Error::success() to Expected<T>
This would trigger an assertion at runtime otherwise.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286562 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 04:29:25 +00:00
Mehdi Amini
df0b8bce48 Make the Error class constructor protected
This is forcing to use Error::success(), which is in a wide majority
of cases a lot more readable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286561 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 04:28:40 +00:00
Davide Italiano
582d2b4b31 [ADT/MathExtras] Make buildbot happy again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 04:03:29 +00:00
Davide Italiano
07ca53dbb5 [ADT/MathExtras] Add tests for PowerOf2Floor (previously untested).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 02:38:24 +00:00
Davide Italiano
17ff1559b1 [ADT/MathExtras] Introduce PowerOf2Ceil.
To be used in lld (and probably somewhere else in llvm).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 02:22:16 +00:00
Zachary Turner
48fbf5cc1a [Support] Improve flexibility of binary blob formatter.
This makes it possible to indent a binary blob by a certain
number of bytes, and also makes some things more idiomatic.
Finally, it integrates this binary blob formatter into ScopedPrinter
which used to have its own implementation of this algorithm.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 20:16:45 +00:00
Greg Clayton
a20694002c Added the ability to dump hex bytes easily into a raw_ostream.
Unit tests were added to verify this functionality keeps working correctly.

Example output for raw hex bytes:
llvm::ArrayRef<uint8_t> Bytes = ...;
llvm::outs() << format_hex_bytes(Bytes);
554889e5 4881ec70 04000048 8d051002
00004c8d 05fd0100 004c8b0d d0020000

Example output for raw hex bytes with offsets:
llvm::outs() << format_hex_bytes(Bytes, 0x100000d10);
0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002
0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000

Example output for raw hex bytes with ASCII with offsets:
llvm::outs() << format_hex_bytes_with_ascii(Bytes, 0x100000d10);
0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002 |UH.?H.?p...H....|
0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000 |..L..?...L..?...|

The default groups bytes into 4 byte groups, but this can be changed to 1 byte:
llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 1 /*ByteGroupSize*/);
0x0000000100000d10: 55 48 89 e5 48 81 ec 70 04 00 00 48 8d 05 10 02
0x0000000100000d20: 00 00 4c 8d 05 fd 01 00 00 4c 8b 0d d0 02 00 00

llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 2 /*ByteGroupSize*/);
0x0000000100000d10: 5548 89e5 4881 ec70 0400 0048 8d05 1002
0x0000000100000d20: 0000 4c8d 05fd 0100 004c 8b0d d002 0000

llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 8 /*NumPerLine*/, 1 /*ByteGroupSize*/);
0x0000000100000d10: 55 48 89 e5 48 81 ec 70
0x0000000100000d18: 04 00 00 48 8d 05 10 02
0x0000000100000d20: 00 00 4c 8d 05 fd 01 00
0x0000000100000d28: 00 4c 8b 0d d0 02 00 00

https://reviews.llvm.org/D26405



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 00:15:54 +00:00
Peter Collingbourne
4ac35e8272 Support: Remove MemoryObject and DataStreamer interfaces.
These interfaces are no longer used.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 00:08:37 +00:00
Serge Pavlov
3cf18dea43 Attempt to pacify buildbot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 07:52:10 +00:00
Serge Pavlov
038b68a6a3 Allow resolving response file names relative to including file
If a response file included by construct @file itself includes a response file
and that file is specified by relative file name, current behavior is to resolve
the name relative to the current working directory. The change adds additional
flag to ExpandResponseFiles that may be used to resolve nested response file
names relative to including file. With the new mode a set of related response
files may be kept together and reference each other with short position
independent names.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285675 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 06:53:29 +00:00
Zachary Turner
b53c2b0d14 Resubmit "Add support for advanced number formatting."
This resubmits r284436 and r284437, which were reverted in
r284462 as they were breaking the AArch64 buildbot.

The breakage on AArch64 turned out to be a miscompile which is
still not fixed, but is actively tracked at llvm.org/pr30748.

This resubmission re-writes the code in a way so as to make the
miscompile not happen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-29 00:27:22 +00:00
Benjamin Kramer
c2cab9b61f [Support] Fix AlignOf test on i386-linux.
On i386 alignof(double) = 8 is not the same as alignof(struct { double
}) = 4. This used to be not an issue because the old implementation
always measured alignment inside of structs. Wrap a dummy struct around
the test to avoid this issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21 09:15:57 +00:00
Benjamin Kramer
cafdc34428 [Support] Remove llvm::alignOf now that all uses are gone.
Also clean up the legacy hacks for AlignedCharArray. I'm keeping
LLVM_ALIGNAS alive for a bit longer because GCC 4.8.0 (which we still
support apparently) shipped a buggy alignas(). All other supported
compilers have a working alignas.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20 15:36:38 +00:00
Benjamin Kramer
cb58e1e3bc Retire llvm::alignOf in favor of C++11 alignof.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20 15:02:18 +00:00
Pavel Labath
911bb941ce Reapply "Add Chrono.h - std::chrono support header"
This is a resubmission of r284590. The mingw build should be fixed now. The
problem was we were matching time_t with _localtime_64s, which was incorrect on
_USE_32BIT_TIME_T systems. Instead I use localtime_s, which should always
evaluate to the correct function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20 12:05:50 +00:00
Mehdi Amini
2bd75068e1 Add computeHostNumPhysicalCores() implementation for Darwin
Differential Revision: https://reviews.llvm.org/D25800

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 22:36:07 +00:00
Pavel Labath
b40b8e3413 Revert "Add Chrono.h - std::chrono support header"
This reverts commit r284590 as it fails on the mingw buildbot. I think I know the
fix, but I cannot test it right now. Will reapply when I verify it works ok.

This reverts r284590.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284615 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 17:17:53 +00:00
Pavel Labath
bca3cda284 Add Chrono.h - std::chrono support header
Summary:
std::chrono mostly covers the functionality of llvm::sys::TimeValue and
lldb_private::TimeValue. This header adds a bit of utility functions and
typedefs, which make the usage of the library and porting code from TimeValues
easier.

Rationale:
- TimePoint typedef - precision of system_clock is implementation defined -
  using a well-defined precision helps maintain consistency between platforms,
  makes it interact better with existing TimeValue classes, and avoids cases
  there a time point is implicitly convertible to a specific precision on some
  platforms but not on others.
- system_clock::to_time_t only accepts time_points with the default system
  precision (even though time_t has only second precision on all platforms we
  support). To avoid the need for explicit casts, I have added a toTimeT()
  wrapper function. toTimePoint(time_t) was not strictly necessary, but I have
  added it for symmetry.

Reviewers: zturner, mehdi_amini

Subscribers: beanz, mgorny, llvm-commits, modocache

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284590 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 13:58:55 +00:00
Renato Golin
8bb4ccc94b Revert "Resubmit "Add support for advanced number formatting.""
This reverts commits 284436 and 284437 because they still break AArch64 bots:

Value of: format_number(-10, IntegerStyle::Integer, 1)
  Actual: "-0"
  Expected: "-10"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-18 09:30:18 +00:00
Zachary Turner
88bc637ad2 Rename HexStyle -> HexFormatStyle, and remove a constexpr.
This should fix the remaining broken builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 23:08:47 +00:00
Zachary Turner
b3a18516ab Resubmit "Add support for advanced number formatting."
This resubmits commits 284425 and r284428, which were reverted
in r284429 due to some infinite recursion caused by an incorrect
selection of function overloads.  Reproduced the failure on Linux
using GCC 4.8.4, and confirmed that with the new patch the tests
path on GCC as well as MSVC.  So hopefully this fixes everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284436 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 22:49:24 +00:00
Zachary Turner
fdfb1c554e Revert formatting changes.
This reverts r288425 and r284428 as they are causing test crashes
on some systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 21:25:41 +00:00
Zachary Turner
d4bb10c270 Try to fix build after invalid pointer conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284428 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 21:14:27 +00:00
Zachary Turner
0a7eca8829 [Support] Add support for "advanced" number formatting.
raw_ostream has not afforded a lot of flexibility in terms of
how to format numbers when outputting.  Wrap this all up into
a set of low level helper functions that can be used to output
numbers with arbitrary precision, alignment, format, etc and
then update raw_ostream to use these functions.

This will be useful for upcoming improvements to llvm's string
formatting libraries, but are still useful independently.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 20:57:45 +00:00
Teresa Johnson
6fb063ad06 Rename interface for querying physical hardware concurrency
Based on post-commit review for D25585/r284180, rename
hardware_physical_concurrency to heavyweight_hardware_concurrency,
to better reflect what type of tasks it should be used for and
to enable other systems to map this to something other than the
number of physical cores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 14:56:53 +00:00
Benjamin Kramer
573d9cc8f2 [Support] remove_dots: Remove windows test.
Windows doesn't have roots, so I think this test doesn't make sense
there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 13:57:16 +00:00
Benjamin Kramer
94b3ee41bc [Support] remove_dots: Remove .. from absolute paths.
/../foo is still a proper path after removing the dotdot. This should
now finally match https://9p.io/sys/doc/lexnames.html [Cleaning names].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 13:28:21 +00:00
Justin Bogner
13579ede05 unittests: Explicitly ignore some return values in crash tests
Ideally these would actually check that the results are reasonable,
but given that we're looping over so many different kinds of path that
isn't really practical.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 22:09:24 +00:00
Teresa Johnson
0a9d04f218 Add interface for querying physical hardware concurrency
Summary:
This will be used by ThinLTO to set the amount of backend
parallelism, which performs better when restricted to the number
of physical cores (on X86 at least, where getHostNumPhysicalCores is
currently defined). If not available this falls back to
thread::hardware_concurrency.

Note I didn't add to the thread class since that is a typedef to
std::thread where available.

Reviewers: mehdi_amini

Subscribers: beanz, llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 00:13:59 +00:00
Teresa Johnson
26cb3d9e11 Add interface to compute number of physical cores on host system
Summary:
For now I have only added support for x86_64 Linux, but other systems
can be added incrementally.

This is to be used for setting the default parallelism for ThinLTO
backends (instead of thread::hardware_concurrency which includes
hyperthreading and is too aggressive). I'll send this as a follow-on
patch, and it will fall back to hardware_concurrency when the new
getHostNumPhysicalCores returns -1 (when not supported for a given
host system).

I also added an interface to MemoryBuffer to force reading a file
as a stream - this is required for /proc/cpuinfo which is a special
file that looks like a normal file but appears to have 0 size.
The existing readers of this file in Host.cpp are reading the first
1024 or so bytes from it, because the necessary info is near the top.
But for the new functionality we need to be able to read the entire
file. I can go back and change the other readers to use the new
getFileAsStream as a follow-on patch since it seems much more robust.

Added a unittest.

Reviewers: mehdi_amini

Subscribers: beanz, mgorny, llvm-commits, modocache

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13 17:43:20 +00:00
Eric Liu
e0d080d15d Do not delete leading ../ in remove_dots.
Reviewers: bkramer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-13 15:07:14 +00:00
Javed Absar
a297939a6a [ARM]: Add Cortex-R52 target to LLVM
This patch adds Cortex-R52, the new ARM real-time processor, to LLVM. 
Cortex-R52 implements the ARMv8-R architecture.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 12:06:40 +00:00
Mehdi Amini
a47cbd993e Use StringReg in TargetParser APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 08:37:29 +00:00
Mehdi Amini
f9bb6bcf37 Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283285 and re-commit r283275 with
a fix for format("%s", Str); where Str is a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 05:59:29 +00:00
Dean Michael Berris
f6b865d41a [Support][CommandLine] Add cl::getRegisteredSubcommands()
This should allow users of the library to get a range to iterate through
all the subcommands that are registered to the global parser. This
allows users to define subcommands in libraries that self-register to
have dispatch done at a different stage (like main). It allows for
writing code like the following:

    for (auto *S : cl::getRegisteredSubcommands()) {
      if (*S) {
	// Dispatch on S->getName().
      }
    }

This change also contains tests that show this usage pattern.

Reviewers: zturner, dblaikie, echristo

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 05:20:08 +00:00
Mehdi Amini
ef350f2eb3 Revert "Re-commit "Use StringRef in Support/Darf APIs (NFC)""
One test seems randomly broken: DebugInfo/X86/gnu-public-names.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:04:02 +00:00
Mehdi Amini
a2df9c87e9 Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283278 and re-commit r283275 with
the update to fix the build on the LLDB side.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:37:18 +00:00
Mehdi Amini
c441cc0af2 Revert "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283275, it broke LLDB Android debug server.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:21:14 +00:00
Mehdi Amini
ba4c13cb88 Use StringRef in Support/Darf APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:55:40 +00:00
Mehdi Amini
b7d8ee46b4 Use StringRef in CommandLine Options handling (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-01 03:43:20 +00:00
Rafael Espindola
3a04627b8a Add xxhash to llvm.
It will be used for fast fingerprinting in lld at least.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-27 15:45:57 +00:00
Zachary Turner
95da21422c Revert "[Support][CommandLine] Add cl::getRegisteredSubcommands()"
This reverts r281290, as it breaks unit tests.
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/303

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 04:11:57 +00:00
Dean Michael Berris
5021054629 [Support][CommandLine] Add cl::getRegisteredSubcommands()
This should allow users of the library to get a range to iterate through
all the subcommands that are registered to the global parser. This
allows users to define subcommands in libraries that self-register to
have dispatch done at a different stage (like main). It allows for
writing code like the following:

    for (auto *S : cl::getRegisteredSubcommands()) {
      if (*S) {
	// Dispatch on S->getName().
      }
    }

This change also contains tests that show this usage pattern.

Reviewers: zturner, dblaikie, echristo

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 02:35:00 +00:00
Zachary Turner
684da7277a [YAMLIO] Add the ability to map with context.
mapping a yaml field to an object in code has always been
a stateless operation.  You could still pass state by using the
`setContext` function of the YAMLIO object, but this represented
global state for the entire yaml input.  In order to have
context-sensitive state, it is necessary to pass this state in
at the granularity of an individual mapping.

This patch adds support for this type of context-sensitive state.
You simply pass an additional argument of type T to the
`mapRequired` or `mapOptional` functions, and provided you have
specialized a `MappingContextTraits<U, T>` class with the
appropriate mapping function, you can pass this context into
the mapping function.

Reviewed By: chandlerc
Differential Revision: https://reviews.llvm.org/D24162

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 18:22:44 +00:00
George Rimar
e1bd92bac5 [Support] - Fix possible crash in match() of llvm::Regex.
Crash was possible if match() method
was called on object that was moved or object
created with empty constructor.

Testcases updated.

DIfferential revision: https://reviews.llvm.org/D24123

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 08:44:46 +00:00
NAKAMURA Takumi
ef63f7a644 raw_pwrite_stream_test.cpp: _putenv_s() may be assumed as win32-generic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 01:20:18 +00:00
Reid Kleckner
6a701169dc Fix a real temp file leak in FileOutputBuffer
If we failed to commit the buffer but did not die to a signal, the temp
file would remain on disk on Windows. Having an open file mapping and
file handle prevents the file from being deleted. I am choosing not to
add an assertion of success on the temp file removal, since virus
scanners and other environmental things can often cause removal to fail
in real world tools.

Also fix more temp file leaks in unit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 01:10:53 +00:00