Commit Graph

188949 Commits

Author SHA1 Message Date
Toma Tabacu 83cd33c4f6 [mips] Clean up the CodeGen/Mips/inlineasmmemop.ll test. NFC.
Summary:
Improve comments and remove a redundant attribute list.
There are no functional changes (to the CHECK's or to the code).

Part of these changes were suggested in http://reviews.llvm.org/D6637.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 224517
2014-12-18 13:03:51 +00:00
Robert Khasanov 79fb7292d7 [AVX512] Enable FP arithmetic lowering for AVX512VL subsets.
Added RegOp2MemOpTable4 to transform 4th operand from register to memory in merge-masked versions of instructions. 
Added lowering tests.

llvm-svn: 224516
2014-12-18 12:28:22 +00:00
Yaron Keren 3a03797241 Enabling this test again on mingw. The problem seems to happen when
two identical module.modulemap are available on the include path and
so should be fixed in the mingw driver include dies, when we'll have it.

llvm-svn: 224515
2014-12-18 12:13:14 +00:00
Viktor Kutuzov b4ffb5d5e9 [Msan] Generalize instrumentation code to support FreeBSD mapping
Differential Revision: http://reviews.llvm.org/D6666

llvm-svn: 224514
2014-12-18 12:12:59 +00:00
Daniel Jasper 3a623dbd2a clang-format: Fix incorrect detection of ObjC "in" keyword.
Before:
  for (auto v : in [1]) { ..

After:
  for (auto v : in[1]) { ..

llvm-svn: 224513
2014-12-18 12:11:01 +00:00
Serge Pavlov 07c0f04e08 Fixed warnings on redefine keywords and reserved ids.
Repared support for warnings -Wkeyword-macro and -Wreserved-id-macro.
The warning -Wkeyword-macro now is not issued in patterns that are used
in configuration scripts:

    #define inline

also for 'const', 'extern' and 'static'. If macro repalcement is identical
to macro name, the warning also is not issued:

    #define volatile volatile

And finally if macro replacement is also a keyword identical to the replaced
one but decorated with leading/trailing underscores:

    #define inline __inline
    #define inline __inline__
    #define inline _inline // in MSVC compatibility mode

Warning -Wreserved-id-macro is off by default, it could help catching
things like:

    #undef __cplusplus

llvm-svn: 224512
2014-12-18 11:14:21 +00:00
Dmitry Vyukov 794771b08b tsan: disable the test even harder
currently it fails in cmake build with weird errors:

/tmp/real_deadlock_detector_stress_test-68a5ae.o: In function `__clang_call_terminate':
/ssd/src/llvm/projects/compiler-rt/test/tsan/real_deadlock_detector_stress_test.cc:(.text.__clang_call_terminate[__clang_call_terminate]+0x12): undefined reference to `__cxa_begin_catch'
/ssd/src/llvm/projects/compiler-rt/test/tsan/real_deadlock_detector_stress_test.cc:(.text.__clang_call_terminate[__clang_call_terminate]+0x17): undefined reference to `std::terminate()'
/tmp/real_deadlock_detector_stress_test-68a5ae.o: In function `std::vector<int, std::allocator<int> >::_M_check_len(unsigned long, char const*) const':
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_vector.h:1339: undefined reference to `std::__throw_length_error(char const*)'
/tmp/real_deadlock_detector_stress_test-68a5ae.o: In function `__gnu_cxx::new_allocator<int>::allocate(unsigned long, void const*)':
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ext/new_allocator.h:102: undefined reference to `std::__throw_bad_alloc()'
/tmp/real_deadlock_detector_stress_test-68a5ae.o:(.eh_frame+0x63): undefined reference to `__gxx_personality_v0'
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)

llvm-svn: 224511
2014-12-18 10:55:41 +00:00
Dmitry Vyukov 8c7baa4abc tsan: add a stress test for deadlock detector
currently disabled because fails

llvm-svn: 224509
2014-12-18 10:32:48 +00:00
Dmitry Vyukov e1881269f8 tsan: don't crash with NULL deref during reporting
tctx==NULL crash observed during deadlock reporting.
There seems to be some bugs in the deadlock detector,
but it is still useful to be more robust during reporting.

llvm-svn: 224508
2014-12-18 10:19:32 +00:00
Dmitry Vyukov a4cd69217b tsan: disable flaky debug check
see the comment for details

llvm-svn: 224507
2014-12-18 10:17:01 +00:00
Yaron Keren 06d6930b68 Fix Visual C++ error "'llvm::make_unique' : ambiguous call to overloaded function".
llvm-svn: 224506
2014-12-18 10:03:35 +00:00
David Majnemer 2d3663e559 Parse: Don't parse after the eof has been consumed
ParseCXXNonStaticMemberInitializer stashes away all the tokens for the
initializer and an additional EOF token to denote where the initializer
ends.  However, it is possible for ParseLexedMemberInitializer to get
its hands on the "real" EOF token; since the two tokens are
indistinguishable, we end up consuming the EOF and descend into madness.

Instead, make it possible to tell which EOF token we are looking at.

This fixes PR21872.

llvm-svn: 224505
2014-12-18 09:57:31 +00:00
Alexey Bataev 7cb1789011 Fix for PR21915: assert on multidimensional VLA in function arguments.
Fixed assertion on type checking for arguments and parameters on function call if arguments are pointers to VLA
Differential Revision: http://reviews.llvm.org/D6655

llvm-svn: 224504
2014-12-18 06:54:53 +00:00
Bob Wilson f5ba8288ad Change -save-temps to emit unoptimized bitcode files.
It is often convenient to use -save-temps to collect the intermediate
results of a compilation, e.g., when triaging a bug report. Besides the
temporary files for preprocessed source and assembly code, this adds the
unoptimized bitcode files as well.

This adds a new BackendJobAction, which is mostly mechanical, to run after
the CompileJobAction. When not using -save-temps, the BackendJobAction is
combined into one job with the CompileJobAction, similar to the way the
integrated assembler is handled. I've implemented this entirely as a
driver change, so under the hood, it is just using -disable-llvm-optzns
to get the unoptimized bitcode.

Based in part on a patch by Steven Wu.
rdar://problem/18909437

llvm-svn: 224503
2014-12-18 06:08:26 +00:00
Saleem Abdulrasool 3a23917d48 ARM: improve instruction validation for thumb mode
The ARM Architecture Reference Manual states the following:
  LDM{,IA,DB}:
    The SP cannot be in the list.
    The PC can be in the list.
    If the PC is in the list:
      • the LR must not be in the list
      • the instruction must be either outside any IT block, or the last
        instruction in an IT block.
  POP:
    The PC can be in the list.
    If the PC is in the list:
      • the LR must not be in the list
      • the instruction must be either outside any IT block, or the last
        instruction in an IT block.
  PUSH:
    The SP and PC can be in the list in ARM instructions, but not in Thumb
    instructions.
  STM:{,IA,DB}:
    The SP and PC can be in the list in ARM instructions, but not in Thumb
    instructions.

llvm-svn: 224502
2014-12-18 05:24:38 +00:00
Saleem Abdulrasool 69973e0fa0 test: avoid unnecessary temporary files
Use pipes and redirect the error output to FileCheck directly.  NFC.

llvm-svn: 224501
2014-12-18 05:24:32 +00:00
Chandler Carruth 68ea415d04 [SROA] Cleanup - remove the use of std::mem_fun_ref nonsense and use
a lambda now that we have them.

llvm-svn: 224500
2014-12-18 05:19:47 +00:00
Rafael Espindola 7d727b5f11 Modernize the getStreamedBitcodeModule interface a bit. NFC.
llvm-svn: 224499
2014-12-18 05:08:43 +00:00
Craig Topper f7df7221d1 [PowerPC] Use MCPhysReg for tables of registers. Const-correct the tables. Only put the anonymous namespace around classes. NFC.
llvm-svn: 224498
2014-12-18 05:02:14 +00:00
Craig Topper 5645f6b45b [X86] Use correct opsize on indirect call and jump aliases.
llvm-svn: 224497
2014-12-18 05:02:12 +00:00
Craig Topper 9480732be2 [X86] Don't use PS prefix on LDMXCSR/STMXCSR.
Near as I can tell prefixes are ignored on these instructions except for a comment in the Intel docs about 0xf3. Binutils disassembler seems to ignore prefixes on these instructions. Our disassembler still doesn't distinguish PS and "no prefix" well enough for this to make a functional change, but it helps with experiments I'm doing on a potential new disassembler table builder.

llvm-svn: 224496
2014-12-18 05:02:10 +00:00
Craig Topper 2e2aee0cd6 [X86] Remove unnecessary 'In64BitMode' predicate for instructions that already indicate use of REX.W.
llvm-svn: 224495
2014-12-18 05:02:08 +00:00
Justin Hibbits 88030b94c6 Add a corresponding '@LOCAL' parse to match r224415.
Pointed out by Jim Grosbach.

llvm-svn: 224494
2014-12-18 03:06:37 +00:00
Eric Christopher 526ca20011 Update for llvm front end change and use the TargetOptions struct
for ABI.

llvm-svn: 224493
2014-12-18 02:23:27 +00:00
Eric Christopher 661f2d1ca1 Add a new string member to the TargetOptions struct for the name
of the abi we should be using. For targets that don't use the
option there's no change, otherwise this allows external users
to set the ABI via string and avoid some of the -backend-option
pain in clang.

Use this option to move the ABI for the ARM port from the
Subtarget to the TargetMachine and update the testcases
accordingly since it's no longer valid to set via -mattr.

llvm-svn: 224492
2014-12-18 02:20:58 +00:00
Eric Christopher 560cc4fb44 Make sure that arm-linux-gnu is still the apcs-gnu ABI when we
use clang -cc1 matching the front end and backend. Fix up a couple
of tests that were testing aapcs for arm-linux-gnu.

The test that removes the aapcs abi calling convention removes
them because the default triple matches what the backend uses
for the calling convention there and so it doesn't need to be
explicitly stated - see the code in TargetInfo.cpp.

llvm-svn: 224491
2014-12-18 02:08:55 +00:00
Eric Christopher 7a8b31d631 Reinstate aapcs as the default arm abi.
llvm-svn: 224490
2014-12-18 02:08:51 +00:00
Eric Christopher 1971c3508a Model ARM backend ABI selection after the front end code doing the
same. This will change the "bare metal" ABI from APCS to AAPCS.

The only difference between the front and back end code is that
the code for Triple::GNU was added for environment. That will migrate
to the front end shortly.

Tests updated with the ABI they were originally testing in the case
of bare metal (e.g. -mtriple armv7) or with a -gnu for arm-linux
triples.

llvm-svn: 224489
2014-12-18 02:08:45 +00:00
Petar Jovanovic 7a6f5e47cf Do not define CRT_HAS_128BIT for MIPS64
Do not define it for MIPS64 until its backend supports it.
See the bug report [1] for more information.

[1] http://llvm.org/bugs/show_bug.cgi?id=20098

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

llvm-svn: 224488
2014-12-18 01:21:33 +00:00
Duncan P. N. Exon Smith fda0cee7c6 Reapply "Linker: Drop superseded subprograms"
This reverts commit r224416, reapplying r224389.  The buildbots hadn't
recovered after my revert, waiting until David reverted a couple of his
commits.  It looks like it was just bad timing (where we were both
modifying code related to the same assertion).  Trying again...

Here's the original text:

    When a function gets replaced by `ModuleLinker`, drop superseded
    subprograms.  This ensures that the "first" subprogram pointing at a
    function is the same one that `!dbg` references point at.

    This is a stop-gap fix for PR21910.  Notably, this fixes Release+Asserts
    bootstraps that are currently asserting out in
    `LexicalScopes::initialize()` due to the explicit instantiations in
    `lib/IR/Dominators.cpp` eventually getting replaced by -argpromotion.

llvm-svn: 224487
2014-12-18 01:05:33 +00:00
Duncan P. N. Exon Smith 9fb3665426 IR: Make DICompositeType mutators private
Make `DICompositeType` mutators private to prevent misuse.  All calls to
`setArrays()` and `setContainingType()` should go through
`DIBuilder::replaceArrays()` and `DIBuilder::replaceVTableHolder()`.

This is a follow-up to r224482 (now that clang has been updated in
r224483).

llvm-svn: 224486
2014-12-18 00:54:39 +00:00
Kevin Enderby d0b6b7fb7f Add printing the LC_LINKER_OPTION load command with llvm-objdump’s -private-headers.
Also corrected the name of the load command to not end in an ’S’ as well as corrected
the name of the MachO::linker_option_command struct and other places that had the
word option as plural which did not match the Mac OS X headers.

llvm-svn: 224485
2014-12-18 00:53:40 +00:00
Duncan P. N. Exon Smith c8ee63e2d0 CGDebugInfo: Use DIBuilder API for self-referencing DICompositeTypes
Use new `DIBuilder` API from LLVM r224482 to mutate `DICompositeType`s,
rather than changing them directly.  This allows `DIBuilder` to track
otherwise orphaned cycles when `CollectContainingType()` creates a
self-reference.

Fixes PR21941.

llvm-svn: 224483
2014-12-18 00:48:56 +00:00
Duncan P. N. Exon Smith 97f07c2778 IR: Handle self-referencing DICompositeTypes in DIBuilder
Add API to DIBuilder to handle self-referencing `DICompositeType`s.

Self-references aren't expected in the debug info graph, and we take
advantage of that by only calling `resolveCycles()` on nodes that were
once forward declarations (otherwise, DIBuilder needs an expensive
tracking reference to every unresolved node it creates, which in cyclic
graphs is *all of them*).

However, clang seems to create self-referencing `DICompositeType`s.  Add
API to manage this safely.  The paired commit to clang will include the
regression test.

I'll make the `DICompositeType` API `private` in a follow-up to prevent
misuse (I've separated that to prevent build failures from missing the
clang commit).

llvm-svn: 224482
2014-12-18 00:46:16 +00:00
Alexey Samsonov d927bd8d15 [dsymutil] Fix missing member initializer.
This bug was found by the MSan bootstrap bot:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/5330/steps/check-llvm%20msan/logs/stdio

llvm-svn: 224481
2014-12-18 00:45:32 +00:00
Reid Kleckner ae628965c4 Fix diagnostic for static methods referencing fields from using decls
Previously we thought the instance member was a function, not a field,
and we'd say something silly like:
  t.cpp:4:27: error: call to non-static member function without an object argument
    static int f() { return n; }
                            ^

Noticed in PR21923.

llvm-svn: 224480
2014-12-18 00:42:51 +00:00
Fariborz Jahanian 323ddf97ba [Objective-C]. Modern property getters have side-effects.
So, place warning about property getter should not be used for side-effect
under its own group so warning can be turned off.
rdar://19137815

llvm-svn: 224479
2014-12-18 00:30:54 +00:00
Richard Trieu 2b8ff7e461 Fix a function that only calls itself. The const_cast needs to remove the
const so that the other overloaded function will be called.

llvm-svn: 224478
2014-12-18 00:06:45 +00:00
Dan Albert 12c0c8b67f [libcxxabi] Add __cxa_thread_atexit for TLS support on Linux.
Summary:
Fixes PR21738.

The implementation for this is handled by __cxa_thread_atexit_impl,
which is supplied by libc.

More information:
https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables

Reviewers: mclow.lists, EricWF, jroelofs

Reviewed By: jroelofs

Subscribers: majnemer, cfe-commits

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

llvm-svn: 224477
2014-12-18 00:03:57 +00:00
Justin Bogner 8e015ff43b InstrProf: Simplify/reduce state in CoverageMapping (NFC)
This state object makes things harder to reason about and isn't really
useful, since we can just emit the mappings before the state changes
rather than holding on to it.

llvm-svn: 224476
2014-12-17 23:55:04 +00:00
Rafael Espindola d1cdcb2377 Revert "Put static local variables of inline functions in the function comdat."
This reverts commit r224369.

Thanks to Reid Kleckner for pointing out that we need a bigger gun to fix this
case.

llvm-svn: 224475
2014-12-17 23:49:22 +00:00
Alexey Samsonov ae23ffb751 [ASan] Mark test for -fsized-delete as XFAIL for dynamic runtime.
-fsized-delete is implemented via weak symbols, and doesn't work
properly when malloc/free replacements are provided in shared
ASan runtime.

llvm-svn: 224474
2014-12-17 23:46:53 +00:00
Alexey Samsonov 658e2d274d [ASan] Add -ldl to linker invocation to lit tests that require it.
This fixes these tests under dynamic ASan runtime.

llvm-svn: 224473
2014-12-17 23:46:49 +00:00
Renato Golin 518a7b2585 Fix obvious cut&paste error on AArch64 Compiler-RT settings
llvm-svn: 224472
2014-12-17 23:43:39 +00:00
Reid Kleckner af9bf59ba9 Don't assume friended C++ method decls have qualifiers
There are a few cases where unqualified lookup can find C++ methods.
Unfortunately, none of them seem to have illegal access paths, so I
can't excercise the diagnostic source range code that I am changing
here.

Fixes PR21851, which was a crash on valid.

llvm-svn: 224471
2014-12-17 23:40:46 +00:00
Alexey Samsonov 969902b43b [ASan] Always build shared ASan runtime on Linux.
This commit changes the strategy for building shared ASan runtime
and the way we test it:
  - COMPILER_RT_BUILD_SHARED_ASAN CMake option is removed. We now
    always build shared ASan runtime (it is the default on Android,
    Windows and Mac, and not the default on Linux and FreeBSD).
  - Platforms, which use static runtime by default now have
    "check-asan-dynamic" testsuite. This testsuite contains instrumented
    unit tests, and ASan lit tests, and runs them with shared ASan
    runtime. This testsuite is *not* a part of "check-asan" and
    *not* a part of "check-all", as adding 1000 more test cases, which
    duplicate existing ones is costly. However, you're welcome to
    add this command to your buildbot.

llvm-svn: 224470
2014-12-17 23:14:01 +00:00
Kostya Serebryany 20f3a52249 [sanitizer] add CombinedAllocator::InitIfLinkerInitialized and use it in lsan: speeds up lsan start-up time by ~25%
llvm-svn: 224469
2014-12-17 23:06:36 +00:00
Eric Christopher c9d1c27d48 Fix a format string warning by noting that StringIsBreakpointName
will set the error accordingly and so there's no need to set it
again.

llvm-svn: 224468
2014-12-17 22:26:32 +00:00
Eric Christopher f70824428e Fix initialization order to match that of the source.
llvm-svn: 224467
2014-12-17 22:25:37 +00:00
Duncan P. N. Exon Smith 140d41b791 LTO: Lazy-load LTOModule in local contexts
Start lazy-loading `LTOModule`s that own their contexts.  These can only
really be used for parsing symbols, so its unnecessary to ever
materialize their functions.

I looked into using `IRObjectFile::create()` and optionally calling
`materializAllPermanently()` afterwards, but this turned out to be
awkward.

  - The default target triple and data layout logic needs to happen
    *before* the call to `IRObjectFile::IRObjectFile()`, but after
    `Module` was created.

  - I tried passing a lambda in to do the module initialization, but
    this seemed to require threading the error message from
    `TargetRegistry::lookupTarget()` through `std::error_code`.

  - I also looked at setting `errMsg` directly from within the lambda,
    but this didn't look any better.

(I guess there's a reason we weren't already using that function.)

llvm-svn: 224466
2014-12-17 22:05:42 +00:00