Commit Graph

211718 Commits

Author SHA1 Message Date
Rui Ueyama 47d4f9496c Remove trailing whitespaces.
llvm-svn: 249037
2015-10-01 17:33:36 +00:00
George Rimar ee05828261 [ELF2] Implement --allow-shlib-undefined as default behavior.
We ignore --{no,}allow-shlib-undefined options and always allow undefined
symbols if we are building a DSO.

llvm-svn: 249036
2015-10-01 17:24:24 +00:00
NAKAMURA Takumi 096492a07b Reformat.
llvm-svn: 249033
2015-10-01 17:01:03 +00:00
NAKAMURA Takumi 1ed20db720 Revert r248959, "[WinEH] Emit int3 after noreturn calls on Win64"
It broke; LLVM :: CodeGen__Generic__2009-11-16-BadKillsCrash.ll

llvm-svn: 249032
2015-10-01 17:00:56 +00:00
Adrian Prantl 42ce2d3ba3 Module debugging: Also emit Objective-C interfaces forward declarations
in their module scope when building a clang module.

llvm-svn: 249031
2015-10-01 16:57:02 +00:00
Vasileios Kalintiris 447e35701a Allow a ToolChain to compute the path of a compiler-rt's component.
Summary:
This patch moves getCompilerRT() from the clang::driver::tools namespace to
the ToolChain class. This is needed for multilib toolchains that need to
place their libraries in Clang's resource directory with a layout that is
different from the default one.

Reviewers: atanasyan, rsmith

Subscribers: tberghammer, danalbert, srhines, cfe-commits

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

llvm-svn: 249030
2015-10-01 16:54:58 +00:00
Igor Kudrin d912ee9595 [ELF2] Add -Bstatic and -Bdynamic command line switches
Summary:
These switches affect library searching for '-l' which follow them. Synonym forms are also supported:
* -dy and -call_shared for -Bdynamic switch
* -dn, -non_shared and -static for -Bstatic switch 

Reviewers: rafael, ruiu

Subscribers: emaste, llvm-commits

Projects: #lld

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

llvm-svn: 249029
2015-10-01 16:42:03 +00:00
Sean Callanan b92bd7538e Made Target hold a map of languages to TypeSystems, and added some accessors.
Also added some target-level search functions so that persistent variables and
symbols can be searched for without hand-iterating across the map of
TypeSystems.

llvm-svn: 249027
2015-10-01 16:28:02 +00:00
Rafael Espindola c8b158155c Copy DT_SONAME to DT_NEEDED.
If a shared library has a DT_SONAME entry, that is what should be included
in the DT_NEEDED of a program using it.

We don't implement -soname yet, so check in a .so for now.

llvm-svn: 249025
2015-10-01 15:47:50 +00:00
Rui Ueyama bd35d75e42 ELF2: Linker scripts can refer other linker scripts. Test that.
This did not work before r249023.

llvm-svn: 249024
2015-10-01 15:45:41 +00:00
Rui Ueyama 983ed2b749 ELF2: Define Driver::addFile() as a one-stop place to open a file.
Opening a file and dispatching to readLinkerScript() or createFile()
is a common operation. We want to use that at least from Driver and
from LinkerScript. In COFF, we had the same problem. This patch
resolves the problem in the same way as we did for COFF.

Now, if you have a path that you want to open, just call
Driver->addFile(StringRef). That function opens the file and handles
that as if that were given by command line. This function is the
only place we call identify_magic().

llvm-svn: 249023
2015-10-01 15:23:09 +00:00
Rafael Espindola 812f57e6dc Use more strict types. NFC.
On 32 bit ELF these are 32 bit values.

llvm-svn: 249022
2015-10-01 15:22:42 +00:00
Sagar Thakur 2ee26ee37b Romove accidentially added statement in r249020
llvm-svn: 249021
2015-10-01 15:15:42 +00:00
Sagar Thakur b8862c0107 [LLDB][MIPS] Fix gp register value for o32 applications on 64-bit target
GP registers for o32 applications were always giving zero value because SetType() on the RegisterValue was causing the accessor functions to pickup the value from m_scalar of RegisterValue which is zero.
In this patch byte size and byte order of register value is set at the time of setting the value of the register.

llvm-svn: 249020
2015-10-01 15:05:31 +00:00
Benjamin Kramer 250c892ac1 [VFS] Remove unused setters. NFC.
llvm-svn: 249019
2015-10-01 15:02:15 +00:00
Arnaud A. de Grandmaison 849f3bf8c9 [InstCombine] Remove trivially empty lifetime start/end ranges.
Summary:
Some passes may open up opportunities for optimizations, leaving empty
lifetime start/end ranges. For example, with the following code:

    void foo(char *, char *);
    void bar(int Size, bool flag) {
      for (int i = 0; i < Size; ++i) {
        char text[1];
        char buff[1];
        if (flag)
          foo(text, buff); // BBFoo
      }
    }

the loop unswitch pass will create 2 versions of the loop, one with
flag==true, and the other one with flag==false, but always leaving
the BBFoo basic block, with lifetime ranges covering the scope of the for
loop. Simplify CFG will then remove BBFoo in the case where flag==false,
but will leave the lifetime markers.

This patch teaches InstCombine to remove trivially empty lifetime marker
ranges, that is ranges ending right after they were started (ignoring
debug info or other lifetime markers in the range).

This fixes PR24598: excessive compile time after r234581.

Reviewers: reames, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 249018
2015-10-01 14:54:31 +00:00
Angel Garcia Gomez 05ca3ec7d0 Update clang-tidy documentation.
Summary:
Improve modernize-use-auto documentation (https://llvm.org/bugs/show_bug.cgi?id=24962).
Add documentation for modernize-make-unique.

Reviewers: klimek

Subscribers: cfe-commits, alexfh

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

llvm-svn: 249017
2015-10-01 14:50:40 +00:00
Rui Ueyama 44f5d91af9 ELF2: Rename undefError -> reportUndefined.
The new name starts with a verb, and it does not imply that it errors
out and exit (it acutally can just emit a warning depending on settings.)

llvm-svn: 249016
2015-10-01 14:46:54 +00:00
Ulrich Weigand cf1670a095 [SystemZ] Add assembly instructions for obtaining clock values as well as CPU features
Provide assembler support for STCK, STCKF, STCKE, and STFLE.

Author: joncmu
Differential Revision: http://reviews.llvm.org/D13299

llvm-svn: 249015
2015-10-01 14:43:48 +00:00
Tamas Berghammer 3e8947be91 Fix Android-SDK detection on API 10 device
Run the getprop command with AdbClient::Shell instead of
Platform::RunShellCommand because getting the output from getprop
with Platform::RunShellCommand have some (currently unknown) issues.

llvm-svn: 249014
2015-10-01 13:58:01 +00:00
Tamas Berghammer 76011b63cd Fix breakpoint opcode calculation on Linux
Change the way we detect if we have to place a thumb breakpoint instead
of an arm breakpoint in the case when no symbol table or mapping symbols
are available. Detect it based on the LSB of the FileAddress instead of
the LSB of the LoadAddress because the LSB of the LoadAddress is already
masked out.

llvm-svn: 249013
2015-10-01 13:57:57 +00:00
Tamas Berghammer 3c47151d1a Restrict the scope of a hack in DYLDRendezvous
The hack is there to work around an incorrect load address reported
by the android linker on API 21 and 22 devices. This CL restricts the
hack to those android API levels.

Differential revision: http://reviews.llvm.org/D13288

llvm-svn: 249012
2015-10-01 13:57:54 +00:00
Chad Rosier b7c5b91068 [AArch64] Hoist commonly failing check. NFC.
llvm-svn: 249011
2015-10-01 13:43:05 +00:00
Johannes Doerfert 850d346302 [FIX] Parallel codegen for invariant loads
Hand down all preloaded values to the parallel subfunction.

llvm-svn: 249010
2015-10-01 13:40:36 +00:00
Hal Finkel a57b890a33 [PowerPC] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros on all PPC cores
We support all __sync_val_compare_and_swap_* builtins (only 64-bit on 64-bit
targets) on all cores, and should define the corresponding
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros, just as GCC does. As it turns out,
this is really important because they're needed to prevent a bad ODR violation
with libstdc++'s std::shared_ptr (this is well explained in PR12730).

We were doing this only for P8, but this is necessary on all PPC systems.

llvm-svn: 249009
2015-10-01 13:39:49 +00:00
Chad Rosier 0b15e7c618 [AArch64] Rename variable to improve readability. NFC.
llvm-svn: 249008
2015-10-01 13:33:31 +00:00
Chad Rosier 7a83d770ae [AArch64] Update comment to reflect reality.
llvm-svn: 249007
2015-10-01 13:09:44 +00:00
Angel Garcia Gomez 90bf895aa3 Prevent loop-convert from leaving empty lines after removing an alias declaration.
Summary: This fixes https://llvm.org/bugs/show_bug.cgi?id=17716.

Reviewers: klimek

Subscribers: cfe-commits, alexfh

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

llvm-svn: 249006
2015-10-01 13:08:21 +00:00
Renato Golin 41106188a4 Revert "Decorating virtual functions load with invariant.load" and fix
This reverts commit r248982 as it was breaking the ARM buildbots and the fix didn't work.
This reverts commit r248984, the fix that didn't work.

llvm-svn: 249005
2015-10-01 12:58:41 +00:00
Zoran Jovanovic 2960f3a346 [mips][microMIPS] Implement CACHEE, WRPGPR and WSBH instructions
Differential Revision: http://reviews.llvm.org/D10337

llvm-svn: 249004
2015-10-01 12:49:27 +00:00
Scott Douglass 290183d734 [ARM] More care with Thumb1 writeback in ARMLoadStoreOptimizer
Differential Revision: http://reviews.llvm.org/D13240

llvm-svn: 249002
2015-10-01 11:56:19 +00:00
Yaron Keren 54bb215fab C++11 rangify for loops, NFC.
llvm-svn: 249001
2015-10-01 11:19:28 +00:00
Johannes Doerfert e46925f324 [FIX] Erase stall results during the SCoP detection
With this patch we erase cached results for regions that are invalid
  as early as possible. If we do not (as before), it is possible that
  two expanded regions will have the same address and the tracked
  results for both are mixed. Currently this would "only" cause
  pessimism in later passes but that will change when we allow invariant
  loads in the SCoP.  Additionally, it triggers non-deterministic
  results as we might dismiss a later region because of results cached
  for an earlier one.

  There is no test case as the problem occurs only non-deterministically.

llvm-svn: 249000
2015-10-01 10:59:14 +00:00
Daniel Jasper e12597cc23 [clang-format] Add support of consecutive declarations alignment
This allows clang-format to align identifiers in consecutive
declarations. This is useful for increasing the readability of the code
in the same way the alignment of assignations is.

The code is a slightly modified version of the consecutive assignment
alignment code. Currently only the identifiers are aligned, and there is
no support of alignment of the pointer star or reference symbol.

The patch also solve the issue of alignments not being possible due to
the ColumnLimit for both the existing AlignConsecutiveAligments and the
new AlignConsecutiveDeclarations.

Patch by Beren Minor, thank you.

Review: http://reviews.llvm.org/D12362
llvm-svn: 248999
2015-10-01 10:06:54 +00:00
Tamas Berghammer 539cd118b2 Trim the output of mktem in PlatformAndroid::DownloadSymbolFile
Differential revision: http://reviews.llvm.org/D13293

llvm-svn: 248998
2015-10-01 09:42:23 +00:00
Alexander Kornienko eef2c237a5 [clang-tidy] fix add_new_check.py
Before this check, I would get the following error:

Updating ./misc/CMakeLists.txt...
Creating ./misc/NoReinterpret_castCheck.h...
Creating ./misc/NoReinterpret_castCheck.cpp...
Updating ./misc/MiscTidyModule.cpp...
Creating ../test/clang-tidy/misc-no-reinterpret_cast.cpp...
Creating ../docs/clang-tidy/checks/misc-no-reinterpret_cast.rst...
Traceback (most recent call last):

File "./add_new_check.py", line 271, in <module>
  main()
File "./add_new_check.py", line 267, in main
  update_checks_list(module_path)
File "./add_new_check.py", line 220, in update_checks_list
  os.listdir('docs/clang-tidy/checks')))
OSError: [Errno 2] No such file or directory: 'docs/clang-tidy/checks'

Patch by Matthias Gehre!

Differential revision: http://reviews.llvm.org/D13272

llvm-svn: 248997
2015-10-01 09:23:20 +00:00
Alexander Kornienko 30c423b1e3 [clang-tidy] Implement FixitHints for identifier references in IdentifierNamingCheck
This diff requires http://reviews.llvm.org/D13079 to be applied first. I wasn't sure about how to make patch series in Phabricator, and I wanted to keep the two separate for clarity.

It looks like that most cases can be supported with this patch. I'm not totally sure about the actual coverage though. I think that the matchers are very generic, but I'm still not totally fluent with the AST.

Patch by Beren Minor!

Differential revision: http://reviews.llvm.org/D13081

llvm-svn: 248996
2015-10-01 09:19:40 +00:00
Pavel Labath 746ffd6980 Revert "Fixing a subtle issue on Mac OS X systems with dSYMs..."
This reverts commit r248985, as it was breaking all remote
expression-evaluating tests (on android at least).

llvm-svn: 248995
2015-10-01 09:03:33 +00:00
Angel Garcia Gomez 2bfb7cbddb Add support for 'cbegin()' and 'cend()' on modernize-loop-convert.
Summary:
This fixes https://llvm.org/bugs/show_bug.cgi?id=22196 .

Also add a non-trivially copyable type to fix some tests that were meant to be about using const-refs, but were changed in r248438.

Reviewers: klimek

Subscribers: alexfh, cfe-commits

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

llvm-svn: 248994
2015-10-01 08:57:11 +00:00
Eric Fiselier 7362982e62 Attempt to prevent flaky thread.mutex tests by once again increasing timing tolerances
llvm-svn: 248993
2015-10-01 08:34:37 +00:00
Bruce Mitchener f0248ca545 Add a Post-Build Event on Windows to copy the correct custom Python DLL to the LLDB binaries dir
Summary:
After a developer builds LLDB from source on Windows (assuming they've built it with Python support enabled), they may be somewhat flustered when it fails to launch with a cryptic error.

{F890625}

This happens because Windows can't find python27.dll (or python27_d.dll in case LLDB was built in debug mode). Many developers may have previously installed a release build of Python 2.7 and will not notice anything is amiss when they run a release build of LLDB because Windows will load the python27.dll from one of the system directories or `PATH` (rather than the one that the LLDB build instructions tell them to build). The issue tends to be more pronounced with debug builds of LLDB, since fewer developers probably have python27_d.dll sitting in one of the Windows system directories.

To ensure Windows loads the correct custom built Python DLL when launching LLDB I've added a post-build event that copies the relevant DLL (based on the LLDB build configuration) from `PYTHON_HOME` to the directory in which the LLDB executable is generated.

Patch by Vadim Macagon. Thanks!

Reviewers: brucem, zturner

Subscribers: lldb-commits

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

llvm-svn: 248992
2015-10-01 07:55:44 +00:00
Bruce Mitchener 852cb7fb0d Use the correct Python lib for each build configuration generated by the Visual Studio CMake generator
Summary:
Previously `CMAKE_BUILD_TYPE` was used to determine whether to link in `python27.lib` or `python27_d.lib`, unfortunately this only works reliably when using a CMake generator that generates a single build configuration (e.g. Ninja). The Visual Studio CMake generator generates four build configurations at once (`Debug`, `Release`, `RelWithDebInfo`, `MinSizeRel`), so if `CMAKE_BUILD_TYPE` is set to `Debug` all four build configurations end up linking in `python27_d.lib`, this is clearly undesirable.

To ensure that the correct Python lib is used for each build configuration the value of `PYTHON_LIBRARY` is now determined using generator expressions that evaluate to either the debug or release Python lib. The values of `PYTHON_EXECUTABLE` and `PYTHON_DLL` are now likewise determined using generator expressions.

Note that these changes only apply to the Windows build.

Patch by Vadim Macagon. Thanks!

Reviewers: zturner, brucem

Subscribers: zturner, lldb-commits

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

llvm-svn: 248991
2015-10-01 07:47:38 +00:00
Bruce Mitchener c32c277b84 Include platform agnostic <HostGetOpt.h> in the place of <getopt.h>
Summary: Problem caught on NetBSD with missing getopt_long_only(3).

Change by Kamil Rytarowski <n54@gmx.com>

Reviewers: joerg, brucem

Subscribers: brucem, lldb-commits

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

llvm-svn: 248990
2015-10-01 07:45:58 +00:00
Eric Fiselier d866bdd692 Manually suppress -Wnonnull when it occurs in an unevaluated context
llvm-svn: 248989
2015-10-01 07:41:07 +00:00
Eric Fiselier 5c736fe9ab Fix initialzation order in dynarray
llvm-svn: 248988
2015-10-01 07:29:38 +00:00
Eric Fiselier b4e2e7a292 Suppress array initialization warnings in std::experimental::apply tests
llvm-svn: 248987
2015-10-01 07:05:38 +00:00
Eric Fiselier f74bb3b8b0 Dont link -lrt in the testsuite on linux unless using sanitizers.
llvm-svn: 248986
2015-10-01 06:15:26 +00:00
Jason Molenda 8b2f23d515 Fixing a subtle issue on Mac OS X systems with dSYMs (possibly
introduced by r235737 but I didn't look into it too closely).

A dSYM can have a per-UUID plist in it which tells lldb where
to find an executable binary for the dSYM (DBGSymbolRichExecutable)
- other information can be included in this plist, like how to
remap the source file paths from their build pathnames to their
long-term storage pathnames.

This per-UUID plist is a unusual; it is used probably exclusively
inside apple with our build system.  It is not created by default
in normal dSYMs.

The problem was like this:

  1. lldb wants to find an executable, given only a UUID
     (this happens when lldb is doing cross-host debugging
      and doesn't have a copy of the target system's binaries)

  2. It eventually calls LocateMacOSXFilesUsingDebugSymbols
     which does a spotlight search for the dSYM on the local
     system, and failing that, tries the DBGShellCommands
     command to find the dSYM.

  3. It gets a dSYM.  It reads the per-UUID plist in the dSYM.
     The dSYM has a DBGSymbolRichExecutable kv pair pointing to
     the binary on a network filesystem.

  4. Using the binary on the network filesystem, lldb now goes
     to find the dSYM.

  5. It starts by looking for a dSYM next to the binary it found.

  6. lldb is now reading the dSYM over a network filesystem,
     ignoring the one it found on its local filesystem earlier.

Everything still *works* but it's much slower.

This would be a tricky one to write up in a testsuite case;
you really need the binary to not exist on the local system.
And LocateMacOSXFilesUsingDebugSymbols will only compile on
Mac OS X - even if I found a way to write up a test case, it
would not run anywhere but on a mac.

One change Greg wanted while I was touching this code was to
have LocateMacOSXFilesUsingDebugSymbols (which could be asked
to find a binary OR find a dSYM) to instead return a ModuleSpec
with the sum total of everything it could find.  This
change of passing around a ModuleSpec instead of a FileSpec
was percolated up into ModuleList::GetSharedModule.

The changes to LocateMacOSXFilesUsingDebugSymbols look larger
than they really are - there's a lot of simple whitespace changes
in there.

I ran the testsuites on mac, no new regressions introduced

<rdar://problem/21993813> 

llvm-svn: 248985
2015-10-01 05:37:22 +00:00
Piotr Padlewski aca0e58caa Test fix
llvm-svn: 248984
2015-10-01 04:19:45 +00:00
Jingyue Wu df1a1b113b [NaryReassociate] SeenExprs records WeakVH
Summary:
The instructions SeenExprs records may be deleted during rewriting.
FindClosestMatchingDominator should ignore these deleted instructions.

Fixes PR24301.

Reviewers: grosser

Subscribers: grosser, llvm-commits

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

llvm-svn: 248983
2015-10-01 03:51:44 +00:00