platform/upstream/llvm.git
11 years agoAdd convenience accessor to Triple for OS == NaCl
Eli Bendersky [Fri, 7 Dec 2012 00:01:53 +0000 (00:01 +0000)]
Add convenience accessor to Triple for OS == NaCl

llvm-svn: 169565

11 years agoTry to unbreak makefile build by excluding gtest-all.cc source
Alexey Samsonov [Thu, 6 Dec 2012 23:59:54 +0000 (23:59 +0000)]
Try to unbreak makefile build by excluding gtest-all.cc source

llvm-svn: 169564

11 years ago[analyzer] Avoid ProgramStateRef copy constructors.
Jordan Rose [Thu, 6 Dec 2012 23:55:34 +0000 (23:55 +0000)]
[analyzer] Avoid ProgramStateRef copy constructors.

Suggested by David Blaikie. ExplodedNode, CallEvent, and CheckerContext all
hang onto their ProgramState, so the accessors can return a reference to the
internal state rather than preemptively copying it. This helps avoid
temporary ProgramStateRefs, though local variables will still (correctly)
do an extra retain and release.

llvm-svn: 169563

11 years agoRevert r169557. It seems that the test is too restricted
Logan Chien [Thu, 6 Dec 2012 23:40:31 +0000 (23:40 +0000)]
Revert r169557.  It seems that the test is too restricted
and will break the build on buildbot.

llvm-svn: 169562

11 years agoAdd a 'using' declaration to suppress GCC's -Woverloaded-virtual while we
Matt Beaumont-Gay [Thu, 6 Dec 2012 23:15:36 +0000 (23:15 +0000)]
Add a 'using' declaration to suppress GCC's -Woverloaded-virtual while we
decide what pattern we want to follow in the future.

llvm-svn: 169561

11 years ago<rdar://problem/12827789>
Greg Clayton [Thu, 6 Dec 2012 23:12:53 +0000 (23:12 +0000)]
<rdar://problem/12827789>

Be sure to load dSYM files when the object file is in memory only.

llvm-svn: 169560

11 years agoModify the LLVM checkout of googletest:
Alexey Samsonov [Thu, 6 Dec 2012 23:04:41 +0000 (23:04 +0000)]
Modify the LLVM checkout of googletest:
1) don't delete gtest-all.cc (which is used to gather all gtest source
   files in a single file)
2) make including LLVMSupport headers optional (on by default).
   Sanitizer tools may want to use their own versions of googletest
   compiled with specific flags, instead of the common googletest
   library used for all other LLVM/Clang unittests.

llvm-svn: 169559

11 years ago[libclang] Add a test to make sure we skip bodies properly from "#pragma once" headers.
Argyrios Kyrtzidis [Thu, 6 Dec 2012 23:04:24 +0000 (23:04 +0000)]
[libclang] Add a test to make sure we skip bodies properly from "#pragma once" headers.

llvm-svn: 169558

11 years agoAdd i686-linux-android for gcc toolchain detection.
Logan Chien [Thu, 6 Dec 2012 22:59:37 +0000 (22:59 +0000)]
Add i686-linux-android for gcc toolchain detection.

* Look for i686-linux-android under <sysroot>/lib/gcc.

* This patch also slightly enhance the test suite for
  Android GCC toolchain detection.

llvm-svn: 169557

11 years ago<rdar://problem/12820334>
Greg Clayton [Thu, 6 Dec 2012 22:49:16 +0000 (22:49 +0000)]
<rdar://problem/12820334>

I modified the "Args::StringtoAddress(...)" function to be able to evaluate address expressions. This is now used for any command line arguments or options that takes addresses like:

memory read <addr> [<end-addr>]
memory write <addr>
breakpoint set --address <addr>
disassemble --start-address <addr> --end-address <addr>

It calls the expression parser to evaluate the address expression and will also work around the issue where the compiler doesn't like to add offsets to function pointers (which is what happens when you try to evaluate "main + 12"). So there is a temp fix in the Args::StringtoAddress() to work around this until we can get special compiler support for debug expressions with function pointers.

llvm-svn: 169556

11 years agoAdd extra truthiness.
Richard Smith [Thu, 6 Dec 2012 22:40:09 +0000 (22:40 +0000)]
Add extra truthiness.

llvm-svn: 169555

11 years agoFixes Makefile for Format unit tests.
Fariborz Jahanian [Thu, 6 Dec 2012 22:29:01 +0000 (22:29 +0000)]
Fixes Makefile for Format unit tests.

llvm-svn: 169554

11 years agofixed valgrind issues of prior commit, this change applies r169456 changes back to...
Pedro Artigas [Thu, 6 Dec 2012 22:12:44 +0000 (22:12 +0000)]
fixed valgrind issues of prior commit, this change applies r169456 changes back to the tree with fixes. on darwin no valgrind issues exist in the tests that used to fail.

original change description:

change MCContext to work on the doInitialization/doFinalization model

reviewed by Evan Cheng <evan.cheng@apple.com>

llvm-svn: 169553

11 years agoAdd examples of how to set env vars for the inferior process from lldb.
Jason Molenda [Thu, 6 Dec 2012 22:10:27 +0000 (22:10 +0000)]
Add examples of how to set env vars for the inferior process from lldb.

llvm-svn: 169552

11 years agoRemove unused field.
Jakub Staszak [Thu, 6 Dec 2012 22:08:59 +0000 (22:08 +0000)]
Remove unused field.

llvm-svn: 169551

11 years agoRemove trailing spaces.
Jakub Staszak [Thu, 6 Dec 2012 21:57:16 +0000 (21:57 +0000)]
Remove trailing spaces.

llvm-svn: 169550

11 years agoMark the "dwarf" version of the test expected fail as well as the dsym version.
Jim Ingham [Thu, 6 Dec 2012 21:40:51 +0000 (21:40 +0000)]
Mark the "dwarf" version of the test expected fail as well as the dsym version.

llvm-svn: 169549

11 years agohexagon-toolchain.c now passes on win32
Matthew Curtis [Thu, 6 Dec 2012 21:25:18 +0000 (21:25 +0000)]
hexagon-toolchain.c now passes on win32

llvm-svn: 169548

11 years agoFix typos in CHECK lines.
Dmitri Gribenko [Thu, 6 Dec 2012 21:24:47 +0000 (21:24 +0000)]
Fix typos in CHECK lines.

Patch by Alexander Zinenko.

llvm-svn: 169547

11 years agoDocumentation: fix typos and formatting.
Dmitri Gribenko [Thu, 6 Dec 2012 21:12:35 +0000 (21:12 +0000)]
Documentation: fix typos and formatting.

llvm-svn: 169546

11 years agorelax hexagon-toolchain.c even more to accomodate mingw32 targets
Matthew Curtis [Thu, 6 Dec 2012 20:55:41 +0000 (20:55 +0000)]
relax hexagon-toolchain.c even more to accomodate mingw32 targets

llvm-svn: 169544

11 years agorelax hexagon-toolchain.c CHECK to accomodate mingw32 targets
Matthew Curtis [Thu, 6 Dec 2012 20:21:20 +0000 (20:21 +0000)]
relax hexagon-toolchain.c CHECK to accomodate mingw32 targets

llvm-svn: 169543

11 years agoSimplify PDiag's move assignment overload a bit, the self-move check isn't actually...
Benjamin Kramer [Thu, 6 Dec 2012 20:12:03 +0000 (20:12 +0000)]
Simplify PDiag's move assignment overload a bit, the self-move check isn't actually necessary.

This just empties out the diag, which is fine.

llvm-svn: 169542

11 years agoRevert "Allow modifying an ImmutableMap without canonicalizing it immediately."
Ted Kremenek [Thu, 6 Dec 2012 19:41:30 +0000 (19:41 +0000)]
Revert "Allow modifying an ImmutableMap without canonicalizing it immediately."

Jordan and I discussed this, and we don't want this in the API.

llvm-svn: 169541

11 years agoMake sure to initialize the HasSkippedBody bit.
Argyrios Kyrtzidis [Thu, 6 Dec 2012 19:41:23 +0000 (19:41 +0000)]
Make sure to initialize the HasSkippedBody bit.

llvm-svn: 169540

11 years ago[libclang] Introduce a new indexing mode where we skip function bodies
Argyrios Kyrtzidis [Thu, 6 Dec 2012 19:41:16 +0000 (19:41 +0000)]
[libclang] Introduce a new indexing mode where we skip function bodies
that were already parsed in the same "indexing session".

An indexing session is defined as using the same CXIndexAction object
for multiple clang_indexSourceFile calls.
Passing CXIndexOpt_SkipParsedBodiesInSession as an indexing option will
enable the mode where we try to skip bodies that were already parsed in
another translation unit.

If a function's body was skipped, the "flags" field in the CXIdxDeclInfo
structure will have "CXIdxDeclFlag_Skipped" bit was set.

llvm-svn: 169539

11 years agoRevert "[analyzer] Aggressively cut back on the canonicalization in RegionStore."
Ted Kremenek [Thu, 6 Dec 2012 19:40:32 +0000 (19:40 +0000)]
Revert "[analyzer] Aggressively cut back on the canonicalization in RegionStore."

Jordan and I discussed this, and we are going to do this another way.

llvm-svn: 169538

11 years agoReplace r169459 with something safer. Rather than having computeMaskedBits to
Evan Cheng [Thu, 6 Dec 2012 19:13:27 +0000 (19:13 +0000)]
Replace r169459 with something safer. Rather than having computeMaskedBits to
understand target implementation of any_extend / extload, just generate
zero_extend in place of any_extend for liveouts when the target knows the
zero_extend will be implicit (e.g. ARM ldrb / ldrh) or folded (e.g. x86 movz).

rdar://12771555

llvm-svn: 169536

11 years agoAdd move semantics to PartialDiagnostic, which can be very expensive to copy.
Benjamin Kramer [Thu, 6 Dec 2012 19:09:30 +0000 (19:09 +0000)]
Add move semantics to PartialDiagnostic, which can be very expensive to copy.

llvm-svn: 169535

11 years agoRemove unneeded function, since PR8156 was fixed over a year ago.
Jakub Staszak [Thu, 6 Dec 2012 19:05:46 +0000 (19:05 +0000)]
Remove unneeded function, since PR8156 was fixed over a year ago.

llvm-svn: 169534

11 years agoUn-XFAIL hexagon-toolchain.c test for mingw32
Matthew Curtis [Thu, 6 Dec 2012 19:03:09 +0000 (19:03 +0000)]
Un-XFAIL hexagon-toolchain.c test for mingw32

llvm-svn: 169533

11 years agoAllow modifying an ImmutableMap without canonicalizing it immediately.
Jordan Rose [Thu, 6 Dec 2012 19:01:24 +0000 (19:01 +0000)]
Allow modifying an ImmutableMap without canonicalizing it immediately.

This is an alternative to the ImmutableMapRef interface where a factory
should still be canonicalizing by default, but in certain cases an
improvement can be made by delaying the canonicalization.

llvm-svn: 169532

11 years agoAdd a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a body
Argyrios Kyrtzidis [Thu, 6 Dec 2012 18:59:10 +0000 (18:59 +0000)]
Add a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a body
that was skipped by the parser.

llvm-svn: 169531

11 years ago[analyzer] Remove isa<> followed by dyn_cast<>.
Jordan Rose [Thu, 6 Dec 2012 18:58:29 +0000 (18:58 +0000)]
[analyzer] Remove isa<> followed by dyn_cast<>.

llvm-svn: 169530

11 years ago[analyzer] Remove unused fields from ExprEngine.
Jordan Rose [Thu, 6 Dec 2012 18:58:26 +0000 (18:58 +0000)]
[analyzer] Remove unused fields from ExprEngine.

'currStmt', 'CleanedState', and 'EntryNode' were being set, but only ever
used locally.

llvm-svn: 169529

11 years ago[analyzer] Remove checks that predate the linearized CFG.
Jordan Rose [Thu, 6 Dec 2012 18:58:22 +0000 (18:58 +0000)]
[analyzer] Remove checks that predate the linearized CFG.

llvm-svn: 169528

11 years ago[analyzer] Simplify RetainCountChecker's handling of dead symbols.
Jordan Rose [Thu, 6 Dec 2012 18:58:18 +0000 (18:58 +0000)]
[analyzer] Simplify RetainCountChecker's handling of dead symbols.

Previously we made three passes over the set of dead symbols, and removed
them from the state /twice/. Now we combine the autorelease pass and the
symbol death pass, and only have to remove the bindings for the symbols
that leaked.

llvm-svn: 169527

11 years ago[analyzer] Use a smarter algorithm to find the last block in an inlined call.
Jordan Rose [Thu, 6 Dec 2012 18:58:15 +0000 (18:58 +0000)]
[analyzer] Use a smarter algorithm to find the last block in an inlined call.

Previously we would search for the last statement, then back up to the
entrance of the block that contained that statement. Now, while we're
scanning for the statement, we just keep track of which blocks are being
exited (in reverse order).

llvm-svn: 169526

11 years ago[analyzer] Speed up ExplodedNode::Profile by avoiding copy constructors.
Jordan Rose [Thu, 6 Dec 2012 18:58:12 +0000 (18:58 +0000)]
[analyzer] Speed up ExplodedNode::Profile by avoiding copy constructors.

ProgramStateRef::Retain isn't free!

llvm-svn: 169525

11 years ago[analyzer] Use optimized assumeDual for branches.
Jordan Rose [Thu, 6 Dec 2012 18:58:09 +0000 (18:58 +0000)]
[analyzer] Use optimized assumeDual for branches.

This doesn't seem to make much of a difference in practice, but it does
have the potential to avoid a trip through the constraint manager.

llvm-svn: 169524

11 years ago[analyzer] Aggressively cut back on the canonicalization in RegionStore.
Jordan Rose [Thu, 6 Dec 2012 18:58:06 +0000 (18:58 +0000)]
[analyzer] Aggressively cut back on the canonicalization in RegionStore.

Whenever we touch a single bindings cluster multiple times, we can delay
canonicalizing it until the final access. This has some interesting
implications, in particular that we shouldn't remove an /empty/ cluster
from the top-level map until canonicalization.

This is good for a 2% speedup or so on the test case in
<rdar://problem/12810842>

llvm-svn: 169523

11 years ago[analyzer] Remove bindExprAndLocation, which does extra work for no gain.
Jordan Rose [Thu, 6 Dec 2012 18:58:01 +0000 (18:58 +0000)]
[analyzer] Remove bindExprAndLocation, which does extra work for no gain.

This feature was probably intended to improve diagnostics, but was currently
only used when dumping the Environment. It shows what location a given value
was loaded from, e.g. when evaluating an LValueToRValue cast.

llvm-svn: 169522

11 years agoSimplify code.
Jakub Staszak [Thu, 6 Dec 2012 18:22:59 +0000 (18:22 +0000)]
Simplify code.

llvm-svn: 169521

11 years agoClang-format: IndentCaseLabels option, proper namespace handling
Alexander Kornienko [Thu, 6 Dec 2012 18:03:27 +0000 (18:03 +0000)]
Clang-format: IndentCaseLabels option, proper namespace handling

Summary: + tests arranged in groups, as their number is already quite large.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D185

llvm-svn: 169520

11 years agoFixes a typo in this test.
Fariborz Jahanian [Thu, 6 Dec 2012 17:50:40 +0000 (17:50 +0000)]
Fixes a typo in this test.

llvm-svn: 169519

11 years agoClang-format: detect unbalanced braces.
Alexander Kornienko [Thu, 6 Dec 2012 17:49:17 +0000 (17:49 +0000)]
Clang-format: detect unbalanced braces.

Reviewers: klimek, djasper

Reviewed By: klimek

CC: cfe-commits, silvas
Differential Revision: http://llvm-reviews.chandlerc.com/D176

llvm-svn: 169518

11 years agoHexagon TC: Add/improve support for small data
Matthew Curtis [Thu, 6 Dec 2012 17:49:03 +0000 (17:49 +0000)]
Hexagon TC: Add/improve support for small data
 threshold, pic, pie

llvm-svn: 169517

11 years agoFix a bug in the code that merges consecutive stores. Previously we did not
Nadav Rotem [Thu, 6 Dec 2012 17:34:13 +0000 (17:34 +0000)]
Fix a bug in the code that merges consecutive stores. Previously we did not
check if loads that happen in between stores alias with the first store in the
chain, only with the second store onwards.

llvm-svn: 169516

11 years agoMerge rename fix from libcxxabi (r169402: rename class with name that clashes with...
Daniel Malea [Thu, 6 Dec 2012 16:52:09 +0000 (16:52 +0000)]
Merge rename fix from libcxxabi (r169402: rename class with name that clashes with GCC 4.6/4.7)

llvm-svn: 169515

11 years ago[sanitizer] POD-ify the allocator cache
Kostya Serebryany [Thu, 6 Dec 2012 16:22:04 +0000 (16:22 +0000)]
[sanitizer] POD-ify the allocator cache

llvm-svn: 169514

11 years agoFix hexagon-toolchain.c test to handle versioned clang executables.
Matthew Curtis [Thu, 6 Dec 2012 16:01:06 +0000 (16:01 +0000)]
Fix hexagon-toolchain.c test to handle versioned clang executables.

llvm-svn: 169513

11 years agoHexagon TC: Reimplement Link::ConstructJob to call
Matthew Curtis [Thu, 6 Dec 2012 15:46:07 +0000 (15:46 +0000)]
Hexagon TC: Reimplement Link::ConstructJob to call
 linker directly

Rather than calling gcc.

llvm-svn: 169512

11 years agotsan: fix lint warning and make output tests more robust
Dmitry Vyukov [Thu, 6 Dec 2012 15:42:54 +0000 (15:42 +0000)]
tsan: fix lint warning and make output tests more robust

llvm-svn: 169511

11 years agoSema: Don't emit a warning when __func__ is used in a lambda outside of a function.
Benjamin Kramer [Thu, 6 Dec 2012 15:42:21 +0000 (15:42 +0000)]
Sema: Don't emit a warning when __func__ is used in a lambda outside of a function.

Fixes PR14518.

llvm-svn: 169510

11 years agotest/Driver/hexagon-toolchain.c: Unbreak XPASS. Cygwin can be treated as unix-like...
NAKAMURA Takumi [Thu, 6 Dec 2012 14:42:56 +0000 (14:42 +0000)]
test/Driver/hexagon-toolchain.c: Unbreak XPASS. Cygwin can be treated as unix-like system.

llvm-svn: 169509

11 years agoImplements multiple parents in the parent map.
Manuel Klimek [Thu, 6 Dec 2012 14:42:48 +0000 (14:42 +0000)]
Implements multiple parents in the parent map.

Previously we would match the last visited parent, which in the
case of template instantiations was the last instantiated template.

llvm-svn: 169508

11 years ago[asan/msan] one more test for 32-bit allocator + minor code simplification
Kostya Serebryany [Thu, 6 Dec 2012 14:39:41 +0000 (14:39 +0000)]
[asan/msan] one more test for 32-bit allocator + minor code simplification

llvm-svn: 169507

11 years ago[asan/msan] add BulkAllocate to the 32-bit allocator (and a test)
Kostya Serebryany [Thu, 6 Dec 2012 14:27:32 +0000 (14:27 +0000)]
[asan/msan] add BulkAllocate to the 32-bit allocator (and a test)

llvm-svn: 169506

11 years agoHexagon TC: Move getHexagonTargetCPU from Tools.cpp to
Matthew Curtis [Thu, 6 Dec 2012 14:16:43 +0000 (14:16 +0000)]
Hexagon TC: Move getHexagonTargetCPU from Tools.cpp to
 ToolChains.cpp

This is in anticipation of forthcoming library path changes.

Also ...
- Fixes some inconsistencies in how the arch is passed to tools.
- Add test cases for various forms of arch flags

llvm-svn: 169505

11 years agoMemorySanitizer.cpp: Suppress a warning. [-Wunused-variable]
NAKAMURA Takumi [Thu, 6 Dec 2012 13:38:00 +0000 (13:38 +0000)]
MemorySanitizer.cpp: Suppress a warning. [-Wunused-variable]

llvm-svn: 169504

11 years ago[asan/msan] refactor allocator's BulkAllocate (move to AllocatorFreeList)
Kostya Serebryany [Thu, 6 Dec 2012 13:34:11 +0000 (13:34 +0000)]
[asan/msan] refactor allocator's BulkAllocate (move to AllocatorFreeList)

llvm-svn: 169503

11 years agotsan: add new file to cmake
Dmitry Vyukov [Thu, 6 Dec 2012 13:32:49 +0000 (13:32 +0000)]
tsan: add new file to cmake

llvm-svn: 169502

11 years agotsan: add some more functions for java filtering
Dmitry Vyukov [Thu, 6 Dec 2012 13:20:37 +0000 (13:20 +0000)]
tsan: add some more functions for java filtering

llvm-svn: 169501

11 years agoImprove clang-format's handling of unary operators.
Daniel Jasper [Thu, 6 Dec 2012 13:16:39 +0000 (13:16 +0000)]
Improve clang-format's handling of unary operators.

llvm-svn: 169500

11 years ago[asan/msan] add GetBlockBegin to the 32-bit allocator (+test)
Kostya Serebryany [Thu, 6 Dec 2012 13:13:58 +0000 (13:13 +0000)]
[asan/msan] add GetBlockBegin to the 32-bit allocator (+test)

llvm-svn: 169499

11 years agoDisable hexagon toolchain test on windows targets
Matthew Curtis [Thu, 6 Dec 2012 13:06:19 +0000 (13:06 +0000)]
Disable hexagon toolchain test on windows targets

llvm-svn: 169498

11 years ago[asan/msan] one more test for 32-bit allocator
Kostya Serebryany [Thu, 6 Dec 2012 13:00:11 +0000 (13:00 +0000)]
[asan/msan] one more test for 32-bit allocator

llvm-svn: 169497

11 years ago[asan/msan] new 32-bit allocator, basic functionality so far
Kostya Serebryany [Thu, 6 Dec 2012 12:49:28 +0000 (12:49 +0000)]
[asan/msan] new 32-bit allocator, basic functionality so far

llvm-svn: 169496

11 years agoHexagon TC: Update toolchain to add appropriate include
Matthew Curtis [Thu, 6 Dec 2012 12:43:18 +0000 (12:43 +0000)]
Hexagon TC: Update toolchain to add appropriate include
 paths

- Inherit from Linux rather than ToolChain
- Override AddClangSystemIncludeArgs and AddClangCXXStdlibIncludeArgs
  to properly set include paths.

llvm-svn: 169495

11 years agotsan: add 'free' to java nonsense reports
Dmitry Vyukov [Thu, 6 Dec 2012 12:42:53 +0000 (12:42 +0000)]
tsan: add 'free' to java nonsense reports

llvm-svn: 169494

11 years agotsan: add mutexsets to reports
Dmitry Vyukov [Thu, 6 Dec 2012 12:16:15 +0000 (12:16 +0000)]
tsan: add mutexsets to reports
With this change reports say what mutexes the threads hold around the racy memory accesses.

llvm-svn: 169493

11 years agoclang/test/CodeGen/2008-01-07-UnusualIntSize.c: Add triple x86_64. It doesn't assume...
NAKAMURA Takumi [Thu, 6 Dec 2012 12:05:25 +0000 (12:05 +0000)]
clang/test/CodeGen/2008-01-07-UnusualIntSize.c: Add triple x86_64. It doesn't assume 32-bit target, for now.

llvm-svn: 169492

11 years ago[msan] Fix a typo in a comment.
Evgeniy Stepanov [Thu, 6 Dec 2012 11:58:59 +0000 (11:58 +0000)]
[msan] Fix a typo in a comment.

llvm-svn: 169491

11 years ago[msan] Do not store origin for clean values.
Evgeniy Stepanov [Thu, 6 Dec 2012 11:41:03 +0000 (11:41 +0000)]
[msan] Do not store origin for clean values.

Instead of unconditionally storing origin with every application store,
only do this when the shadow of the stored value is != 0.

This change also delays instrumentation of stores until after the walk over
function's instructions, because adding new basic blocks confuses InstVisitor.

We only keep 1 origin value per 4 bytes of application memory. This change
fixes the bug when a store of a single clean byte wiped the origin for the
whole 4-byte area.

Since stores of uninitialized values are relatively uncommon, this change
improves performance of track-origins mode by 5% median and by up to 47% on
specs.

llvm-svn: 169490

11 years agoRework the bitfield access IR generation to address PR13619 and
Chandler Carruth [Thu, 6 Dec 2012 11:14:44 +0000 (11:14 +0000)]
Rework the bitfield access IR generation to address PR13619 and
generally support the C++11 memory model requirements for bitfield
accesses by relying more heavily on LLVM's memory model.

The primary change this introduces is to move from a manually aligned
and strided access pattern across the bits of the bitfield to a much
simpler lump access of all bits in the bitfield followed by math to
extract the bits relevant for the particular field.

This simplifies the code significantly, but relies on LLVM to
intelligently lowering these integers.

I have tested LLVM's lowering both synthetically and in benchmarks. The
lowering appears to be functional, and there are no really significant
performance regressions. Different code patterns accessing bitfields
will vary in how this impacts them. The only real regressions I'm seeing
are a few patterns where the LLVM code generation for loads that feed
directly into a mask operation don't take advantage of the x86 ability
to do a smaller load and a cheap zero-extension. This doesn't regress
any benchmark in the nightly test suite on my box past the noise
threshold, but my box is quite noisy. I'll be watching the LNT numbers,
and will look into further improvements to the LLVM lowering as needed.

llvm-svn: 169489

11 years ago"<<" alignment for clang-format.
Daniel Jasper [Thu, 6 Dec 2012 09:56:08 +0000 (09:56 +0000)]
"<<" alignment for clang-format.

Also, small fix for handling the first token correctly.

Review: http://llvm-reviews.chandlerc.com/D177
llvm-svn: 169488

11 years agoIntegrate polly test-suite into an llvm "make check-all" if built as part of the...
Andy Gibbs [Thu, 6 Dec 2012 07:59:18 +0000 (07:59 +0000)]
Integrate polly test-suite into an llvm "make check-all" if built as part of the whole using cmake.

llvm-svn: 169487

11 years agos/getLowerBoundDefault/getDefaultLowerBound/ for consistency. Also put the more natur...
Bill Wendling [Thu, 6 Dec 2012 07:55:19 +0000 (07:55 +0000)]
s/getLowerBoundDefault/getDefaultLowerBound/ for consistency. Also put the more natural check first in the if-then statement.

llvm-svn: 169486

11 years agoRemove unused variable.
Bill Wendling [Thu, 6 Dec 2012 07:43:17 +0000 (07:43 +0000)]
Remove unused variable.

llvm-svn: 169485

11 years agoHandle non-default array bounds.
Bill Wendling [Thu, 6 Dec 2012 07:38:10 +0000 (07:38 +0000)]
Handle non-default array bounds.

Some languages, e.g. Ada and Pascal, allow you to specify that the array bounds
are different from the default (1 in these cases). If we have a lower bound
that's non-default, then we emit the lower bound. We also calculate the correct
upper bound in those cases.

llvm-svn: 169484

11 years agoRemove intrinsic specific instructions for (V)MOVQUmr with patterns pointing to the...
Craig Topper [Thu, 6 Dec 2012 07:31:16 +0000 (07:31 +0000)]
Remove intrinsic specific instructions for (V)MOVQUmr with patterns pointing to the normal instructions.

llvm-svn: 169482

11 years agoUse the BlockDecl captures list to infer the direct captures for a BlockDataRegion...
Ted Kremenek [Thu, 6 Dec 2012 07:17:26 +0000 (07:17 +0000)]
Use the BlockDecl captures list to infer the direct captures for a BlockDataRegion.  Fixes <rdar://problem/12415065>.

We still need to do a recursive walk to determine all static/global variables
referenced by a block, which is needed for region invalidation.

llvm-svn: 169481

11 years agoOnly provide explicit getCapturedRegion() and getOriginalRegion() from referenced_var...
Ted Kremenek [Thu, 6 Dec 2012 07:17:20 +0000 (07:17 +0000)]
Only provide explicit getCapturedRegion() and getOriginalRegion() from referenced_vars_iterator.

This is a nice conceptual cleanup.

llvm-svn: 169480

11 years agoPull logic to map from VarDecl* to captured region using a helper function. WIP.
Ted Kremenek [Thu, 6 Dec 2012 07:17:13 +0000 (07:17 +0000)]
Pull logic to map from VarDecl* to captured region using a helper function.  WIP.

llvm-svn: 169479

11 years agoUse 'getOriginalRegion()' rather than going through the logic to recreate it.
Ted Kremenek [Thu, 6 Dec 2012 07:17:04 +0000 (07:17 +0000)]
Use 'getOriginalRegion()' rather than going through the logic to recreate it.

llvm-svn: 169478

11 years agoMark MOVDQ(A/U)rm as ReMaterializable. Mark all MOVDQ(A/U) instructions as neverHasSi...
Craig Topper [Thu, 6 Dec 2012 06:49:16 +0000 (06:49 +0000)]
Mark MOVDQ(A/U)rm as ReMaterializable. Mark all MOVDQ(A/U) instructions as neverHasSideEffects.

llvm-svn: 169477

11 years agoFix http://stackoverflow.com/questions/13521163
Richard Smith [Thu, 6 Dec 2012 06:44:44 +0000 (06:44 +0000)]
Fix http://stackoverflow.com/questions/13521163

Don't require that, during template deduction, a template specialization type
as a function parameter has at least as many template arguments as one used in
a function argument (not even if the argument has been resolved to an exact
type); the additional parameters might be provided by default template
arguments in the template. We don't need this check, since we now implement
[temp.deduct.call]p4 with an additional check after deduction.

llvm-svn: 169475

11 years ago[tsan] add MmapAlignedOrDie
Kostya Serebryany [Thu, 6 Dec 2012 06:10:31 +0000 (06:10 +0000)]
[tsan] add MmapAlignedOrDie

llvm-svn: 169474

11 years agoDon't use dyn_cast on a Type* which might not be canonical. Fixes an extremely obscur...
Richard Smith [Thu, 6 Dec 2012 03:04:50 +0000 (03:04 +0000)]
Don't use dyn_cast on a Type* which might not be canonical. Fixes an extremely obscure record layout bug.

llvm-svn: 169467

11 years agoFix ABIMacOSX_i386::RegisterIsVolatile to return the negated value of
Jason Molenda [Thu, 6 Dec 2012 02:49:20 +0000 (02:49 +0000)]
Fix ABIMacOSX_i386::RegisterIsVolatile to return the negated value of
RegisterIsCalleeSaved.  Add ebp back to the list of registers that
are callee saved.
<rdar://problem/12817918>

llvm-svn: 169466

11 years ago<rdar://problem/12560257>
Greg Clayton [Thu, 6 Dec 2012 02:33:54 +0000 (02:33 +0000)]
<rdar://problem/12560257>

Fixed zero sized arrays to work correctly. This will only happen once we get a clang that emits correct debug info for zero sized arrays. For now I have marked the TestStructTypes.py as an expected failure.

llvm-svn: 169465

11 years agoProperly fix the tes.
Evan Cheng [Thu, 6 Dec 2012 02:29:29 +0000 (02:29 +0000)]
Properly fix the tes.

llvm-svn: 169464

11 years agollvm/test/CodeGen/ARM/extload-knownzero.ll: Try to unbreak, to add -O0. I guess Chad...
NAKAMURA Takumi [Thu, 6 Dec 2012 02:22:58 +0000 (02:22 +0000)]
llvm/test/CodeGen/ARM/extload-knownzero.ll: Try to unbreak, to add -O0. I guess Chad expects fastisel here.

llvm-svn: 169463

11 years agoRevert r169456, "change MCContext to work on the doInitialization/doFinalization...
NAKAMURA Takumi [Thu, 6 Dec 2012 02:00:13 +0000 (02:00 +0000)]
Revert r169456, "change MCContext to work on the doInitialization/doFinalization model"

It broke many builders.

llvm-svn: 169462

11 years agoThe expression parser will now check the validity
Sean Callanan [Thu, 6 Dec 2012 01:35:38 +0000 (01:35 +0000)]
The expression parser will now check the validity
of the "self"/"this" pointer for the current stack
frame before wrapping expressions in C++ or
Objective-C methods.  This works around bad debug
info where the compiler emits a "this" or "self"
but doesn't give any way to find its location.

<rdar://problem/12809985>

llvm-svn: 169461

11 years ago[arm fast-isel] Make the fast-isel implementation of memcpy respect alignment.
Chad Rosier [Thu, 6 Dec 2012 01:34:31 +0000 (01:34 +0000)]
[arm fast-isel] Make the fast-isel implementation of memcpy respect alignment.
rdar://12821569

llvm-svn: 169460

11 years agoLet targets provide hooks that compute known zero and ones for any_extend
Evan Cheng [Thu, 6 Dec 2012 01:28:01 +0000 (01:28 +0000)]
Let targets provide hooks that compute known zero and ones for any_extend
and extload's. If they are implemented as zero-extend, or implicitly
zero-extend, then this can enable more demanded bits optimizations. e.g.

define void @foo(i16* %ptr, i32 %a) nounwind {
entry:
  %tmp1 = icmp ult i32 %a, 100
  br i1 %tmp1, label %bb1, label %bb2
bb1:
  %tmp2 = load i16* %ptr, align 2
  br label %bb2
bb2:
  %tmp3 = phi i16 [ 0, %entry ], [ %tmp2, %bb1 ]
  %cmp = icmp ult i16 %tmp3, 24
  br i1 %cmp, label %bb3, label %exit
bb3:
  call void @bar() nounwind
  br label %exit
exit:
  ret void
}

This compiles to the followings before:
        push    {lr}
        mov     r2, #0
        cmp     r1, #99
        bhi     LBB0_2
@ BB#1:                                 @ %bb1
        ldrh    r2, [r0]
LBB0_2:                                 @ %bb2
        uxth    r0, r2
        cmp     r0, #23
        bhi     LBB0_4
@ BB#3:                                 @ %bb3
        bl      _bar
LBB0_4:                                 @ %exit
        pop     {lr}
        bx      lr

The uxth is not needed since ldrh implicitly zero-extend the high bits. With
this change it's eliminated.

rdar://12771555

llvm-svn: 169459

11 years agoDisable clang/test/Preprocessor/macro-multiline.c for now, while investigating lit...
NAKAMURA Takumi [Thu, 6 Dec 2012 01:09:31 +0000 (01:09 +0000)]
Disable clang/test/Preprocessor/macro-multiline.c for now, while investigating lit.ShUtil.parser.

llvm-svn: 169458

11 years agomore test of template declarations in a
Fariborz Jahanian [Thu, 6 Dec 2012 00:57:28 +0000 (00:57 +0000)]
more test of template declarations in a
<declaration> XML tag. // rdar://12378714

llvm-svn: 169457

11 years agochange MCContext to work on the doInitialization/doFinalization model
Pedro Artigas [Thu, 6 Dec 2012 00:50:55 +0000 (00:50 +0000)]
change MCContext to work on the doInitialization/doFinalization model

reviewed by Evan Cheng <evan.cheng@apple.com>

llvm-svn: 169456