platform/upstream/llvm.git
11 years agoRemove debugging assert.
David Blaikie [Wed, 14 Nov 2012 04:41:34 +0000 (04:41 +0000)]
Remove debugging assert.

Found by Richard Smith in post-commit review of r167906.

llvm-svn: 167911

11 years agoPatch from Andrew Kaylor andrew.kaylor@intel.com to have
Jason Molenda [Wed, 14 Nov 2012 04:26:02 +0000 (04:26 +0000)]
Patch from Andrew Kaylor andrew.kaylor@intel.com to have
Thread::ResetFrameZeroRegisters() clear the UnwindLLDB object when
resetting the thread's register state.

llvm-svn: 167910

11 years agoSemaTemplateDeduction.cpp: Prune two obsolete descriptions. [-Wdocumentation]
NAKAMURA Takumi [Wed, 14 Nov 2012 02:21:48 +0000 (02:21 +0000)]
SemaTemplateDeduction.cpp: Prune two obsolete descriptions. [-Wdocumentation]

* getMostSpecialized()

/// \param Index if non-NULL and the result of this function is non-nULL,
/// receives the index corresponding to the resulting function template
/// specialization.

* DeduceTemplateArguments()

/// \param Name the name of the function being called. This is only significant
/// when the function template is a conversion function template, in which
/// case this routine will also perform template argument deduction based on
/// the function to which

llvm-svn: 167909

11 years agoParseTemplate.cpp: Doxygen fix in AnnotateTemplateIdToken(). [-Wdocumentation]
NAKAMURA Takumi [Wed, 14 Nov 2012 02:21:42 +0000 (02:21 +0000)]
ParseTemplate.cpp: Doxygen fix in AnnotateTemplateIdToken(). [-Wdocumentation]

llvm-svn: 167908

11 years agoSuppress elided variadic macro argument extension diagnostic for macros using
Eli Friedman [Wed, 14 Nov 2012 02:18:46 +0000 (02:18 +0000)]
Suppress elided variadic macro argument extension diagnostic for macros using
the related comma pasting extension.

In certain cases, we used to get two diagnostics for what is essentially one
extension.  This change suppresses the first diagnostic in certain cases
where we know we're going to print the second diagnostic.  The
diagnostic is redundant, and it can't be suppressed in the definition
of the macro because it points at the use of the macro, so we want to
avoid printing it if possible.

The implementation works by detecting constructs which look like comma
pasting at the time of the definition of the macro; this information
is then used when the macro is used.  (We can't actually detect
whether we're using the comma pasting extension until the macro is
actually used, but we can detecting constructs which will be comma
pasting if the varargs argument is elided.)

<rdar://problem/12292192>

llvm-svn: 167907

11 years agoProvide the correct mangling and linkage for certain unnamed nested classes.
David Blaikie [Wed, 14 Nov 2012 01:52:05 +0000 (01:52 +0000)]
Provide the correct mangling and linkage for certain unnamed nested classes.

This corrects the mangling and linkage of classes (& their member functions) in
cases like this:

  struct foo {
    struct {
      void func() { ... }
    } x;
  };

we were accidentally giving this nested unnamed struct 'no' linkage where it
should've had the linkage of the outer class. The mangling was incorrecty too,
mangling as TU-wide unnamed type mangling of $_X rather than class-scoped
mangling of UtX_.

This also fixes -Wunused-member-function which would incorrectly diagnose
'func' as unused due to it having no linkage & thus appearing to be TU-local
when in fact it might be correctly used in another TU.

Similar mangling should be applied to function local classes in similar cases
but I've deferred that for a subsequent patch.

Review/discussion by Richard Smith, John McCall, & especially Eli Friedman.

llvm-svn: 167906

11 years agodocs: Fix Sphinx toctree warning.
Sean Silva [Wed, 14 Nov 2012 01:49:23 +0000 (01:49 +0000)]
docs: Fix Sphinx toctree warning.

llvm-svn: 167905

11 years agoUse TARGET2 relocation for TType references on ARM.
Anton Korobeynikov [Wed, 14 Nov 2012 01:47:00 +0000 (01:47 +0000)]
Use TARGET2 relocation for TType references on ARM.
Do some cleanup of the code while here.

Inspired by patch by Logan Chien!

llvm-svn: 167904

11 years agodocs: chmod -x HowToUseInstrMappings.rst
Sean Silva [Wed, 14 Nov 2012 01:41:58 +0000 (01:41 +0000)]
docs: chmod -x HowToUseInstrMappings.rst

llvm-svn: 167903

11 years agoUse consistent spelling of 'behavior' in a C++ warning.
Anders Carlsson [Wed, 14 Nov 2012 01:39:09 +0000 (01:39 +0000)]
Use consistent spelling of 'behavior' in a C++ warning.

llvm-svn: 167902

11 years agoThis function isn't called SaveFiles any more.
Nick Lewycky [Wed, 14 Nov 2012 01:33:49 +0000 (01:33 +0000)]
This function isn't called SaveFiles any more.

llvm-svn: 167901

11 years agoFix an assertion failure printing the unused-label fixit in files using CRLF line...
Eli Friedman [Wed, 14 Nov 2012 01:28:38 +0000 (01:28 +0000)]
Fix an assertion failure printing the unused-label fixit in files using CRLF line endings.  <rdar://problem/12639047>.

llvm-svn: 167900

11 years agoRemove another questionable use of hasTrivial*. The relevant thing for this
Richard Smith [Wed, 14 Nov 2012 00:50:40 +0000 (00:50 +0000)]
Remove another questionable use of hasTrivial*. The relevant thing for this
test was whether the /selected/ operator= was trivial, not whether the class
had any trivial (or any non-trivial) operator=s.

llvm-svn: 167897

11 years agoAccept and pass arguments to __unknown_anytype in argument
John McCall [Wed, 14 Nov 2012 00:49:39 +0000 (00:49 +0000)]
Accept and pass arguments to __unknown_anytype in argument
positions of Objective-C methods.

It is possible to recover a lot of type information about
Objective-C methods from the reflective metadata for their
implementations.  This information is not rich when it
comes to struct types, however, and it is not possible to
produce a type in the debugger's round-tripped AST which
will really do anything useful during type-checking.
Therefore we allow __unknown_anytype in these positions,
which essentially disables type-checking for that argument.
We infer the parameter type to be the unqualified type of
the argument expression unless that expression is an
explicit cast, in which case it becomes the type-as-written
of that cast.

rdar://problem/12565338

llvm-svn: 167896

11 years ago<rdar://problem/12695557>
Greg Clayton [Wed, 14 Nov 2012 00:23:48 +0000 (00:23 +0000)]
<rdar://problem/12695557>

Added missing plist files for iOS.

llvm-svn: 167895

11 years agoFix broken asserts. Also, spell 'indices' correctly.
Matt Beaumont-Gay [Wed, 14 Nov 2012 00:21:27 +0000 (00:21 +0000)]
Fix broken asserts. Also, spell 'indices' correctly.

llvm-svn: 167894

11 years ago[Object] Fix endianess bug by refactoring Archive::Symbol::getMember.
Michael J. Spencer [Wed, 14 Nov 2012 00:04:13 +0000 (00:04 +0000)]
[Object] Fix endianess bug by refactoring Archive::Symbol::getMember.

llvm-svn: 167893

11 years agouse the getSplat API. Patch by Paul Redmond.
Nadav Rotem [Wed, 14 Nov 2012 00:02:13 +0000 (00:02 +0000)]
use the getSplat API. Patch by Paul Redmond.

llvm-svn: 167892

11 years agoFix typo
Matt Beaumont-Gay [Wed, 14 Nov 2012 00:00:25 +0000 (00:00 +0000)]
Fix typo

llvm-svn: 167891

11 years agoFix typo from code review (thanks to Alexey Samsonov). This is also caught by the...
Richard Smith [Tue, 13 Nov 2012 23:58:20 +0000 (23:58 +0000)]
Fix typo from code review (thanks to Alexey Samsonov). This is also caught by the existing tests when building for i386.

llvm-svn: 167890

11 years agoSupport for building the ubsan runtime when using the autoconf build system on
Richard Smith [Tue, 13 Nov 2012 23:55:06 +0000 (23:55 +0000)]
Support for building the ubsan runtime when using the autoconf build system on
Darwin. Patch by Jean-Daniel Dupas, tweaked by Jonathan Sauer, simplified
somewhat by me.

llvm-svn: 167889

11 years ago-fsanitize=undefined: Switch to using sanitizer_common for output. This gets us much...
Richard Smith [Tue, 13 Nov 2012 23:42:05 +0000 (23:42 +0000)]
-fsanitize=undefined: Switch to using sanitizer_common for output. This gets us much closer to not depending on any system headers.

llvm-svn: 167888

11 years agoRevert "Use the 'count' attribute instead of the 'upper_bound' attribute."
Eric Christopher [Tue, 13 Nov 2012 23:30:57 +0000 (23:30 +0000)]
Revert "Use the 'count' attribute instead of the 'upper_bound' attribute."
temporarily since it breaks the gdb bots.

This reverts commit r167807/30305bec25cac981c6d4a3b8be004401310a82a7.

llvm-svn: 167887

11 years agoRevert "Use the 'count' attribute instead of the 'upper_bound' attribute."
Eric Christopher [Tue, 13 Nov 2012 23:30:43 +0000 (23:30 +0000)]
Revert "Use the 'count' attribute instead of the 'upper_bound' attribute."
temporarily as it is breaking the gdb bots.

This reverts commit r167806/e7ff4c14b157746b3e0228d2dce9f70712d1c126.

llvm-svn: 167886

11 years agoDon't try to save the assigned value in a Objective-C property assignment
Eli Friedman [Tue, 13 Nov 2012 23:16:33 +0000 (23:16 +0000)]
Don't try to save the assigned value in a Objective-C property assignment
if the type of the value is a non-trivial class type.  Fixes PR14318.

(There's a minor ObjC++ language change here: given that we can't save the
value, the type of the assignment expression is void in such cases.)

llvm-svn: 167884

11 years ago[asan] use #if defined __x86_64__ instead of #if __WORDSIZE == 64 in sanitizer_linux.cc
Kostya Serebryany [Tue, 13 Nov 2012 23:13:17 +0000 (23:13 +0000)]
[asan] use #if defined __x86_64__ instead of #if __WORDSIZE == 64 in sanitizer_linux.cc

llvm-svn: 167883

11 years agoAcknowledge code ownership of MC.
Jim Grosbach [Tue, 13 Nov 2012 23:01:35 +0000 (23:01 +0000)]
Acknowledge code ownership of MC.

llvm-svn: 167882

11 years agoAssignment of Bitcode ownership to Joe Abbey, after announcing proposal on
Joe Abbey [Tue, 13 Nov 2012 22:32:15 +0000 (22:32 +0000)]
Assignment of Bitcode ownership to Joe Abbey, after announcing proposal on
LLVMdev and not hearing any major objections.  Although it did spark a nice
discussion regarding what it means to own something in LLVM.

llvm-svn: 167881

11 years agoRevert -join-splitedges to a boolean cmd line option.
Andrew Trick [Tue, 13 Nov 2012 22:19:48 +0000 (22:19 +0000)]
Revert -join-splitedges to a boolean cmd line option.

llvm-svn: 167880

11 years agoThe MachineScheduler does not currently require JoinSplitEdges.
Andrew Trick [Tue, 13 Nov 2012 22:15:40 +0000 (22:15 +0000)]
The MachineScheduler does not currently require JoinSplitEdges.

This option will eventually either be enabled unconditionally or
replaced by a more general live range splitting optimization.

llvm-svn: 167879

11 years ago[ms] Make mangleIntegerLiteral less aware of exact type of the literal.
Nico Weber [Tue, 13 Nov 2012 22:09:44 +0000 (22:09 +0000)]
[ms] Make mangleIntegerLiteral less aware of exact type of the literal.

Integer literal mangling does not actually depend on exact type of the literal.
This will simplify calling mangleIntegerLiteral when literal type is not known,
for example, when sizes or offsets are mangled as integer literals.

Also, call mangleNumber instead of directly printing mangled values of 0/1, to
avoid this knowledge from being in multiple places.

Patch from Evgeny Eltsin!

llvm-svn: 167878

11 years ago[MC][COFF] Emit weak symbols to the correct section. Patch by Dmitry Puzirev!
Michael J. Spencer [Tue, 13 Nov 2012 22:04:09 +0000 (22:04 +0000)]
[MC][COFF] Emit weak symbols to the correct section. Patch by Dmitry Puzirev!

llvm-svn: 167877

11 years agoRevert r167836, "llvm/test/Other/close-stderr.ll: Mark it as XFAIL:mingw32 for now...
NAKAMURA Takumi [Tue, 13 Nov 2012 21:57:42 +0000 (21:57 +0000)]
Revert r167836, "llvm/test/Other/close-stderr.ll: Mark it as XFAIL:mingw32 for now.", corresponding to r167849.

llvm-svn: 167876

11 years agoAdd test case to verify correct relocs being generated for
Ulrich Weigand [Tue, 13 Nov 2012 21:53:43 +0000 (21:53 +0000)]
Add test case to verify correct relocs being generated for
TLS symbols on PowerPC using the integrated assembler.

llvm-svn: 167875

11 years agoAdd program header emission to ELF writer. This patch also rearranges sections for...
Hemant Kulkarni [Tue, 13 Nov 2012 21:34:45 +0000 (21:34 +0000)]
Add program header emission to ELF writer. This patch also rearranges sections for efficient memory utilization

llvm-svn: 167874

11 years agoFor classes that have the warn_unused_result attribute, don't apply the
Kaelyn Uhrain [Tue, 13 Nov 2012 21:23:31 +0000 (21:23 +0000)]
For classes that have the warn_unused_result attribute, don't apply the
attribute to the class' methods even when they return an instance of the
class (e.g. assignment operators).

llvm-svn: 167873

11 years agonumerically sort the symbols, so that the testcase result is uniform
Shankar Easwaran [Tue, 13 Nov 2012 21:01:11 +0000 (21:01 +0000)]
numerically sort the symbols, so that the testcase result is uniform

llvm-svn: 167872

11 years agochanges after mspencer reviews in phabricator
Shankar Easwaran [Tue, 13 Nov 2012 20:34:55 +0000 (20:34 +0000)]
changes after mspencer reviews in phabricator

llvm-svn: 167871

11 years agoFix style violations.
Michael J. Spencer [Tue, 13 Nov 2012 19:58:58 +0000 (19:58 +0000)]
Fix style violations.

llvm-svn: 167869

11 years ago[analyzer] Address Jordan's code review for r167813.
Anna Zaks [Tue, 13 Nov 2012 19:47:40 +0000 (19:47 +0000)]
[analyzer] Address Jordan's code review for r167813.

This simplifies logic, fixes a bug, and adds a test case.
Thanks Jordan!

llvm-svn: 167868

11 years agollvm-nm: Make sort more stable when symbol names are equal.
Daniel Dunbar [Tue, 13 Nov 2012 19:39:55 +0000 (19:39 +0000)]
llvm-nm: Make sort more stable when symbol names are equal.

llvm-svn: 167866

11 years agoAdd (some) PowerPC TLS relocation types to ELF.h and
Ulrich Weigand [Tue, 13 Nov 2012 19:24:36 +0000 (19:24 +0000)]
Add (some) PowerPC TLS relocation types to ELF.h and
generate them from PPCELFObjectWriter::getRelocTypeInner
as appropriate.

llvm-svn: 167864

11 years agoFix wrong PowerPC instruction opcodes for:
Ulrich Weigand [Tue, 13 Nov 2012 19:21:31 +0000 (19:21 +0000)]
Fix wrong PowerPC instruction opcodes for:
 - lwaux
 - lhzux
 - stbu

llvm-svn: 167863

11 years agoFix wrong PowerPC instruction encodings due to
Ulrich Weigand [Tue, 13 Nov 2012 19:19:46 +0000 (19:19 +0000)]
Fix wrong PowerPC instruction encodings due to
operand field name mismatches in:
 - AForm_3  (fmul, fmuls)
 - XFXForm_5 (mtcrf)
 - XFLForm (mtfsf)

llvm-svn: 167862

11 years agoFix instruction encoding for "bd(n)z" on PowerPC,
Ulrich Weigand [Tue, 13 Nov 2012 19:15:52 +0000 (19:15 +0000)]
Fix instruction encoding for "bd(n)z" on PowerPC,
by using a new instruction format BForm_1.

llvm-svn: 167861

11 years agoFix instruction encoding for "isel" on PowerPC,
Ulrich Weigand [Tue, 13 Nov 2012 19:14:19 +0000 (19:14 +0000)]
Fix instruction encoding for "isel" on PowerPC,
using a new instruction format AForm_4.

llvm-svn: 167860

11 years agoX86: when constructing VZEXT_LOAD from other loads, makes sure its output
Manman Ren [Tue, 13 Nov 2012 19:13:05 +0000 (19:13 +0000)]
X86: when constructing VZEXT_LOAD from other loads, makes sure its output
chain is correctly setup.

As an example, if the original load must happen before later stores, we need
to make sure the constructed VZEXT_LOAD is constrained to be before the stores.

rdar://12684358

llvm-svn: 167859

11 years agoRevert r167801, "[preprocessor] When #including something that contributes no
Daniel Dunbar [Tue, 13 Nov 2012 19:12:37 +0000 (19:12 +0000)]
Revert r167801, "[preprocessor] When #including something that contributes no
tokens at all,". This change broke External/Nurbs in LLVM test-suite.

llvm-svn: 167858

11 years agoRevision of the patch from Andrew Kaylor <andrew.kaylor@intel.com> to prevent missing...
Jim Ingham [Tue, 13 Nov 2012 19:09:45 +0000 (19:09 +0000)]
Revision of the patch from Andrew Kaylor <andrew.kaylor@intel.com> to prevent missing an event added in WaitForEventsInternal, narrowing the time in which we are not accepting new events.  Also, made everything that was protected private, since there really isn't any good reason why subclasses would have to muck with the listener internals.

llvm-svn: 167857

11 years agoSimplify function try/catch scope handling.
David Blaikie [Tue, 13 Nov 2012 18:51:45 +0000 (18:51 +0000)]
Simplify function try/catch scope handling.

Based on post-commit review feedback for r167766 by Richard Smith.

llvm-svn: 167856

11 years agoDo not consider a machine instruction that uses and defines the same
Ulrich Weigand [Tue, 13 Nov 2012 18:40:58 +0000 (18:40 +0000)]
Do not consider a machine instruction that uses and defines the same
physical register as candidate for common subexpression elimination
in MachineCSE.

This fixes a bug on PowerPC in MultiSource/Applications/oggenc/oggenc
caused by MachineCSE invalidly merging two separate DYNALLOC insns.

llvm-svn: 167855

11 years agoAdding support to resolve symbols with archive libraries in lld
Shankar Easwaran [Tue, 13 Nov 2012 18:39:10 +0000 (18:39 +0000)]
Adding support to resolve symbols with archive libraries in lld

llvm-svn: 167854

11 years agoAdding changes to support GNU style archive library reading
Shankar Easwaran [Tue, 13 Nov 2012 18:38:42 +0000 (18:38 +0000)]
Adding changes to support GNU style archive library reading

llvm-svn: 167853

11 years agoAdding convenience function to ELF Header
Shankar Easwaran [Tue, 13 Nov 2012 18:26:22 +0000 (18:26 +0000)]
Adding convenience function to ELF Header

llvm-svn: 167852

11 years agoFix -join-splitedges: my previous "cleanup" broke it.
Andrew Trick [Tue, 13 Nov 2012 17:37:46 +0000 (17:37 +0000)]
Fix -join-splitedges: my previous "cleanup" broke it.

Working on reducing unit tests.
This won't be enabled unless a subtarget enables misched.

llvm-svn: 167851

11 years agoFix AST-matcher descendant visiting for Types, TypeLocs and NestedNamespecifierLocs.
Daniel Jasper [Tue, 13 Nov 2012 17:14:11 +0000 (17:14 +0000)]
Fix AST-matcher descendant visiting for Types, TypeLocs and NestedNamespecifierLocs.

The RecursiveASTVisitor assumes that any given Traverse-method can be called with a NULL-node. So the subclass needs to handle these appropriately.

llvm-svn: 167850

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