platform/upstream/llvm.git
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

11 years ago[ASan] Fix the golden stack for use-after-free.cc.
Alexander Potapenko [Mon, 12 Nov 2012 11:27:24 +0000 (11:27 +0000)]
[ASan] Fix the golden stack for use-after-free.cc.
The change has been caused by the switch to llvm-symbolizer, that prints inlined stack frames.
This should fix PR 14251

llvm-svn: 167721

11 years agoadd unit test for waymarking algorithm (Use::getUser)
Gabor Greif [Mon, 12 Nov 2012 10:01:17 +0000 (10:01 +0000)]
add unit test for waymarking algorithm (Use::getUser)

llvm-svn: 167720

11 years agoRemove unused field.
Eric Christopher [Mon, 12 Nov 2012 07:35:12 +0000 (07:35 +0000)]
Remove unused field.

llvm-svn: 167719

11 years agoFix PR14314
Michael Liao [Mon, 12 Nov 2012 06:49:17 +0000 (06:49 +0000)]
Fix PR14314

- Fix operand order for atomic sub, where the minuend is the value
  loaded from memory and the subtrahend is the parameter specified.

llvm-svn: 167718

11 years agoCheck that the input size is correct for the given constraint.
Bill Wendling [Mon, 12 Nov 2012 06:42:51 +0000 (06:42 +0000)]
Check that the input size is correct for the given constraint.

The 'a', 'c', and 'd' constraints on i386 mean a 32-bit register. We cannot
place a 64-bit value into the 32-bit register. Error out instead of causing the
compiler to spew general badness.
<rdar://problem/12415959>

llvm-svn: 167717

11 years agoAdd --enable-werror and --enable-cxx11 to projects/sample/
Craig Topper [Mon, 12 Nov 2012 06:11:12 +0000 (06:11 +0000)]
Add --enable-werror and --enable-cxx11 to projects/sample/

llvm-svn: 167716

11 years agoRemove calls to getMostRecentDecl. The case they were added for in r117526 are
Rafael Espindola [Mon, 12 Nov 2012 04:32:23 +0000 (04:32 +0000)]
Remove calls to getMostRecentDecl. The case they were added for in r117526 are
now covered by attribute merging.

llvm-svn: 167714

11 years agoIn Sema::MergeVarDecl we handle merging of storage classes and visibility
Rafael Espindola [Mon, 12 Nov 2012 04:10:23 +0000 (04:10 +0000)]
In Sema::MergeVarDecl we handle merging of storage classes and visibility
attributes. In cases where the merged declaration is fully equivalent to the
two original ones, some of the code was getLVForDecl was duplicated.

Cases that are still handled in getLVForDecl are things like

__private_extern__ int N;
int N;

For which we cannot produce a single merged decl with all the information.

llvm-svn: 167703

11 years ago[NVPTX] Fix const modifier on builtins
Justin Holewinski [Mon, 12 Nov 2012 03:16:56 +0000 (03:16 +0000)]
[NVPTX] Fix const modifier on builtins

Some NVVM intrinsics were incorrectly labeled.

llvm-svn: 167700

11 years ago[NVPTX] Add more precise PTX/SM target attributes
Justin Holewinski [Mon, 12 Nov 2012 03:16:43 +0000 (03:16 +0000)]
[NVPTX] Add more precise PTX/SM target attributes

Each SM and PTX version is modeled as a subtarget feature/CPU. Additionally,
PTX 3.1 is added as the default PTX version to be out-of-the-box compatible
with CUDA 5.0.

Available CPUs for this target:

  sm_10 - Select the sm_10 processor.
  sm_11 - Select the sm_11 processor.
  sm_12 - Select the sm_12 processor.
  sm_13 - Select the sm_13 processor.
  sm_20 - Select the sm_20 processor.
  sm_21 - Select the sm_21 processor.
  sm_30 - Select the sm_30 processor.
  sm_35 - Select the sm_35 processor.

Available features for this target:

  ptx30 - Use PTX version 3.0.
  ptx31 - Use PTX version 3.1.
  sm_10 - Target SM 1.0.
  sm_11 - Target SM 1.1.
  sm_12 - Target SM 1.2.
  sm_13 - Target SM 1.3.
  sm_20 - Target SM 2.0.
  sm_21 - Target SM 2.1.
  sm_30 - Target SM 3.0.
  sm_35 - Target SM 3.5.

llvm-svn: 167699

11 years agoDelete a stale comment. No functional change.
Meador Inge [Mon, 12 Nov 2012 00:28:15 +0000 (00:28 +0000)]
Delete a stale comment.  No functional change.

llvm-svn: 167698

11 years agoMove some helper methods to being static functions in the implementation file.
Craig Topper [Sun, 11 Nov 2012 22:45:02 +0000 (22:45 +0000)]
Move some helper methods to being static functions in the implementation file.

llvm-svn: 167696

11 years agoFix binding of nodes in case of forEach..() matchers.
Daniel Jasper [Sun, 11 Nov 2012 22:14:55 +0000 (22:14 +0000)]
Fix binding of nodes in case of forEach..() matchers.

When recursively visiting the generated matches, the aggregated bindings need
to be copied during the recursion. Otherwise, we they might not be properly
overwritten (which is shown by the test), or there might be bound nodes present
that were bound on a different matching branch.

Review: http://llvm-reviews.chandlerc.com/D112
llvm-svn: 167695

11 years agoRemove unneeded includes from IdentifierTable
Nico Weber [Sun, 11 Nov 2012 21:39:39 +0000 (21:39 +0000)]
Remove unneeded includes from IdentifierTable

llvm-svn: 167694

11 years agoDelete comment reference to non-existent method
Nico Weber [Sun, 11 Nov 2012 21:02:03 +0000 (21:02 +0000)]
Delete comment reference to non-existent method

llvm-svn: 167692

11 years agoRemove hard-coded constant in Transforms/InstCombine/memcmp-1.ll
Meador Inge [Sun, 11 Nov 2012 07:10:25 +0000 (07:10 +0000)]
Remove hard-coded constant in Transforms/InstCombine/memcmp-1.ll

Transforms/InstCombine/memcmp-1.ll has a test case that looks like:

  @foo = constant [4 x i8] c"foo\00"
  @hel = constant [4 x i8] c"hel\00"

  ...

  %mem1 = getelementptr [4 x i8]* @hel, i32 0, i32 0
  %mem2 = getelementptr [4 x i8]* @foo, i32 0, i32 0
  %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3)
  ret i32 %ret
  ; CHECK: ret i32 2

The folded return value (2 above) is computed using the system memcmp
that the compiler is linked with.  This can return different values on
different systems.  The test was originally written on an OS X 10.7.5
x86-64 box and passed.  However, it failed on one of the x86-64 FreeBSD
buildbots because the system memcpy on that machine returned a different
value (1 instead of 2).

I fixed the test by checking the folding constants with regexes.

llvm-svn: 167691

11 years agos/BCPLComment/LineComment/
Nico Weber [Sun, 11 Nov 2012 07:02:14 +0000 (07:02 +0000)]
s/BCPLComment/LineComment/

llvm-svn: 167690

11 years agoinstcombine: Migrate memset optimizations
Meador Inge [Sun, 11 Nov 2012 06:49:03 +0000 (06:49 +0000)]
instcombine: Migrate memset optimizations

This patch migrates the memset optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167689

11 years agoUpdate the vectorizer docs.
Nadav Rotem [Sun, 11 Nov 2012 06:47:51 +0000 (06:47 +0000)]
Update the vectorizer docs.

llvm-svn: 167688

11 years agoinstcombine: Migrate memmove optimizations
Meador Inge [Sun, 11 Nov 2012 06:22:40 +0000 (06:22 +0000)]
instcombine: Migrate memmove optimizations

This patch migrates the memmove optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167687

11 years agoinstcombine: Migrate memcpy optimizations
Meador Inge [Sun, 11 Nov 2012 05:54:34 +0000 (05:54 +0000)]
instcombine: Migrate memcpy optimizations

This patch migrates the memcpy optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167686

11 years agoUse the isTruncFree and isZExtFree API to figure out of these operations are free...
Nadav Rotem [Sun, 11 Nov 2012 05:34:45 +0000 (05:34 +0000)]
Use the isTruncFree and isZExtFree API to figure out of these operations are free. Thanks Andy!

llvm-svn: 167685

11 years agoFix a comment typo and add comments.
Nadav Rotem [Sun, 11 Nov 2012 05:15:00 +0000 (05:15 +0000)]
Fix a comment typo and add comments.

llvm-svn: 167684

11 years agoinstcombine: Migrate memcmp optimizations
Meador Inge [Sun, 11 Nov 2012 05:11:20 +0000 (05:11 +0000)]
instcombine: Migrate memcmp optimizations

This patch migrates the memcmp optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167683

11 years agoinstcombine: Migrate strstr optimizations
Meador Inge [Sun, 11 Nov 2012 03:51:48 +0000 (03:51 +0000)]
instcombine: Migrate strstr optimizations

This patch migrates the strstr optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167682

11 years agoAdd method for replacing instructions to LibCallSimplifier
Meador Inge [Sun, 11 Nov 2012 03:51:43 +0000 (03:51 +0000)]
Add method for replacing instructions to LibCallSimplifier

In some cases the library call simplifier may need to replace instructions
other than the library call being simplified.  In those cases it may be
necessary for clients of the simplifier to override how the replacements
are actually done.  As such, a new overrideable method for replacing
instructions was added to LibCallSimplifier.

A new subclass of LibCallSimplifier is also defined which overrides
the instruction replacement method.  This is because the instruction
combiner defines its own replacement method which updates the worklist
when instructions are replaced.

llvm-svn: 167681

11 years agoFileCheckize test
Nico Weber [Sun, 11 Nov 2012 01:35:05 +0000 (01:35 +0000)]
FileCheckize test

llvm-svn: 167680

11 years agoFix a typo which Matt pointed out.
Richard Smith [Sun, 11 Nov 2012 00:28:33 +0000 (00:28 +0000)]
Fix a typo which Matt pointed out.

llvm-svn: 167679

11 years agoobjective-C blocks: Change BLOCK_HAS_EXTENDED_LAYOUT to be 1<<31.
Fariborz Jahanian [Sat, 10 Nov 2012 18:30:40 +0000 (18:30 +0000)]
objective-C blocks: Change BLOCK_HAS_EXTENDED_LAYOUT to be 1<<31.
lower 24bit is currently being used.

llvm-svn: 167678

11 years agoTest commit: clean up C++11 options in lldb (on Linux) build page
Daniel Malea [Sat, 10 Nov 2012 18:09:36 +0000 (18:09 +0000)]
Test commit: clean up C++11 options in lldb (on Linux) build page

llvm-svn: 167677

11 years agoProvide definitions for all functions.
Benjamin Kramer [Sat, 10 Nov 2012 16:10:16 +0000 (16:10 +0000)]
Provide definitions for all functions.

ICC refuses to compile a class in an anonymous namespace if some functions
aren't defined. Fixes PR13477.

llvm-svn: 167676

11 years agoinstcombine: Migrate strcspn optimizations
Meador Inge [Sat, 10 Nov 2012 15:16:48 +0000 (15:16 +0000)]
instcombine: Migrate strcspn optimizations

This patch migrates the strcspn optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167675

11 years agoSimplify the SmallVector pretty printer for LLDB a bit and make it work with referenc...
Benjamin Kramer [Sat, 10 Nov 2012 09:45:32 +0000 (09:45 +0000)]
Simplify the SmallVector pretty printer for LLDB a bit and make it work with reference types.

llvm-svn: 167674

11 years agoRemove unnecessary subtraction and addition by 1 around a couple for loops.
Craig Topper [Sat, 10 Nov 2012 09:25:36 +0000 (09:25 +0000)]
Remove unnecessary subtraction and addition by 1 around a couple for loops.

llvm-svn: 167673

11 years agoRemove empty directory.
Duncan Sands [Sat, 10 Nov 2012 09:24:44 +0000 (09:24 +0000)]
Remove empty directory.

llvm-svn: 167672

11 years agoTidy up spacing. No functional change.
Craig Topper [Sat, 10 Nov 2012 09:02:47 +0000 (09:02 +0000)]
Tidy up spacing. No functional change.

llvm-svn: 167671

11 years agoRemoved unimplemented method declaration.
Craig Topper [Sat, 10 Nov 2012 09:00:12 +0000 (09:00 +0000)]
Removed unimplemented method declaration.

llvm-svn: 167670

11 years agoSimplify custom emitter code for pcmp(e/i)str(i/m) and make the helper functions...
Craig Topper [Sat, 10 Nov 2012 08:57:41 +0000 (08:57 +0000)]
Simplify custom emitter code for pcmp(e/i)str(i/m) and make the helper functions static.

llvm-svn: 167669

11 years agoRework my implementation of circular-reference finding to not use
Douglas Gregor [Sat, 10 Nov 2012 07:24:09 +0000 (07:24 +0000)]
Rework my implementation of circular-reference finding to not use
CXXRecordDecl::forallBases, which does *not* do what I need. Fixes the
failure introduced in r167651.

llvm-svn: 167668

11 years agoAdd support for libdispatch version 4 structure layout for finding
Jason Molenda [Sat, 10 Nov 2012 06:54:30 +0000 (06:54 +0000)]
Add support for libdispatch version 4 structure layout for finding
GCD queue names of threads to
ProcessGDBRemote::GetDispatchQueueNameForThread()
May need tweaking once this version is rolled out but visual
inspection looks fine.
<rdar://problem/12333100>

llvm-svn: 167667

11 years agoDon't assume that Modules have directories. They may be in-memory-only
Jason Molenda [Sat, 10 Nov 2012 06:52:37 +0000 (06:52 +0000)]
Don't assume that Modules have directories.  They may be in-memory-only
things like our favorite "cl_kernels" and so module_directory here
can be NULL.

llvm-svn: 167666

11 years agoAdd clang support of RTM from TSX
Michael Liao [Sat, 10 Nov 2012 05:17:46 +0000 (05:17 +0000)]
Add clang support of RTM from TSX

- New options '-mrtm'/'-mno-rtm' are added to enable/disable RTM feature
- Builtin macro '__RTM__' is defined if RTM feature is enabled
- RTM intrinsic header is added and introduces 3 new intrinsics, namely
  '_xbegin', '_xend', and '_xabort'.
- 3 new builtins are added to keep compatible with gcc, namely
  '__builtin_ia32_xbegin', '__builtin_ia32_xend', and '__builtin_ia32_xabort'.
- Test cases for pre-defined macro and new intrinsic codegen are added.

llvm-svn: 167665

11 years ago-momit-leaf-frame-pointer is a -m option, not a -f option.
Richard Smith [Sat, 10 Nov 2012 04:54:44 +0000 (04:54 +0000)]
-momit-leaf-frame-pointer is a -m option, not a -f option.

llvm-svn: 167664

11 years agoConvert an improper CodeGen test to a MC test.
Evan Cheng [Sat, 10 Nov 2012 04:30:40 +0000 (04:30 +0000)]
Convert an improper CodeGen test to a MC test.

llvm-svn: 167663

11 years agoRevert "Disable -Wimplicit-fallthrough when not using C++.", pending further discussi...
Ted Kremenek [Sat, 10 Nov 2012 04:03:41 +0000 (04:03 +0000)]
Revert "Disable -Wimplicit-fallthrough when not using C++.", pending further discussion on cfe-dev.

llvm-svn: 167662

11 years agoAdd a few more test cases for verifying -fno-builtin.
Meador Inge [Sat, 10 Nov 2012 03:56:55 +0000 (03:56 +0000)]
Add a few more test cases for verifying -fno-builtin.

Some holes in testing where discovered while working on the LLVM library
call simplifiers.

llvm-svn: 167661

11 years agoinstcombine: Query target library information to gate libcall simplifications
Meador Inge [Sat, 10 Nov 2012 03:11:10 +0000 (03:11 +0000)]
instcombine: Query target library information to gate libcall simplifications

Several of the simplifiers migrated from the simplify-libcalls pass to
the instcombine pass were not correctly checking the target library
information to gate the simplifications.  This patch ensures that the
check is made.

llvm-svn: 167660

11 years agoAdd more functions to the target library information.
Meador Inge [Sat, 10 Nov 2012 03:11:06 +0000 (03:11 +0000)]
Add more functions to the target library information.

In the process of migrating optimizations from the simplify-libcalls pass
to the instcombine pass I noticed that a few functions are missing from
the target library information.  These functions need to be available for
querying in the instcombine library call simplifiers.  More functions will
probably be added in the future as more simplifiers are migrated to
instcombine.

llvm-svn: 167659

11 years agoxfail a bad test. This is a MC test but it's dependent on a codegen optimization...
Evan Cheng [Sat, 10 Nov 2012 02:34:36 +0000 (02:34 +0000)]
xfail a bad test. This is a MC test but it's dependent on a codegen optimization which is now disabled.

llvm-svn: 167658

11 years agoDisable the Thumb no-return call optimization:
Evan Cheng [Sat, 10 Nov 2012 02:09:05 +0000 (02:09 +0000)]
Disable the Thumb no-return call optimization:
mov lr, pc
b.w _foo

The "mov" instruction doesn't set bit zero to one, it's putting incorrect
value in lr. It messes up backtraces.

rdar://12663632

llvm-svn: 167657

11 years agohow to do it correctly.
Jim Ingham [Sat, 10 Nov 2012 02:08:14 +0000 (02:08 +0000)]
how to do it correctly.

llvm-svn: 167656

11 years agoDisable -Wimplicit-fallthrough when not using C++.
Ted Kremenek [Sat, 10 Nov 2012 01:47:40 +0000 (01:47 +0000)]
Disable -Wimplicit-fallthrough when not using C++.

The rationale is that there is no good workflow to silence the warning
for specific cases, other than using pragmas.  This is because the
attribute to decorate an explicit fall through is only available
in C++11.

By that argument, this should probably also be disabled unless one
is using C++11, but apparently there is an explicit test case for
this warning when using C++98.  This will require further discussion
on cfe-commits.

Fixes:  <rdar://problem/12584746>
llvm-svn: 167655

11 years ago[analyzer] When invalidating symbolic offset regions, take fields into account.
Jordan Rose [Sat, 10 Nov 2012 01:40:08 +0000 (01:40 +0000)]
[analyzer] When invalidating symbolic offset regions, take fields into account.

Previously, RegionStore was being VERY conservative in saying that because
p[i].x and p[i].y have a concrete base region of 'p', they might overlap.
Now, we check the chain of fields back up to the base object and check if
they match.

This only kicks in when dealing with symbolic offset regions because
RegionStore's "base+offset" representation of concrete offset regions loses
all information about fields. In cases where all offsets are concrete
(s.x and s.y), RegionStore will already do the right thing, but mixing
concrete and symbolic offsets can cause bindings to be invalidated that
are known to not overlap (e.g. p[0].x and p[i].y).
This additional refinement is tracked by <rdar://problem/12676180>.

<rdar://problem/12530149>

llvm-svn: 167654

11 years agoHandle redeclarations of catch variables in catch blocks.
David Blaikie [Sat, 10 Nov 2012 01:38:24 +0000 (01:38 +0000)]
Handle redeclarations of catch variables in catch blocks.

Fix to regression caused by r167650, caught by Richard Smith in code review.

llvm-svn: 167653

11 years agoCleanup pcmp(e/i)str(m/i) instruction definitions and load folding support.
Craig Topper [Sat, 10 Nov 2012 01:23:36 +0000 (01:23 +0000)]
Cleanup pcmp(e/i)str(m/i) instruction definitions and load folding support.

llvm-svn: 167652

11 years agoDiagnostic circular inheritance involving dependent base classes. We
Douglas Gregor [Sat, 10 Nov 2012 01:18:17 +0000 (01:18 +0000)]
Diagnostic circular inheritance involving dependent base classes. We
would have diagnosed this at instantiation time anyway, if only we
didn't hang on all of these test cases. Fixes <rdar://problem/12629723>

llvm-svn: 167651

11 years agoPR14296: function parameter name collisions in function try/catch
David Blaikie [Sat, 10 Nov 2012 01:04:23 +0000 (01:04 +0000)]
PR14296: function parameter name collisions in function try/catch

C++11 3.3.3/2 "A parameter name shall not be redeclared in the outermost block
of the function definition nor in the outermost block of any handler associated
with a function-try-block."

It's not totally clear to me whether the "FIXME" case is covered by this, but
Richard Smith thinks it probably should be. It's just a bit more involved to
fix that case.

llvm-svn: 167650

11 years agoMake __LDBL_MAX__ etc. have the correct type on targets where long double/double...
Eli Friedman [Sat, 10 Nov 2012 00:20:38 +0000 (00:20 +0000)]
Make __LDBL_MAX__ etc. have the correct type on targets where long double/double/etc. have the same format.  PR14285.

Based on patch by Jeroen Dobbelaere.

llvm-svn: 167649

11 years ago-Wobjc-literal-compare: look through implicit casts.
Jordan Rose [Fri, 9 Nov 2012 23:55:21 +0000 (23:55 +0000)]
-Wobjc-literal-compare: look through implicit casts.

This warning was failing to fire under ARC because of the implicit
lifetime casts added around the object literal expression.

<rdar://problem/11300873>, again.

llvm-svn: 167648

11 years ago[NVPTX] Add __nvvm_* intrinsics as Clang builtins
Justin Holewinski [Fri, 9 Nov 2012 23:50:51 +0000 (23:50 +0000)]
[NVPTX] Add __nvvm_* intrinsics as Clang builtins

Fixes bug 13354.

llvm-svn: 167647

11 years ago[NVPTX] Use ABI alignment for parameters when alignment is not specified.
Justin Holewinski [Fri, 9 Nov 2012 23:50:24 +0000 (23:50 +0000)]
[NVPTX] Use ABI alignment for parameters when alignment is not specified.

Affects SM 2.0+.  Fixes bug 13324.

llvm-svn: 167646

11 years agoDocument -W in clang --help. Also make the help text more consistent (don't end descr...
Richard Smith [Fri, 9 Nov 2012 23:30:30 +0000 (23:30 +0000)]
Document -W in clang --help. Also make the help text more consistent (don't end descriptions in periods, use | to separate possible values).

llvm-svn: 167645

11 years agoDon't include the help for -mips* in clang --help. These are just aliases for other...
Richard Smith [Fri, 9 Nov 2012 23:26:04 +0000 (23:26 +0000)]
Don't include the help for -mips* in clang --help. These are just aliases for other options, and not common enough to be worth including here.

llvm-svn: 167644

11 years ago-Wlarge-by-value-copy may be awesome, but it really shouldn't be the one and
Richard Smith [Fri, 9 Nov 2012 23:18:31 +0000 (23:18 +0000)]
-Wlarge-by-value-copy may be awesome, but it really shouldn't be the one and
only -W flag which clang --help lists.

llvm-svn: 167643

11 years agoPR13788: Don't perform checks on the initializer of a dependently-typed
Richard Smith [Fri, 9 Nov 2012 23:03:14 +0000 (23:03 +0000)]
PR13788: Don't perform checks on the initializer of a dependently-typed
variable. Previously we didn't notice the type was dependent if the only
dependence came from an array bound.

Patch by Brian Brooks!

llvm-svn: 167642