Commit Graph

158218 Commits

Author SHA1 Message Date
Anders Waldenborg fc8ca53329 Revert "llvm-c: Add LLVMGetPointerToFunction"
This reverts r191030

llvm-svn: 191075
2013-09-20 07:00:36 +00:00
Dmitry Vyukov 481d90c480 tsan: handle memory read/write in syscalls
llvm-svn: 191074
2013-09-20 06:54:14 +00:00
Craig Topper 9a3915a74f Lift alignment restrictions on load/store folding of VEXTRACTI128/VINSERTI128.
llvm-svn: 191073
2013-09-20 05:37:49 +00:00
Dmitry Vyukov c7547d0527 tsan: allow to ignore memory accesses in malloc and free
llvm-svn: 191072
2013-09-20 05:37:36 +00:00
Andrew Trick 978674b2bc Allow subtarget selection of the default MachineScheduler and document the interface.
The global registry is used to allow command line override of the
scheduler selection, but does not work well as the normal selection
API. For example, the same LLVM process should be able to target
multiple targets or subtargets.

llvm-svn: 191071
2013-09-20 05:14:41 +00:00
Rui Ueyama eb0434e9ae Fallback to the default stringize function to show some meaningful error message.
GNU LD driver only understood no_such_file_or_directory error and was showing
just "Unknown Error" for any other type of error. With this patch, the driver
now prints file name and error message string by default.

llvm-svn: 191070
2013-09-20 03:32:27 +00:00
Rui Ueyama 391ffdf70e Generalize errStr() function so that it can handle any type of errors.
llvm-svn: 191069
2013-09-20 03:18:58 +00:00
Richard Trieu 406e65c8d1 Modify the uninitialized field visitor to detect uninitialized use across the
fields in the class.  This allows a better checking of member intiailizers and
in class initializers in regards to initialization ordering.

For instance, this code will now produce warnings:

class A {
  int x;
  int y;
  A() : x(y) {}  // y is initialized after x, warn here
  A(int): y(x) {} // default initialization of leaves x uninitialized, warn here
};

Several test cases were updated with -Wno-uninitialized to silence this warning.

llvm-svn: 191068
2013-09-20 03:03:06 +00:00
Richard Smith b8c65f0136 Testcase I forgot to svn add in r191057.
llvm-svn: 191067
2013-09-20 02:48:08 +00:00
Dmitry Vyukov 20f6ff1e66 tsan: do not crash when user intercepts fopen()
llvm-svn: 191066
2013-09-20 02:01:38 +00:00
Richard Smith 3e9a6d345a Revert r191062; the build break was also fixed in a different (incompatible) way in r191060.
llvm-svn: 191065
2013-09-20 01:24:10 +00:00
Richard Smith 541b38be7b Switch the semantic DeclContext for a block-scope declaration of a function or
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.

Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.

llvm-svn: 191064
2013-09-20 01:15:31 +00:00
Rui Ueyama 508939428d [PECOFF] Ignore /incremental option.
/incremental is an option to enable incremental linking. We will eventually
want to implement the feature for better performance, but in the meantime,
we want to just ignore the option so that the linker does not output unknown
option error when it sees /incremental option.

llvm-svn: 191063
2013-09-20 00:55:37 +00:00
Richard Smith 2767048bae Unbreak Clang build after r191050: don't pass a StringRef to snprintf.
llvm-svn: 191062
2013-09-20 00:38:18 +00:00
Rui Ueyama 9f5f635e7f Remove extraneous parentheses.
llvm-svn: 191061
2013-09-20 00:33:34 +00:00
David Blaikie efd0bcb70f DebugInfo: GDBIndexEntry*String conversion functions now return const char* for easy llvm::formating
This was previously invoking UB by passing a user-defined type to
format. Thanks to Jordan Rose for pointing this out.

llvm-svn: 191060
2013-09-20 00:33:15 +00:00
David Blaikie 9d117ab7ef Add braces to suppress Clang's dangling-else warning.
These violations were introduced in r191049

llvm-svn: 191059
2013-09-20 00:33:11 +00:00
Rui Ueyama 388fbd8f31 Handle "file not found" error in the superclass's errStr().
If a subclass does not override the member function, the superclass's method
takes care of string conversion of "file not found" error. This is a reasonable
default behavior. Subclasses are still able to override to customize error
messages.

llvm-svn: 191058
2013-09-20 00:32:40 +00:00
Richard Smith f7ec86a55b PR17290: Use 'false' macro in fix-it hint for initializing a variable of type
_Bool in C, if the macro is defined. Also teach FixItUtils to look at whether
the macro was defined at the source location for which it is creating a fixit,
rather than looking at whether it's defined *now*. This is especially relevant
for analysis-based warnings which are delayed until end of TU.

llvm-svn: 191057
2013-09-20 00:27:40 +00:00
Dmitry Vyukov b523b9c8d4 tsan: fix linking of tsan runtime into dynamic libraries
versioned symbols can not be linked into dynamic library w/o linker script
also simplifies code as side effect

llvm-svn: 191056
2013-09-19 23:44:51 +00:00
David Blaikie ac30f9e8da DebugInfo: constrain gnu pubnames test further
Ensures that the pubnames entries actually refer to the intended
entities. This test could be more flexible if there was a way to do
multiline FileCheck matches with captures (in that way the test wouldn't
need to have hardcoded offset values and would thus be resilient to
changes in the layout of the DIEs in this CU).

llvm-svn: 191055
2013-09-19 23:43:46 +00:00
Rui Ueyama dc30cdb18c Fix file comments and include guard
llvm-svn: 191054
2013-09-19 23:34:20 +00:00
Richard Mitton 89a4bc6dc3 Fixed warning
llvm-svn: 191053
2013-09-19 23:21:07 +00:00
Richard Mitton 21101b3231 Added support for generate DWARF .debug_aranges sections automatically.
llvm-svn: 191052
2013-09-19 23:21:01 +00:00
Andrew Trick 665d3ec3d3 Rename ConvergingScheduler to GenericScheduler.
This was an experimental scheduler a year ago. It's now used by
several subtargets, both in-order and out-of-order, and it
is about to be enabled by default for x86 and armv7. It will be the
new GenericScheduler for subtargets that don't provide their own
SchedulingStrategy.

llvm-svn: 191051
2013-09-19 23:10:59 +00:00
David Blaikie 404d3047c0 DebugInfo: llvm-dwarfdump support for gnu_pubnames section
llvm-svn: 191050
2013-09-19 23:01:29 +00:00
Kai Nacke d09bb4614b PR16726: extend rol/ror matching
C-like languages promote types like unsigned short to unsigned int before
performing an arithmetic operation. Currently the rotate matcher in the
DAGCombiner does not consider this situation.

This commit extends the DAGCombiner in the way that the pattern

(or (shl ([az]ext x), (*ext y)), (srl ([az]ext x), (*ext (sub 32, y))))

is folded into

([az]ext (rotl x, y))

The matching is restricted to aext and zext because in this cases the upper
bits are either undefined or known. Test case is included.

This fixes PR16726.

llvm-svn: 191049
2013-09-19 23:00:28 +00:00
Kai Nacke 2d967b2751 Revert PR16726: extend rol/ror matching
There is a buildbot failure. Need to investigate this.

llvm-svn: 191048
2013-09-19 22:53:36 +00:00
Daniel Malea e106cded61 Disable TestInferiorAssert (due to llvm.org/pr17276)
- last remaining failure on the clang buildbot

llvm-svn: 191047
2013-09-19 22:41:36 +00:00
Kaelyn Uhrain aee2ebe5a5 Don't correct typos in Sema::BuildCXXNestedNameSpecifier with -fms-extensions
When -fms-extensions is enabled, the typo correction was being called here on
non-error paths (as in test/SemaTemplate/lookup-dependent-bases.cpp) and correct
compilation depended on Sema::CorrectTypo not finding a viable candidate.

llvm-svn: 191046
2013-09-19 22:38:48 +00:00
Kai Nacke 4eaf6444fa PR16726: extend rol/ror matching
C-like languages promote types like unsigned short to unsigned int before
performing an arithmetic operation. Currently the rotate matcher in the
DAGCombiner does not consider this situation.

This commit extends the DAGCombiner in the way that the pattern

(or (shl ([az]ext x), (*ext y)), (srl ([az]ext x), (*ext (sub 32, y))))

is folded into

([az]ext (rotl x, y))

The matching is restricted to aext and zext because in this cases the upper
bits are either undefined or known. Test case is included.

This fixes PR16726.

llvm-svn: 191045
2013-09-19 22:36:39 +00:00
Rui Ueyama 91a95a590a [PECOFF] Ignore /errorReport command line option.
/errorReport is a command line option to let the linker to report internal
linker error information to Microsoft. For LLD that option doesn't make any
sense, so it just ignores the option.

llvm-svn: 191044
2013-09-19 22:19:40 +00:00
David Blaikie d0a869d0bf DebugInfo: Improve IR annotation comments for GNU pubthings.
llvm-svn: 191043
2013-09-19 22:19:37 +00:00
Peter Collingbourne 4e380b0a04 Fix LTO handling of module-level assembly (PR14152).
Patch by Tom Roeder!

llvm-svn: 191042
2013-09-19 22:15:52 +00:00
Daniel Malea 105b2a4bc3 Make threading tests not depend on the currently selected thread
- tests are now anostic to the currently selected thread, as that is a frontend (i.e. driver) decision
- this is in preparation to a fix to POSIXThread::BreakNotify that will be committed shortly

Reviewed by: Matt Kopec

llvm-svn: 191041
2013-09-19 22:00:07 +00:00
Bill Wendling 64587097b6 Add testcase to make sure we don't generate too many jumps for a une compare.
<rdar://problem/7859988>

llvm-svn: 191040
2013-09-19 21:58:20 +00:00
Benjamin Kramer 4f921f1afc Unbreak C++03 build.
llvm-svn: 191039
2013-09-19 21:30:00 +00:00
Shankar Easwaran a2f881e275 [lld][ELF][Hexagon] Cleanup unused data
Cleanup structure members that are not being used.

Also clang-format it.

llvm-svn: 191038
2013-09-19 21:27:21 +00:00
Shuxin Yang 3a7ca6ec87 [Fast-math] Disable "(C1/X)*C2 => (C1*C2)/X" if C1/X has multiple uses.
If "C1/X" were having multiple uses, the only benefit of this
transformation is to potentially shorten critical path. But it is at the
cost of instroducing additional div.

  The additional div may or may not incur cost depending on how div is
implemented. If it is implemented using Newton–Raphson iteration, it dosen't
seem to incur any cost (FIXME). However, if the div blocks the entire
pipeline, that sounds to be pretty expensive. Let CodeGen to take care 
this transformation.

  This patch sees 6% on a benchmark.

rdar://15032743

llvm-svn: 191037
2013-09-19 21:13:46 +00:00
Benjamin Kramer 0b37cdf9af InstCombine: Don't allow turning vector-of-pointer loads into vector-of-integer.
The code below can't handle any pointers. PR17293.

llvm-svn: 191036
2013-09-19 20:59:04 +00:00
David Blaikie 8dec407649 Unshift the GDB index/GNU pubnames constants modified in r191025
Based on code review feedback from Eric Christopher, unshifting these
constants as they can appear in the gdb_index itself, shifted a further
24 bits. This means that keeping them preshifted is a bit inflexible, so
let's not do that.

Given the motivation, wrap up some nicer enums, more type safety, and
some utility functions.

llvm-svn: 191035
2013-09-19 20:40:26 +00:00
Hans Wennborg 87cfa71071 clang-cl: implement /fallback mode
When this flag is enabled, clang-cl falls back to cl.exe if it
cannot compile the code itself for some reason.

The idea is to use this to help build projects that almost compile
with clang-cl, except for some files that can then be built with
the fallback mechanism.

Differential Revision: http://llvm-reviews.chandlerc.com/D1711

llvm-svn: 191034
2013-09-19 20:32:16 +00:00
Shankar Easwaran 70fefd515a [lld][ELF] Group command line options for better usage
llvm-svn: 191033
2013-09-19 20:07:06 +00:00
Shankar Easwaran a17e5bc02a [lld][ELF] Support non alloc sections in the Writer.
This also makes it support debugging executables built with lld.

Initial patch done by Bigcheese. This is only a revised patch to
have the functionality in the Writer.

llvm-svn: 191032
2013-09-19 20:07:01 +00:00
Anders Waldenborg 8bbda41c6e llvm-c: Add LLVMGetPointerToFunction
Differential Revision: http://llvm-reviews.chandlerc.com/D1715

llvm-svn: 191030
2013-09-19 19:55:06 +00:00
Anders Waldenborg 5b15455823 llvm-c: Make LLVMGetFirstTarget a proper prototype
This avoids warnings when included in a application that
uses -Wstrict-prototypes.

Differential Revision: http://llvm-reviews.chandlerc.com/D1713

llvm-svn: 191029
2013-09-19 19:43:55 +00:00
Sylvestre Ledru 88483a3130 Fix build failures under GNU/Linux running on mips
llvm-svn: 191027
2013-09-19 19:06:57 +00:00
Eric Christopher 7eec59e2f1 Remove extraneous space, the asm printing infrastructure adds a space
in normally.

llvm-svn: 191026
2013-09-19 18:41:40 +00:00
David Blaikie b20db58a4d DebugInfo: Simplify gnu_pubnames index computation.
Names open to bikeshedding. Could switch back to the constants being
unshifted, but this way seems a bit easier to work with.

llvm-svn: 191025
2013-09-19 18:39:59 +00:00
Fariborz Jahanian 8bf05566d7 Fixes a buildbot failure (was using local
type in template instantiation).

llvm-svn: 191022
2013-09-19 17:52:50 +00:00