platform/upstream/llvm.git
11 years agoR600/SI: fix VOP3b encoding v2
Christian Konig [Tue, 26 Feb 2013 17:52:09 +0000 (17:52 +0000)]
R600/SI: fix VOP3b encoding v2

v2: document why we hardcode VCC for now.

This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176099

11 years agoR600/SI: fix and cleanup SI register definition v2
Christian Konig [Tue, 26 Feb 2013 17:52:03 +0000 (17:52 +0000)]
R600/SI: fix and cleanup SI register definition v2

Prevent producing real strange tablegen code by using
proper register sizes, alignments and hierarchy.

Also cleanup the unused definitions and add some comments.

v2: add SGPR 512 bit registers, stop registers from wrapping around,
    fix SGPR alignment

This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176098

11 years agoR600/SI: fix stupid typo
Christian Konig [Tue, 26 Feb 2013 17:51:57 +0000 (17:51 +0000)]
R600/SI: fix stupid typo

This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176097

11 years agoAdding ARM as supported architecture
Renato Golin [Tue, 26 Feb 2013 17:23:13 +0000 (17:23 +0000)]
Adding ARM as supported architecture

llvm-svn: 176096

11 years agoProper XFAILs for ARMv7 / v5
Renato Golin [Tue, 26 Feb 2013 17:16:27 +0000 (17:16 +0000)]
Proper XFAILs for ARMv7 / v5

llvm-svn: 176095

11 years agoFix PR15359.
Bill Schmidt [Tue, 26 Feb 2013 16:41:03 +0000 (16:41 +0000)]
Fix PR15359.

The PowerPC TLS relocation types were not previously added to the
necessary list in MCELFStreamer::fixSymbolsInTLSFixups().  Now they are!

llvm-svn: 176094

11 years agoMichael van der Westhuizen: correction to the libcxx build instructions when built...
Howard Hinnant [Tue, 26 Feb 2013 16:27:55 +0000 (16:27 +0000)]
Michael van der Westhuizen: correction to the libcxx build instructions when built with libcxxrt on Linux.

llvm-svn: 176093

11 years agoFix bad line break decision.
Daniel Jasper [Tue, 26 Feb 2013 13:59:14 +0000 (13:59 +0000)]
Fix bad line break decision.

Before:
if (Intervals[i].getRange().getFirst() < Intervals[i - 1]
                                             .getRange().getLast()) {}

After:
if (Intervals[i].getRange().getFirst() <
    Intervals[i - 1].getRange().getLast()) {}

llvm-svn: 176092

11 years ago[Sanitizer] Don't die if external symbolizer is used on Mac, where it's not implement...
Alexey Samsonov [Tue, 26 Feb 2013 13:40:51 +0000 (13:40 +0000)]
[Sanitizer] Don't die if external symbolizer is used on Mac, where it's not implemented yet

llvm-svn: 176091

11 years agoGCC 4.6.3 O3 miscompiles on ARM
Renato Golin [Tue, 26 Feb 2013 13:32:40 +0000 (13:32 +0000)]
GCC 4.6.3 O3 miscompiles on ARM

llvm-svn: 176090

11 years ago[sanitizer] A low-level vector implementation to be used in leak checking code. Patch...
Kostya Serebryany [Tue, 26 Feb 2013 13:30:27 +0000 (13:30 +0000)]
[sanitizer] A low-level vector implementation to be used in leak checking code. Patch by Sergey Matveev

llvm-svn: 176089

11 years agoAllow dash before "ld" in android driver test.
Evgeniy Stepanov [Tue, 26 Feb 2013 13:20:29 +0000 (13:20 +0000)]
Allow dash before "ld" in android driver test.

Sometimes android linker is "arm-linux-androideabi-ld", and not just "ld".

llvm-svn: 176088

11 years agoIn range-based for-loops, prefer splitting after ":".
Daniel Jasper [Tue, 26 Feb 2013 13:18:08 +0000 (13:18 +0000)]
In range-based for-loops, prefer splitting after ":".

Before:
for (const aaaaaaaaaaaaaaaaaaaaa &
         aaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}

After:
for (const aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaa :
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}

llvm-svn: 176087

11 years agoOnly keep empty lines in unwrapped lines if they preceed a line comment.
Daniel Jasper [Tue, 26 Feb 2013 13:10:34 +0000 (13:10 +0000)]
Only keep empty lines in unwrapped lines if they preceed a line comment.

Empty lines followed by line comments are often used to highlight the
comment. Empty lines somewhere else are usually left over from manual or
automatic formatting and should probably be removed.

Before (clang-format would keep):
S s = {
  a,

  b
};

After:
S s = { a, b };

llvm-svn: 176086

11 years ago[asan] a bit stricter lint for CHECK vs CHECK_XX (these CHECK_XX really help debugging!)
Kostya Serebryany [Tue, 26 Feb 2013 12:59:06 +0000 (12:59 +0000)]
[asan] a bit stricter lint for CHECK vs CHECK_XX (these CHECK_XX really help debugging!)

llvm-svn: 176085

11 years agoOnly break string literals as a last resort.
Daniel Jasper [Tue, 26 Feb 2013 12:52:34 +0000 (12:52 +0000)]
Only break string literals as a last resort.

We might want to move towards doing this if the formatting can be
significantly improved, but we need to carefully evaluate the different
situations first.

Before (the string literal was split by clang-format here):
aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaaaa("aaa aaaaa aaa aaa aaaaa aaa "
                                                  "aaaaa aaa aaa aaaaaa"));

After:
aaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaa,
    aaaaaa("aaa aaaaa aaa aaa aaaaa aaa aaaaa aaa aaa aaaaaa"));

llvm-svn: 176084

11 years agoDefine CMake option CLANG_INCLUDE_TESTS *before* traversing into tests/ subdirectory...
Alexey Samsonov [Tue, 26 Feb 2013 09:43:27 +0000 (09:43 +0000)]
Define CMake option CLANG_INCLUDE_TESTS *before* traversing into tests/ subdirectory. Otherwise, while configuring the build tree for the first time, Clang unit tests could avoid being added to 'check-clang' command, and thus avoid being built and executed.

llvm-svn: 176080

11 years ago[tsan] enable tsan-vs-gvn test since it is now fixed
Kostya Serebryany [Tue, 26 Feb 2013 08:18:27 +0000 (08:18 +0000)]
[tsan] enable tsan-vs-gvn test since it is now fixed

llvm-svn: 176079

11 years ago[asan] fix the output for range accesses (memset, etc); improve the tests; more stric...
Kostya Serebryany [Tue, 26 Feb 2013 07:25:18 +0000 (07:25 +0000)]
[asan] fix the output for range accesses (memset, etc); improve the tests; more strict checking in memcmp

llvm-svn: 176078

11 years ago[asan] use the new attribute syntax (no_address_safety_analysis => no_sanitize_address)
Kostya Serebryany [Tue, 26 Feb 2013 07:01:06 +0000 (07:01 +0000)]
[asan] use the new attribute syntax (no_address_safety_analysis => no_sanitize_address)

llvm-svn: 176077

11 years agoUnify clang/llvm attributes for asan/tsan/msan (Clang part)
Kostya Serebryany [Tue, 26 Feb 2013 06:58:27 +0000 (06:58 +0000)]
Unify clang/llvm attributes for asan/tsan/msan (Clang part)

These are two related changes (one in llvm, one in clang).
LLVM:
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG:
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

llvm-svn: 176076

11 years agoUnify clang/llvm attributes for asan/tsan/msan (LLVM part)
Kostya Serebryany [Tue, 26 Feb 2013 06:58:09 +0000 (06:58 +0000)]
Unify clang/llvm attributes for asan/tsan/msan (LLVM part)

These are two related changes (one in llvm, one in clang).
LLVM:
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG:
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

llvm-svn: 176075

11 years agoUpdate tests to do a full match against printed C++11 attributes.
Michael Han [Tue, 26 Feb 2013 02:00:13 +0000 (02:00 +0000)]
Update tests to do a full match against printed C++11 attributes.

llvm-svn: 176074

11 years ago[Pass][Layout] Fix bug and add debug printing.
Michael J. Spencer [Tue, 26 Feb 2013 01:35:30 +0000 (01:35 +0000)]
[Pass][Layout] Fix bug and add debug printing.

Fix a bug where if two atoms had the same index in the override map,
the compare would return false. It now goes to the next check when
they are equal.

No test because it currently can't be tested. An upcomming patch will test it.

llvm-svn: 176073

11 years agoUse a DenseMap instead of a std::map for AnalysisID -> Pass* maps. This reduces the...
Michael Ilseman [Tue, 26 Feb 2013 01:31:59 +0000 (01:31 +0000)]
Use a DenseMap instead of a std::map for AnalysisID -> Pass* maps. This reduces the pass-manager overhead from FPPassManager::runOnFunction() by about 10%.

llvm-svn: 176072

11 years agoA quick variable rename Sean and I had discussed earlier to make things a bit clearer.
Greg Clayton [Tue, 26 Feb 2013 01:31:37 +0000 (01:31 +0000)]
A quick variable rename Sean and I had discussed earlier to make things a bit clearer.

llvm-svn: 176071

11 years ago[mips] Use class RegDefsUses to track register defs and uses.
Akira Hatanaka [Tue, 26 Feb 2013 01:30:05 +0000 (01:30 +0000)]
[mips] Use class RegDefsUses to track register defs and uses.

No functionality change.

llvm-svn: 176070

11 years ago[analyzer] Don't look through casts when creating pointer temporaries.
Jordan Rose [Tue, 26 Feb 2013 01:21:27 +0000 (01:21 +0000)]
[analyzer] Don't look through casts when creating pointer temporaries.

Normally, we need to look through derived-to-base casts when creating
temporary object regions (added in r175854). However, if the temporary
is a pointer (rather than a struct/class instance), we need to /preserve/
the base casts that have been applied.

This also ensures that we really do create a new temporary region when
we need to: MaterializeTemporaryExpr and lvalue CXXDefaultArgExprs.

Fixes PR15342, although the test case doesn't include the crash because
I couldn't isolate it.

llvm-svn: 176069

11 years ago[analyzer] StackAddrEscapeChecker: strip qualifiers from temporary types.
Jordan Rose [Tue, 26 Feb 2013 01:21:21 +0000 (01:21 +0000)]
[analyzer] StackAddrEscapeChecker: strip qualifiers from temporary types.

With the new support for trivial copy constructors, we are not always
consistent about whether a CXXTempObjectRegion gets reused or created
from scratch, which affects whether qualifiers are preserved. However,
we probably don't care anyway.

This also switches to using the current PrintingPolicy for the type,
which means C++ types don't get a spurious 'struct' prefix anymore.

llvm-svn: 176068

11 years agoFixed several problems with class uniq'ing in the
Sean Callanan [Tue, 26 Feb 2013 01:12:25 +0000 (01:12 +0000)]
Fixed several problems with class uniq'ing in the
SymbolFileDWARF code:

  - If a class is being uniqued to another copy of itself
    and the method lists don't match exactly, take a slow
    path and at least unique the methods that they have
    in common.

  - Sort name_to_die maps before querying them.  This
    would otherwise result in uniquing failures because
    looking up a name in a map that contains it would
    often fail.

  - Tolerate classes in other symbol files in the case
    of debugging with .o files rather than with a
    .dSYM.  We used to assume that the classes being
    uniqued were in the same symbol file, causing
    unpredictable results.

This will dramatically reduce the number of cases where
a function does not have a valid DeclContext.

<rdar://problem/12153915>

llvm-svn: 176067

11 years ago[fast-isel] Make sure the FastLowerArguments function checks to make sure the
Chad Rosier [Tue, 26 Feb 2013 01:05:31 +0000 (01:05 +0000)]
[fast-isel] Make sure the FastLowerArguments function checks to make sure the
arguments type is a simple type.
rdar://13290455

llvm-svn: 176066

11 years agoRemoving leftover printf() statement
Enrico Granata [Tue, 26 Feb 2013 00:28:02 +0000 (00:28 +0000)]
Removing leftover printf() statement

llvm-svn: 176065

11 years agoIf the user has disabled kext loading with the
Jason Molenda [Tue, 26 Feb 2013 00:26:47 +0000 (00:26 +0000)]
If the user has disabled kext loading with the
plugin.dynamic-loader.darwin-kernel.load-kexts setting, don't print
any messages about loading the kexts (which isn't being done) and
don't read the Mach-O headers out of memory (which can be slow and
they're not being used for anything at this point).

llvm-svn: 176064

11 years ago<rdar://problem/13289157>
Greg Clayton [Tue, 26 Feb 2013 00:21:38 +0000 (00:21 +0000)]
<rdar://problem/13289157>

Set the exception breakpoints more efficiently by specifying two module basenames as module filters for Apple vendor targets.

llvm-svn: 176063

11 years ago<rdar://problem/13282582>
Han Ming Ong [Tue, 26 Feb 2013 00:04:29 +0000 (00:04 +0000)]
<rdar://problem/13282582>

Really don't call sysctl again when we already have the result.

llvm-svn: 176062

11 years agoFix the .categories, it had "dataformatter" not "dataformatters".
Jim Ingham [Mon, 25 Feb 2013 23:51:06 +0000 (23:51 +0000)]
Fix the .categories, it had "dataformatter" not "dataformatters".
Remove the getCategory from TestDataFormatterObjC.py, since it was superceded by the .categories file,
and didn't work anyway (getCategories currently has to be a method on the test class, not on the test.)
Add a "basic_process" category, and start to find some tests for simple process running sniff tests.

llvm-svn: 176061

11 years agoRefine fix to PR10499, no functionality change
Michael Liao [Mon, 25 Feb 2013 23:16:36 +0000 (23:16 +0000)]
Refine fix to PR10499, no functionality change

- Put expensive checking after simple one

llvm-svn: 176060

11 years agoBeing explicit about how ignoring optparse's exceptions is not a best principle
Enrico Granata [Mon, 25 Feb 2013 23:01:08 +0000 (23:01 +0000)]
Being explicit about how ignoring optparse's exceptions is not a best principle

llvm-svn: 176059

11 years agoFix PR10499
Michael Liao [Mon, 25 Feb 2013 23:01:03 +0000 (23:01 +0000)]
Fix PR10499

- Check whether SSE is available before lowering all 1s vector building with
  PCMPEQD, which is only available from SSE2

llvm-svn: 176058

11 years agoProvide workaround for PR 15130.
Andrew Kaylor [Mon, 25 Feb 2013 23:00:19 +0000 (23:00 +0000)]
Provide workaround for PR 15130.

This changes the RecordingMemoryManager in lli to use mapped memory rather than malloc to allocate memory for sections and uses a 'near' MemoryBlock to keep the allocations together.  This works around a problem in MCJIT where relocations are applied to a generated image immediately oupon generation, which isn't appropriate for the remote case.

llvm-svn: 176057

11 years ago[ubsan] Emit single check for left shift.
Will Dietz [Mon, 25 Feb 2013 22:37:49 +0000 (22:37 +0000)]
[ubsan] Emit single check for left shift.

Avoids warning twice on same shift.

llvm-svn: 176056

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