Commit Graph

242766 Commits

Author SHA1 Message Date
Rafael Espindola bf04708e11 Revert "Only restrict order if both sections are in the script."
This reverts commit r282015. It broke some bots.

llvm-svn: 282021
2016-09-20 21:28:19 +00:00
Vedant Kumar e90797794f [llvm-cov] Demangle names for hidden instantiation views
llvm-svn: 282020
2016-09-20 21:27:48 +00:00
Kostya Serebryany c7cc93ad07 [asan] Add C++17 aligned new/delete entrypoints. Patch by Jakub Jelinek, see https://reviews.llvm.org/D24771
llvm-svn: 282019
2016-09-20 21:27:10 +00:00
Reid Kleckner cf661a0bf7 XFAIL cfi/stats.cpp on Windows until we fix LLD
llvm-svn: 282018
2016-09-20 21:09:31 +00:00
Xinliang David Li deda33cdbd [Profile] dump ic value profile value/site-count histogram
Differential Revision: http://reviews.google.com/D24783

llvm-svn: 282017
2016-09-20 21:04:22 +00:00
Rafael Espindola 145569df64 Only restrict order if both sections are in the script.
This matches gold and bfd behavior and is required to handle some scripts.

The script has to assume where PT_LOADs start in order to align that
spot. If we don't allow section it doesn't know about to move to the
middle, we can need more PT_LOADs and those will not be aligned.

llvm-svn: 282015
2016-09-20 20:54:39 +00:00
Rafael Espindola e5bfa690d0 Make test less dependent on the section order.
This means either relaxing CHECKs or listing more sections and
addresses in linker scripts.

llvm-svn: 282014
2016-09-20 20:48:54 +00:00
Zachary Turner fb3b3bd111 [PECOFF] Use the COFF subsystem field when determining the Triple.
Patch by walter erquinigo
Differential revision: https://reviews.llvm.org/D24284

llvm-svn: 282013
2016-09-20 20:44:50 +00:00
Filipe Cabecinhas 08c1eb9b63 [asan] Fix GlobalAddressDescription::Print()
Summary: Check bug_type for nullptr before calling internal_strcmp

Reviewers: kcc, vitalybuka, eugenis

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D24773

llvm-svn: 282012
2016-09-20 20:33:18 +00:00
Anna Zaks c154f7bc37 [analyzer] Add a checker that detects blocks in critical sections
This checker should find the calls to blocking functions (for example: sleep, getc, fgets,read,recv etc.) inside a critical section. When sleep(x) is called while a mutex is held, other threads cannot lock the same mutex. This might take some time, leading to bad performance or even deadlock.

Example:

mutex_t m;

void f() {
  sleep(1000); // Error: sleep() while m is locked! [f() is called from foobar() while m is locked]
  // do some work
}

void foobar() {
  lock(m);
  f();
  unlock(m);
}

A patch by zdtorok (Zoltán Dániel Török)!

Differential Revision: https://reviews.llvm.org/D21506

llvm-svn: 282011
2016-09-20 20:28:50 +00:00
Petr Hosek 1290355f5a Mark ELF sections whose name start with .note as note
Previously, such section would be marked as SHT_PROGBITS which
makes it impossible to use an initialized C variable declaration
to emit an (allocated) ELF note. The new behavior is also consistent
with ELF assembly parser.

Differential Revision: https://reviews.llvm.org/D24692

llvm-svn: 282010
2016-09-20 20:21:13 +00:00
Xinliang David Li c7368287b7 [Profile] Do not annotate select insts not covered in profile.
Fixed PR/30466

llvm-svn: 282009
2016-09-20 20:20:01 +00:00
Kevin Enderby fc0929adb8 Next set of additional error checks for invalid Mach-O files for bad load commands
that use the Mach::dylib_command type for the load commands that are
currently used in the MachOObjectFile constructor.

This contains the missing checks for LC_ID_DYLIB, LC_ID_DYLIB, etc.
load commands and the fields for the Mach::dylib_command type.

Also checks that only an MH_DYLIB or MH_STUB_DYLIB has an
LC_ID_DYLIB load command (and others filetype don’t) and there
is not more than one of these load commands.

llvm-svn: 282008
2016-09-20 20:14:14 +00:00
Eric Christopher 07a791643b Remove some boilerplate comments that don't explain anything.
llvm-svn: 282007
2016-09-20 19:45:06 +00:00
Rui Ueyama ee92470969 Simplify SORT and --sort-section command line option handling.
Differential Revision: https://reviews.llvm.org/D24685

llvm-svn: 282006
2016-09-20 19:42:41 +00:00
Sanjay Patel db3438abcb [x86] split up tests, regenerate checks
Note that we fail to eliminate 'or' with 0!

llvm-svn: 282005
2016-09-20 19:31:30 +00:00
Zachary Turner c4815d4f42 Fix a regex error breaking tests.
llvm-svn: 282004
2016-09-20 19:10:56 +00:00
Chris Bieneman ebfc680685 [CMake] Support overriding CLANG_VERSION_*
As with how we handle LLVM_VERSION_* variables we should support
overriding clang version variables.

llvm-svn: 282003
2016-09-20 19:09:21 +00:00
Xinliang David Li a754c47ac5 [Profile] code refactoring: make getStep a method in base class
llvm-svn: 282002
2016-09-20 19:07:22 +00:00
Evandro Menezes 9b5d89513b Revert part of "AArch64: Do not test for CPUs, use SubtargetFeatures"
This reverts part of commit 119e358d9635c8d1f3e7aee67e3ea3b8a62f8db6 by
removing FeatureUseRSqrt et al per request by Eric Christopher
<echristo@gmail.com> (v. http://bit.ly/2cmz6kW).

llvm-svn: 282001
2016-09-20 19:02:09 +00:00
Evandro Menezes ba4926efde Revert "[AArch64] Use the reciprocal estimation machinery"
This reverts commit b7d42b0048f65346e9fa37fb65defeea7ce8c337 per request by
Eric Christopher <echristo@gmail.com> (v. http://bit.ly/2cmz6kW).

llvm-svn: 282000
2016-09-20 19:02:06 +00:00
Evandro Menezes 61a1273d27 Revert "[AArch64] Properly validate the reciprocal estimation."
This reverts commit ad8ca1528242e2a4cb363e3779309e70eb7a430e per request by
Eric Christopher <echristo@gmail.com> (v. http://bit.ly/2cmz6kW).

llvm-svn: 281999
2016-09-20 19:02:02 +00:00
Zachary Turner e848a7363f Add some entropy to the folder name in Driver/warning-options.cpp.
It was trying to check that things behave correctly when a
non-existant folder was specified for -isysroot.  Incidentally,
I have a folder named FOO in the root of my drive, so this test
was failing.  Make this impossible by using %T to refer to a
definitely non-existant folder.:

llvm-svn: 281998
2016-09-20 18:41:19 +00:00
Saleem Abdulrasool 82f6added3 CodeGen: further merge cstring literal construction
Use the new CreateCStringLiteral in an additional site.  Now all the C string
literals are created in one function.  Furthermore, mark the additional literal
as an `unnamed_addr constant`.

llvm-svn: 281997
2016-09-20 18:38:54 +00:00
Nick Lewycky d8d498657a Fix typo in documentation.
Since this is a header it will break links to this section.

llvm-svn: 281996
2016-09-20 18:37:25 +00:00
Alexander Shaposhnikov c937026e7e [cleanup] Remove excessive padding from TextTokenRetokenizer::Position
Reorder the fields of the struct TextTokenRetokenizer::Position to remove excessive padding.
Test plan: make -j8 check-clang

Differential revision: https://reviews.llvm.org/D24751

llvm-svn: 281995
2016-09-20 18:32:48 +00:00
Adrian Prantl 12fa3b3911 ASAN: Don't drop debug info attachements for global variables.
This is a follow-up to r281284. Global Variables now can have
!dbg attachements, so ASAN should clone these when generating a
sanitized copy of a global variable.

<rdar://problem/24899262>

llvm-svn: 281994
2016-09-20 18:28:42 +00:00
Enrico Granata 9800539f19 Make it so that one can register prefix matches as well as identical matches as extra cases for NSDictionary data formatting
llvm-svn: 281993
2016-09-20 18:26:30 +00:00
Dmitry Vyukov 4c8eb4a391 tsan: revert r281970
r281970 extended the check in a useful way,
but caused (true) failures on aarch64.
Revert it for now.

llvm-svn: 281992
2016-09-20 18:05:06 +00:00
Adrian McCarthy ad8ac54d10 Fix syntactical nit from r281990.
llvm-svn: 281991
2016-09-20 17:42:13 +00:00
Adrian McCarthy c64acfd4c2 Emit S_COMPILE3 CodeView record
CodeView has an S_COMPILE3 record to identify the compiler and source language of the compiland.  This record comes first in the debug$S section for the compiland. The debuggers rely on this record to know the source language of the code.

There was a little test fallout from introducing a new record into the symbols subsection.

Differential Revision: https://reviews.llvm.org/D24317

llvm-svn: 281990
2016-09-20 17:20:51 +00:00
Rafael Espindola db62cbb97f Don't produce an error for undefined entry symbol.
This is particularly important when the symbol comes from a linker
script. It is common to use the same linker script for shared
libraries and executables. Without this we would always fail to link
shared libraries with -z,defs and a linker script with an ENTRY
directive.

llvm-svn: 281989
2016-09-20 17:14:16 +00:00
Vedant Kumar 6fe6eae7f7 [docs] Extend the code coverage docs some more
Flesh out the section on interpreting coverage reports, mention the
coverage export feature, and add notes on how to build llvm with
coverage turned on.

llvm-svn: 281988
2016-09-20 17:11:18 +00:00
Tobias Grosser 349d1c3368 [ScopDetection] Remove redundant checks for endless loops
Summary:
Both `canUseISLTripCount()` and `addOverApproximatedRegion()` contained checks
to reject endless loops which are now removed and replaced by a single check
in `isValidLoop()`.

For reporting such loops the `ReportLoopOverlapWithNonAffineSubRegion` is
renamed to `ReportLoopHasNoExit`. The test case
`ReportLoopOverlapWithNonAffineSubRegion.ll` is adapted and renamed as well.

The schedule generation in `buildSchedule()` is based on the following
assumption:

Given some block B that is contained in a loop L and a SESE region R,
we assume that L is contained in R or the other way around.

However, this assumption is broken in the presence of endless loops that are
nested inside other loops. Therefore, in order to prevent erroneous behavior
in `buildSchedule()`, r265280 introduced a corresponding check in
`canUseISLTripCount()` to reject endless loops. Unfortunately, it was possible
to bypass this check with -polly-allow-nonaffine-loops which was fixed by adding
another check to reject endless loops in `allowOverApproximatedRegion()` in
r273905. Hence there existed two separate locations that handled this case.

Thank you Johannes Doerfert for helping to provide the above background
information.

Reviewers: Meinersbur, grosser

Subscribers: _jdoerfert, pollydev

Differential Revision: https://reviews.llvm.org/D24560

Contributed-by: Matthias Reisinger <d412vv1n@gmail.com>
llvm-svn: 281987
2016-09-20 17:05:22 +00:00
Saleem Abdulrasool 03ffa797ad X86: loosen an overly aggressive MachO assertion
We would assert that the FP setup CFI used esp/rsp always.  This held up in
practice when the code was generated from IR.  However, with the integrated
assembler, it is possible to have the input be user specified assembly.  In such
a case, we cannot assume that the function implementation has a compact unwind
representation.  Loosen the assertion into a check and bail if we cannot
represent the frame pointer in the compact unwinding.

Addresses PR30453!

llvm-svn: 281986
2016-09-20 17:05:04 +00:00
Rafael Espindola c8e7c98b66 Redirect stderr to /dev/null. NFC.
Makes the error output less confusing when this test fails.

llvm-svn: 281985
2016-09-20 17:02:38 +00:00
Davide Italiano 8f41f33f45 [Writer] Fix a typo. NFC.
llvm-svn: 281984
2016-09-20 16:57:02 +00:00
Eric Christopher a1ccdc3433 Remove more guts of TargetMachine::getNameWithPrefix and migrate one check to the TLOF mach-o version.
NFC intended.

llvm-svn: 281983
2016-09-20 16:05:02 +00:00
Eric Christopher ef579d2195 Remove a use of subtarget initialization in the X86 backend so we can get rid of the default subtarget.
NFC intended.

llvm-svn: 281982
2016-09-20 16:04:59 +00:00
Eric Christopher 0be7793d75 Remove extra argument used once on TargetMachine::getNameWithPrefix and inline the result into the singular caller.
llvm-svn: 281981
2016-09-20 16:04:50 +00:00
Keith Walker f83a19ffc2 Improve the -debug output for Debug Range Extension (NFC)
Include header messages and remove unnecessary blank lines.

llvm-svn: 281980
2016-09-20 16:04:31 +00:00
Nick Lewycky d9bce5062e Replace 'isProvablyNonNull' with existing utility llvm::IsKnownNonNull which handles more cases. Noticed by inspection.
Because of how the IR generation works, this isn't expected to cause an observable difference.

llvm-svn: 281979
2016-09-20 15:49:58 +00:00
Rafael Espindola b45fd70ef1 Disable --rosegment when we have linker scripts.
Linker scripts are responsible for aliging '.'. Since they are
designed for bfd which has no --rosegment, they don't align the RO to
RX transition.

llvm-svn: 281978
2016-09-20 15:22:27 +00:00
Tim Northover b18ea162df GlobalISel: split aggregates for PCS lowering
This should match the existing behaviour for passing complicated struct and
array types, in particular HFAs come through like that from Clang.

For C & C++ we still need to somehow support all the weird ABI flags, or at
least those that are present in the IR (signext, byval, ...), and stack-based
parameter passing.

llvm-svn: 281977
2016-09-20 15:20:36 +00:00
Rafael Espindola 1b87995f31 Make tests less dependent on the exact layout.
In most cases that means just not checking the address when we don't
need it.

For some tests it is easier to just set . to a known value.

llvm-svn: 281976
2016-09-20 15:08:24 +00:00
Simon Dardis 3d9c763816 [mips] MSA intrinsics header file
This patch adds the msa.h header file containing the shorter names for the
MSA instrinsics, e.g. msa_sll_b for builtin_msa_sll_b.

Reviewers: vkalintiris, zoran.jovanovic

Differential Review: https://reviews.llvm.org/D24674

llvm-svn: 281975
2016-09-20 15:07:36 +00:00
Rafael Espindola 49913bc63d Move test to the correct directory. NFC.
llvm-svn: 281974
2016-09-20 14:49:18 +00:00
Simon Pilgrim 1c38e1189f [X86][SSE] Regenerate multiple combine tests
llvm-svn: 281973
2016-09-20 14:42:45 +00:00
Sanjay Patel b2332e1931 move variables closer to their uses; add FIXMEs; NFC
llvm-svn: 281972
2016-09-20 14:36:14 +00:00
Dean Michael Berris d1617cdc49 [XRay] ARM 32-bit no-Thumb support in compiler-rt
This is a port of XRay to ARM 32-bit, without Thumb support yet.
This is one of 3 commits to different repositories of XRay ARM port. The other 2 are:

https://reviews.llvm.org/D23931 (LLVM)
https://reviews.llvm.org/D23932 (Clang test)

Differential Revision: https://reviews.llvm.org/D23933

llvm-svn: 281971
2016-09-20 14:35:57 +00:00