Commit Graph

132504 Commits

Author SHA1 Message Date
Anitha Boyapati 0dd589c5f1 FMA3 tests on bdver2 target for changes made in rev 162012. Also made
corresponding changes to existing tests for darwin triple to ensure that
same pattern is tested for bdver2 target.

llvm-svn: 162655
2012-08-27 06:59:01 +00:00
Craig Topper f7828f91ee Add HasAVX1Only predicate and use it for patterns that have an AVX1 instruction and an AVX2 instruction rather than relying on AddedComplexity.
llvm-svn: 162654
2012-08-27 06:08:57 +00:00
Craig Topper 9e4f0aae17 Make sure that FMA3 is favored even when FMA4 is also enabled. Test case for r162454.
llvm-svn: 162653
2012-08-27 03:38:15 +00:00
Rafael Espindola 5e892a7a03 Pass -lLTO after gold-plugin.o so that it gets used in systems that default to
--as-needed.
Patch by Felix Geyer. Fixes pr13262.

llvm-svn: 162652
2012-08-27 03:03:07 +00:00
John McCall 9320707aac Tweak the ARC-requires-10.6 diagnostic according to Jordan's review.
llvm-svn: 162651
2012-08-27 01:56:21 +00:00
Manuel Klimek 0fd1106229 Update reference docs to latest changes.
llvm-svn: 162650
2012-08-26 23:55:24 +00:00
Craig Topper 4de5b24b19 Mark avx2 maskstore has ReadWriteArgMem. Mark broadcast and maskload as ReadArgMem.
llvm-svn: 162649
2012-08-26 22:01:42 +00:00
Howard Hinnant 3320c058bf Hyeon-bin Jeong: libc++ fails to create any classes inherit from basic_ios if they
provided char type other than char or wchar_t. It throw exception during
construction, so there is no chance to imbue own ctype.

This fixes http://llvm.org/bugs/show_bug.cgi?id=13698

llvm-svn: 162648
2012-08-26 18:05:35 +00:00
Howard Hinnant 2e8e1d42be Update CREDITS.TXT
llvm-svn: 162647
2012-08-26 17:46:29 +00:00
Howard Hinnant e890ab2377 Michel Morin: My previous fix for C++03 was incomplete.
It does not consider user-defined conversions that convert an rvalue
into an lvalue and works incorrectly for types with such a conversion
operator.
For example, 

    struct foo
    {
        operator int&();
    };

 returns false_type. 
Attached a patch that fixes this problem. 
http://llvm.org/bugs/show_bug.cgi?id=13601

llvm-svn: 162644
2012-08-25 15:06:50 +00:00
Eli Friedman 48ddcf2cb5 Fix a CodeGen bug where we would skip zero-initialization for
array new with a non-trivial constructor. Pointed out in PR13380.

llvm-svn: 162643
2012-08-25 07:11:29 +00:00
Richard Smith a374bf0ae1 Remove spurious string literal for bool argument.
llvm-svn: 162642
2012-08-25 05:43:00 +00:00
Francois Pichet fb5d242d25 _HAS_CHAR16_T_LANGUAGE_SUPPORT is not predefined MSVC macro.
llvm-svn: 162641
2012-08-25 05:27:04 +00:00
Ted Kremenek ca13244bb7 Change --with-analyzer to --use-analyzer, per sage feedback from Jordan.
llvm-svn: 162640
2012-08-25 05:24:46 +00:00
John McCall a5f46fbcf9 Fix the CC-matching logic for instance methods in the MS ABI.
Patch by Timur Iskhodzhanov!

llvm-svn: 162639
2012-08-25 02:00:03 +00:00
John McCall 3351dc397b Fix the mangling of function pointers in the MS ABI.
Patch by Timur Iskhodzhanov!

llvm-svn: 162638
2012-08-25 01:12:56 +00:00
Jordan Rose 0a0aa84da3 [analyzer] Use the common evalBind infrastructure for initializers.
This allows checkers (like the MallocChecker) to process the effects of the
bind. Previously, using a memory-allocating function (like strdup()) in an
initializer would result in a leak warning.

This does bend the expectations of checkBind a bit; since there is no
assignment expression, the statement being used is the initializer value.
In most cases this shouldn't matter because we'll use a PostInitializer
program point (rather than PostStmt) for any checker-generated nodes, though
we /will/ generate a PostStore node referencing the internal statement.
(In theory this could have funny effects if someone actually does an
assignment within an initializer; in practice, that seems like it would be
very rare.)

<rdar://problem/12171711>

llvm-svn: 162637
2012-08-25 01:06:23 +00:00
Richard Smith cb889d8737 Stub out a release notes section on -fcatch-undefined-behavior.
llvm-svn: 162636
2012-08-25 00:47:19 +00:00
Richard Smith f994353801 Update the user's manual for some of the new -fcatch-undefined-behavior features.
llvm-svn: 162635
2012-08-25 00:44:02 +00:00
Richard Smith 3e056dea1b -fcatch-undefined-behavior: add the -ftrapv checks to the set of things caught
by this mode, and also check for signed left shift overflow. The rules for the
latter are a little subtle:

 * neither C89 nor C++98 specify the behavior of a signed left shift at all
 * in C99 and C11, shifting a 1 bit into the sign bit has undefined behavior
 * in C++11, with core issue 1457, shifting a 1 bit *out* of the sign bit has
   undefined behavior

As of this change, we use the C99 rules for all C language variants, and the
C++11 rules for all C++ language variants. Once we have individual
-fcatch-undefined-behavior= flags, this should be revisited.

llvm-svn: 162634
2012-08-25 00:32:28 +00:00
Filipe Cabecinhas c5041918dd Added SBDebugger's log callbacks to Python-land
- Tweaked a parameter name in SBDebugger.h so my typemap will catch it;
- Added a SBDebugger.Create(bool, callback, baton) to the swig interface;
- Added SBDebugger.SetLoggingCallback to the swig interface;
- Added a callback utility function for log callbacks;
- Guard against Py_None on both callback utility functions;

- Added a FIXME to the SBDebugger API test;
- Added a __del__() stub for SBDebugger.

We need to be able to get both the log callback and baton from an
SBDebugger if we want to protect against memory leaks (or make the user
responsible for holding another reference to the callback).
Additionally, it's impossible to revert from a callback-backed log
mechanism to a file-backed log mechanism.

llvm-svn: 162633
2012-08-25 00:29:07 +00:00
Chad Rosier de70e0ef45 [ms-inline asm] As part of a larger refactoring, rename AsmStmt to GCCAsmStmt.
No functional change intended.

llvm-svn: 162632
2012-08-25 00:11:56 +00:00
NAKAMURA Takumi 6ab80a0872 ASTTests: Suppress TestCXXConstructorDecl11 on msvc for now. It seems incompatible.
llvm-svn: 162631
2012-08-25 00:05:56 +00:00
Richard Smith a6a03369da Remove RequireCompleteType call which was made redundant by r162586.
llvm-svn: 162630
2012-08-24 23:51:39 +00:00
Chad Rosier e30d4994f2 [ms-inline asm] Update the AST Reader/Writer for MS-style inline asms.
llvm-svn: 162629
2012-08-24 23:51:02 +00:00
Fariborz Jahanian 1cfbe7a240 objective-C: Do not warn if align attribute on method
declaration is not provided. It is only necessary on
the method implementation. // rdar://11593375

llvm-svn: 162628
2012-08-24 23:50:13 +00:00
Sam Panzer 4cf99cfdc7 loop-convert, a C++11 for loop modernizer
A new Clang-based tool which converts for loops to use the range-based
syntax new to C++11. Three kinds of loops can be converted:
 - Loops over statically allocated arrays
 - Loops over containers, using iterators
 - Loops over array-like containers, using operator[] and at()

Each transformation is assigned a confidence level by the tool. The
minimum require confidence level to actually apply the transformation
can be specified on the command line, but the default level should be
fine for most code.

Like other tools based on RefactoringTool, it is easiest to use this
tool with a compilation database.

llvm-svn: 162627
2012-08-24 23:46:42 +00:00
Richard Smith 24adaee6bc Fix integer unsigned behavior in clang due to signed left shift overflow.
llvm-svn: 162626
2012-08-24 23:43:39 +00:00
Ted Kremenek 12cda3384a Fix a few issues related to -with-analyzer reported by Jordan. Let's
have the option with two '--' to be consistent with other options.

llvm-svn: 162625
2012-08-24 23:42:58 +00:00
Sam Panzer 8e0df501fa Reverted to correct commit this time.
llvm-svn: 162624
2012-08-24 23:29:33 +00:00
Richard Smith 228e6d4cf3 Fix integer undefined behavior due to signed left shift overflow in LLVM.
Reviewed offline by chandlerc.

llvm-svn: 162623
2012-08-24 23:29:28 +00:00
Jakob Stoklund Olesen 3d91b43ad2 Add missing mayLoad flags to a large class of AVX *_Int instructions.
llvm-svn: 162622
2012-08-24 23:29:07 +00:00
Ted Kremenek 22708504f2 Rework how scan-build picks the version of clang to use for static analysis.
Unless the user specifies, the clang used for static analysis is the one
found relative to scan-build.

If the user specifies -with-analyzer, they can pick either to use
the clang bundled with Xcode (via xcrun) or they can specify
a path to clang.

llvm-svn: 162620
2012-08-24 23:08:08 +00:00
Ted Kremenek 2f65f465bf Reformat help text for scan-build, and remove -constraints
and -store from help text because they are no longer relevant
to users.

llvm-svn: 162619
2012-08-24 23:08:06 +00:00
Sam Panzer 6d471a12db Reverted incorect partial commit of loop migrator. git-svn strikes again
llvm-svn: 162618
2012-08-24 23:02:27 +00:00
Jim Ingham b520a104c1 Add the "expr" command to the gdb command equivalents.
llvm-svn: 162617
2012-08-24 22:56:40 +00:00
John McCall e91aec7a57 When computing the effective context for access control,
make sure we walk up the DC chain for the current context,
rather than allowing ourselves to get switched over to the
canonical DC chain.  Fixes PR13642.

llvm-svn: 162616
2012-08-24 22:54:02 +00:00
Jakob Stoklund Olesen 74352494a6 Missed tLEApcrelJT.
ARMConstantIslandPass expects this instruction to stay in the same basic
block as the jump table branch.

llvm-svn: 162615
2012-08-24 22:46:55 +00:00
Jakob Stoklund Olesen c2272df1be Infer instruction properties from single-instruction patterns.
Previously, instructions without a primary patterns wouldn't get their
properties inferred. Now, we use all single-instruction patterns for
inference, including 'def : Pat<>' instances.

This causes a lot of instruction flags to change.

- Many instructions no longer have the UnmodeledSideEffects flag because
  their flags are now inferred from a pattern.

- Instructions with intrinsics will get a mayStore flag if they already
  have UnmodeledSideEffects and a mayLoad flag if they already have
  mayStore. This is because intrinsics properties are linear.

- Instructions with atomic_load patterns get a mayStore flag because
  atomic loads can't be reordered. The correct workaround is to create
  pseudo-instructions instead of using normal loads. PR13693.

llvm-svn: 162614
2012-08-24 22:46:53 +00:00
Howard Hinnant 7b838f53a6 Wrap throw in _LIBCPP_NO_EXCEPTIONS in debug.cpp. Calls abort if can't throw an exception. Fixes http://llvm.org/bugs/show_bug.cgi?id=13082.
llvm-svn: 162613
2012-08-24 22:15:12 +00:00
Sam Panzer 72676f419a Slight refactoring
llvm-svn: 162612
2012-08-24 22:10:18 +00:00
Sam Panzer 78184d9d74 Fixes according to code review comments
llvm-svn: 162611
2012-08-24 22:10:15 +00:00
Sam Panzer 4483b0c56d For Loop Conversion
Loop Converter Skeleton - array-step-1

Added a check to loop increments - array-step-2b

Added a check on the loop's condition expression - array-step-2c

Finished array matcher - array-step-2

Retrieved matched nodes - array-step-3

Analysis for array loop indices - array-step-4

Added checking for naming and variable scope

Added confidence level and count-only command line args

Added aliased variable elision

Added support for iterator-based loops

Added support for single-iterator loops which call end() repeatedly

Added support for converting array-like containers

llvm-svn: 162610
2012-08-24 22:10:10 +00:00
Sam Panzer 68a35af312 New matcher for MaterializeTemporaryExpr
llvm-svn: 162609
2012-08-24 22:04:44 +00:00
Howard Hinnant dbbdd0c1f0 Have basic_istream seekg, putback and unget first clear eofbit. Fixes http://llvm.org/bugs/show_bug.cgi?id=13089.
llvm-svn: 162608
2012-08-24 22:03:03 +00:00
Howard Hinnant bad901b362 Add Hyeon-bin Jeong to CREDITS.TXT
llvm-svn: 162604
2012-08-24 21:45:19 +00:00
Jakob Stoklund Olesen 47ac1a8ec0 Explicitly mark LEApcrel pseudos with hasSideEffects.
It's not clear that they should be marked as such, but tbb formation
fails if t2LEApcrelJT is hoisted of of a loop.

This doesn't change the flags on these instructions,
UnmodeledSideEffects was already inferred from the missing pattern.

llvm-svn: 162603
2012-08-24 21:44:11 +00:00
Chad Rosier 175ea24e38 [ms-inline asm] Change the -fenable-experimental-ms-inline-asm option from a
CodeGen option to a LangOpt option.  In turn, hoist the guard into the parser 
so that we avoid the new (and fairly unstable) Sema/AST/CodeGen logic.  This
should restore the behavior of clang to that prior to r158325.
<rdar://problem/12163681>

llvm-svn: 162602
2012-08-24 21:42:51 +00:00
Howard Hinnant bfd96e11ed Hyeon-Bin Jeong: 1. sync() should reset it’s external buffer pointers.
Remaining characters should be discarded once sync() called. If don’t, garbage
characters can be inserted to the front of external buffer in underflow().
Because underflow() copies remaining characters in external buffer to it’s
front. This results wrong characters insertion when seekpos() or seekoff() is
called.

this line should be inserted in sync() just before return:
__extbufnext_ = __extbufend_ = __extbuf_;

2. sync() should use length() rather than out() to calculate offset.
Reversing iterators and calling out() to calculate offset from behind is
working fine in stateless character encoding. However, in stateful encoding,
escape sequences could differ in length. As a result, out() could return wrong
length. 

For example, if we have internal buffer converted from this external sequence:
(capital letters mean escape sequence)
… a a a a B b b b b

out() produces this sequence. 
b b b b A a a a a

Because out() inserts escape sequence A rather than B, result sequence doesn't
match to external sequence. A and B could have different lengths, result offset
could be wrong value too.

length() method in codecvt is right for calculating offset, but it counts
offset from the beginning of buffer. So it requires another state member
variable to hold state before conversion.
Fixes http://llvm.org/bugs/show_bug.cgi?id=13667

llvm-svn: 162601
2012-08-24 21:20:56 +00:00
Enrico Granata 5eb99ccd3e Providing an additional Python command example
llvm-svn: 162600
2012-08-24 21:20:14 +00:00