Commit Graph

3109 Commits

Author SHA1 Message Date
Vladimir Sukharev
27d12f3e6e [AArch64, ARM] Add v8.1a architecture and generic cpu
New architecture and cpu added, following http://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development

Reviewers: t.p.northover

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8505


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233290 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-26 17:05:54 +00:00
Aaron Ballman
54b6c4c709 Sometimes report_fatal_error is called when there is not a handler function used to fail gracefully. In that case, RunInterruptHandlers is called, which attempts to enter a critical section object. Ensure that the critical section is properly initialized so that this code functions properly, and tools like clang-tidy do not crash in Debug builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233282 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-26 16:24:38 +00:00
Benjamin Kramer
eaf3cbd897 [APInt] Add an isSplat helper and use it in some places.
To complement getSplat. This is more general than the binary
decomposition method as it also handles non-pow2 splat sizes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233195 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-25 16:49:59 +00:00
Aaron Ballman
9990bb34aa Silencing some MSVC warnings "C4805: '^' : unsafe mix of type 'bool' and type 'unsigned int' in operation"; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233067 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-24 12:47:51 +00:00
David Blaikie
b370250f03 Refactor: Simplify boolean expressions in llvm Support
Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson - I dropped the parens and != 0 test, for
consistency with other patches/tests like this, but I'm open to the
notion that we should add the explicit non-zero test in all these sort
of cases (non-bool assigned to a bool).

Differential Revision: http://reviews.llvm.org/D8526

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 19:45:40 +00:00
Benjamin Kramer
1bfcd1f675 Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232998 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 19:32:43 +00:00
Benjamin Kramer
2fa206d48a Add missing include that MSVC complains about.
Also reorder includes a bit, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232980 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 18:19:41 +00:00
Benjamin Kramer
df93f4bb0b Purge unused includes throughout libSupport.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232976 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 18:07:13 +00:00
Benjamin Kramer
bd8e1b1dfe Move private classes into anonymous namespaces
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232944 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 12:30:58 +00:00
Craig Topper
38d5f48397 Fix typo 'AVX too' instead of 'AVX2'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232929 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 04:17:11 +00:00
Craig Topper
da740f1e8e [X86] Add one stepping of Broadwell to the CPU name autodetection for march=native.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232927 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-23 00:15:06 +00:00
Benjamin Kramer
00edfaecf0 FoldingSet: Make FoldingSetImpl's dtor protected and non-virtual
It's not intended to be polymorphically deleted. Make FoldingSet
and ContextualFoldingSet final to avoid noise from -Wnon-virtual-dtor.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232922 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-22 18:22:33 +00:00
Rafael Espindola
2c275b1f80 Note that we don't support COFF on PPC.
Should bring back the windows bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232701 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-19 02:40:56 +00:00
Rafael Espindola
b354ef31cf Teach getDefaultFormat that we only support ELF on some architectures.
This should bring the windows bots back.

It is a bit ugly, but it is better than what we had before: The triple would
say that the object format was COFF, but llc/llvm-mc would produce an ELF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 22:19:16 +00:00
Yaron Keren
703b185464 Remove many superfluous SmallString::str() calls.
Now that SmallString is a first-class citizen, most SmallString::str()
calls are not required. This patch removes a whole bunch of them, yet
there are lots more.

There are two use cases where str() is really needed:
1) To use one of StringRef member functions which is not available in
SmallString.
2) To convert to std::string, as StringRef implicitly converts while 
SmallString do not. We may wish to change this, but it may introduce
ambiguity.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232622 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-18 10:17:07 +00:00
Renato Golin
ce1f16421f [ARM] Add support for ARMV6K subtarget (LLVM)
ARMv6K is another layer between ARMV6 and ARMV6T2. This is the LLVM
side of the changes.

ARMV6 family LLVM implementation.

+-------------------------------------+
| ARMV6                               |
+----------------+--------------------+
| ARMV6M (thumb) | ARMV6K (arm,thumb) | <- From ARMV6K and ARMV6M processors
+----------------+--------------------+    have support for hint instructions
| ARMV6T2 (arm,thumb,thumb2)          |    (SEV/WFE/WFI/NOP/YIELD). They can
+-------------------------------------+    be either real or default to NOP.
| ARMV7 (arm,thumb,thumb2)            |    The two processors also use
+-------------------------------------+    different encoding for them.

Patch by Vinicius Tinti.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232468 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 11:55:28 +00:00
Yaron Keren
0401f798d1 Teach Twine to support SmallString.
Enable removing .str() member calls for these frequent cases. 

 http://reviews.llvm.org/D6372



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-17 09:51:17 +00:00
David Blaikie
7610ba7d24 Fix uses of reserved identifiers starting with an underscore followed by an uppercase letter
This covers essentially all of llvm's headers and libs. One or two weird
cases I wasn't sure were worth/appropriate to fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232394 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 18:06:57 +00:00
Gabor Horvath
1fc0a8da34 [llvm] Replacing asserts with static_asserts where appropriate
Summary:
This patch consists of the suggestions of clang-tidy/misc-static-assert check.


Reviewers: alexfh

Reviewed By: alexfh

Subscribers: xazax.hun, llvm-commits

Differential Revision: http://reviews.llvm.org/D8343

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232366 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 09:53:42 +00:00
Yaron Keren
9f6a4a5bb8 No need to prototype RtlCaptureContext with mingw-w64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 19:20:56 +00:00
Benjamin Kramer
7cb3aa3ed5 CommandLine: Replace cold std::sort with array_pod_sort.
Also replace an old use of qsort with it. Compiles down to the same thing but
gives us some type safety. Safes a couple of kb on CommandLine.o.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232236 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 00:20:13 +00:00
Benjamin Kramer
2175eac141 Wrap in __MINGW32__ to avoid warnings from msvc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231933 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 16:09:02 +00:00
Benjamin Kramer
e513fc118d Add missing namespace specifier for MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 15:53:24 +00:00
Benjamin Kramer
20f78d477e RtlCaptureContext is absent from the mingw32 headers, provide a prototype.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231929 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-11 15:41:15 +00:00
Yaron Keren
1132d0cc5b Teach raw_ostream to accept SmallString.
Saves adding .str() call to any raw_ostream << SmallString usage
and a small step towards making .str() consistent in the ADTs by
removing one of the SmallString::str() use cases, discussion at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141013/240026.html

I'll update the Phabricator patch http://reviews.llvm.org/D6372
for review of the Twine SmallString support, it's more complex
than this one.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 07:33:23 +00:00
Ben Langmuir
5cb5adbe01 Don't treat .foo as two path components in path::iterators
We were treating '/.foo' as ['/', '.', 'foo'] instead of ['/', '.foo'],
which lead to insanity.  Same for '..'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231727 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-10 00:04:29 +00:00
Ed Schouten
71706a01b0 Add support for Nuxi CloudABI.
CloudABI is a POSIX-like runtime environment built around the concept of
capability-based security. More details:

	https://github.com/NuxiNL/cloudlibc

CloudABI uses its own ELFOSABI number. This number has been allocated by
the maintainers of ELF a couple of days ago.

Reviewed by:	echristo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231681 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 18:40:45 +00:00
Benjamin Kramer
0df66b878f Drop the hacks used for partial C99 math libraries.
All supported platforms have half-way decent C99 support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 18:35:18 +00:00
David Blaikie
da4471d726 Simplify expressions involving boolean constants with clang-tidy
Patch by Richard (legalize at xmission dot com).

Differential Revision: http://reviews.llvm.org/D8154

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231617 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 01:57:13 +00:00
Rui Ueyama
8617b3bb3e Support: Improve performance of FileOutputBuffer on Windows
We extend an underlying file before mmap'ing it, but it's not needed
on Windows. Extending file is slow on Windows, so we should avoid doing that.
The difference gets larger as the size of an output file gets larger.
It shove off 2 seconds out of 25 seconds when linking chrome.dll with LLD,
for example.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231452 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-06 06:07:32 +00:00
Zachary Turner
387cf215c0 Replace PrintStackTrace(FILE*) with PrintStackTrace(raw_ostream&)
This will be followed by a change on the clang side to update
the only user of this function with the new version.

Differential Revision: http://reviews.llvm.org/D8074
Reviewed By: Reid Kleckner

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231392 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 19:10:52 +00:00
Reid Kleckner
f836cd08e5 Silence -Wmissing-braces warning from clang-cl
The first element of STACKFRAME64 is a struct and Clang wants us to put
braces around it's initialization. Instead, drop the zero. The result
should be the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231387 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 18:26:58 +00:00
Zachary Turner
98638f07f1 [Windows] Implement PrintStackTrace(FILE*)
llvm::sys::PrintBacktrace(FILE*) is supposed to print a backtrace
of the current thread given the current PC.  This function was
unimplemented on Windows, and instead the only time we could
print a backtrace was as the result of an exception through
LLVMUnhandledExceptionFilter.

This patch implements backtracing of self by using
RtlCaptureContext to get a CONTEXT for the current thread, and
moving the printing and StackWalk64 code to a common method that
printing own stack trace and printing stack trace of an exception
can use.

Differential Revision: http://reviews.llvm.org/D8068
Reviewed by: Reid Kleckner

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231382 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-05 17:47:52 +00:00
Argyrios Kyrtzidis
05b7eaffdd [Support] Increase timeout for the LockFileManager back to 5 mins.
Waiting for just 1 min may not be enough for some contexts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231309 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-04 22:54:38 +00:00
Dan Albert
a33c652878 Make Triple::getOSVersion make sense for Android.
Reviewers: srhines

Reviewed By: srhines

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7928

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231090 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-03 18:23:51 +00:00
Rui Ueyama
4d1d4bad13 Use read{16,32,64}{le,be}() instead of *reinterpret_cast<u{little,big}{16,32,64}_t>().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231016 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 21:19:12 +00:00
Justin Bogner
97cc07352b Detect malformed YAML sequence in yaml::Input::beginSequence()
When reading a yaml::SequenceTraits object, YAMLIO does not report an
error if the yaml item is not a sequence. Instead, YAMLIO reads an
empty sequence. For example:

---
seq:
    foo: 1
    bar: 2
...

If `seq` is a SequenceTraits object, then reading the above yaml will
yield `seq` as an empty sequence.

Fix this to report an error for the above mapping ("not a sequence")

Patch by William Fisher. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230976 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-02 17:26:43 +00:00
Zachary Turner
a0a46d1595 [raw_ostream] When printing color on Windows, use correct bg color.
When using SetConsoleTextAttribute() to set the foreground or
background color, if you don't explicitly set both colors, then
a default value of black will be chosen for whichever you don't
specify a value for.

This is annoying when you have a non default console background
color, for example, and you try to set the foreground color.

This patch gets the existing fg/bg color and when you set one
attribute, sets the opposite attribute to its existing color
prior to comitting the update.

Reviewed by: Aaron Ballman
Differential Revision: http://reviews.llvm.org/D7967

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230859 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-28 19:08:27 +00:00
Reid Kleckner
b2d565708c Silence some Win64 clang-cl warnings about unused stuff due to ifdefs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230685 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 21:08:21 +00:00
Reid Kleckner
7a481adc12 Use wider type for overflow check on LLP64 platforms like Win64, found by clang-cl -Wtautological
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230684 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-26 21:07:30 +00:00
Justin Bogner
a4beb9e372 Object: Handle Mach-O kext bundle files
This particular subtype of Mach-O was missing. Add it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230567 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25 22:59:20 +00:00
Benjamin Kramer
42f72e2c16 Sync the __builtin_expects for our 3 quadratically probed hash table implementations.
This assumes that
  a) finding the bucket containing the value is LIKELY
  b) finding an empty bucket is LIKELY
  c) growing the table is UNLIKELY

I also switched the a) and b) cases for SmallPtrSet as we seem to use
the set mostly more for insertion than for checking existence.

In a simple benchmark consisting of 2^21 insertions of 2^20 unique
pointers into a DenseMap or SmallPtrSet a few percent speedup on average,
but nothing statistically significant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230232 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 16:41:36 +00:00
Davide Italiano
a983427f67 Small cleanup. Don't use else when not needed.
Pointed out by David Majnemer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 02:36:54 +00:00
Chris Bieneman
cbccd8ddf5 Checking if TARGET_OS_IPHONE is defined isn't good enough for 10.7 and earlier.
Older versions of the TargetConditionals header always defined TARGET_OS_IPHONE to something (0 or 1), so we need to test not only for the existence but also if it is 1.

This resolves PR22631.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229904 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 19:50:52 +00:00
Ben Langmuir
7b5766d2f6 Assume the original file is created before release in LockFileManager
This is true in clang, and let's us remove the problematic code that
waits around for the original file and then times out if it doesn't get
created in short order.  This caused any 'dead' lock file or legitimate
time out to cause a cascade of timeouts in any processes waiting on the
same lock (even if they only just showed up).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229881 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 18:22:35 +00:00
Benjamin Kramer
1ce666d86c Demote vectors to arrays. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229861 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 15:26:17 +00:00
Davide Italiano
d6f86b8614 [Support/Timer] Make GetMallocUsage() aware of jemalloc.
Differential Revision:	D7657
Reviewed by:	shankarke, majnemer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 07:27:14 +00:00
Dmitri Gribenko
07aa3556c4 Provide the same ABI regardless of NDEBUG
For projects depending on LLVM, I find it very useful to combine a
release-no-asserts build of LLVM with a debug+asserts build of the dependent
project.  The motivation is that when developing a dependent project, you are
debugging that project itself, not LLVM.  In my usecase, a significant part of
the runtime is spent in LLVM optimization passes, so I would like to build LLVM
without assertions to get the best performance from this combination.

Currently, `lib/Support/Debug.cpp` changes the set of symbols it provides
depending on NDEBUG, while `include/llvm/Support/Debug.h` requires extra
symbols when NDEBUG is not defined.  Thus, it is not possible to enable
assertions in an external project that uses facilities of `Debug.h`.

This patch changes `Debug.cpp` and `Valgrind.cpp` to always define the symbols
that other code may depend on when #including LLVM headers without NDEBUG.

http://reviews.llvm.org/D7662



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229819 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-19 05:30:16 +00:00
Benjamin Kramer
1a50a12b43 Prefer SmallVector::append/insert over push_back loops.
Same functionality, but hoists the vector growth out of the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229500 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17 15:29:18 +00:00
Aaron Ballman
502401111b We require MSVC 1800 as our minimum, so these checks can safely go away; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229415 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 18:23:00 +00:00