Commit Graph

23018 Commits

Author SHA1 Message Date
Nico Weber f69cba649e Add a warning flag for an existing diagnostic.
One more, and the number of flags without a dedicated flag fits in two decimal
digits :-)

llvm-svn: 215946
2014-08-18 23:02:03 +00:00
Alexey Samsonov c4f1fc2af1 Update link strategy for sanitizer runtime libraries on Linux:
1. Always put static sanitizer runtimes to the front of the linker
invocation line. This was already done for all sanitizers except UBSan:
in case user provides static libstdc++ we need to make sure that new/delete
operator definitions are picked from sanitizer runtimes instead of libstdc++.
We have to put UBSan runtime first for similar reasons: it depends on some
libstdc++ parts (e.g. __dynamic_cast function), and has to go first in
link line to ensure these functions will be picked up from libstdc++.

2. Put sanitizer libraries system dependencies (-ldl, -lpthread etc.) right
after sanitizer runtimes. This will ensure these libraries participate in
the link even if user provided -Wl,-as-needed flag. This should fix PR15823.

3. In case we link in several sanitizer runtimes (e.g. "ubsan", "ubsan_cxx"
and "san"), add system dependencies (-ldl, -lpthread, ...) only once.

llvm-svn: 215940
2014-08-18 22:10:42 +00:00
Ben Langmuir e13fd1c430 Fix the rececl chain for redeclarations of predefined decls
Predefined decls like 'Protocol' in objc are not loaded from AST files,
so we cannot rely on loading the canonical decl to complete the redecl
chain for redeclarations of these decls.  The broken redecl chain was
non-circular, so looping over redecls() would hang.

llvm-svn: 215929
2014-08-18 19:32:45 +00:00
Pavel Chupin 4a29468dcd [x32] Handle -m64/-m32 switches by Driver in x32 mode
Summary:
Adding remaining 2 cases handling:
* from x32 to 32 via -m32
* from x32 to 64 via -m64

Test Plan: linux-ld test updated

Reviewers: chandlerc, atanasyan

Subscribers: cfe-commits, zinovy.nis

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

llvm-svn: 215899
2014-08-18 15:38:38 +00:00
Manuel Klimek f560b22a92 Do not rely on bin/ path prefix in tests.
llvm-svn: 215845
2014-08-17 19:11:18 +00:00
Rafael Espindola 69d2ad031b Add a test for -no-canonical-prefixes.
llvm-svn: 215836
2014-08-17 16:22:16 +00:00
Olivier Goffart fc8f893192 Fix assertion on asm register that are "%"
Name might be empty again after we removed the '%' prefix
and Name[0] would assert.

Found on code like
register int foo asm("%" MACRO);
where MACRO was supposed to be defined in a header file that was not found.

llvm-svn: 215834
2014-08-17 13:19:48 +00:00
Abramo Bagnara 152eb39cc6 Uniformed parsing of GNU attributes at line beginnning and added GNU attributes parsing FIXMEs.
llvm-svn: 215814
2014-08-16 08:29:27 +00:00
Nico Weber ae4bb8c8f4 Make sure that vtables referenced from delay-parsed templates get referenced.
This fixes PR20671, see the bug for details. In short, ActOnTranslationUnit()
calls DefineUsedVTables() and only then PerformPendingInstantiations(). But
PerformPendingInstantiations() is what does delayed template parsing, so
vtables only references from late-parsed templates weren't marked used.

As a fix, move the SavePendingInstantiationsAndVTableUsesRAII in
PerformPendingInstantiations() up above the delayed template parsing code.
That way, vtables referenced from templates end up in the RAII object, and the
call to DefineUsedVTables() in PerformPendingInstantiations() marks them used.

llvm-svn: 215786
2014-08-15 23:21:41 +00:00
David Blaikie 0c8e3f2fdd DebugInfo: While loop backedge should be attribute to the start of the while statement.
A little test case simplification - this could be simplified further,
though there are certainly interesting connections to the if/else
construct so I'm hesitant to remove that entirely though it does appear
somewhat unrelated.

(similar fix to r215766, related to PR19864)

llvm-svn: 215768
2014-08-15 21:11:25 +00:00
David Blaikie 15c4956b3a DebugInfo: Fix PR19864 better - attribute the jump at the end of a range-for loop, to the start of the loop.
This avoids debuggers stepping to strange places (like the last
statement in the loop body, or the first statement in the if).

This is not the whole answer, though - similar bugs no doubt exist in
other loops (patches to follow) and attributing exception handling code
to the correct line is also tricky (based on the previous fix to
PR19864, exception handling is still erroneously attributed to the 'if'
line).

llvm-svn: 215766
2014-08-15 20:50:45 +00:00
Reid Kleckner b9538a6d09 MS ABI: Virtual member pointer thunks are not unnamed_addr
They can be compared for identity.

llvm-svn: 215745
2014-08-15 18:12:40 +00:00
Matt Arsenault dbb84916d9 R600: Add ldexp intrinsic
llvm-svn: 215738
2014-08-15 17:44:32 +00:00
Fariborz Jahanian 4eda2c0086 Objective-C. Do not warn if user is using property-dox syntax to name a
user provided setter name (as declared in @property attribute declaration).
rdar://18022762

llvm-svn: 215736
2014-08-15 17:39:00 +00:00
Rafael Espindola d76eb44cdf Use a valid arch name in this triple.
llvm-svn: 215726
2014-08-15 16:55:25 +00:00
Reid Kleckner 062be331e2 Limit our MSVC compat hack for nested names from dependent bases
Previously, any undeclared unqualified id starting a nested name
specifier in a dependent context would have its lookup retried during
template instantiation.  Now we limit that retry hack to methods of a
class with dependent bases.  Free function templates in particular are
no longer affected by this hack.

Also, diagnose this as a Microsoft extension. This has the downside that
template authors may see this warning *and* an error during
instantiation time about this identifier. Fixing that will probably
require formalizing some kind of "delayed" identifier, instead of our
ad-hoc solutions of forming dependent AST nodes when lookup fails.

Based on a patch by Kim Gräsman!

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

llvm-svn: 215683
2014-08-14 23:34:52 +00:00
DeLesley Hutchins e8d2a9d755 Thread Safety Analysis: Move -Wthread-safety-negative out of the
-Wthread-safety umbrella flag, pending updates to documentation.  The flag
works, but is likely to be confusing to existing users of -Wthread-safety.

llvm-svn: 215679
2014-08-14 21:54:34 +00:00
DeLesley Hutchins eb0ea5f40a Thread safety analysis: add -Wthread-safety-verbose flag, which adds additional notes that are helpful when compiling statistics on thread safety warnings.
llvm-svn: 215677
2014-08-14 21:40:15 +00:00
Richard Smith 462b6fc6dc [modules] Turn off a broken optimization: we need to pick up implicit special
members from all redefinitions of a class that have them, in case the special
member is defined in one module but only declared in another.

llvm-svn: 215675
2014-08-14 20:30:52 +00:00
Reid Kleckner 53e6a5d60c Don't Lex past EOF when lexing _Pragma
Fixes PR20662.

llvm-svn: 215672
2014-08-14 19:47:06 +00:00
DeLesley Hutchins 4133b13bd2 Thread Safety Analysis: fix to improve handling of references to guarded
data members and range based for loops.

llvm-svn: 215671
2014-08-14 19:17:06 +00:00
Joerg Sonnenberger b704534233 Use the big endian emulations for NetBSD/arm in EB mode.
llvm-svn: 215670
2014-08-14 19:12:41 +00:00
Adam Nemet 2278fcbf0c [AVX512] Add FMA intrinsics
Part of <rdar://problem/17688758>

llvm-svn: 215666
2014-08-14 17:17:57 +00:00
Justin Bogner 085c4b294b Revert "CodeGen: When bitfields fall on natural boundaries, split them up"
It fits better with LLVM's memory model to try to do this in the
backend. Specifically, narrowing wide loads in the backends should be
relatively straightforward and is generally valuable, whereas widening
loads tends to be very constrained.

Discussion here:

  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140811/112581.html

This reverts commit r215614.

llvm-svn: 215648
2014-08-14 15:44:29 +00:00
Rafael Espindola 764837431a Delete support for AuroraUX.
auroraux.org is not resolving.

llvm-svn: 215644
2014-08-14 15:14:51 +00:00
Pekka Jaaskelainen ab751a8f71 Fix a crash when compiling blocks in OpenCL with multiple
address spaces.

llvm-svn: 215629
2014-08-14 09:37:50 +00:00
David Majnemer ad2986efce Parse: Don't attempt to act on #pragma init_seg when not targeting MSVC
It doesn't really make sense to try and do stuff with #pragma init_seg
when targeting non-Microsoft platforms; notions like library vs user
initializers don't exist for other targets.

This fixes PR20639.

llvm-svn: 215618
2014-08-14 06:35:08 +00:00
Richard Smith 72544f875b [modules] Don't assert if the same imported class template specialization
declaration has its definition instantiated in two sibling modules and they use
a partial specialization.

llvm-svn: 215616
2014-08-14 03:30:27 +00:00
Justin Bogner caf1c6e3dd CodeGen: When bitfields fall on natural boundaries, split them up
Currently when laying out bitfields that don't need any padding, we
represent them as a wide enough int to contain all of the bits. This
can be hard on the backend since we'll do things like represent stores
to a few bits as loading an i144, masking it with a large constant,
and storing it back.

This turns up in less pathological cases where we load and mask 64 bit
word on a 32 bit platform when we actually only need to access 32 bits.
This leads to bad code being generated in most of our 32 bit backends.

In practice, there are often natural breaks in bitfields, and it's a
fairly simple and effective heuristic to split these fields into legal
integer sized chunks when it will be equivalent (ie, it won't force us
to add any extra padding).

llvm-svn: 215614
2014-08-14 02:42:10 +00:00
Richard Smith 8c913ecd15 [modules] When we merge together multiple class template specialization
definitions (because some other declaration declares a special member that
isn't present in the canonical definition), we need to search *all* of them; we
can't just stop when we find the requested name in any of the definitions,
because that can fail to find things (and in particular, it can fail to find
the member of the canonical declaration and return a bogus ODR failure).

llvm-svn: 215612
2014-08-14 02:21:01 +00:00
David Majnemer 5c734ad844 Sema: Permit nullptr template args in MSVC compat mode
This fixes a regression I caused back in r211766.

llvm-svn: 215609
2014-08-14 00:49:23 +00:00
NAKAMURA Takumi c92ab5c900 clang/test/Modules/cxx-irgen.cpp: Let it tolerant of x86_thiscallcc.
llvm-svn: 215607
2014-08-14 00:23:30 +00:00
Fariborz Jahanian d288fad374 Objective-C. Handle case of multiple class methods
found in global pool as well. rdar://16808765

llvm-svn: 215603
2014-08-13 23:38:04 +00:00
Yi Kong 45a09319bf ARM: Add mappings for ACLE prefetch intrinsics
Implement __pld, __pldx, __pli and __plix builtin intrinsics as specified in
ARM ACLE 2.0.

llvm-svn: 215599
2014-08-13 23:20:15 +00:00
NAKAMURA Takumi b6ac3f93e7 clang/test/Index/index-module.m: Tweak expressions to meet dos path on win32.
llvm-svn: 215592
2014-08-13 22:14:49 +00:00
Justin Bogner 5ea05aed15 test/CodeGen: Don't rely on a value's number in check lines
The tests in r215568 hard code a value as %0 in their checks. This
isn't correct in asserts builds.

llvm-svn: 215585
2014-08-13 21:54:06 +00:00
Richard Smith c9cbde7e8b [modules] Fix a rejects-valid resulting from emitting an inline function
recursively within the emission of another inline function. This ultimately
led to us emitting the same inline function definition twice, which we then
rejected because we believed we had a mangled name conflict.

llvm-svn: 215579
2014-08-13 21:15:09 +00:00
Fariborz Jahanian 30ae8d4413 Objective-C. This patch is to resolve the method used in method
expression to the best method found in global method pools. 
This is wip.  // rdar://16808765

llvm-svn: 215577
2014-08-13 21:07:35 +00:00
Yi Kong a5548431a5 AArch64: Prefetch intrinsic
llvm-svn: 215569
2014-08-13 19:18:20 +00:00
Yi Kong 26d104a9ec ARM: Prefetch intrinsics
llvm-svn: 215568
2014-08-13 19:18:14 +00:00
Manuel Klimek f67672e41c Work around missing handling of temporaries bound to default arguments.
Yet more problems due to the missing CXXBindTemporaryExpr in the CFG for
default arguments.

Unfortunately we cannot just switch off inserting temporaries for the
corresponding default arguments, as that breaks existing tests
(test/SemaCXX/return-noreturn.cpp:245).

llvm-svn: 215554
2014-08-13 15:25:55 +00:00
Simon Atanasyan d95c67d425 [Driver] Support -muclibc / -mglibc command line options for a couple
of MIPS toolchains.

The uCLibc implemented for multiple architectures. A couple of MIPS toolchains
contains both uCLibc and glibc implementation so these options allow to select
used C library.

Initially -muclibc / -mglibc (as well as -mbionic) have been implemented in gcc
for various architectures so they are not MIPS specific.

llvm-svn: 215552
2014-08-13 14:34:14 +00:00
Joerg Sonnenberger dd13b30c29 For NetBSD, use the same settings for PPC64 as for PPC when it comes to
integrated assembler, libc++ and libgcc. Set emulation for ld for both
platforms for correct -m32 handling.

llvm-svn: 215551
2014-08-13 14:17:32 +00:00
Manuel Klimek c0ff99089a Default getFile() to use the last accessed name in the FileEntry.
With modules we start accessing headers for the first time while reading
the module map, which often has very different paths from the include
scanning logic.

Using the name by which the file was accessed gets us one step closer to
the right solution, which is using a FileName abstraction that decouples
the name by which a file was accessed from the FileEntry.

llvm-svn: 215541
2014-08-13 12:34:41 +00:00
Richard Smith 843f18fc14 PR20634: add some more cases that can legitimately come after a struct declaration to our list of special cases.
llvm-svn: 215520
2014-08-13 02:13:15 +00:00
Richard Smith bb853c79c0 [modules] When performing a lookup into a namespace, ensure that any later
redefinitions of that namespace have already been loaded. When writing out the
names in a namespace, if we see a name that is locally declared and had
imported declarations merged on top of it, export the local declaration as the
lookup result, because it will be the most recent declaration of that entity in
the redeclaration chain of an importer of the module.

llvm-svn: 215518
2014-08-13 01:23:33 +00:00
Adam Nemet 4abc07cb75 [AVX512] Add intrinsics for FP scalar broadcasts
Similar approach to the set1 intrinsics is used: implement in terms of vector
initializers and then ensure with an LLVM test that a broadcast is generated
at the end.

Part of <rdar://problem/17688758>

llvm-svn: 215486
2014-08-13 00:29:01 +00:00
Alexey Samsonov de443c5002 [UBSan] Add returns-nonnull sanitizer.
Summary:
This patch adds a runtime check verifying that functions
annotated with "returns_nonnull" attribute do in fact return nonnull pointers.
It is based on suggestion by Jakub Jelinek:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140623/223693.html.

Test Plan: regression test suite

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 215485
2014-08-13 00:26:40 +00:00
Fariborz Jahanian 5ab8750c5c Objective-C [qoi]. Patch to not do Fix-It for fixing
a messaging expression except in the simple case
of a unary selector. We cannot reliably provide such a fixit due
to numerous reasons where a matching selector could not be found.
rdar://15756038

llvm-svn: 215480
2014-08-12 22:16:41 +00:00
Richard Trieu 4834ad2609 Improve -Wuninitialized to catch const classes being used in their own copy
constructors.

llvm-svn: 215471
2014-08-12 21:05:04 +00:00