Commit Graph

196295 Commits

Author SHA1 Message Date
Ed Schouten bd250daee0 Don't hardcode the locale name string.
The rest of the test uses the #defines for the locale names properly. In
this single spot we do hardcode the string. This causes this test to
fail on CloudABI, where this locale is called en_US.UTF-8@UTC.

llvm-svn: 232365
2015-03-16 09:44:37 +00:00
Simon Atanasyan 3c1818c8c0 [Mips] clang-format the code
No functional changes.

llvm-svn: 232364
2015-03-16 09:14:47 +00:00
Simon Atanasyan a1abb2e2c7 [Mips] Do not check the relocation type twice
No functional changes.

llvm-svn: 232363
2015-03-16 09:14:40 +00:00
Simon Atanasyan 622a4bc83b [Mips] Add `const` qualifier to some member functions
No functional changes.

llvm-svn: 232362
2015-03-16 09:14:34 +00:00
Simon Atanasyan 44e9b094e0 [Mips] Implement R_MIPS_TLS_xxx relocation handling in case of N64 ABI
llvm-svn: 232361
2015-03-16 09:14:28 +00:00
Simon Atanasyan 256407d9e2 [Mips] Implement R_MIPS_GOT_DISP/PAGE/OFST relocations handling
llvm-svn: 232360
2015-03-16 09:14:17 +00:00
Simon Atanasyan 08b19d67fa [Mips] Group some cases in the switch statement
No functional changes.

llvm-svn: 232359
2015-03-16 09:14:06 +00:00
Dmitry Vyukov ee842385ad asan: fix overflows in isSafeAccess
As pointed out in http://reviews.llvm.org/D7583
The current checks can cause overflows when object size/access offset cross Quintillion bytes.

http://reviews.llvm.org/D8193

llvm-svn: 232358
2015-03-16 08:04:26 +00:00
Michael Gottesman d63436fb2e One more try with unused.
llvm-svn: 232357
2015-03-16 08:00:27 +00:00
Michael Gottesman a0d2d3379e Add in an unreachable after a covered switch to appease certain bots.
llvm-svn: 232356
2015-03-16 07:46:34 +00:00
Michael Gottesman c219dd1de1 Remove a used that snuck in that seems to be triggering the MSVC buildbots.
llvm-svn: 232355
2015-03-16 07:34:17 +00:00
Justin Bogner 0a582d766c InstrProf: Remove xfails for big-endian from coverage tests
This still doesn't actually work correctly for big endian input files,
but since these tests all use little endian input files they don't
actually fail. I'll be committing a real fix for big endian soon, but
I don't have proper tests for it yet.

llvm-svn: 232354
2015-03-16 07:29:49 +00:00
Alexander Musman 7931b98735 [OPENMP] Enable codegen of the ‘private’ clause for ‘omp simd’ directive
llvm-svn: 232353
2015-03-16 07:14:41 +00:00
Michael Gottesman c01ab519e6 [objc-arc] Fix indentation of debug logging so it is easy to read the output.
llvm-svn: 232352
2015-03-16 07:02:39 +00:00
Michael Gottesman dd60f9bb09 [objc-arc] Make the ARC optimizer more conservative by forcing it to be non-safe in both direction, but mitigate the problem by noting that we just care if there was a further use.
The problem here is the infamous one direction known safe. I was
hesitant to turn it off before b/c of the potential for regressions
without an actual bug from users hitting the problem. This is that bug ;
).

The main performance impact of having known safe in both directions is
that often times it is very difficult to find two releases without a use
in-between them since we are so conservative with determining potential
uses. The one direction known safe gets around that problem by taking
advantage of many situations where we have two retains in a row,
allowing us to avoid that problem. That being said, the one direction
known safe is unsafe. Consider the following situation:

retain(x)
retain(x)
call(x)
call(x)
release(x)

Then we know the following about the reference count of x:

// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
retain(x)
// rc(x) == N+2
call A(x)
call B(x)
// rc(x) >= 1 (since we can not release a deallocated pointer).
release(x)
// rc(x) >= 0

That is all the information that we can know statically. That means that
we know that A(x), B(x) together can release (x) at most N+1 times. Lets
say that we remove the inner retain, release pair.

// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
call A(x)
call B(x)
// rc(x) >= 1
release(x)
// rc(x) >= 0

We knew before that A(x), B(x) could release x up to N+1 times meaning
that rc(x) may be zero at the release(x). That is not safe. On the other
hand, consider the following situation where we have a must use of
release(x) that x must be kept alive for after the release(x)**. Then we
know that:

// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
retain(x)
// rc(x) == N+2
call A(x)
call B(x)
// rc(x) >= 2 (since we know that we are going to release x and that that release can not be the last use of x).
release(x)
// rc(x) >= 1 (since we can not deallocate the pointer since we have a must use after x).
…
// rc(x) >= 1
use(x)

Thus we know that statically the calls to A(x), B(x) can together only
release rc(x) N times. Thus if we remove the inner retain, release pair:

// rc(x) == N (for some N).
retain(x)
// rc(x) == N+1
call A(x)
call B(x)
// rc(x) >= 1
…
// rc(x) >= 1
use(x)

We are still safe unless in the final … there are unbalanced retains,
releases which would have caused the program to blow up anyways even
before optimization occurred. The simplest form of must use is an
additional release that has not been paired up with any retain (if we
had paired the release with a retain and removed it we would not have
the additional use). This fits nicely into the ARC framework since
basically what you do is say that given any nested releases regardless
of what is in between, the inner release is known safe. This enables us to get
back the lost performance.

<rdar://problem/19023795>

llvm-svn: 232351
2015-03-16 07:02:36 +00:00
Michael Gottesman 7a26d8fa54 [objc-arc] Treat memcpy, memove, memset as just using pointers, not decrementing them.
This will be tested in the next commit (which required it). The commit
is going to update a bunch of tests at the same time.

llvm-svn: 232350
2015-03-16 07:02:32 +00:00
Michael Gottesman 6779217ec5 [objc-arc] Rename ConnectTDBUTraversals => PairUpRetainsReleases.
This is a name that is more descriptive of what the method really does. NFC.

llvm-svn: 232349
2015-03-16 07:02:30 +00:00
Michael Gottesman 65cb7377fd [objc-arc] Move initialization of ARCMDKindCache into the class itself. I also made it lazy.
llvm-svn: 232348
2015-03-16 07:02:27 +00:00
Michael Gottesman ca3a47288b [objc-arc] Change EntryPointType to an enum class outside of ARCRuntimeEntryPoints called ARCRuntimeEntryPointKind.
llvm-svn: 232347
2015-03-16 07:02:24 +00:00
Justin Bogner 7b33cc9dbc InstrProf: Do a better job of reading coverage mapping data.
This code was casting regions of a memory buffer to a couple of
different structs. This is wrong in a few ways:

1. It breaks aliasing rules.
2. If the buffer isn't aligned, it hits undefined behaviour.
3. It completely ignores endianness differences.
4. The structs being defined for this aren't specifying their padding
   properly, so this doesn't even represent the data properly on some
   platforms.

This commit is mostly NFC, except that it fixes reading coverage for
32 bit binaries as a side effect of getting rid of the mispadded
structs. I've included a test for that.

I've also baked in that we only handle little endian more explicitly,
since that was true in practice already. I'll fix this to handle
endianness properly in a followup commit.

llvm-svn: 232346
2015-03-16 06:55:45 +00:00
Vince Harron 0fc6c6762f Added nullptr to fix build
llvm-svn: 232345
2015-03-16 03:54:22 +00:00
Alexander Kornienko 33bc1b8894 And one more empty directory.
llvm-svn: 232344
2015-03-16 03:14:16 +00:00
Alexander Kornienko d42d969a49 Remove an empty directory.
llvm-svn: 232343
2015-03-16 02:27:24 +00:00
Frederic Riss bce93ff011 [dsymutil] Add support to generate .debug_pubnames and .debug_pubtypes
The information gathering part of the patch stores a bit more information
than what is strictly necessary for these 2 sections. The rest will
become useful when we start emitting __apple_* type accelerator tables.

llvm-svn: 232342
2015-03-16 02:05:10 +00:00
Shankar Easwaran 9fdb81d09b [ELF][ARM] Make gotSymbol a member.
The gotSymbol need not be a global static variable. Apart from this reason, This
variable was creating an issue with self hosting lld, as there seems to be an
issue running global initializers, when initializing the guard for this static
variable.

Program received signal SIGTRAP, Trace/breakpoint trap.

llvm-svn: 232341
2015-03-16 00:54:03 +00:00
Alexander Kornienko 4ab63a8c32 Fix ./configure build after r232338.
llvm-svn: 232340
2015-03-16 00:43:57 +00:00
NAKAMURA Takumi 3289643c28 Rework r232337. Let llvm/test/tools/dsymutil/X86/basic-linking-x86.test dospath-tolerant.
llvm-svn: 232339
2015-03-16 00:40:47 +00:00
Alexander Kornienko 57a5c6b56c Move remove-cstr-calls from a standalone executable to a clang-tidy check readability-redundant-string-cstr
http://reviews.llvm.org/D7318

Patch by Richard Thomson!

llvm-svn: 232338
2015-03-16 00:32:25 +00:00
NAKAMURA Takumi 208caf22d9 Suppress llvm/test/tools/dsymutil/X86/basic-linking-x86.test for now. Will fix later.
llvm-svn: 232337
2015-03-15 23:07:16 +00:00
NAKAMURA Takumi 6e40ce9f40 llvm/test/tools/dsymutil/X86/basic-lto-*-linking-x86.test: Relax expressions to meet dos path.
llvm-svn: 232336
2015-03-15 23:07:05 +00:00
Frederic Riss c3820d09c7 [dsymutil] Add missing raw_svector_stream::resync() calls.
Also, after looking at the raw_svector_stream internals, increase the
size of the SmallString used with it to prevent heap allocation.

Issue found by the Asan bot.

llvm-svn: 232335
2015-03-15 22:20:28 +00:00
Renato Golin dabbaca7c9 Adding commit msg guidelines to dev policy
After much bike shed discussions, we seem to agree to a few loose
but relevant guidelines on how to prepare a commit message. It also
points the attribution section to the new commit messages section
to deduplicate information.

llvm-svn: 232334
2015-03-15 21:15:48 +00:00
Frederic Riss 63786b016f [dsymutil] Add support for linking line tables.
This code comes with a lot of cruft that is meant to mimic darwin's
dsymutil behavior. A much simpler approach (described in the numerous
FIXMEs that I put in there) gives the right output for the vast
majority of cases. The extra corner cases that are handled differently
need to be investigated: they seem to correctly handle debug info that
is in the input, but that info looks suspicious in the first place.

Anyway, the current code needs to handle this, but I plan to revisit it
as soon as the big round of validation against the classic dsymutil is
over.

llvm-svn: 232333
2015-03-15 20:45:43 +00:00
Frederic Riss ceb1836d3a [MCDwarf] Do not emit useless line table opcode.
No need to emit a DW_LNS_advance_pc with a 0 increment. Found out while
comparing dsymutil's and LLVM's line table encoding. Not a correctenss
fix, just a small encoding size optimization.

I'm not sure how to generate a sequence that triggers this, and moreover
llvm-dwardump doesn't dump the line table program, thus the effort
involved in creating a testcase for this trivial patch seemed out of
proportion.

llvm-svn: 232332
2015-03-15 20:45:39 +00:00
Simon Pilgrim e2c6a1b96d Use SDValue bool check to tidyup some possible combines. NFC.
llvm-svn: 232331
2015-03-15 19:47:42 +00:00
Benjamin Kramer 6eb776547e SimpleArray: Provide reverse iteration via std::reverse_iterator.
NFC intended.

llvm-svn: 232330
2015-03-15 18:47:26 +00:00
Ed Schouten 69722ab7c1 Remove unneeded initialisation of fenv_t and fexcept_t.
Though common, there is no requirement that fenv_t and fexcept_t are
structure and integer types, respectively. fexcept_t is a structure on
CloudABI.

llvm-svn: 232329
2015-03-15 18:36:31 +00:00
Sanjay Patel 4297c3f08c remove function names from comments; NFC
llvm-svn: 232328
2015-03-15 18:16:04 +00:00
Sanjay Patel 12fa37f1bf fix typo: NFC
llvm-svn: 232327
2015-03-15 18:11:35 +00:00
Vince Harron b63c1880f2 Use -fno-limit-debug-info instead of -fstandalone-debug in tests
This fixes tests on clang-3.4

AFAICT, these flags have the same affect and -fstandalone-debug wasn't
added until after clang-3.4

Committed to try to fix buildbot

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

llvm-svn: 232326
2015-03-15 18:05:53 +00:00
Simon Pilgrim cc4d4d4fef Use SDValue bool check to tidyup some possible combines. NFC.
llvm-svn: 232325
2015-03-15 17:21:35 +00:00
Simon Pilgrim 253fbb17e3 [SSE} Added tests for float4-float3 conversions (PR11580)
llvm-svn: 232324
2015-03-15 16:19:15 +00:00
Benjamin Kramer 15b9717873 Implement PreprocessingRecord's and LazyVector's iterators on top of iterator_adaptor_base
This basically creates a wrapper around an 'int' that poses as an iterator.
While that looks a bit counter-intuitive it works just fine because iterator
operations and basic integer arithmetic works in exactly the same way.

Remove the manual integer wrapping code and reduce the reliance on iterator
internals in the implementation. No functionality change intended.

llvm-svn: 232322
2015-03-15 15:27:19 +00:00
Daniel Jasper bc46b939e6 clang-format: [JS] support cast syntax and type arguments.
Casts in TS syntax (foo = <type>bar;) should not be followed by
whitespace.

Patch by Martin Probst. Thank you.

llvm-svn: 232321
2015-03-15 13:59:51 +00:00
Daniel Jasper 60948b12bb clang-format: [JS] more precisely detect enums.
The current enum detection is overly aggressive. As NestingLevel only
applies per line (?) it classifies many if not most object literals as
enum declarations and adds superfluous line breaks into them. This
change narrows the heuristic by requiring an assignment just before the
open brace and requiring the line to start with an identifier.

Patch by Martin Probst. Thank you.

llvm-svn: 232320
2015-03-15 13:55:54 +00:00
Benjamin Kramer 482284a885 Factor the iterators of ImmutableSet/ImmutableMap into a common base class
This simplifies code quite a bit and brings the iterators closer to
C++'s iterator concept. No functional change intended.

llvm-svn: 232319
2015-03-15 13:26:03 +00:00
David Majnemer ad803d4b76 MS ABI: Don't use qualified pointee types for 'catch' EH TypeDescriptors
Qualifiers are located next to the TypeDescriptor in order to properly
ensure that a pointer type can only be caught by a more qualified catch
handler.  This means that a catch handler of type 'const int *' requires
an RTTI object for 'int *'.  We got this correct for 'throw' but not for
'catch'.

N.B.  We don't currently have the means to store the qualifiers because
LLVM's EH strategy is tailored to the Itanium scheme.  The Itanium ABI
stores qualifiers inside the type descriptor in such a way that the
manner of qualification is stored in addition to the pointee type's
descriptor.  Perhaps the best way of modeling this for the MS ABI is
using an aggregate type to bundle the qualifiers with the descriptor?
This is tricky because we want to make it clear to the optimization
passes which catch handlers invalidate other handlers.

My current thoughts on a design for this is along the lines of:
  { { TypeDescriptor* TD, i32 QualifierFlags }, i32 MiscFlags }

The idea is that the inner most aggregate is all that is needed to
communicate that one catch handler might supercede another.  The
'MiscFlags' field would be used to hold the bitpattern for the notion
that the 'catch' handler does not need to invoke a copy-constructor
because we are catching by reference.

llvm-svn: 232318
2015-03-15 07:10:01 +00:00
David Majnemer fb4898e881 ImmutableSet: Rename Self to SelfTy to make it more clear it is a type
No functional change intended.

llvm-svn: 232317
2015-03-15 07:09:20 +00:00
David Majnemer 4ca5191290 PostOrderIterator: Remove stray semicolon
llvm-svn: 232316
2015-03-15 07:09:18 +00:00
Duncan P. N. Exon Smith a66dc8f689 IR: Default the Metadata::dump() argument "harder" after r232275
Use an overload instead of a default argument for `Metadata::dump()`.
The latter seems to require calling `dump(nullptr)` explicitly when
using a debugger, where as the former doesn't.

Other than utility for debugging, there's NFC here.

llvm-svn: 232315
2015-03-15 06:53:32 +00:00