platform/upstream/llvm.git
11 years agoFix wording.
Chad Rosier [Mon, 25 Feb 2013 22:20:00 +0000 (22:20 +0000)]
Fix wording.

llvm-svn: 176055

11 years ago[analyzer] Restrict ObjC type inference to methods that have related result type.
Anna Zaks [Mon, 25 Feb 2013 22:10:34 +0000 (22:10 +0000)]
[analyzer] Restrict ObjC type inference to methods that have related result type.

This addresses a case when we inline a wrong method due to incorrect
dynamic type inference. Specifically, when user code contains a method from init
family, which creates an instance of another class.

Use hasRelatedResultType() to find out if our inference rules should be triggered.

llvm-svn: 176054

11 years agoRemove extraneous attribute number.
Chad Rosier [Mon, 25 Feb 2013 22:06:05 +0000 (22:06 +0000)]
Remove extraneous attribute number.

llvm-svn: 176053

11 years ago[fast-isel] Add X86FastIsel::FastLowerArguments to handle functions with 6 or
Chad Rosier [Mon, 25 Feb 2013 21:59:35 +0000 (21:59 +0000)]
[fast-isel] Add X86FastIsel::FastLowerArguments to handle functions with 6 or
fewer scalar integer (i32 or i64) arguments. It completely eliminates the need
for SDISel for trivial functions.

Also, add the new llc -fast-isel-abort-args option, which is similar to
-fast-isel-abort option, but for formal argument lowering.

llvm-svn: 176052

11 years ago<rdar://problem/13281528>
Greg Clayton [Mon, 25 Feb 2013 21:53:07 +0000 (21:53 +0000)]
<rdar://problem/13281528>

Fixed issues with the SBModule "sections" property, and with the SBBlock "ranges" attributes.

llvm-svn: 176051

11 years ago[analyzer] Recover all PreStmtPurgeDeadSymbols nodes with a single successor or prede...
Ted Kremenek [Mon, 25 Feb 2013 21:32:40 +0000 (21:32 +0000)]
[analyzer] Recover all PreStmtPurgeDeadSymbols nodes with a single successor or predecessor.

These nodes are never consulted by any analyzer client code, so they are
used only for machinery for removing dead bindings.  Once successor nodes
are generated they can be safely removed.

This greatly reduces the amount of nodes that are generated in some case,
lowering the memory regression when analyzing Sema.cpp introduced by
r176010 from 14% to 2%.

llvm-svn: 176050

11 years agoAdded missing lldb module namespace.
Greg Clayton [Mon, 25 Feb 2013 21:20:59 +0000 (21:20 +0000)]
Added missing lldb module namespace.

llvm-svn: 176049

11 years agoSkip test that fails intermittently with Clang/GCC on Linux
Daniel Malea [Mon, 25 Feb 2013 20:54:19 +0000 (20:54 +0000)]
Skip test that fails intermittently with Clang/GCC on Linux
- was causing buildbot failures due to unexpected pass

llvm-svn: 176048

11 years agoVarious additions to ASTMatcher library:
Edwin Vane [Mon, 25 Feb 2013 20:43:32 +0000 (20:43 +0000)]
Various additions to ASTMatcher library:

New type matchers:
* recordType
* elaboratedType

New narrowing matchers:
* hasQualifier
* namesType
* hasDeclContext

Added tests and updated LibASTMatchersReference.

Reviewers: klimek
llvm-svn: 176047

11 years agoAdd user documentation for cpp11-migrate
Edwin Vane [Mon, 25 Feb 2013 20:37:03 +0000 (20:37 +0000)]
Add user documentation for cpp11-migrate

Adding an RST document for cpp11-migrate. This user documentation explains
command line options, transformations, risk level and how it applies to
loop convert, and code examples of transformations.

There is a TODO task under "Risk" for "Loop Convert" to find code examples
that produce incorrect transformations that change semantics. The definition
of risk in loop convert and instances where the confidence level is lowered
will need to be looked at more carefully.

Information for all new features (including verbose output, auto transform)
will be added in a later change.

Author: Jack Yang <jack.wang@intel.com>
Reviewer: grigozavr
llvm-svn: 176046

11 years ago[ELF][Writer] Fill in dynamic table entries.
Michael J. Spencer [Mon, 25 Feb 2013 20:03:09 +0000 (20:03 +0000)]
[ELF][Writer] Fill in dynamic table entries.

llvm-svn: 176045

11 years agoRevert "Add more attributes from the command line to functions."
Anna Zaks [Mon, 25 Feb 2013 19:51:03 +0000 (19:51 +0000)]
Revert "Add more attributes from the command line to functions."

This reverts commit 176009.

The commit is a likely cause of several buildbot failures.

llvm-svn: 176044

11 years ago[analyzer] Address Jordan's code review of r175857.
Anna Zaks [Mon, 25 Feb 2013 19:50:50 +0000 (19:50 +0000)]
[analyzer] Address Jordan's code review of r175857.

llvm-svn: 176043

11 years ago[analyzer] Handle reference parameters with default values.
Jordan Rose [Mon, 25 Feb 2013 19:45:34 +0000 (19:45 +0000)]
[analyzer] Handle reference parameters with default values.

r175026 added support for default values, but didn't take reference
parameters into account, which expect the default argument to be an
lvalue. Use createTemporaryRegionIfNeeded if we can evaluate the default
expr as an rvalue but the expected result is an lvalue.

Fixes the most recent report of PR12915. The original report predates
default argument support, so that can't be it.

llvm-svn: 176042

11 years agoOptimization of the code-running NSDictionary formatter to skip runtime symbol fetching
Enrico Granata [Mon, 25 Feb 2013 19:44:39 +0000 (19:44 +0000)]
Optimization of the code-running NSDictionary formatter to skip runtime symbol fetching

llvm-svn: 176041

11 years ago<rdar://problem/13286937>
Greg Clayton [Mon, 25 Feb 2013 19:34:57 +0000 (19:34 +0000)]
<rdar://problem/13286937>

Make sure to not look in self.images when we have a symbolicator with a live process.

llvm-svn: 176040

11 years agoAdd a log line when debugserver exits, and clean up some of the other standard logs...
Jim Ingham [Mon, 25 Feb 2013 19:31:37 +0000 (19:31 +0000)]
Add a log line when debugserver exits, and clean up some of the other standard logs output to make it more useful.

llvm-svn: 176039

11 years agoAdd a front-end test case for r176036.
Chad Rosier [Mon, 25 Feb 2013 19:13:23 +0000 (19:13 +0000)]
Add a front-end test case for r176036.

llvm-svn: 176038

11 years agopre-RA-sched fix: only reevaluate physreg interferences when necessary.
Andrew Trick [Mon, 25 Feb 2013 19:11:48 +0000 (19:11 +0000)]
pre-RA-sched fix: only reevaluate physreg interferences when necessary.

Fixes rdar:13279013: scheduler was blowing up on select instructions.

llvm-svn: 176037

11 years ago[ms-inline asm] Add support for the pushad/popad mnemonics.
Chad Rosier [Mon, 25 Feb 2013 19:06:27 +0000 (19:06 +0000)]
[ms-inline asm] Add support for the pushad/popad mnemonics.
rdar://13254235

llvm-svn: 176036

11 years agoFix empty declaration printing.
Michael Han [Mon, 25 Feb 2013 18:40:11 +0000 (18:40 +0000)]
Fix empty declaration printing.

Don't print the semicolon when visiting an empty declaration because the semicolon
will be printed as a terminator later.

llvm-svn: 176035

11 years ago[analyzer] Base regions may be invalid when layered on symbolic regions.
Jordan Rose [Mon, 25 Feb 2013 18:36:15 +0000 (18:36 +0000)]
[analyzer] Base regions may be invalid when layered on symbolic regions.

While RegionStore checks to make sure casts on TypedValueRegions are valid,
it does not do the same for SymbolicRegions, which do not have perfect type
info anyway. Additionally, MemRegion::getAsOffset does not take a
ProgramState, so it can't use dynamic type info to determine a better type
for the regions. (This could also be dangerous if the type of a super-region
changes!)

Account for this by checking that a base object region is valid on top of a
symbolic region, and falling back to "symbolic offset" mode if not.

Fixes PR15345.

llvm-svn: 176034

11 years agoARM build docs easier for copy&paste
Renato Golin [Mon, 25 Feb 2013 18:25:58 +0000 (18:25 +0000)]
ARM build docs easier for copy&paste

llvm-svn: 176033

11 years agoAdd forgotten testcase.
Eric Christopher [Mon, 25 Feb 2013 18:19:32 +0000 (18:19 +0000)]
Add forgotten testcase.

llvm-svn: 176032

11 years ago'Hexadecimal' has two 'a's and only one 'i'.
Matt Beaumont-Gay [Mon, 25 Feb 2013 18:11:18 +0000 (18:11 +0000)]
'Hexadecimal' has two 'a's and only one 'i'.

llvm-svn: 176031

11 years agoFix missing relocation for TLS addressing peephole optimization.
Bill Schmidt [Mon, 25 Feb 2013 16:44:35 +0000 (16:44 +0000)]
Fix missing relocation for TLS addressing peephole optimization.

Report and fix due to Kai Nacke.  Testcase update by me.

llvm-svn: 176029

11 years agoRe-add hack that caused regression.
Daniel Jasper [Mon, 25 Feb 2013 15:59:54 +0000 (15:59 +0000)]
Re-add hack that caused regression.

This fixes llvm.org/PR15350.

Before:
Constructor(int Parameter = 0)
    : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa),
                aaaaaaaaaaaa(aaaaaaaaaaaaaaaaa) {}

After:
Constructor(int Parameter = 0)
    : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa),
      aaaaaaaaaaaa(aaaaaaaaaaaaaaaaa) {}

I think the correct solution is to put the VariablePos into
ParenState, not LineState. Added FIXME.

llvm-svn: 176027

11 years agoAlexey Samsonov: #ifdefs out undefined function in static build of libc++ w/o RTTI.
Howard Hinnant [Mon, 25 Feb 2013 15:50:36 +0000 (15:50 +0000)]
Alexey Samsonov: #ifdefs out undefined function in static build of libc++ w/o RTTI.

llvm-svn: 176026

11 years agoAdding hasDeclaration overload for TemplateSpecializationType
Edwin Vane [Mon, 25 Feb 2013 14:49:29 +0000 (14:49 +0000)]
Adding hasDeclaration overload for TemplateSpecializationType

TemplateSpecializationType doesn't quite have getDecl(). Need to go
through TemplateName to get a TemplateDecl.

Added test cases for the hasDeclaration() overload for
TemplateSpecializationType. Also introduced the type matcher
templateSpecializationType() used by the new hasDeclaration() test case.

Updated LibASTMatchersReference.

Reviewers: klimek
llvm-svn: 176025

11 years agoSupport in hasDeclaration for types with getDecl()
Edwin Vane [Mon, 25 Feb 2013 14:32:42 +0000 (14:32 +0000)]
Support in hasDeclaration for types with getDecl()

Re-introducing r175532. The has_getDecl metafunction didn't compile with
Visual Studio. This revision uses approaches has_getDecl from a
different angle that isn't a problem for Visual Studio.

Added dedicated tests for the metafunction.

Reviewers: klimek
llvm-svn: 176024

11 years agoFix spelling noticed by Duncan.
Chandler Carruth [Mon, 25 Feb 2013 14:29:38 +0000 (14:29 +0000)]
Fix spelling noticed by Duncan.

llvm-svn: 176023

11 years agoFix the root cause of PR15348 by correctly handling alignment 0 on
Chandler Carruth [Mon, 25 Feb 2013 14:20:21 +0000 (14:20 +0000)]
Fix the root cause of PR15348 by correctly handling alignment 0 on
memory intrinsics in the SDAG builder.

When alignment is zero, the lang ref says that *no* alignment
assumptions can be made. This is the exact opposite of the internal API
contracts of the DAG where alignment 0 indicates that the alignment can
be made to be anything desired.

There is another, more explicit alignment that is better suited for the
role of "no alignment at all": an alignment of 1. Map the intrinsic
alignment to this early so that we don't end up generating aligned DAGs.

It is really terrifying that we've never seen this before, but we
suddenly started generating a large number of alignment 0 memcpys due to
the new code to do memcpy-based copying of POD class members. That patch
contains a bug that rounds bitfield alignments down when they are the
first field. This can in turn produce zero alignments.

This fixes weird crashes I've seen in library users of LLVM on 32-bit
hosts, etc.

llvm-svn: 176022

11 years agoReverting r176019. Corrupt patch.
Edwin Vane [Mon, 25 Feb 2013 14:09:28 +0000 (14:09 +0000)]
Reverting r176019. Corrupt patch.

llvm-svn: 176021

11 years ago[Sanitizer] one more fix for signed/unsigned mismatch in comparison
Alexey Samsonov [Mon, 25 Feb 2013 14:06:38 +0000 (14:06 +0000)]
[Sanitizer] one more fix for signed/unsigned mismatch in comparison

llvm-svn: 176020

11 years agoSupport in hasDeclaration for types with getDecl()
Edwin Vane [Mon, 25 Feb 2013 13:59:06 +0000 (13:59 +0000)]
Support in hasDeclaration for types with getDecl()

Re-introducing r175532. The has_getDecl metafunction didn't compile with Visual
Studio. This revision approaches has_getDecl from a different angle that isn't
a problem for Visual Studio.

Added dedicated tests for the metafunction.

Reviewers: klimek
llvm-svn: 176019

11 years agoUpdate generated documentation after recent matcher addition.
Daniel Jasper [Mon, 25 Feb 2013 12:39:41 +0000 (12:39 +0000)]
Update generated documentation after recent matcher addition.

llvm-svn: 176018

11 years agoAdd matcher for AccessSpecDecls.
Daniel Jasper [Mon, 25 Feb 2013 12:02:08 +0000 (12:02 +0000)]
Add matcher for AccessSpecDecls.

Also, add matchers isPrivate(), isProtected() and isPublic(), that
restrict the matching of such AccessSpecDecls and all other Decls.

llvm-svn: 176017

11 years ago[Sanitizer] fix signed/unsigned compare warnings in sanitizer_stacktrace_test. Build...
Alexey Samsonov [Mon, 25 Feb 2013 09:00:03 +0000 (09:00 +0000)]
[Sanitizer] fix signed/unsigned compare warnings in sanitizer_stacktrace_test. Build sanitizer_common tests with -Werror as we use predictable just-built Clang for building them

llvm-svn: 176014

11 years ago[TSan] Add interceptor for malloc_usable_size()
Alexey Samsonov [Mon, 25 Feb 2013 08:43:10 +0000 (08:43 +0000)]
[TSan] Add interceptor for malloc_usable_size()

llvm-svn: 176013

11 years ago[TSan] remove temporary build directory in 'make clean' command
Alexey Samsonov [Mon, 25 Feb 2013 08:32:02 +0000 (08:32 +0000)]
[TSan] remove temporary build directory in 'make clean' command

llvm-svn: 176012

11 years ago[analyzer] Relax assumption in FindLastStoreBRVisitor that the thing we are looking...
Ted Kremenek [Mon, 25 Feb 2013 07:37:18 +0000 (07:37 +0000)]
[analyzer] Relax assumption in FindLastStoreBRVisitor that the thing we are looking for is always a VarRegion.

This was triggering assertion failures when analyzing the LLVM codebase.  This
is fallout from r175988.

I've got delta chewing away on a test case, but I wanted the fix to go
in now.

llvm-svn: 176011

11 years ago[analyzer] add the notion of an "interesting" lvalue expression for ExplodedNode...
Ted Kremenek [Mon, 25 Feb 2013 07:37:13 +0000 (07:37 +0000)]
[analyzer] add the notion of an "interesting" lvalue expression for ExplodedNode pruning.

r175988 modified the ExplodedGraph trimming algorithm to retain all
nodes for "lvalue" expressions.  This patch refines that notion to
only "interesting" expressions that would be used for diagnostics.

llvm-svn: 176010

11 years agoAdd more attributes from the command line to functions.
Bill Wendling [Mon, 25 Feb 2013 07:15:16 +0000 (07:15 +0000)]
Add more attributes from the command line to functions.

This is an ongoing process. Any command line option which a back-end cares about
should be added here.

llvm-svn: 176009

11 years ago<rdar://problem/13282582>
Han Ming Ong [Mon, 25 Feb 2013 05:41:42 +0000 (05:41 +0000)]
<rdar://problem/13282582>

Need available CPU on target device to support CPU reporting.

llvm-svn: 176008

11 years agoMake pseudos FEXT_CCRX16_ins and FEXT_CCRXI16_ins into custom emitters.
Reed Kotler [Mon, 25 Feb 2013 02:25:47 +0000 (02:25 +0000)]
Make pseudos FEXT_CCRX16_ins and FEXT_CCRXI16_ins into custom emitters.

llvm-svn: 176007

11 years agoDocumentation: add an idea for a (weird) clang tool
Dmitri Gribenko [Mon, 25 Feb 2013 01:14:45 +0000 (01:14 +0000)]
Documentation: add an idea for a (weird) clang tool

llvm-svn: 176005

11 years agoDIBuilder: support structs with vtable pointers in the same way as classes
David Blaikie [Mon, 25 Feb 2013 01:07:18 +0000 (01:07 +0000)]
DIBuilder: support structs with vtable pointers in the same way as classes

llvm-svn: 176004

11 years agoUpdate Clang for a minor DIBuilder breaking change.
David Blaikie [Mon, 25 Feb 2013 01:07:08 +0000 (01:07 +0000)]
Update Clang for a minor DIBuilder breaking change.

llvm-svn: 176003

11 years ago Make psuedo FEXT_T8I816_ins into a custom emitter.
Reed Kotler [Sun, 24 Feb 2013 23:17:51 +0000 (23:17 +0000)]
 Make psuedo FEXT_T8I816_ins into a custom emitter.

llvm-svn: 176002

11 years agoMoving initialization into the initializer list and correcting capitalization, as...
Aaron Ballman [Sun, 24 Feb 2013 19:08:10 +0000 (19:08 +0000)]
Moving initialization into the initializer list and correcting capitalization, as suggested by Chandler.

llvm-svn: 176001

11 years agoDocumentation: add an idea for an automatic refactoring
Dmitri Gribenko [Sun, 24 Feb 2013 19:04:36 +0000 (19:04 +0000)]
Documentation: add an idea for an automatic refactoring

llvm-svn: 176000

11 years agoAllow breaking between a type and name in variable declarations.
Daniel Jasper [Sun, 24 Feb 2013 18:54:32 +0000 (18:54 +0000)]
Allow breaking between a type and name in variable declarations.

This fixes llvm.org/PR14967 and is generall necessary to avoid
situations where the column limit is exceeded. The challenge is
restricting such lines splits, otherwise clang-format suddenly starts
breaking at bad places.

Before:
ReallyLongReturnType<TemplateParam1, TemplateParam2>
ReallyReallyLongFunctionName(
    const std::string &SomeParameter,
    const SomeType<string,
                   SomeOtherTemplateParameter> &ReallyReallyLongParameterName,
    const SomeType<string,
                   SomeOtherTemplateParameter> &AnotherLongParameterName) {}

After:
ReallyLongReturnType<TemplateParam1, TemplateParam2>
ReallyReallyLongFunctionName(
    const std::string &SomeParameter,
    const SomeType<string, SomeOtherTemplateParameter> &
        ReallyReallyLongParameterName,
    const SomeType<string, SomeOtherTemplateParameter> &
        AnotherLongParameterName) {}

llvm-svn: 175999

11 years agoFix PR14364.
Bill Schmidt [Sun, 24 Feb 2013 17:34:50 +0000 (17:34 +0000)]
Fix PR14364.

This removes a const_cast hack from PPCRegisterInfo::hasReservedSpillSlot().
The proper place to save the frame index for the CR spill slot is in the
PPCFunctionInfo object, not the PPCRegisterInfo object.

No new test cases, as this just reimplements existing function.  Existing
tests such as test/CodeGen/PowerPC/crsave.ll are sufficient.

llvm-svn: 175998

11 years ago[ELF][Hexagon] add _SDA_BASE_(absolute symbol pointing to start of quickdata)
Shankar Easwaran [Sun, 24 Feb 2013 16:02:24 +0000 (16:02 +0000)]
[ELF][Hexagon] add _SDA_BASE_(absolute symbol pointing to start of quickdata)

llvm-svn: 175997

11 years agoAdd the testcase from PR13573, this used to crash.
Benjamin Kramer [Sun, 24 Feb 2013 15:51:32 +0000 (15:51 +0000)]
Add the testcase from PR13573, this used to crash.

The error is a bit strange tbh, but better than crashing.

llvm-svn: 175996

11 years agoCVP: If we have a PHI with an incoming select, try to skip the select.
Benjamin Kramer [Sun, 24 Feb 2013 15:34:43 +0000 (15:34 +0000)]
CVP: If we have a PHI with an incoming select, try to skip the select.

This is a common pattern with dyn_cast and similar constructs, when the
PHI no longer depends on the select it can often be turned into a simpler
construct or even get hoisted out of the loop.

PR15340.

llvm-svn: 175995

11 years agoFix invalid IR in test, missing incoming value for PHI node.
Benjamin Kramer [Sun, 24 Feb 2013 15:34:29 +0000 (15:34 +0000)]
Fix invalid IR in test, missing incoming value for PHI node.

llvm-svn: 175994

11 years ago[ELF] Change functions to virtual, in ExecutableAtoms
Shankar Easwaran [Sun, 24 Feb 2013 15:11:55 +0000 (15:11 +0000)]
[ELF] Change functions to virtual, in ExecutableAtoms

llvm-svn: 175993

11 years ago[ELF]Change name of runtime files, so that targets can change runtime files that...
Shankar Easwaran [Sun, 24 Feb 2013 14:54:02 +0000 (14:54 +0000)]
[ELF]Change name of runtime files, so that targets can change runtime files that they own

llvm-svn: 175992

11 years agoTypo
Francois Pichet [Sun, 24 Feb 2013 12:34:13 +0000 (12:34 +0000)]
Typo

llvm-svn: 175991

11 years ago[analyzer] tracking stores/constraints now works for ObjC ivars or struct fields.
Ted Kremenek [Sun, 24 Feb 2013 07:21:01 +0000 (07:21 +0000)]
[analyzer] tracking stores/constraints now works for ObjC ivars or struct fields.

This required more changes than I originally expected:

- ObjCIvarRegion implements "canPrintPretty" et al
- DereferenceChecker indicates the null pointer source is an ivar
- bugreporter::trackNullOrUndefValue() uses an alternate algorithm
  to compute the location region to track by scouring the ExplodedGraph.
  This allows us to get the actual MemRegion for variables, ivars,
  fields, etc.  We only hand construct a VarRegion for C++ references.
- ExplodedGraph no longer drops nodes for expressions that are marked
  'lvalue'.  This is to facilitate the logic in the previous bullet.
  This may lead to a slight increase in size in the ExplodedGraph,
  which I have not measured, but it is likely not to be a big deal.

I have validated each of the changed plist output.

Fixes <rdar://problem/12114812>

llvm-svn: 175988

11 years agoAdd "KnownSVal" to represent SVals that cannot be UnknownSVal.
Ted Kremenek [Sun, 24 Feb 2013 07:20:53 +0000 (07:20 +0000)]
Add "KnownSVal" to represent SVals that cannot be UnknownSVal.

This provides a few sundry cleanups, and allows us to provide
a compile-time check for a case that was a runtime assertion.

llvm-svn: 175987

11 years agoAdd regression test for serialized diagnostics for notes without locations.
Ted Kremenek [Sun, 24 Feb 2013 07:20:47 +0000 (07:20 +0000)]
Add regression test for serialized diagnostics for notes without locations.

This meant to be included in r175802.

llvm-svn: 175986

11 years agoRevert r169638 because it broke Mesa llvmpipe tests.
Nadav Rotem [Sun, 24 Feb 2013 07:09:35 +0000 (07:09 +0000)]
Revert r169638 because it broke Mesa llvmpipe  tests.

Fix PR15239.

llvm-svn: 175985

11 years agoMake psuedo FEXT_T8I816_ins a custom inserter. It should be expanded
Reed Kotler [Sun, 24 Feb 2013 06:16:39 +0000 (06:16 +0000)]
Make psuedo FEXT_T8I816_ins a custom inserter. It should be expanded
as early as possible; which means during instruction selection.

llvm-svn: 175984

11 years ago[ELF][Hexagon]add typeZeroFillFast
Shankar Easwaran [Sun, 24 Feb 2013 03:09:10 +0000 (03:09 +0000)]
[ELF][Hexagon]add typeZeroFillFast

llvm-svn: 175983

11 years agoPR15338: Don't assert if -fsanitize=bounds sees array indexing on an incomplete
Richard Smith [Sun, 24 Feb 2013 01:56:24 +0000 (01:56 +0000)]
PR15338: Don't assert if -fsanitize=bounds sees array indexing on an incomplete
array type.

llvm-svn: 175982

11 years agoAdd a use of an otherwise unused variable to remove a warning in non-Asserts
Cameron Zwarich [Sun, 24 Feb 2013 01:26:05 +0000 (01:26 +0000)]
Add a use of an otherwise unused variable to remove a warning in non-Asserts
builds.

llvm-svn: 175981

11 years agoTwoAddressInstructionPass::tryInstructionTransform() only potentially returns
Cameron Zwarich [Sun, 24 Feb 2013 00:27:29 +0000 (00:27 +0000)]
TwoAddressInstructionPass::tryInstructionTransform() only potentially returns
true when shouldOnlyCommute is false, so we can remove code that checks
otherwise.

llvm-svn: 175980

11 years agoTwoAddrInstructionPass::tryInstructionTransform() has a case where it calls
Cameron Zwarich [Sun, 24 Feb 2013 00:27:26 +0000 (00:27 +0000)]
TwoAddrInstructionPass::tryInstructionTransform() has a case where it calls
itself recursively with a new instruction that has not been finalized, in order
to determine whether to keep the instruction. On 'make check' and test-suite the
only cases where the recursive invocation made any transformations were simple
instruction commutations, so I am restricting the recursive invocation to do
only this.

The other cases wouldn't work correctly when updating LiveIntervals, since the
new instructions don't have slot indices and LiveIntervals hasn't yet been
updated. If the other transformations were actually triggering in any test case
it would be possible to support it with a lot of effort, but since they don't
it's not worth it.

llvm-svn: 175979

11 years ago[preprocessor] Use MacroDirective in the preprocessor callbacks to make available the
Argyrios Kyrtzidis [Sun, 24 Feb 2013 00:05:14 +0000 (00:05 +0000)]
[preprocessor] Use MacroDirective in the preprocessor callbacks to make available the
full information about the macro (e.g if it was imported and where).

llvm-svn: 175978

11 years agoAdd comments for the MacroDirective & MacroInfo classes.
Argyrios Kyrtzidis [Sun, 24 Feb 2013 00:05:05 +0000 (00:05 +0000)]
Add comments for the MacroDirective & MacroInfo classes.

llvm-svn: 175977

11 years agoIn Sema::InstantiateStaticDataMemberDefinition, pass the var decl to the consumer
Argyrios Kyrtzidis [Sun, 24 Feb 2013 00:05:01 +0000 (00:05 +0000)]
In Sema::InstantiateStaticDataMemberDefinition, pass the var decl to the consumer
just using ASTConsumer::HandleCXXStaticMemberVarInstantiation(), don't pass it with
ASTConsumer::HandleTopLevelDecl.

ASTConsumer::HandleTopLevelDecl is intended for user-written top-level decls;
a consumer can treat an instantiated static data member however it wants of course.

llvm-svn: 175976

11 years agoAdd new base instruction def for cmpi, cmp, slt and sltu so that def/uses
Reed Kotler [Sat, 23 Feb 2013 23:37:03 +0000 (23:37 +0000)]
Add new base instruction def for cmpi, cmp, slt and sltu so that def/uses
proper. Fixed this already a few days ago for slti.

llvm-svn: 175975

11 years agoTargetInstrInfo::commuteInstruction() doesn't actually return a new instruction
Cameron Zwarich [Sat, 23 Feb 2013 23:13:28 +0000 (23:13 +0000)]
TargetInstrInfo::commuteInstruction() doesn't actually return a new instruction
unless it was requested to with an optional parameter that defaults to false, so
we don't need to handle that case in TwoAddressInstructionPass.

llvm-svn: 175974

11 years agoBetter formatting of conditional expressions.
Daniel Jasper [Sat, 23 Feb 2013 21:01:55 +0000 (21:01 +0000)]
Better formatting of conditional expressions.

In conditional expressions, if the condition is split over multiple
lines, also break before both operands.

This prevents formattings like:

  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ==
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? b : c;

Which are bad, because they suggestion incorrect operator precedence:

  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ==
      (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? b : c);

This lead to the discovery that the expression parser incorrectly
handled conditional operators and that it could also handle semicolons
(which in turn reduced the amount of special casing for for-loops). As a
side-effect, we can now apply the bin-packing configuration to the
sections of for-loops.

llvm-svn: 175973

11 years ago[ELF][Writer] Add hash table.
Michael J. Spencer [Sat, 23 Feb 2013 19:46:18 +0000 (19:46 +0000)]
[ELF][Writer] Add hash table.

llvm-svn: 175972

11 years agoReference the canonical commit (r175462) in the value casting release note.
David Blaikie [Sat, 23 Feb 2013 19:30:31 +0000 (19:30 +0000)]
Reference the canonical commit (r175462) in the value casting release note.

llvm-svn: 175971

11 years agoDocument the value casting API changes.
David Blaikie [Sat, 23 Feb 2013 19:27:10 +0000 (19:27 +0000)]
Document the value casting API changes.

After changing the way several value inheritance hierarchies (TypeLoc,
CFGelement, ProgramPoint and SVal) handle casting, this documentation describes
how 3rd party code may need to be updated to compile with the new APIs.

As suggested by Sean Silva on cfe-dev.

llvm-svn: 175970

11 years agoPrefer 'and' over '&' in comments.
David Blaikie [Sat, 23 Feb 2013 19:20:56 +0000 (19:20 +0000)]
Prefer 'and' over '&' in comments.

Post commit code review feedback from Matt Beaumont-Gay on r174248.

llvm-svn: 175969

11 years agoShrink SmallPtrSet. It gets swapped a lot which copies the whole small part.
Benjamin Kramer [Sat, 23 Feb 2013 16:56:22 +0000 (16:56 +0000)]
Shrink SmallPtrSet. It gets swapped a lot which copies the whole small part.

Testing shows that it's empty in >99% of the cases and I couldn't find a case
where it contained more than 2 elements.

llvm-svn: 175967

11 years agoAdd streamed versions of getQualifiedNameAsString.
Benjamin Kramer [Sat, 23 Feb 2013 13:53:57 +0000 (13:53 +0000)]
Add streamed versions of getQualifiedNameAsString.

Move the cold virtual method getNameForDiagnostic out of line.

llvm-svn: 175966

11 years agoAdd global structure vectorization to docs
Renato Golin [Sat, 23 Feb 2013 13:25:41 +0000 (13:25 +0000)]
Add global structure vectorization to docs

llvm-svn: 175965

11 years agoSome more tests for the global structure vectorizer
Renato Golin [Sat, 23 Feb 2013 12:48:30 +0000 (12:48 +0000)]
Some more tests for the global structure vectorizer

llvm-svn: 175964

11 years agoRemove data member MSAsmStmt::AsmLoc, wrongly hiding AsmStmt::AsmLoc.
Enea Zaffanella [Sat, 23 Feb 2013 12:27:19 +0000 (12:27 +0000)]
Remove data member MSAsmStmt::AsmLoc, wrongly hiding AsmStmt::AsmLoc.

llvm-svn: 175963

11 years agoX86: Disable cmov-memory patterns on subtargets without cmov.
Benjamin Kramer [Sat, 23 Feb 2013 10:40:58 +0000 (10:40 +0000)]
X86: Disable cmov-memory patterns on subtargets without cmov.

Fixes PR15115.

llvm-svn: 175962

11 years agoMake some fixes for LiveInterval repair with debug info. Debug value
Cameron Zwarich [Sat, 23 Feb 2013 10:25:25 +0000 (10:25 +0000)]
Make some fixes for LiveInterval repair with debug info. Debug value
MachineInstrs don't have a slot index.

llvm-svn: 175961

11 years agoDon't recognize unnamed pointer parameters as casts.
Daniel Jasper [Sat, 23 Feb 2013 08:07:18 +0000 (08:07 +0000)]
Don't recognize unnamed pointer parameters as casts.

This fixes llvm.org/PR15061.

Before: virtual void f(int *)const;
After:  virtual void f(int *) const;
llvm-svn: 175960

11 years agoAllow splitting between string literals and identifiers.
Daniel Jasper [Sat, 23 Feb 2013 07:46:38 +0000 (07:46 +0000)]
Allow splitting between string literals and identifiers.

Also don't break in long include directives as that is not desired.

We can now format:

  #include "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  #define LL_FORMAT "ll"
  printf("aaaaa: %d, bbbbbbbbb: %" LL_FORMAT "d, cccccccc: %" LL_FORMAT
         "d, ddddddddd: %" LL_FORMAT "d\n");

Before, this led to weird results.

llvm-svn: 175959

11 years agoFix a bug with the LiveIntervals updating in the two-address pass found by
Cameron Zwarich [Sat, 23 Feb 2013 04:49:22 +0000 (04:49 +0000)]
Fix a bug with the LiveIntervals updating in the two-address pass found by
running ASCI_Purple/SMG2000 in the test-suite.

llvm-svn: 175957

11 years agoMake TwoAddressInstructionPass::sink3AddrInstruction() LiveIntervals-aware.
Cameron Zwarich [Sat, 23 Feb 2013 04:49:20 +0000 (04:49 +0000)]
Make TwoAddressInstructionPass::sink3AddrInstruction() LiveIntervals-aware.

llvm-svn: 175956

11 years agoMake rescheduleMIBelowKill() and rescheduleKillAboveMI() LiveIntervals-aware in
Cameron Zwarich [Sat, 23 Feb 2013 04:49:13 +0000 (04:49 +0000)]
Make rescheduleMIBelowKill() and rescheduleKillAboveMI() LiveIntervals-aware in
TwoAddressInstructionPass. The code in rescheduleMIBelowKill() is a bit tricky,
since multiple instructions need to be moved down, one-at-a-time, in reverse
order.

llvm-svn: 175955

11 years agoImplement __builtin_eh_return_data_regno() for ARM and MIPS.
Logan Chien [Sat, 23 Feb 2013 04:24:36 +0000 (04:24 +0000)]
Implement __builtin_eh_return_data_regno() for ARM and MIPS.

llvm-svn: 175954

11 years ago<rdar://problem/13265297>
Greg Clayton [Sat, 23 Feb 2013 04:12:47 +0000 (04:12 +0000)]
<rdar://problem/13265297>

StackFrame assumes m_sc is additive, but m_sc can lose its target. So now the SymbolContext::Clear() method takes a bool that indicates if the target should be cleared. Modified all existing code to properly set the bool argument.

llvm-svn: 175953

11 years agoclang/AST/Decl.h: Add "raw_ostream.h" to appease msvc.
NAKAMURA Takumi [Sat, 23 Feb 2013 03:59:16 +0000 (03:59 +0000)]
clang/AST/Decl.h: Add "raw_ostream.h" to appease msvc.

llvm-svn: 175952

11 years ago[ELF][Writer] Add a PHDR program table entry for dynamic files.
Michael J. Spencer [Sat, 23 Feb 2013 03:58:06 +0000 (03:58 +0000)]
[ELF][Writer] Add a PHDR program table entry for dynamic files.

llvm-svn: 175951

11 years agoExpand pseudos/macros for Selt. This is the last of the complex
Reed Kotler [Sat, 23 Feb 2013 03:09:56 +0000 (03:09 +0000)]
Expand pseudos/macros for Selt. This is the last of the complex
macros.The rest is some small misc. stuff.

llvm-svn: 175950

11 years agoubsan: Emit bounds checks for array indexing, vector indexing, and (in really simple...
Richard Smith [Sat, 23 Feb 2013 02:53:19 +0000 (02:53 +0000)]
ubsan: Emit bounds checks for array indexing, vector indexing, and (in really simple cases) pointer arithmetic. This augments the existing bounds checking with language-level array bounds information.

llvm-svn: 175949

11 years agoubsan: Runtime handlers for array indexing checks.
Richard Smith [Sat, 23 Feb 2013 02:40:07 +0000 (02:40 +0000)]
ubsan: Runtime handlers for array indexing checks.

llvm-svn: 175948

11 years agoFix a handful of remaining assumptions that thread IDs were 32-bits
Jason Molenda [Sat, 23 Feb 2013 02:04:45 +0000 (02:04 +0000)]
Fix a handful of remaining assumptions that thread IDs were 32-bits
in the gdb-remote Process plugin files.

llvm-svn: 175947