platform/upstream/llvm.git
11 years agoRevert 167755/167760. We don't want to emit crash diagnostics on command-line syntax...
Chad Rosier [Tue, 13 Nov 2012 16:42:19 +0000 (16:42 +0000)]
Revert 167755/167760. We don't want to emit crash diagnostics on command-line syntax errors.

llvm-svn: 167849

11 years agoUpdate CREDIT.TXT
Howard Hinnant [Tue, 13 Nov 2012 15:57:18 +0000 (15:57 +0000)]
Update CREDIT.TXT

llvm-svn: 167847

11 years agoThis patch makes the behavior of clang consistent with the behavior of gcc 4.6 in...
Benjamin Kramer [Tue, 13 Nov 2012 15:32:35 +0000 (15:32 +0000)]
This patch makes the behavior of clang consistent with the behavior of gcc 4.6 in cases where both -fPIC and -fPIE is used.

- Separately check if -fPIE was specified in the command line and define both __PIC__ and __PIE__ when -fPIE is used. We need to check this separately because -fPIE will infer -fPIC even if its not explicitly used.
- Fixed existing tests.
- Added new tests for cases where both -fPIC and -fPIE is used.

Author: Tareq A. Siraj <tareq.a.siraj@intel.com>
Fixes: PR13221
Review: http://llvm-reviews.chandlerc.com/D94
llvm-svn: 167846

11 years agollvm/test/Other/close-stderr.ll: Mark it as XFAIL:mingw32 for now.
NAKAMURA Takumi [Tue, 13 Nov 2012 15:03:33 +0000 (15:03 +0000)]
llvm/test/Other/close-stderr.ll: Mark it as XFAIL:mingw32 for now.

On MSYS, 70 is not seen, but 1.

r127726 should be reworked. Candidate options are;

  1) Use not exit(70), but _exit(70), in report_fatal_error().
  2) Return with _exit(70) in ~raw_ostream().

llvm-svn: 167836

11 years agotsan: remove unused const
Dmitry Vyukov [Tue, 13 Nov 2012 14:13:21 +0000 (14:13 +0000)]
tsan: remove unused const

llvm-svn: 167835

11 years agotsan: better function names
Dmitry Vyukov [Tue, 13 Nov 2012 14:05:58 +0000 (14:05 +0000)]
tsan: better function names

llvm-svn: 167834

11 years ago[TSan] Add output test for write under reader lock
Alexey Samsonov [Tue, 13 Nov 2012 14:05:02 +0000 (14:05 +0000)]
[TSan] Add output test for write under reader lock

llvm-svn: 167833

11 years agotsan: fix stats collection
Dmitry Vyukov [Tue, 13 Nov 2012 13:53:43 +0000 (13:53 +0000)]
tsan: fix stats collection

llvm-svn: 167832

11 years agoCodegen support for arbitrary vector getelementptrs.
Duncan Sands [Tue, 13 Nov 2012 13:01:58 +0000 (13:01 +0000)]
Codegen support for arbitrary vector getelementptrs.

llvm-svn: 167830

11 years agoFix the instcombine GEP index widening transform to work correctly for vector
Duncan Sands [Tue, 13 Nov 2012 13:01:00 +0000 (13:01 +0000)]
Fix the instcombine GEP index widening transform to work correctly for vector
getelementptrs.

llvm-svn: 167829

11 years agoRelax the restrictions on vector of pointer types, and vector getelementptr.
Duncan Sands [Tue, 13 Nov 2012 12:59:33 +0000 (12:59 +0000)]
Relax the restrictions on vector of pointer types, and vector getelementptr.
Previously in a vector of pointers, the pointer couldn't be any pointer type,
it had to be a pointer to an integer or floating point type.  This is a hassle
for dragonegg because the GCC vectorizer happily produces vectors of pointers
where the pointer is a pointer to a struct or whatever.  Vector getelementptr
was restricted to just one index, but now that vectors of pointers can have
any pointer type it is more natural to allow arbitrary vector getelementptrs.
There is however the issue of struct GEPs, where if each lane chose different
struct fields then from that point on each lane will be working down into
unrelated types.  This seems like too much pain for too little gain, so when
you have a vector struct index all the elements are required to be the same.

llvm-svn: 167828

11 years agoDependenceAnalysis: Print all dependency pairs when dumping. Update all testcases.
Benjamin Kramer [Tue, 13 Nov 2012 12:12:02 +0000 (12:12 +0000)]
DependenceAnalysis: Print all dependency pairs when dumping. Update all testcases.

Part of a patch by Preston Briggs.

llvm-svn: 167827

11 years agomisched: Allow subtargets to enable misched and dependent options.
Andrew Trick [Tue, 13 Nov 2012 08:47:29 +0000 (08:47 +0000)]
misched: Allow subtargets to enable misched and dependent options.

This allows me to begin enabling (or backing out) misched by default
for one subtarget at a time. To run misched we typically want to:
- Disable SelectionDAG scheduling (use the source order scheduler)
- Enable more aggressive coalescing (until we decide to always run the coalescer this way)
- Enable MachineScheduler pass itself.

Disabling PostRA sched may follow for some subtargets.

llvm-svn: 167826

11 years agoAdded RegisterCoalescer support for joining global copies first.
Andrew Trick [Tue, 13 Nov 2012 08:47:25 +0000 (08:47 +0000)]
Added RegisterCoalescer support for joining global copies first.

This adds the -join-globalcopies option which can be enabled by
default once misched is also enabled.

Ideally, the register coalescer would be able to split local live
ranges in a way that produces copies that can be easily resolved by
the scheduler. Until then, this heuristic should be good enough to at
least allow the scheduler to run after coalescing.

llvm-svn: 167825

11 years ago[ASan] now we don't need llvm_obj_root to access llvm-symbolizer tool
Alexey Samsonov [Tue, 13 Nov 2012 07:55:16 +0000 (07:55 +0000)]
[ASan] now we don't need llvm_obj_root to access llvm-symbolizer tool

llvm-svn: 167823

11 years agoFigure out <size> argument of llvm.lifetime intrinsics at the moment they are created...
Alexey Samsonov [Tue, 13 Nov 2012 07:15:32 +0000 (07:15 +0000)]
Figure out <size> argument of llvm.lifetime intrinsics at the moment they are created (during function inlining)

llvm-svn: 167821

11 years agoTest commit.
Jyotsna Verma [Tue, 13 Nov 2012 06:31:55 +0000 (06:31 +0000)]
Test commit.
Add a blank line.

llvm-svn: 167819

11 years agoUCNs in char literals are done (in LiteralSupport), remove FIXME. Expand UCN FIXME...
Nico Weber [Tue, 13 Nov 2012 06:25:15 +0000 (06:25 +0000)]
UCNs in char literals are done (in LiteralSupport), remove FIXME. Expand UCN FIXME in LexNumericConstant.

llvm-svn: 167818

11 years agoBBVectorize: Remove temporary assert used for debugging
Hal Finkel [Tue, 13 Nov 2012 05:54:54 +0000 (05:54 +0000)]
BBVectorize: Remove temporary assert used for debugging

llvm-svn: 167817

11 years agoCopy the decls returned by DeclContext::lookup_result to a
Argyrios Kyrtzidis [Tue, 13 Nov 2012 05:07:23 +0000 (05:07 +0000)]
Copy the decls returned by DeclContext::lookup_result to a
new container so we can safely iterate over them.

The container holding the lookup decls can under certain conditions
be changed while iterating (e.g. because of deserialization).

llvm-svn: 167816

11 years agoinstcombine: Migrate math library call simplifications
Meador Inge [Tue, 13 Nov 2012 04:16:17 +0000 (04:16 +0000)]
instcombine: Migrate math library call simplifications

This patch migrates the math library call simplifications from the
simplify-libcalls pass into the instcombine library call simplifier.

I have typically migrated just one simplifier at a time, but the math
simplifiers are interdependent because:

   1. CosOpt, PowOpt, and Exp2Opt all depend on UnaryDoubleFPOpt.
   2. CosOpt, PowOpt, Exp2Opt, and UnaryDoubleFPOpt all depend on
      the option -enable-double-float-shrink.

These two factors made migrating each of these simplifiers individually
more of a pain than it would be worth.  So, I migrated them all together.

llvm-svn: 167815

11 years agoAdd a test that shows that reporting a leak after failure to free is
Anna Zaks [Tue, 13 Nov 2012 03:34:49 +0000 (03:34 +0000)]
Add a test that shows that reporting a leak after failure to free is
tricky.

llvm-svn: 167814

11 years agoFix a Malloc Checker FP by tracking return values from initWithCharacter
Anna Zaks [Tue, 13 Nov 2012 03:18:01 +0000 (03:18 +0000)]
Fix a Malloc Checker FP by tracking return values from initWithCharacter
and other functions.

When these functions return null, the pointer is not freed by
them/ownership is not transfered. So we should allow the user to free
the pointer by calling another function when the return value is NULL.

llvm-svn: 167813

11 years agoRemove virtual keyword for two routines that should never be overridden.
Evan Cheng [Tue, 13 Nov 2012 03:14:16 +0000 (03:14 +0000)]
Remove virtual keyword for two routines that should never be overridden.

llvm-svn: 167812

11 years agoBBVectorize: Don't vectorize vector-manipulation chains
Hal Finkel [Tue, 13 Nov 2012 03:12:40 +0000 (03:12 +0000)]
BBVectorize: Don't vectorize vector-manipulation chains

Don't choose a vectorization plan containing only shuffles and
vector inserts/extracts. Due to inperfections in the cost model,
these can lead to infinite recusion.

llvm-svn: 167811

11 years agoGiving at least some error information when a Python exception happens during command...
Enrico Granata [Tue, 13 Nov 2012 02:57:43 +0000 (02:57 +0000)]
Giving at least some error information when a Python exception happens during command script import

llvm-svn: 167810

11 years agoRevert r167759. Ben is right this isn't likely to help much.
Evan Cheng [Tue, 13 Nov 2012 02:56:38 +0000 (02:56 +0000)]
Revert r167759. Ben is right this isn't likely to help much.

llvm-svn: 167809

11 years agomisched: Don't consider artificial edges weak edges.
Andrew Trick [Tue, 13 Nov 2012 02:35:06 +0000 (02:35 +0000)]
misched: Don't consider artificial edges weak edges.

For now be more conservative in case other out-of-tree schedulers rely
on the old behavior of artificial edges.

llvm-svn: 167808

11 years agoUse the 'count' attribute instead of the 'upper_bound' attribute.
Bill Wendling [Tue, 13 Nov 2012 02:31:58 +0000 (02:31 +0000)]
Use the 'count' attribute instead of the 'upper_bound' attribute.

If we have a type 'int a[1]' and a type 'int b[0]', the generated DWARF is the
same for both of them because we use the 'upper_bound' attribute. Instead use
the 'count' attrbute, which gives the correct number of elements in the array.
<rdar://problem/12566646>

llvm-svn: 167807

11 years agoUse the 'count' attribute instead of the 'upper_bound' attribute.
Bill Wendling [Tue, 13 Nov 2012 02:31:47 +0000 (02:31 +0000)]
Use the 'count' attribute instead of the 'upper_bound' attribute.

If we have a type 'int a[1]' and a type 'int b[0]', the generated DWARF is the
same for both of them because we use the 'upper_bound' attribute. Instead use
the 'count' attrbute, which gives the correct number of elements in the array.
<rdar://problem/12566646>

llvm-svn: 167806

11 years ago<rdar://problem/11814875>
Enrico Granata [Tue, 13 Nov 2012 02:05:45 +0000 (02:05 +0000)]
<rdar://problem/11814875>

If a ValueObjectDynamic has no formatter, try using its static type to figure one out

llvm-svn: 167803

11 years agoFix IR generation for bool on PPC (and any other target where bool is not 8 bits...
Eli Friedman [Tue, 13 Nov 2012 02:05:15 +0000 (02:05 +0000)]
Fix IR generation for bool on PPC (and any other target where bool is not 8 bits in memory).

PR11777.

llvm-svn: 167802

11 years ago[preprocessor] When #including something that contributes no tokens at all,
Argyrios Kyrtzidis [Tue, 13 Nov 2012 01:03:15 +0000 (01:03 +0000)]
[preprocessor] When #including something that contributes no tokens at all,
don't recursively continue lexing.

This avoids a stack overflow with a sequence of many empty #includes.
rdar://11988695

llvm-svn: 167801

11 years agoIn Lexer::LexTokenInternal, avoid code duplication; no functionality change.
Argyrios Kyrtzidis [Tue, 13 Nov 2012 01:02:40 +0000 (01:02 +0000)]
In Lexer::LexTokenInternal, avoid code duplication; no functionality change.

llvm-svn: 167800

11 years agoDisable accelerator tables when compiling with LTO.
Bill Wendling [Tue, 13 Nov 2012 00:54:24 +0000 (00:54 +0000)]
Disable accelerator tables when compiling with LTO.

LTO doesn't generate correct accelerator tables. This is due to the general lack
correct of debug info for LTO. Disable it when using LTO.
<rdar://problem/12401423>

llvm-svn: 167799

11 years agoFix some wrong-code bugs in implicitly-defined assignment operators:
Richard Smith [Tue, 13 Nov 2012 00:54:12 +0000 (00:54 +0000)]
Fix some wrong-code bugs in implicitly-defined assignment operators:
 - In C++11, perform overload resolution over all assignment operators, rather than just looking for copy/move assignment operators.
 - Clean up after temporaries produced by operator= immediately, rather than accumulating them until the end of the function.

llvm-svn: 167798

11 years agoCleanup the main RegisterCoalescer loop.
Andrew Trick [Tue, 13 Nov 2012 00:34:44 +0000 (00:34 +0000)]
Cleanup the main RegisterCoalescer loop.

Block priorities still apply outside loops.

llvm-svn: 167793

11 years agoA couple of small fixes to r167783
Kaelyn Uhrain [Tue, 13 Nov 2012 00:18:47 +0000 (00:18 +0000)]
A couple of small fixes to r167783

llvm-svn: 167791

11 years ago[analyzer] Address Jordan's feedback for r167780.
Anna Zaks [Tue, 13 Nov 2012 00:13:44 +0000 (00:13 +0000)]
[analyzer] Address Jordan's feedback for r167780.

llvm-svn: 167790

11 years agoFix bad CFG construction bug when handling C++ 'try' statements.
Ted Kremenek [Tue, 13 Nov 2012 00:12:13 +0000 (00:12 +0000)]
Fix bad CFG construction bug when handling C++ 'try' statements.

This code assigned the last created CFGBlock* to the variable 'Block',
which is a scratch variable which is null'ed out after a block is
completed.  By assigning the last created block to 'Block', we start
editing a completed block, inserting CFGStmts that should be in
another block.  This was the case with 'try'.  The test case that
showed this had a while loop inside a 'try', and the logic before
the while loop was being included as part of the "condition block"
for the loop.  This showed up as a bogus dead store, but could
have lots of implications.

Turns out this bug was replicated a few times within CFG.cpp, so
I went and fixed up those as well.

llvm-svn: 167788

11 years agorevert r167740
Shuxin Yang [Tue, 13 Nov 2012 00:08:49 +0000 (00:08 +0000)]
revert r167740

llvm-svn: 167787

11 years agoWhen filtering the list of associated namespaces so that we don't suggest people
Nick Lewycky [Tue, 13 Nov 2012 00:08:34 +0000 (00:08 +0000)]
When filtering the list of associated namespaces so that we don't suggest people
add functions to namespace 'std', also filter out namespaces with '__' anywhere
in the name.

llvm-svn: 167786

11 years agoCleanup -join-splitedges. Make the loop more obvious.
Andrew Trick [Mon, 12 Nov 2012 23:59:48 +0000 (23:59 +0000)]
Cleanup -join-splitedges. Make the loop more obvious.

llvm-svn: 167785

11 years agoBBVectorize: Only some insert element operand pairs are free.
Hal Finkel [Mon, 12 Nov 2012 23:55:36 +0000 (23:55 +0000)]
BBVectorize: Only some insert element operand pairs are free.

This fixes another infinite recursion case when using target costs.
We can only replace insert element input chains that are pure (end
with inserting into an undef).

llvm-svn: 167784

11 years agoEnable C++11 attribute syntax for warn_unused_result and allow it to be
Kaelyn Uhrain [Mon, 12 Nov 2012 23:48:05 +0000 (23:48 +0000)]
Enable C++11 attribute syntax for warn_unused_result and allow it to be
applied to CXXRecordDecls, where functions with that return type will
inherit the warn_unused_result attribute.

Also includes a tiny fix (with no discernable behavior change for
existing code) to re-sync AttributeDeclKind enum and
err_attribute_wrong_decl_type with warn_attribute_wrong_decl_type since
the enum is used with both diagnostic messages to chose the correct
description.

llvm-svn: 167783

11 years agoUpdate link to external document
Jean-Daniel Dupas [Mon, 12 Nov 2012 23:43:34 +0000 (23:43 +0000)]
Update link to external document

llvm-svn: 167781

11 years ago[analyzer] Follow up to r167762 - precisely determine the adjustment
Anna Zaks [Mon, 12 Nov 2012 23:40:29 +0000 (23:40 +0000)]
[analyzer] Follow up to r167762 - precisely determine the adjustment
conditions.

The adjustment is needed only in case of dynamic dispatch performed by
the analyzer - when the runtime declaration is different from the static
one.

Document this explicitly in the code (by adding a helper). Also, use
canonical Decls to avoid matching against the case where the definition
is different from found declaration.

This fix suppresses the testcase I added in r167762, so add another
testcase to make sure we do test commit r167762.

llvm-svn: 167780

11 years agoFactor duplicated implicit memcpy call generation code out of copy/move
Richard Smith [Mon, 12 Nov 2012 23:33:00 +0000 (23:33 +0000)]
Factor duplicated implicit memcpy call generation code out of copy/move
assignment generation. This incidentally avoids reusing the same Expr* across
multiple statements in the same object; that was generating slightly broken
ASTs, but I couldn't trigger any observable bad behavior, so no test.

llvm-svn: 167779

11 years agoPatch from Andrew Kaylor that fixes a race condition in the Listener.cpp.
Greg Clayton [Mon, 12 Nov 2012 23:15:22 +0000 (23:15 +0000)]
Patch from Andrew Kaylor that fixes a race condition in the Listener.cpp.

llvm-svn: 167778

11 years agoFinish reverting r167761, it's causing test failures.
Eric Christopher [Mon, 12 Nov 2012 23:13:34 +0000 (23:13 +0000)]
Finish reverting r167761, it's causing test failures.

llvm-svn: 167777

11 years agoNew compiler warnings caught issues with the m_encoding_uid field that should have...
Greg Clayton [Mon, 12 Nov 2012 22:54:26 +0000 (22:54 +0000)]
New compiler warnings caught issues with the m_encoding_uid field that should have been a lldb::user_id_t type, but was a uint32_t a long time ago and never got updated.

llvm-svn: 167774

11 years agoFixed an error in the ELF parser that was comparing a bool to 4 causing 32 bit ELF...
Greg Clayton [Mon, 12 Nov 2012 22:53:16 +0000 (22:53 +0000)]
Fixed an error in the ELF parser that was comparing a bool to 4 causing 32 bit ELF relocations to get parsed incorrectly.

llvm-svn: 167773

11 years agoFix typo (dwarf/dsym mismatch) in testcase causing early failure on Linux
Daniel Malea [Mon, 12 Nov 2012 22:43:13 +0000 (22:43 +0000)]
Fix typo (dwarf/dsym mismatch) in testcase causing early failure on Linux

llvm-svn: 167771

11 years agoFix minor typo on build page.
Daniel Malea [Mon, 12 Nov 2012 22:34:24 +0000 (22:34 +0000)]
Fix minor typo on build page.

llvm-svn: 167770

11 years agoFix test case added in patch fixing PR14314
Michael Liao [Mon, 12 Nov 2012 22:33:18 +0000 (22:33 +0000)]
Fix test case added in patch fixing PR14314

llvm-svn: 167769

11 years agoUpdate platform section to mention Linux/FreeBSD local debugging support, and also...
Daniel Malea [Mon, 12 Nov 2012 22:32:00 +0000 (22:32 +0000)]
Update platform section to mention Linux/FreeBSD local debugging support, and also mention that LLDB builds on Linux with clang and libstdc++/libc++.

llvm-svn: 167768

11 years agoRemove duplicated line.
Rafael Espindola [Mon, 12 Nov 2012 22:29:43 +0000 (22:29 +0000)]
Remove duplicated line.

llvm-svn: 167767

11 years agoFix more try scoping bugs introduced by r167650.
David Blaikie [Mon, 12 Nov 2012 22:25:41 +0000 (22:25 +0000)]
Fix more try scoping bugs introduced by r167650.

Introduces more clear scoping flags & flag combinations which should hopefully
be more understandable.

llvm-svn: 167766

11 years agoAdd an option to enable prototype "fission" capabilities and debug changes.
Eric Christopher [Mon, 12 Nov 2012 22:22:20 +0000 (22:22 +0000)]
Add an option to enable prototype "fission" capabilities and debug changes.

llvm-svn: 167765

11 years agoReplace const_iterator with iterator to build against libstdc++
Daniel Malea [Mon, 12 Nov 2012 22:16:27 +0000 (22:16 +0000)]
Replace const_iterator with iterator to build against libstdc++
- libstdc++ defines vector::erase(iterator) but not vector::erase(const_iterator)

llvm-svn: 167764

11 years agoThat's causing an error.
Bill Wendling [Mon, 12 Nov 2012 22:14:27 +0000 (22:14 +0000)]
That's causing an error.

llvm-svn: 167763

11 years ago[analyzer] Fix a regression (from r 165079): compare canonical types.
Anna Zaks [Mon, 12 Nov 2012 22:06:24 +0000 (22:06 +0000)]
[analyzer] Fix a regression (from r 165079): compare canonical types.

Suppresses a leak false positive (radar://12663777).

In addition, we'll need to rewrite the adjustReturnValue() method not to
return UnknownVal by default, but rather assert in cases we cannot
handle. To make it possible, we need to correctly handle some of the
edge cases we already know about.

llvm-svn: 167762

11 years agoDon't test for incomplete types.
Bill Wendling [Mon, 12 Nov 2012 22:01:56 +0000 (22:01 +0000)]
Don't test for incomplete types.

llvm-svn: 167761

11 years agoUpdate test case for r167754/r167755.
Chad Rosier [Mon, 12 Nov 2012 21:51:08 +0000 (21:51 +0000)]
Update test case for r167754/r167755.

llvm-svn: 167760

11 years agoCache size of PassVector to speed up getNumContainedPasses().
Evan Cheng [Mon, 12 Nov 2012 21:42:53 +0000 (21:42 +0000)]
Cache size of PassVector to speed up getNumContainedPasses().
getNumContainedPasses() used to compute the size of the vector on demand. It is
called repeated in loops (such as runOnFunction()) and it can be updated while
inside the loop.

llvm-svn: 167759

11 years agoAdded a temporary option to avoid critical edges splitting.
Andrew Trick [Mon, 12 Nov 2012 21:42:40 +0000 (21:42 +0000)]
Added a temporary option to avoid critical edges splitting.

This teaches the register coalescer to be less prone to split critical
edges. I am currently benchmarking this with the new (post-coalescer)
scheduler. I plan to enable this by default and remove the option as
soon as misched is enabled.

llvm-svn: 167758

11 years agoRewrite DIContext interface to take an object. Update all callers.
Eric Christopher [Mon, 12 Nov 2012 21:40:38 +0000 (21:40 +0000)]
Rewrite DIContext interface to take an object. Update all callers.

llvm-svn: 167757

11 years agoRemove abuse of hasTrivial*, and fix miscompile wherein global arrays with
Richard Smith [Mon, 12 Nov 2012 21:38:00 +0000 (21:38 +0000)]
Remove abuse of hasTrivial*, and fix miscompile wherein global arrays with
internal linkage, no uses, trivial construction, and nontrivial destruction
were not emitted.

llvm-svn: 167756

11 years agoRevert r167620; this can be implemented using an existing CL option.
Chad Rosier [Mon, 12 Nov 2012 21:32:44 +0000 (21:32 +0000)]
Revert r167620; this can be implemented using an existing CL option.

llvm-svn: 167755

11 years agoIf we encounter a fatal error, exit with status 70. For BSD systems this is
Chad Rosier [Mon, 12 Nov 2012 21:32:24 +0000 (21:32 +0000)]
If we encounter a fatal error, exit with status 70.  For BSD systems this is
defined as an internal software error.  This notifies the driver to report
diagnostics information.
rdar://11951540

llvm-svn: 167754

11 years agomisched: rename interfaceto avoid gcc warnings
Andrew Trick [Mon, 12 Nov 2012 21:28:10 +0000 (21:28 +0000)]
misched: rename interfaceto avoid gcc warnings

llvm-svn: 167753

11 years ago<rdar://problem/12153915>
Greg Clayton [Mon, 12 Nov 2012 21:27:20 +0000 (21:27 +0000)]
<rdar://problem/12153915>

When uniquing classes against one another we can't depend on any or all of the artificial functions (default ctor, dtor, copy ctor, move ctor, etc) being in each definition. Now we treat those separately and handle those to the best of our ability.

llvm-svn: 167752

11 years agos/BCPLComment/LineComment/ (llvm r167690)
Filipe Cabecinhas [Mon, 12 Nov 2012 21:26:32 +0000 (21:26 +0000)]
s/BCPLComment/LineComment/ (llvm r167690)

llvm-svn: 167751

11 years agoBBVectorize: Use a more sophisticated check for input cost
Hal Finkel [Mon, 12 Nov 2012 21:21:02 +0000 (21:21 +0000)]
BBVectorize: Use a more sophisticated check for input cost

The old checking code, which assumed that input shuffles and insert-elements
could always be folded (and thus were free) is too simple.
This can only happen in special circumstances.
Using the simple check caused infinite recursion.

llvm-svn: 167750

11 years agoPer discussion on cfe-dev, re-enable suppression of -Wimplicit-fallthrough on C,...
Ted Kremenek [Mon, 12 Nov 2012 21:20:48 +0000 (21:20 +0000)]
Per discussion on cfe-dev, re-enable suppression of -Wimplicit-fallthrough on C, but also include dialects of C++ earlier than C++11.

There was enough consensus that we *can* get a good language solution
to have an annotation outside of C++11, and without this annotation
this warning doesn't quite mean's completeness criteria for this
kind of warning.  For now, restrict this warning to C++11 (where an
annotation exists), and make this the behavior for the LLVM 3.2 release.
Afterwards, we will hammer out a language solution that we are all
happy with.

llvm-svn: 167749

11 years agoUpdate testcase to show that we don't emit an error for sizes <= 32-bits.
Bill Wendling [Mon, 12 Nov 2012 21:13:35 +0000 (21:13 +0000)]
Update testcase to show that we don't emit an error for sizes <= 32-bits.

llvm-svn: 167748

11 years agoFix libstdc++ build
Daniel Malea [Mon, 12 Nov 2012 21:02:14 +0000 (21:02 +0000)]
Fix libstdc++ build
- Add missing operator= definition for DelayedAddObjCClassProperty
- needed to be compatible with libstdc++ vector implementation

llvm-svn: 167747

11 years agomisched: Target-independent support for MacroFusion.
Andrew Trick [Mon, 12 Nov 2012 19:52:20 +0000 (19:52 +0000)]
misched: Target-independent support for MacroFusion.

Uses the infrastructure from r167742 to support clustering instructure
that the target processor can "fuse". e.g. cmp+jmp.

Next step: target hook implementations with test cases, and enable.

llvm-svn: 167744

11 years agoBBVectorize: Check the types of compare instructions
Hal Finkel [Mon, 12 Nov 2012 19:41:38 +0000 (19:41 +0000)]
BBVectorize: Check the types of compare instructions

The pass would previously assert when trying to compute the cost of
compare instructions with illegal vector types (like struct pointers).

llvm-svn: 167743

11 years agomisched: Target-independent support for load/store clustering.
Andrew Trick [Mon, 12 Nov 2012 19:40:10 +0000 (19:40 +0000)]
misched: Target-independent support for load/store clustering.

This infrastructure is generally useful for any target that wants to
strongly prefer two instructions to be adjacent after scheduling.

A following checkin will add target-specific hooks with unit
tests. Then this feature will be enabled by default with misched.

llvm-svn: 167742

11 years agoIf we encounter a fatal error, call the interrupt handler to ensure any
Chad Rosier [Mon, 12 Nov 2012 19:39:37 +0000 (19:39 +0000)]
If we encounter a fatal error, call the interrupt handler to ensure any
temporary files are removed.
rdar://12282296

llvm-svn: 167741

11 years agoThis change is to fix rdar://12571717 which is about assertion in Reassociate pass.
Shuxin Yang [Mon, 12 Nov 2012 19:34:11 +0000 (19:34 +0000)]
This change is to fix rdar://12571717 which is about assertion in Reassociate pass.

The assertion is trigged when the Reassociater tries to transform expression
     ... + 2 * n * 3 + 2 * m + ...
  into:
     ... + 2 * (n*3 + m).

In the process of the transformation, a helper routine folds the constant 2*3 into 6,
confusing optimizer which is trying the to eliminate the common factor 2, and cannot
find 2 any more.

Review is pending. But I'd like commit first in order to help those who are waiting
for this fix.

llvm-svn: 167740

11 years ago80 cols & unnecessary braces from r167736.
David Blaikie [Mon, 12 Nov 2012 19:32:32 +0000 (19:32 +0000)]
80 cols & unnecessary braces from r167736.

Post-commit review feedback by Eli Friedman.

llvm-svn: 167739

11 years agomisched: Infrastructure for weak DAG edges.
Andrew Trick [Mon, 12 Nov 2012 19:28:57 +0000 (19:28 +0000)]
misched: Infrastructure for weak DAG edges.

This adds support for weak DAG edges to the general scheduling
infrastructure in preparation for MachineScheduler support for
heuristics based on weak edges.

llvm-svn: 167738

11 years agoMake TOC order deterministic by using MapVector instead of DenseMap.
Ulrich Weigand [Mon, 12 Nov 2012 19:13:24 +0000 (19:13 +0000)]
Make TOC order deterministic by using MapVector instead of DenseMap.

llvm-svn: 167737

11 years agoCorrect printing of nested anonymous type member accesses.
David Blaikie [Mon, 12 Nov 2012 19:12:12 +0000 (19:12 +0000)]
Correct printing of nested anonymous type member accesses.

Patch by Florent Bruneau!

llvm-svn: 167736

11 years agoThe register constraint could mean a 16- or 8-bit register.
Bill Wendling [Mon, 12 Nov 2012 18:52:32 +0000 (18:52 +0000)]
The register constraint could mean a 16- or 8-bit register.

llvm-svn: 167735

11 years agofix a spelling mistake
Nadav Rotem [Mon, 12 Nov 2012 18:45:12 +0000 (18:45 +0000)]
fix a spelling mistake

llvm-svn: 167734

11 years agoWen-Han Gu: Fix for http://llvm.org/bugs/show_bug.cgi?id=14312 Exception Table out...
Howard Hinnant [Mon, 12 Nov 2012 18:19:15 +0000 (18:19 +0000)]
Wen-Han Gu:  Fix for llvm.org/bugs/show_bug.cgi?id=14312 Exception Table out-of-range but still keep walking.

llvm-svn: 167733

11 years agoFixed a potential crash in the Darwin platform.
Sean Callanan [Mon, 12 Nov 2012 18:00:29 +0000 (18:00 +0000)]
Fixed a potential crash in the Darwin platform.

llvm-svn: 167732

11 years agoBBVectorize: Check the input types of shuffles for legality
Hal Finkel [Mon, 12 Nov 2012 14:50:59 +0000 (14:50 +0000)]
BBVectorize: Check the input types of shuffles for legality

This fixes a bug where shuffles were being fused such that the
resulting input types were not legal on the target. This would
occur only when both inputs and dependencies were also foldable
operations (such as other shuffles) and there were other connected
pairs in the same block.

llvm-svn: 167731

11 years agoDon't use __cxa_demangle under MSVC (which doesn't have it)
Alexander Potapenko [Mon, 12 Nov 2012 14:49:58 +0000 (14:49 +0000)]
Don't use __cxa_demangle under MSVC (which doesn't have it)

llvm-svn: 167730

11 years ago[ASan] fixup for r167725: Don't fetch name of StructType if it is literal
Alexey Samsonov [Mon, 12 Nov 2012 14:47:00 +0000 (14:47 +0000)]
[ASan] fixup for r167725: Don't fetch name of StructType if it is literal

llvm-svn: 167729

11 years agoFixup for r167558: Store raw pointer (instead of reference) to RelocMap in DIContext...
Alexey Samsonov [Mon, 12 Nov 2012 14:25:36 +0000 (14:25 +0000)]
Fixup for r167558: Store raw pointer (instead of reference) to RelocMap in DIContext. This is needed to prevent crashes because of dangling reference if the clients don't provide RelocMap to DIContext constructor.

llvm-svn: 167728

11 years ago[ASan] test blacklist functionality for global-init-order checker (r167725)
Alexey Samsonov [Mon, 12 Nov 2012 14:03:00 +0000 (14:03 +0000)]
[ASan] test blacklist functionality for global-init-order checker (r167725)

llvm-svn: 167727

11 years agoNormalize memcmp constant folding results.
Meador Inge [Mon, 12 Nov 2012 14:00:45 +0000 (14:00 +0000)]
Normalize memcmp constant folding results.

The library call simplifier folds memcmp calls with all constant arguments
to a constant.  For example:

  memcmp("foo", "foo", 3) ->  0
  memcmp("hel", "foo", 3) ->  1
  memcmp("foo", "hel", 3) -> -1

The folding is implemented in terms of the system memcmp that LLVM gets
linked with.  It currently just blindly uses the value returned from
the system memcmp as the folded constant.

This patch normalizes the values returned from the system memcmp to
(-1, 0, 1) so that we get consistent results across multiple platforms.
The test cases were adjusted accordingly.

llvm-svn: 167726

11 years ago[ASan]: Add minimalistic support for turning off initialization-order checking for...
Alexey Samsonov [Mon, 12 Nov 2012 14:00:01 +0000 (14:00 +0000)]
[ASan]: Add minimalistic support for turning off initialization-order checking for globals of specified types. Tests for this behavior will go to ASan test suite in compiler-rt.

llvm-svn: 167725

11 years agodo not play preprocessor tricks with 'private', use public interfaces instead; this...
Gabor Greif [Mon, 12 Nov 2012 13:34:59 +0000 (13:34 +0000)]
do not play preprocessor tricks with 'private', use public interfaces instead; this appeases the VC++ buildbots

llvm-svn: 167724

11 years ago[ASan] Add llvm-symbolizer from to tools/
Alexander Potapenko [Mon, 12 Nov 2012 11:33:29 +0000 (11:33 +0000)]
[ASan] Add llvm-symbolizer from to tools/
This is the second and last (2/2) part of a change that moves llvm-symbolizer to llvm/tools/, which will allow to build it
with both cmake and configure+make.

llvm-svn: 167723

11 years ago[ASan] Remove llvm-symbolizer from compiler-rt/utils/
Alexander Potapenko [Mon, 12 Nov 2012 11:32:42 +0000 (11:32 +0000)]
[ASan] Remove llvm-symbolizer from compiler-rt/utils/
This is the first (1/2) part of a change that moves llvm-symbolizer to llvm/tools/, which will allow to build it
with both cmake and configure+make.

llvm-svn: 167722