Commit Graph

118920 Commits

Author SHA1 Message Date
David Chisnall 18e33935f3 Some fixes to <atomic> operations to explicitly use atomic types and operations.
The integral types now work with clang trunk (if you remove the guard), although we're still missing an intrinsic for initialising atomics (needed for C1x too).

Howard: Please review.
llvm-svn: 146865
2011-12-19 11:44:20 +00:00
Manuel Klimek 7582bbc67c Allow for benchmarking more than 4GB of memory
llvm-svn: 146864
2011-12-19 09:56:35 +00:00
Manuel Klimek 51945952ce Adds a flag to allow specifying the memory limitations of the JSON benchmark.
llvm-svn: 146863
2011-12-19 09:32:05 +00:00
Craig Topper a557e1c122 Add AVX2 intrinsics for and, andn, or, and xor.
llvm-svn: 146862
2011-12-19 09:03:48 +00:00
Dylan Noblesmith 2a8bc15230 SourceManager: use getBufferSize()
Forming an out of bounds pointer to check if it's out
of bounds was undefined behavior.

llvm-svn: 146861
2011-12-19 08:51:05 +00:00
Chris Lattner ac2bda8dd0 fix a broken link
llvm-svn: 146859
2011-12-19 07:49:23 +00:00
Craig Topper 94aba2c260 More AVX2 intrinsic support including saturating add/sub and palignr.
llvm-svn: 146857
2011-12-19 07:03:25 +00:00
Richard Smith d0b4dd656d constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.

Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:

  extern const int a;
  const int n = a;
  const int a = 5;
  int arr[n];

Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.

llvm-svn: 146856
2011-12-19 06:19:21 +00:00
Craig Topper dec792ebb5 Begin adding AVX2 intrinsics. Necessitated increasing the number of bits used to store builtinID when serializing identifier table.
llvm-svn: 146855
2011-12-19 05:04:33 +00:00
Jakub Staszak 1b1d523d9e - Use getExitingBlock instead of getExitingBlocks.
- Remove trailing spaces.

llvm-svn: 146854
2011-12-18 21:52:30 +00:00
Howard Hinnant e4097ad7e6 Allow unique_ptr<T const []> to be constructed and assigned from a unique_ptr<T[]>
llvm-svn: 146853
2011-12-18 21:19:44 +00:00
Benjamin Kramer 1b54835a10 Another variadics tweak.
llvm-svn: 146852
2011-12-18 20:51:31 +00:00
Joerg Sonnenberger d6cb7649d8 Allow inlining of functions with returns_twice calls, if they have the
attribute themselve.

llvm-svn: 146851
2011-12-18 20:35:43 +00:00
Benjamin Kramer 530b820500 Use the fancy new VariadicFunction template instead of a plain variadic function.
Some compilers were complaining about passing StringRef to it.

llvm-svn: 146850
2011-12-18 19:59:20 +00:00
Dylan Noblesmith 67c4970b59 capitalize project name, reference bugzilla
And fix the double-[]. It was including the [] as part of
the project name somehow, resulting in PACKAGE_TARNAME "-llvm-"
and a strange docdir default:

./configure --help | grep docdir
  --docdir=DIR           documentation root [DATAROOTDIR/doc/-llvm-]

llvm-svn: 146849
2011-12-18 18:50:16 +00:00
Dylan Noblesmith fb75874697 test/Analysis: fix error message
llvm-svn: 146848
2011-12-18 18:07:42 +00:00
Benjamin Kramer 198e0836f2 Silence gcc warnings.
llvm-svn: 146847
2011-12-18 12:18:02 +00:00
Benjamin Kramer 32481916eb Hexagon: Remove unused variables.
llvm-svn: 146846
2011-12-18 12:00:09 +00:00
Dylan Noblesmith 4cde694855 examples: flesh out PFN readme
Show how to actually use the arguments it has.

llvm-svn: 146845
2011-12-18 11:30:53 +00:00
Michael J. Spencer 773a8fb6ab Initial commit. Code by Nick Kledzik. Cleanups and build system by me.
llvm-svn: 146844
2011-12-18 08:27:59 +00:00
Richard Smith 0b973d091a PR11604: don't allow floating-literal-to-integer casts in ICEs if the (truncated)
floating literal value does not fit into the destination type. Such casts have
undefined behavior at translation time; treating them as non-ICE matches the
behavior of modern gcc versions.

llvm-svn: 146842
2011-12-18 02:33:09 +00:00
Douglas Gregor 05f10357a9 Completely re-implement (de-)serialization of declaration
chains. The previous implementation relied heavily on the declaration
chain being stored as a (circular) linked list on disk, as it is in
memory. However, when deserializing from multiple modules, the
different chains could get mixed up, leading to broken declaration chains.

The new solution keeps track of the first and last declarations in the
chain for each module file. When we load a declaration, we search all
of the module files for redeclarations of that declaration, then
splice together all of the lists into a coherent whole (along with any
redeclarations that were actually parsed). 

As a drive-by fix, (de-)serialize the redeclaration chains of
TypedefNameDecls, which had somehow gotten missed previously. Add a
test of this serialization.

This new scheme creates a redeclaration table that is fairly large in
the PCH file (on the order of 400k for Cocoa.h's 12MB PCH file). The
table is mmap'd in and searched via a binary search, but it's still
quite large. A future tweak will eliminate entries for declarations
that have no redeclarations anywhere, and should
drastically reduce the size of this table.

llvm-svn: 146841
2011-12-17 23:38:30 +00:00
Chandler Carruth 1fc603e516 Split the Windows toolchain definition into its own file. This is
especially nice as the Windows toolchain needs the windows header files,
and has lots of platform specific hooks in it.

To facilitate the split, hoist a bunch of file-level static helpers into
class-level static helpers. Spiff up their doxygen comments while there
as they're now more likely to be looked up via docs.

Hopefully, this will be followed by further breaking apart of the
toolchain definitions. Most of the large and complex ones should likely
live on their own. I'm looking at you Darwin. ;]

llvm-svn: 146840
2011-12-17 23:10:01 +00:00
Chandler Carruth 45661653df Fix an abiguous-else warning from GCC. I have no idea why Clang doesn't
have this warning.

llvm-svn: 146839
2011-12-17 22:32:42 +00:00
Chad Rosier 5e5bee4c52 Revert 146728 as it's causing failures on some of the external bots as well as
internal nightly testers.  Original commit message:

By popular demand, link up types by name if they are isomorphic and one is an
autorenamed version of the other.   This makes the IR easier to read, because
we don't end up with random renamed versions of the types after LTO'ing a large
app.

llvm-svn: 146838
2011-12-17 22:19:53 +00:00
Chandler Carruth 7cf80e3850 Teach the link-step test to verify that we don't pass bad --hash-style
flags on MIPS paltforms.

llvm-svn: 146837
2011-12-17 21:57:25 +00:00
Ted Kremenek 8f3c349430 Update CMake dependencies.
llvm-svn: 146836
2011-12-17 20:08:54 +00:00
Craig Topper 865fff5d4c Add -mavx2 and -mno-avx2 command line support. Also add core-avx2 processor type.
llvm-svn: 146835
2011-12-17 19:55:21 +00:00
Kevin Enderby 8b3deabd2d Revert r146822 at Pete Cooper's request as it broke clang self hosting.
Hope I did this correctly :)

llvm-svn: 146834
2011-12-17 19:48:52 +00:00
Craig Topper a913dde0ef Remove an unused X86ISD node type.
llvm-svn: 146833
2011-12-17 19:16:44 +00:00
Benjamin Kramer 792edd3c75 X86: Factor the bswap asm matching to be slightly less horrible to read.
llvm-svn: 146831
2011-12-17 14:36:05 +00:00
NAKAMURA Takumi 7bfba2f0d3 Frontend/VerifyDiagnosticConsumer.cpp: Fix an expression that had side-effect.
It had been causing test "Misc/diag-verify.cpp" failure on ms cl.exe. The emission was ordered unexpectedly as below;

First)  error: 'error' diagnostics seen but not expected:
Second) error: 'error' diagnostics expected but not seen:

llvm-svn: 146830
2011-12-17 13:00:31 +00:00
Michael J. Spencer a2a6e2f282 More renaming.
llvm-svn: 146829
2011-12-17 12:35:04 +00:00
Michael J. Spencer c7e7638ec2 Rename lold to lld :(.
llvm-svn: 146828
2011-12-17 12:27:19 +00:00
Chandler Carruth b071036b7b As Doug pointed out (and I really should know), it is perfectly easy to
make VariadicFunction actually be trivial. Do so, and also make it look
more like your standard trivial functor by making it a struct with no
access specifiers. The unit test is updated to initialize its functors
properly.

llvm-svn: 146827
2011-12-17 10:20:15 +00:00
Argyrios Kyrtzidis f76e13e9ea [PCH] Remove extraneous line in the test that was mistakenly copied.
No functionality change.

llvm-svn: 146825
2011-12-17 08:11:28 +00:00
Argyrios Kyrtzidis da32f5c422 [PCH] Don't deserialize bodies of interesting decls while iterating
over them because more interesting decls can be added during body
deserialization.

Should fix msvc build tests.

llvm-svn: 146824
2011-12-17 08:11:25 +00:00
Pete Cooper eadf124d2b SimplifyCFG now predicts some conditional branches to true or false depending on previous branch on same comparison operands.
For example, 

if (a == b) {
    if (a > b) // this is false
    
Fixes some of the issues on <rdar://problem/10554090>

llvm-svn: 146822
2011-12-17 06:32:38 +00:00
Manuel Klimek 3c2848ea31 Deleting the json-bench-test until I understand why it is flaky.
llvm-svn: 146821
2011-12-17 06:29:32 +00:00
Ted Kremenek 4548e04458 Refactor SerializeDiagnosticsPrinter to using DiagnosticRenderer. This gives us comparative diagnostics
to TextDiagnosticPrinter.

This certainly can be cleaned up a bit.

llvm-svn: 146820
2011-12-17 05:26:11 +00:00
Ted Kremenek c4bbd8531e Refactor 'TextDiagnostic' to have a parent class 'DiagnosticRenderer' which handles
the policy of how diagnostics are lowered/rendered, while TextDiagnostic handles
the actual pretty-printing.

This is a first part of reworking SerializedDiagnosticPrinter to use the same
inclusion-stack/macro-expansion logic as TextDiagnostic.

llvm-svn: 146819
2011-12-17 05:26:04 +00:00
Argyrios Kyrtzidis 2072fbd775 [PCH] Fix bug where we failed to update an identifier for a single token
macro expansion.

rdar://10588825

llvm-svn: 146818
2011-12-17 04:13:31 +00:00
Argyrios Kyrtzidis 97ea7d6fc9 [PCH] In ASTReader::FinishedDeserializing fully load the interesting decls,
including deserializing their bodies, so that any other declarations that
get referenced in the body will be fully deserialized by the time we pass them to the consumer.

Could not reduce to a test case unfortunately. rdar://10587158.

llvm-svn: 146817
2011-12-17 04:13:28 +00:00
Argyrios Kyrtzidis dbabfbaa1a Add a sanity check in the Redeclarable::redecl_iterator to avoid infinite loop
when we formed an invalid redeclaration chain due to a bug.

Thanks to Doug for the hint!

llvm-svn: 146816
2011-12-17 04:13:25 +00:00
Argyrios Kyrtzidis e1ee623ada In Parser::SkipUntil do not stop at '@' unconditionally.
Stopping at '@' was originally intended to avoid skipping an '@' at the @interface context
when doing parser recovery, but we should not stop at all '@' tokens because they may be part
of expressions (e.g. in @"string", @selector(), etc.), so in most cases we will want to skip them.

This commit caused 'test/Parser/method-def-in-class.m' to fail for the cases where we tried to
recover from unmatched angle bracket but IMO it is not a big deal to not have good recovery
from such broken code and the way we did recovery would not always work anyway (e.g. if there was '@'
in an expression).

The case that rdar://7029784 is about still passes.

llvm-svn: 146815
2011-12-17 04:13:22 +00:00
Argyrios Kyrtzidis 9a174fb8ee After late parsing an objc method, make sure there are no leftover cached tokens,
because the memory associated with them is going to get released.
We also don't want them to affect later parsing.
(We do the same for C++ inline methods.)

The underlying cause for the leftover tokens is going to be addressed in the
next commit.

Couldn't get a test case for the crash though. rdar://10583033.

llvm-svn: 146814
2011-12-17 04:13:18 +00:00
Eli Friedman 79281d1df9 Add a missing check before trying to evaluate a temporary. PR11595.
llvm-svn: 146813
2011-12-17 02:24:21 +00:00
Johnny Chen 290fa41bf6 Fixed code rot pointed out by Jim.
SBThread::GetStopReasonDataCount/GetStopReasonDataAtIndex() need to handle eStopReasonWatchpoint.

llvm-svn: 146812
2011-12-17 02:07:52 +00:00
Sean Callanan 4de1090322 Added a version of the LLVM/Clang checkout and
build script that applies any local patches to
LLVM/Clang.

llvm-svn: 146811
2011-12-17 02:00:57 +00:00
Chad Rosier 7caca84ce4 Fix _mm_permute_ps and _mm256_permute_ps AVX intrinsics to use "I" (ICE)
markings.  Fix avxintrin.h to take them into account.
Part of rdar://10595450

llvm-svn: 146810
2011-12-17 01:51:05 +00:00