Commit Graph

12867 Commits

Author SHA1 Message Date
Craig Topper a06d4a1c40 Add the rest of the BMI intrinsics.
llvm-svn: 147265
2011-12-25 07:27:12 +00:00
Craig Topper f2855ade2b Add intrinsics for lzcnt and tzcnt instructions.
llvm-svn: 147263
2011-12-25 06:25:37 +00:00
Richard Smith 966c1fb0c8 Always implicitly declare move assignment operations for dynamic classes, in
case they override virtual functions from a base class. Also fix -print-stats
counting of move assignment/construction.

llvm-svn: 147258
2011-12-24 21:56:24 +00:00
Craig Topper 175543ac78 Add last of the AVX2 intrinsics except for gather.
llvm-svn: 147253
2011-12-24 17:20:15 +00:00
Craig Topper a9387739aa Add AVX2 permute intrinsics. Also add parentheses on some macro arguments in other intrinsic headers.
llvm-svn: 147242
2011-12-24 07:55:25 +00:00
Craig Topper 9a01e58447 Add AVX2 intrinsics for FP vbroadcast, vbroadcasti128, and vpblendd.
llvm-svn: 147240
2011-12-24 05:19:47 +00:00
Craig Topper a6fdbd1807 Intrinsics for AVX2 unpack instructions.
llvm-svn: 147237
2011-12-24 03:58:43 +00:00
Craig Topper f4bb952533 More AVX2 intrinsics for shift, psign, some shuffles, and psadbw.
llvm-svn: 147236
2011-12-24 03:28:57 +00:00
Nico Weber d3bdadf616 Fix several issues related to specializations and explicit instantiations.
Explicit instantiations following specializations are no-ops and hence have
no PointOfInstantiation. That was done correctly in most cases, but for a
specialization -> instantiation decl -> instantiation definition chain, the
definition didn't realize that it was a no-op. Fix that.

Also, when printing diagnostics for these no-ops, get the diag location from
the decl name location.

Add many test cases, one of them not yet passing (but it failed the same way
before this change). Fixes http://llvm.org/pr11558 and more.

llvm-svn: 147225
2011-12-23 20:58:04 +00:00
Craig Topper 235a365d58 Add AVX2 multiply intrinsics.
llvm-svn: 147219
2011-12-23 08:31:16 +00:00
Argyrios Kyrtzidis 2644063ec9 Pass context and access to Parser::ParseExplicitInstantiation() for
good parser error recovery and for not crashing.

We still have a accepts-invalid-code bug.

llvm-svn: 147216
2011-12-23 02:16:45 +00:00
Fariborz Jahanian 87b4ae6cab objective-c: Use class definition AST in several situations when
building related objc ASTs which require a class definition AST.
These were uncovered when testing objc rewriter.

llvm-svn: 147210
2011-12-23 00:31:02 +00:00
Douglas Gregor fe76cfd89c When building a module with an umbrella header, warn about any headers
found within that umbrella directory that were not actually included
by the umbrella header. They should either be referenced in the module
map or included by the umbrella header.

llvm-svn: 147207
2011-12-23 00:23:59 +00:00
Ted Kremenek 72be32af88 Colorize and condense CFG pretty-printing.
llvm-svn: 147203
2011-12-22 23:33:52 +00:00
Nico Weber 3cef10814a Add -Wdangling-else.
This works like described in  http://drdobbs.com/blogs/cpp/231602010
Fixes http://llvm.org/PR11609

llvm-svn: 147202
2011-12-22 23:26:17 +00:00
Douglas Gregor 464b0ca61a Serialize the AST reader's mapping from canonical declarations to the
set of (previously-canonical) declaration IDs to the module file, so
that future AST reader instances that load the module know which
declarations are merged. This is important in the fairly tricky case
where a declaration of an entity, e.g.,

  @class X;

occurs before the import of a module that also declares that
entity. We merge the declarations, and record the fact that the
declaration of X loaded from the module was merged into the (now
canonical) declaration of X that we parsed.

llvm-svn: 147181
2011-12-22 21:40:42 +00:00
Kevin Enderby fc85b1d1c5 Add missing triple to darwin clang driver test.
llvm-svn: 147179
2011-12-22 21:32:51 +00:00
Douglas Gregor 0475cd88c9 If we end up merging an Objective-C class with an existing Objective-C
class that comes from a different module file, make sure that we load
all of the pending declarations for the original declaration.

llvm-svn: 147168
2011-12-22 19:44:59 +00:00
Kevin Enderby 292dc080e0 Last part of support for generating dwarf for assembly source files. This gets
the clang driver to enable this when assembling a .s file.  rdar://9275556

llvm-svn: 147167
2011-12-22 19:31:58 +00:00
Sebastian Redl 6901c0de67 Overloading for initializer list construction.
llvm-svn: 147156
2011-12-22 18:58:38 +00:00
Sebastian Redl 867f228a55 Fix a parser bug that prevented it from correctly parsing explicit construct expressoins of the form T{args}.
llvm-svn: 147155
2011-12-22 18:58:29 +00:00
Sebastian Redl ed2e53222f List-initialization via constructor part 1. Still needs: pretty-printing, overloading, initializer_list.
llvm-svn: 147145
2011-12-22 14:44:04 +00:00
Craig Topper 1f2460ad43 Add AVX2 intrinsics for max, min, sign extend, and zero extend.
llvm-svn: 147141
2011-12-22 09:18:58 +00:00
Ted Kremenek 5586354d7d Fix typos in analyzer diagnostics pointed out by Matt Beaumont-Gay and Robert Purves.
llvm-svn: 147139
2011-12-22 06:35:52 +00:00
Argyrios Kyrtzidis 8a26c4de64 In Lexer::getCharAndSizeSlow[NoWarn] if we come up against
\<newline><newline>

don't consume the second newline.

Thanks to David Blaikie for pointing out the crash!

llvm-svn: 147138
2011-12-22 04:38:07 +00:00
Eli Friedman 803acb3ff2 Add support for bitcasts to vector type in Evaluate.
llvm-svn: 147137
2011-12-22 03:51:45 +00:00
Richard Smith cc36f698af PR11614: Mark defaulted special constructors as constexpr if their implicit
definition would satisfy the constexpr requirements.

llvm-svn: 147128
2011-12-22 02:22:31 +00:00
Douglas Gregor 022857e03d When deserializing an Objective-C class, check whether we have another
declaration of that same class that either came from some other module
or occurred in the translation unit loading the module. In this case,
we need to merge the two redeclaration chains immediately so that all
such declarations have the same canonical declaration in the resulting
AST (even though they don't in the module files we've imported).

Focusing on Objective-C classes until I'm happy with the design, then
I'll both (1) extend this notion to other kinds of declarations, and
(2) optimize away this extra checking when we're not dealing with
modules. For now, doing this checking for PCH files/preambles gives us
better testing coverage.

llvm-svn: 147123
2011-12-22 01:48:48 +00:00
Richard Smith ca2cfbf5ce PR11637: implement special-case constant evaluation for char arrays initialized
by string literals.

llvm-svn: 147120
2011-12-22 01:07:19 +00:00
Ted Kremenek c177d9faf5 Fix regression in LiveVariables when reasoning about variables captured by blocks.
llvm-svn: 147116
2011-12-22 00:46:32 +00:00
Eli Friedman 1148b0f13c Fix a silly mistake in this test that somehow slipped into my last commit.
llvm-svn: 147112
2011-12-22 00:06:39 +00:00
Eli Friedman 5c9cd7a8a3 Fix a failure (which led to a crash) in constant emission code with vector compound literals.
llvm-svn: 147111
2011-12-22 00:04:00 +00:00
Argyrios Kyrtzidis e5cdd080ba In Lexer::getCharAndSizeSlow[NoWarn] make sure we don't go over the end of the buffer
when the end of the buffer is immediately after an escaped newline.

Fixes http://llvm.org/PR10153.

llvm-svn: 147091
2011-12-21 20:19:55 +00:00
Fariborz Jahanian a4b2a86353 objc, objc rewriter. Fixes couple of bugs one
because of recent refactoring and one in the
rewriter.

llvm-svn: 147070
2011-12-21 19:48:07 +00:00
Argyrios Kyrtzidis 2403797eec For SourceManager::isBeforeInTranslationUnit(), have it consider macro arg expanded
token locations as coming before the closing ')' of a function macro expansion.

Include a unit test for SourceManager.

llvm-svn: 147056
2011-12-21 16:56:29 +00:00
Craig Topper a73baa8050 Add a few more AVX2 intrinsics and fix the type strings on a couple SSE intrinsics.
llvm-svn: 147048
2011-12-21 08:35:05 +00:00
Craig Topper 3fe5ac40db Add AVX2 horizontal add/sub intrinsics.
llvm-svn: 147047
2011-12-21 08:17:40 +00:00
Richard Smith f2b681b4d8 constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in
constant expressions.

llvm-svn: 147035
2011-12-21 05:04:46 +00:00
Richard Smith 242ad89a15 C++11 half of r147023: In C++11, additionally eagerly instantiate:
- constexpr function template instantiations
 - variables of reference type
 - constexpr variables

llvm-svn: 147031
2011-12-21 02:55:12 +00:00
Eli Friedman b9ccd553fc Attempt to fix test on 32-bit hosts.
llvm-svn: 147030
2011-12-21 01:57:31 +00:00
Eli Friedman 13ec75ba42 Fix a case where Expr::isConstantInitializer would return true for an expression we can't support. In a slightly amusing twist, the case in question was already in the clang regression tests marked as a valid construct. <rdar://problem/10020074>
llvm-svn: 147026
2011-12-21 00:43:02 +00:00
Richard Smith ed2974f3cf C++ constant expression handling: eagerly instantiate static const integral data
members of class templates so that their values can be used in ICEs. This
required reverting r105465, to get such instantiated members to be included in
serialized ASTs.

llvm-svn: 147023
2011-12-21 00:25:33 +00:00
Richard Smith 4f848f1dac PR11297: Provide a better diagnostic for code which contains a
reasonable-looking but ill-formed for-range statement of the form:

  for (expression : expression)

llvm-svn: 147006
2011-12-20 22:56:20 +00:00
Anna Zaks 5f847144d1 [analyzer] Do not invalidate arguments when the parameter's
type is a pointer to const. (radar://10595327)

The regions corresponding to the pointer and reference arguments to
a function get invalidated by the calls since a function call can
possibly modify the pointed to data. With this change, we are not going
to invalidate the data if the argument is a pointer to const. This
change makes the analyzer more optimistic in reporting errors.
(Support for C, C++ and Obj C)

llvm-svn: 147002
2011-12-20 22:35:30 +00:00
Fariborz Jahanian 028b9e1d0a objc/c++: Issue diagnostic when free-standing ivar is accessed
in class method instead of crash. // rdar://10593227

llvm-svn: 146998
2011-12-20 22:21:08 +00:00
Douglas Gregor 0abc262b02 When we make a previously-deserialized module definition visible,
notify the AST deserialization listener so that the AST writer knows
that it can write the macro definition.

llvm-svn: 146994
2011-12-20 22:06:13 +00:00
Ted Kremenek a1745c24c4 Fix inversion of static analyzer path diagnostics for path conditions.
llvm-svn: 146993
2011-12-20 22:00:25 +00:00
Nico Weber 3ffc4c93fd Fix a crash on invalid, http://llvm.org/pr11599
llvm-svn: 146988
2011-12-20 20:32:49 +00:00
Roman Divacky fadb3bea6b Let the KNR promotion warning be disabled.
Patch by Dimitry Andric!

llvm-svn: 146982
2011-12-20 18:35:44 +00:00
Douglas Gregor 21823bfe31 When performing name lookup for a redeclaration, ignore module
visibility restrictions. This ensures that all declarations of the
same entity end up in the same redeclaration chain, even if some of
those declarations aren't visible. While this may seem unfortunate to
some---why can't two C modules have different functions named
'f'?---it's an acknowedgment that a module does not introduce a new
"namespace" of names.

As part of this, stop merging the 'module-private' bit from previous
declarations to later declarations, because we want each declaration
in a module to stand on its own because this can effect, for example,
submodule visibility.

Note that this notion of names that are invisible to normal name
lookup but are available for redeclaration lookups is how we should
implement friend declarations and extern declarations within local
function scopes. I'm not tackling that problem now.

llvm-svn: 146980
2011-12-20 18:11:52 +00:00