Commit Graph

182411 Commits

Author SHA1 Message Date
Richard Smith efa6f736e6 Add error, recovery and fixit for "~A::A() {...}".
llvm-svn: 217302
2014-09-06 02:06:12 +00:00
Eric Christopher d650b82b22 The original jit no longer exists in llvm, remove from dependencies.
PR20864

llvm-svn: 217301
2014-09-06 02:03:06 +00:00
Kuba Brecka a51ea3822a Implement ASan history threads in SB API
Reviewed at
http://reviews.llvm.org/D5219
and
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012809.html

llvm-svn: 217300
2014-09-06 01:33:13 +00:00
Enrico Granata edc4414094 Expose the ability to retrieve the result of a type validator via the SB API. To keep it simple, do not expose the pair, but just return a NULL string for success, and a non-NULL string for error; If we were to decide to expose the pair, we would need an SBTypeValidatorResult, which is fine, but it should come as part of exposing type validators through the SB API rather than as a one-off thing. So, KISS for now
llvm-svn: 217299
2014-09-06 01:30:04 +00:00
Nico Weber 728894340f Add -Wunused-local-typedef, a warning that finds unused local typedefs.
The warning warns on TypedefNameDecls -- typedefs and C++11 using aliases --
that are !isReferenced(). Since the isReferenced() bit on TypedefNameDecls
wasn't used for anything before this warning it wasn't always set correctly,
so this patch also adds a few missing MarkAnyDeclReferenced() calls in
various places for TypedefNameDecls.

This is made a bit complicated due to local typedefs possibly being used only
after their local scope has closed. Consider:

    template <class T>
    void template_fun(T t) {
      typename T::Foo s3foo;  // YYY
      (void)s3foo;
    }
    void template_fun_user() {
      struct Local {
        typedef int Foo;  // XXX
      } p;
      template_fun(p);
    }

Here the typedef in XXX is only used at end-of-translation unit, when YYY in
template_fun() gets instantiated. To handle this, typedefs that are unused when
their scope exits are added to a set of potentially unused typedefs, and that
set gets checked at end-of-TU. Typedefs that are still unused at that point then
get warned on. There's also serialization code for this set, so that the
warning works with precompiled headers and modules. For modules, the warning
is emitted when the module is built, for precompiled headers each time the
header gets used.

Finally, consider a function using C++14 auto return types to return a local
type defined in a header:

    auto f() {
      struct S { typedef int a; };
      return S();
    }

Here, the typedef escapes its local scope and could be used by only some
translation units including the header. To not warn on this, add a
RecursiveASTVisitor that marks all delcs on local types returned from auto
functions as referenced. (Except if it's a function with internal linkage, or
the decls are private and the local type has no friends -- in these cases, it
_is_ safe to warn.)

Several of the included testcases (most of the interesting ones) were provided
by Richard Smith.

(gcc's spelling -Wunused-local-typedefs is supported as an alias for this
warning.)

llvm-svn: 217298
2014-09-06 01:25:55 +00:00
Kuba Brecka aaa0b81a4e Fix CMake configuration (forgot to add a file in the last commit).
llvm-svn: 217297
2014-09-06 01:22:55 +00:00
Kuba Brecka a5ea1e2b6c Expose ThreadCollection in SB API
Reviewed at
http://reviews.llvm.org/D5218
and
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012828.html

llvm-svn: 217296
2014-09-06 01:21:19 +00:00
Nick Lewycky 095b92e51b Check whether the iterator p == the end iterator before trying to dereference it. This is a speculative fix for a failure found on the valgrind buildbot triggered by a clang test.
llvm-svn: 217295
2014-09-06 01:16:42 +00:00
Alexey Samsonov ba1ecbc7d3 Fix right shift by 64 bits detected on CXX/lex/lex.literal/lex.ext/p4.cpp
test case on UBSan bootstrap bot.

This fixes the last failure of "check-clang" in UBSan bootstrap bot.

llvm-svn: 217294
2014-09-06 00:41:19 +00:00
Richard Smith 091405d7e3 Reword switch/goto diagnostics "protected scope" diagnostics. Making up a term
"protected scope" is very unhelpful here and actively confuses users. Instead,
simply state the nature of the problem in the diagnostic: we cannot jump from
here to there. The notes explain nicely why not.

llvm-svn: 217293
2014-09-06 00:24:58 +00:00
Sean Silva 5e44ffdb3e [docs] Document what "NFC" means in a commit message.
llvm-svn: 217292
2014-09-06 00:19:16 +00:00
Lang Hames 018452e6bc [MCJIT] Fix an iterator invalidation bug in MCJIT::finalizeObject.
The finalizeObject method calls generateCodeForModule on each of the currently
'added' objects, but generateCodeForModule moves objects out of the 'added'
set as it's called. To avoid iterator invalidation issues, the added set is
copied out before any calls to generateCodeForModule.

This should fix http://llvm.org/PR20851 .

llvm-svn: 217291
2014-09-05 23:38:35 +00:00
David Blaikie f5f9a83668 Fix r217275 to work without the need for standard headers being included
It seems (I guess) in ObjC that va_list is provided without the need for
inclusions. I verified that with this change the test still crashes in
the absence of the fix committed in r217275.

llvm-svn: 217290
2014-09-05 23:36:59 +00:00
Chandler Carruth 21d27ee95b [x86] Fix an embarressing bug in the INSERTPS formation code. The mask
computation was totally wrong, but somehow it didn't really show up with
llc.

I've added an assert that triggers on multiple existing test cases and
updated one of them to show the correct value.

There appear to still be more bugs lurking around insertps's mask. =/
However, note that this only really impacts the new vector shuffle
lowering.

llvm-svn: 217289
2014-09-05 23:19:45 +00:00
Akira Hatanaka 489decec67 [inline asm] Add a check in InlineAsm::ConstraintInfo::Parse to make sure '{'
follows '~' in a clobber constraint string.

Previously llc would hit an llvm_unreachable when compiling an inline-asm
instruction with malformed constraint string "~x{21}". This commit enables
LLParser to catch the error earlier and print a more helpful diagnostic.

rdar://problem/14206559

llvm-svn: 217288
2014-09-05 22:30:32 +00:00
Todd Fiala cefdbdf2fe Added logging of the POSIX-DYLD rendezvous address (i.e. the info_location address)
llvm-svn: 217287
2014-09-05 22:28:40 +00:00
Sanjay Patel 75cc90eddc Allow vector fsub ops with constants to get the same optimizations as scalars.
This problem is bigger than just fsub, but this is the minimum fix to solve
fneg for PR20556 ( http://llvm.org/bugs/show_bug.cgi?id=20556 ), and we solve
zero subtraction with the same change.

llvm-svn: 217286
2014-09-05 22:26:22 +00:00
Rui Ueyama 47a8a83dc3 FileArchive cleanup
Moved code used only by isDataSymbol from find to isDataSymbol member
function. Also changed the return type of isDataSymbol because
previously "if (isDataSymbol(...))" meant "if it is *not* a data symbol"
which is opposite from what you'd expect.

llvm-svn: 217285
2014-09-05 22:06:07 +00:00
Alexey Samsonov 62063b46fc Use "-gline-tables-only" instead of "-g" in sanitizer test suites.
We are interested in verifying that -gline-tables-only provides enough
debug information for verbose error reports and symbolized stack traces.

llvm-svn: 217284
2014-09-05 22:05:32 +00:00
Todd Fiala c82f650a2b Add more logging to DynamicLoaderPOSIXDYLD, especially around rendezvous handling.
Covers more of the behavior of rendezvous breakpoint handling and other
dynamic loader aspects, all on the 'enable log lldb dyld' log channel.

llvm-svn: 217283
2014-09-05 22:01:04 +00:00
Enrico Granata 744794aa96 Start plumbing the type validator logic through to the ValueObjects; allow a ValueObject to have a validator, to update it from the FormatManager, and to retrieve (and cache) the result of the validation
llvm-svn: 217282
2014-09-05 21:46:22 +00:00
Rafael Espindola d31dc048ca Fix pr20078.
When linking llvm.global_ctors with the optional third element we have to handle
it specially and only copy the elements whose keys were also copied.

llvm-svn: 217281
2014-09-05 21:27:52 +00:00
Todd Fiala 4bce548a6b Add TypeValidator.cpp to cmake build.
llvm-svn: 217280
2014-09-05 21:23:09 +00:00
Bjorn Steinbrink 5a121b2ef5 Restore the ability to check if LLVMCreateObjectFile was successful
Summary:
Until r216870 LLVMCreateObjectFile returned nullptr in case of an error,
so callers could check if the call was successful. Now, it always
returns an OwningBinary wrapped as an LLVMObjectFileRef, so callers
can't check if the call was successul.

This results in a segfault running e.g.

 llvm-c-test --object-list-sections < /dev/null

So the old behaviour should be restored.

Subscribers: llvm-commits

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

llvm-svn: 217279
2014-09-05 21:22:09 +00:00
Sanjay Patel f4b8debc1c clean up; NFC
llvm-svn: 217278
2014-09-05 20:55:46 +00:00
Enrico Granata c582713ce6 Introduce the notion of a "type validator" formatter
Type Validators have the purpose of looking at a ValueObject, and making sure that there is nothing semantically wrong about the object's contents
For instance, if you have a class that represents a speed, the validator might trigger if the speed value is greater than the speed of light

This first patch hooks up the moving parts in the formatters subsystem, but does not link ValueObjects to TypeValidators, nor lets the SB API be exposed to validators
It also lacks the notion of Python validators

llvm-svn: 217277
2014-09-05 20:45:07 +00:00
Jonathan Roelofs afe6794bc2 Address some post-commit review comments on r217261
llvm-svn: 217276
2014-09-05 20:28:44 +00:00
Ben Langmuir bb1c918ec8 Move the initialization of VAListTagName after InitializeSema()
This innocuous statement to get the identifier info for __va_list_tag
was causing an assertion failure:
  NextIsPrevious() && "decl became non-canonical unexpectedly"
if the __va_list_tag identifier was found in a PCH in some
circumstances, because it was looked up before the ASTReader had a Sema
object to use to find existing decls to merge with.

We could possibly move getting the identifier info even later, or make
it lazy if we wanted to, but this seemed like the minimal change.

Now why a PCH would have this identifier in the first place is a bit
mysterious. This seems to be related to the global module index in some
way, because when the test case is built without the global module index
it will not emit an identifier for __va_list_tag into the PCH, but with
the global module index it does.

llvm-svn: 217275
2014-09-05 20:24:27 +00:00
Samuel Benzaquen 7ec2cb2fda Separate the matchers by type and statically dispatch to the right list.
Summary:
Separate the matchers by type and statically dispatch to the right list.
For any node type that we support, it reduces the number of matchers we
run it through.
For node types we do not support, it makes match() a noop.
This change improves our clang-tidy related benchmark by ~30%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 217274
2014-09-05 20:15:31 +00:00
Reid Kleckner e89756f32a Fix CMake configuration
llvm-svn: 217273
2014-09-05 20:11:22 +00:00
Reid Kleckner 3fe67c9fc1 Require an x86 target for ms-inline-asm-return.cpp instead of XFAIL
llvm-svn: 217272
2014-09-05 20:06:06 +00:00
Jonathan Roelofs b3fcc67f8f Allow libc++ to be built on systems without POSIX threads
If you're crazy enough to want this sort of thing, then add
-D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and
--param=additiona_features=libcpp-has-no-threads to your lit commnad line.

http://reviews.llvm.org/D3969

llvm-svn: 217271
2014-09-05 19:45:05 +00:00
Alexey Samsonov d3e121331b [DWARF parser] Fix nasty memory corruption in .dwo files handling.
Forge a test case where llvm-symbolizer has to use external .dwo
file to produce the inlining information.

llvm-svn: 217270
2014-09-05 19:29:45 +00:00
Kuba Brecka e4d4801c3a [lldb] Abstract a superclass for a generic thread container.
Reviewed at
http://reviews.llvm.org/D5200
and
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012799.html

llvm-svn: 217269
2014-09-05 19:13:15 +00:00
Jonathan Roelofs b352db7f57 Bugfix: allow additional_features to be empty
llvm-svn: 217268
2014-09-05 19:03:46 +00:00
Rafael Espindola 262b90321a The gold tests also require ppc to be compiled in.
We could create a tools/gold/PowerPC and a tools/gold/X86, but it doesn't seem
worth it.

llvm-svn: 217267
2014-09-05 19:01:12 +00:00
Rafael Espindola b582372e87 Revert "Disable the fix for pr20793 because of a gnu ld bug."
This reverts commit r217211.

Both the bfd ld and gold outputs were valid. They were using a Rela relocation,
so the value present in the relocated location was not used, which caused me
to misread the output.

llvm-svn: 217264
2014-09-05 18:03:38 +00:00
Lang Hames 3e930a3e83 [MCJIT] Const-ify the symbol lookup operations on RuntimeDyld.
llvm-svn: 217263
2014-09-05 18:00:16 +00:00
Jonathan Roelofs 3b7f085db1 s/LIBCXXABI_SINGLE_THREADED/LIBCXXABI_HAS_NO_THREADS/ for consistency with libcxx
Also remove the audotedection part so that if you're crazy enough to want a
single-threaded abi library, you'll say so explicitly in the build.

llvm-svn: 217262
2014-09-05 17:46:40 +00:00
Jonathan Roelofs 3547c5441e Set -D_LIBCPP_HAS_NO_THREADS and -D_LIBCPP_HAS_NO_MONOTONIC_CLOCK based on available_features
http://reviews.llvm.org/D5214

llvm-svn: 217261
2014-09-05 17:21:57 +00:00
Adrian Prantl e5e8ce64de Set the parent pointer of cloned DBG_VALUE instructions correctly.
Fixes PR20523.

When spilling variables onto the stack, spillVirtReg() is setting the
parent pointer of the cloned DBG_VALUE intrinsic for the stack location
to the parent pointer of the original intrinsic. MachineInstr parent
pointers should however always point to the parent basic block.

MBB is shadowing the MBB member variable. The instruction still ends up
being inserted into the right basic block, because it's inserted after MI
which serves as the iterator.

I failed at constructing a reliable testcase for this, see
http://llvm.org/bugs/show_bug.cgi?id=20523 for a large testcases.

llvm-svn: 217260
2014-09-05 17:10:10 +00:00
Reid Kleckner e2793c009e -frewrite-includes: Normalize line endings to match the main source file
It is very common to include headers with DOS-style line endings, such
as windows.h, from source files with Unix-style line endings.
Previously, we would end up with mixed line endings and #endifs that
appeared to be on the same line:

  #if 0 /* expanded by -frewrite-includes */
  #include <windows.h>^M#endif /* expanded by -frewrite-includes */

Clang treats either of \r or \n as a line ending character, so this is
purely a cosmetic issue.

This has no automated test because most Unix tools on Windows will
implictly convert CRLF to LF when reading files, making it very hard to
detect line ending mismatches. FileCheck doesn't understand {{\r}}
either.

Fixes PR20552.

llvm-svn: 217259
2014-09-05 16:49:50 +00:00
Jordan Rose f69e65f75c [analyzer] Don't crash if malloc() has an unexpected function prototype.
Patch by Daniel Fahlgren!

llvm-svn: 217258
2014-09-05 16:33:51 +00:00
Toma Tabacu 901ba6ea2e [mips] Change Feature-related types from unsigned to uint64_t in MipsAsmParser. No functional changes.
Summary: Found a couple of cases where unsigned was still being used. These two should be the last ones in the (entire) Mips backend.

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 217257
2014-09-05 16:32:09 +00:00
Matt Arsenault 8ae5961065 R600/SI: Use same complex patterns for DS atomics
This fixes hitting the same negative base offset problem
that was already fixed for regular loads and stores.

llvm-svn: 217256
2014-09-05 16:24:58 +00:00
Daniel Sanders 1fcea42e67 [mips] Marked the Trap-on-Condition instructions as Mips II
Patch by Vasileios Kalintiris.

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 217255
2014-09-05 15:50:13 +00:00
Toma Tabacu 3c24b0483a [mips] Rename data members and member functions in MipsAssemblerOptions.
Summary: Use the naming convention from the LLVM Coding Standards.

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 217254
2014-09-05 15:43:21 +00:00
Todd Fiala bc5353a83c Properly handle the DYLD attach step for GDB remotes.
Change by Stephane Sezer.

llvm-svn: 217253
2014-09-05 15:06:16 +00:00
Todd Fiala 0cc371c166 Set the process vendor in GDBRemoteCommunicationClient::GetCurrentProcessInfo.
Change by Stephane Sezer.

llvm-svn: 217252
2014-09-05 14:56:13 +00:00
Todd Fiala 0ee56ce640 Add error report when Module::GetObjectFile() fails to find a plugin to open an object file.
Change by Stephane Sezer.

llvm-svn: 217251
2014-09-05 14:48:49 +00:00