Commit Graph

175887 Commits

Author SHA1 Message Date
David Blaikie 087e7203a9 DebugInfo: Roll argument insertion into variable insertion to ensure arguments are correctly handled in all cases.
No functional change intended.

llvm-svn: 210233
2014-06-05 01:04:20 +00:00
Alexey Samsonov 1c9a921a04 [Deadlock detector] Fix CMake build rules for shared runtime
llvm-svn: 210232
2014-06-05 00:58:28 +00:00
David Blaikie bb6a4e2fea PR19388: DebugInfo: Emit dead arguments in their originally declared order.
Unused arguments were not being added to the argument list, but instead
treated as arbitrary scope variables. This meant they weren't carefully
added in the original argument order.

In this particular example, though, it turns out the argument is only
/mostly/ unused (well, actually it's entirely used, but in a specific
way). It's a struct that, due to ABI reasons, is decomposed into chunks
(exactly one chunk, since it has one member) and then passed. Since only
one of those chunks is used (SROA, etc, kill the original reconstitution
code) we don't have a location to describe the whole variable.

In this particular case, since the struct consists of just the one int,
once we have partial location information, this should have a location
that describes the entire variable (since the piece is the entirety of
the object).

And at some point we'll need to describe the location of even /entirely/
unused arguments so that they can at least be printed on function entry.

llvm-svn: 210231
2014-06-05 00:51:35 +00:00
Richard Smith 599bed75ed Bugfix: don't assert if someone manages to declare an operator new/delete template before the builtin operator new/delete.
llvm-svn: 210230
2014-06-05 00:43:02 +00:00
Alexey Samsonov ad81f0f419 Use AArch64 instead of now removed ARM64 in test configs
llvm-svn: 210229
2014-06-05 00:25:30 +00:00
David Blaikie 6cfa9e1a6d DebugInfo: Add comments/assert description to r209674 based on Eric Christopher's post-commit review feedback.
llvm-svn: 210228
2014-06-05 00:25:26 +00:00
Eric Christopher 21a5e5c1c7 We've got a getSlotSize call already that we use everywhere else,
use it here too.

llvm-svn: 210227
2014-06-05 00:22:13 +00:00
Matt Arsenault 151304691c R600/SI: Match rsq instructions
llvm-svn: 210226
2014-06-05 00:15:55 +00:00
Reid Kleckner e931c06b21 Flush C stdio streams upon process termination
Due to what can only be described as a CRT bug, stdout and amazingly
even stderr are not always flushed upon process termination, especially
when the system is under high threading pressure.  I have found two
repros for this:

1) In lib\Support\Threading.cpp, change sys::Mutex to an
std::recursive_mutex and run check-clang.  Usually between 30 and 40
tests will fail.

2) Add OutputDebugStrings in code that runs during static initialization
and static shutdown.  This will sometimes generate similar failures.

After a substantial amount of troubleshooting and debugging, I found
that I could reproduce this from the command line without running
check-clang.  Simply make the mutex change described in #1, then
manually run the following command many times by running it once, then
pressing Up -> Enter very quickly:

D:\src\llvm\build\vs2013\Debug\bin\c-index-test.EXE -cursor-at=D:\src\llvm\tools\clang\test\Index\targeted-preamble.h:2:15 D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -include D:\src\llvm\build\vs2013\tools\clang\test\Index\Output\targeted-cursor.c.tmp.h -Xclang -error-on-deserialized-decl=NestedVar1      -Xclang -error-on-deserialized-decl=TopVar    | D:\src\llvm\build\vs2013\Debug\bin\FileCheck.EXE D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -check-prefix=PREAMBLE-CURSOR1

Sporadically they will fail, and attaching a debugger to a failed
instance indicates that stdin of FileCheck.exe is empty.

Note that due to the repro in #2, we can rule out a bug in the STL's
mutex implementation, and instead conclude that this is a real flake in
the windows test harness.

Test Plan:
Without patch: Ran check-clang 10 times and saw over 30 Unexpected failures on every run.
With patch: Ran check-clang 10 times and saw 0 unexpected failures across all runs.

Reviewers: rnk

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

Patch by Zachary Turner!

llvm-svn: 210225
2014-06-05 00:13:43 +00:00
Eric Christopher 52fa6599e8 80-columns.
llvm-svn: 210224
2014-06-05 00:09:08 +00:00
Eric Christopher 11b05cccfa Remove uses of the TargetMachine from X86FrameLowering.
llvm-svn: 210223
2014-06-05 00:09:05 +00:00
Matt Arsenault c6f338dd5e Use nullptr
llvm-svn: 210222
2014-06-05 00:01:12 +00:00
David Blaikie 36408e7569 DebugInfo: Reapply r209984 (reverted in r210143), asserting that abstract DbgVariables have DIEs.
Abstract variables within abstract scopes that are entirely optimized
away in their first inlining are omitted because their scope is not
present so the variable is never created. Instead, we should ensure the
scope is created so the variable can be added, even if it's been
optimized away in its first inlining.

This fixes the incorrect debug info in missing-abstract-variable.ll
(added in r210143) and passes an asserts self-hosting build, so
hopefully there's not more of these issues left behind... *fingers
crossed*.

llvm-svn: 210221
2014-06-04 23:50:52 +00:00
Richard Smith 4244ea9ca1 [ubsan] Don't add a --dynamic-list for ubsan symbols when building a shared
library. That results in the linker resolving all references to weak symbols in
the DSO to the definition from within that DSO. Ironically, this rarely causes
observable problems, except that it causes ubsan's own dynamic type check to
spuriously fail (because we fail to properly merge type_info object names).

llvm-svn: 210220
2014-06-04 23:28:46 +00:00
Richard Smith 5659c866f4 Formatting cleanup.
llvm-svn: 210219
2014-06-04 23:26:06 +00:00
Nick Lewycky ce98b43316 Explain why we skip DbgInfoIntrinsics when looking at line numbers in .gcno file emission.
llvm-svn: 210218
2014-06-04 21:47:19 +00:00
Hans Wennborg 910640b5d8 Don't dynamically initialize dllimport vars (PR19933)
They should be initialized when they're exported.

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

llvm-svn: 210217
2014-06-04 21:09:46 +00:00
Greg Fitzgerald a1b620051f [asan] Add install rule for Android runtime
llvm-svn: 210216
2014-06-04 21:05:01 +00:00
Hans Wennborg 8e873329a1 Don't emit structors for available_externally globals (PR19933)
We would previously assert here when trying to figure out the section
for the global.

This makes us handle the situation more gracefully since the IR isn't
malformed.

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

llvm-svn: 210215
2014-06-04 21:04:54 +00:00
Alexey Samsonov adc9037b88 Remove the overload of GetAddrOfConstantString method
llvm-svn: 210214
2014-06-04 20:25:57 +00:00
Todd Fiala ba78c15c9d Move MemoryRegionInfo out of Target/Process.h into its own header.
lldb-gdbserver and NativeProcessProtocol will use MemoryRegionInfo
but don't want to pull in Process.h.  Pull this declaration and
definition out into its own header.

llvm-svn: 210213
2014-06-04 20:13:37 +00:00
Alexey Samsonov 175e52f57b Refactor and generalize GetAddrOfConstantString and GetAddrOfConstantStringFromLiteral.
Share mode code between these functions and re-structure them in a way
which shows how similar they actually are. The latter function works well
with literals of multi-byte chars and does a GlobalVariable name mangling
(if global strings are non-writable).

No functionality change.

llvm-svn: 210212
2014-06-04 19:56:57 +00:00
Richard Smith ff0aff3caf Use __builtin_operator_new/__builtin_operator_delete when available. This
allows allocations and deallocations to be optimized out.

llvm-svn: 210211
2014-06-04 19:54:15 +00:00
David Majnemer 58a0a70fb2 Handle partial nanosleeps in this_thread::sleep_for
Signals may result in nanosleep returning with only some of the
requested sleeping performed.

Utilize nanosleep's "time-remaining" out parameter to continue sleeping
when this occurs.

llvm-svn: 210210
2014-06-04 19:43:20 +00:00
Tobias Grosser be7eaddc69 Adjust another test case to not access out of bounds
llvm-svn: 210208
2014-06-04 19:41:47 +00:00
Rafael Espindola e11f40a9a4 This cast is not necessary any more (llvm api change).
llvm-svn: 210206
2014-06-04 19:03:20 +00:00
Rafael Espindola 78598d9ab5 Add a Constant version of stripPointerCasts.
Thanks to rnk for the suggestion.

llvm-svn: 210205
2014-06-04 19:01:48 +00:00
Rafael Espindola bb9e7a3d06 Update for llvm api change.
llvm-svn: 210204
2014-06-04 18:51:46 +00:00
Rafael Espindola 4dc5dfc56b Clauses in a landingpad are always Constant. Use a stricter type.
llvm-svn: 210203
2014-06-04 18:51:31 +00:00
Peter Collingbourne 8501e39a85 [dfsan] Fix the declaration of dfsan_add_label.
llvm-svn: 210202
2014-06-04 17:54:51 +00:00
Yaron Keren 2207190cd5 Two small enhancements for the JIT.
When JITting a large project such as Boost it's quite hard to figure out the problematic inline asm without debug location. This patch provides debug location printout before the JIT aborts due to inline asm. printDebugLoc() was exposed from MachineInstr.cpp and reused here.

If the JIT run with debug info, don't bomb on DBG_VALUE but ignore them.

http://reviews.llvm.org/D3416

llvm-svn: 210201
2014-06-04 17:35:28 +00:00
David Blaikie 484610c69b XFAIL: test/DebugInfo/missing-abstract-variable.ll on mips and ppc64 due to an inlined parameter that goes missing.
llvm-svn: 210200
2014-06-04 17:05:23 +00:00
Sergey Matveev dcd9bba602 [sanitizer] Make LSan/MSan/TSan honor the "color" flag.
Based on a patch by Stephan Bergmann.

llvm-svn: 210199
2014-06-04 16:57:03 +00:00
David Majnemer 06fa05ae90 MS-ABI: Mangle empty template parameter packs correctly
Tested for compatibility with VS2013.

llvm-svn: 210198
2014-06-04 16:46:32 +00:00
David Majnemer e31a3ed3d4 MS-ABI: Implement user defined literals
Straightforward implementation of UDLs, it's compatible with VS "14".

This nearly completes our implementation of C++ name mangling for the
MS-ABI.

llvm-svn: 210197
2014-06-04 16:46:26 +00:00
Todd Fiala 11d88bd10a Added gdb-remote $qMemoryRegionInfo tests for heap and stack.
Added two new tests: one to verify that a test exe heap address
returned is readable and writeable, and a similar one to verify
a test exe stack address is readable and writeable.

Ran the main.cpp test exe code through the Xcode re-indenter.
I was using TextMate to edit the test's C++ code alongside the
Python code but last check-in found that it was not handling
tabs/indentation the way I am intending it.

Modified test exe to require C++11.

Refactored gdb remote python code's handling of memory region
info into more re-usable methods.

llvm-svn: 210196
2014-06-04 16:42:12 +00:00
Nico Weber 7babe4f074 Make meta.trans.other/aligned_storage.pass.cpp pass on arm.
The maximum alignment on arm is 8, not 16 like on x86. Use alignof(max_align_t)
to make the test work in both cases.

llvm-svn: 210195
2014-06-04 16:25:58 +00:00
Saleem Abdulrasool 72e9a25c76 tools: fix parenthesis warning from GCC
Add parenthesis as suggested by GCC.

llvm-svn: 210194
2014-06-04 16:03:20 +00:00
Saleem Abdulrasool 8c49170879 tools: fix silly typo in llvm-readobj
Case insensitive case preserving file systems are not a good choice for
development.

llvm-svn: 210193
2014-06-04 16:03:18 +00:00
Saleem Abdulrasool e6971cab30 tools: initial implementation of WoA EH decoding
Add support to llvm-readobj to decode Windows ARM Exception Handling data.  This
uses the previously added datastructures to decode the information into a format
that can be used by tests.  This is a necessary step to add support for emitting
Windows on ARM exception handling information.

A fair amount of formatting inspiration is drawn from the Win64 EH printer as
well as the ARM EHABI printer.  This allows for a reasonably thorough look into
the encoded data.

llvm-svn: 210192
2014-06-04 15:47:15 +00:00
Saleem Abdulrasool 6ba36dc132 tools: introduce StreamWriter::printBoolean
Add a helper print method to print a boolean value as "Yes" or "No".  This is
intended to be used by the Windows ARM EH printer.

llvm-svn: 210191
2014-06-04 15:47:11 +00:00
Saleem Abdulrasool 3b293a1dd5 Support: style/documentation cleanup for format
This is purely a documentation/whitespace cleanup for the format support
functions.

The current style does not duplicate the function/class names in the
documentation; conform to this style.

Additionally, there was a large amount of duplication of comments that added no
real value.  Use block comments for the related sets of functions which are used
for type deduction and parameter container classes.

No functional change.

llvm-svn: 210190
2014-06-04 15:47:07 +00:00
Saleem Abdulrasool 5e1c51edcf Support: add additional comment for ARM EH structure
Replicate the fact that ARM::WinEH::RuntimeFunction purposefully does not merge
functions to accommodate raw data access use cases in tools such as readobj.
Pointed out by Renato during post-commit review.

No functional change.

llvm-svn: 210189
2014-06-04 15:47:04 +00:00
Nico Weber 1d1b46cdf7 Make locales (and transitively, std::endl) work reliably with gcc.
libc++ currently relies on undefined initialization order of global
initializers when using gcc:

1. __start_std_streams in iostream.cpp calls locale:🆔:_init, which assigns
   an id to each locale::facet in an initializer

2. Every facet has a static locale::id id, whose constructor sets the facet's
   id to 0

If 2 runs after 1, it clobbers the facet's assigned consecutive id, causing
exceptions to be thrown when e.g. running code like "cout << endl".

To fix this, let _LIBCPP_CONSTEXPR evaluate to "constexpr" instead of nothing
with gcc.  locale::id's constructor is marked _LIBCPP_CONSTEXPR, which ensures
that it won't get an initializer that could potentially run after the
iostream.cpp initializer. (This remains broken when building with msvc.)

Also switch constexpr-specific code in bitset to use __SIZEOF_SIZE_T__ instead
of __SIZE_WIDTH__, because gcc doesn't define the latter.

Pair-programmed/debugged with Dana Jansens.

llvm-svn: 210188
2014-06-04 15:46:56 +00:00
Todd Fiala 0811e71402 Add gdb-remote test for $qMemoryRegionInfo code querying.
Added test stub for collecting a code, heap and stack address.

Added test to verify that the code address returns a readable,
executable memory region and that the memory region range
was indeed the one that the code belonged to.

llvm-svn: 210187
2014-06-04 15:44:33 +00:00
Rafael Espindola 04c2258624 InstCombine: Improvement to check if signed addition overflows.
This patch implements two things:

1. If we know one number is positive and another is negative, we return true as
    signed addition of two opposite signed numbers will never overflow.

2. Implemented TODO : If one of the operands only has one non-zero bit, and if
    the other operand has a known-zero bit in a more significant place than it
    (not including the sign bit) the ripple may go up to and fill the zero, but
    won't change the sign. e.x -  (x & ~4) + 1

We make sure that we are ignoring 0 at MSB.

Patch by Suyog Sarda.

llvm-svn: 210186
2014-06-04 15:39:14 +00:00
Todd Fiala 99a1f2e95b Add gdb-remote test to ensure $qMemoryRegionInfo is supported.
llvm-svn: 210185
2014-06-04 14:48:22 +00:00
Alexander Musman 1bb328cca5 [OPENMP] Parsing/Sema for OMPLasprivateClause.
Parsing this clause, allowing it on directive ‘omp simd’ and semantic checks.

llvm-svn: 210184
2014-06-04 13:06:39 +00:00
Daniel Jasper a69ca9be12 clang-format: Leave empty lines within UnwrappedLines.
These are commonly used to structure things like enums or long braced
lists. There doesn't seem to be a good reason to have the behavior in
such structures be different from the behavior between statements.

llvm-svn: 210183
2014-06-04 12:40:57 +00:00
Tilmann Scheller 5d8d72c5df [AArch64] clang-format the load/store optimizer.
No change in functionality.

llvm-svn: 210182
2014-06-04 12:40:35 +00:00