platform/upstream/llvm.git
9 years agoAdd flag --enable-check-profile to clang-tidy.
Samuel Benzaquen [Thu, 23 Oct 2014 17:23:20 +0000 (17:23 +0000)]
Add flag --enable-check-profile to clang-tidy.

Summary:
Add flag --enable-check-profile to clang-tidy.
It turns on per-matcher profiles in MatchFinder and prints a report to
stderr at the end.

Reviewers: alexfh

Subscribers: curdeius, cfe-commits

Differential Revision: http://reviews.llvm.org/D5937

llvm-svn: 220491

9 years agoAdding llvm-shlib to CMake build system with a few new bells and whistles
Chris Bieneman [Thu, 23 Oct 2014 17:22:14 +0000 (17:22 +0000)]
Adding llvm-shlib to CMake build system with a few new bells and whistles

Summary:
This patch adds a new CMake build setting LLVM_BUILD_LLVM_DYLIB, which defaults to OFF. When set to ON, this will generate a shared library containing most of LLVM. The contents of the shared library can be overriden by specifying LLVM_DYLIB_COMPONENTS. LLVM_DYLIB_COMPONENTS can be set to a semi-colon delimited list of any LLVM components that you llvm-config can resolve.

On Windows, unless you are using Cygwin, you must specify an explicit symbol export file using LLVM_EXPORTED_SYMBOL_FILE. On Cygwin and all unix-like platforms if you do not specify LLVM_EXPORTED_SYMBOL_FILE, an export file containing only the LLVM C API will be auto-generated from the list of LLVM components specified in LLVM_DYLIB_COMPONENTS.

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, llvm-commits

Differential Revision: http://reviews.llvm.org/D5890

llvm-svn: 220490

9 years agoMake headers available in the build directory
Justin Bogner [Thu, 23 Oct 2014 16:51:12 +0000 (16:51 +0000)]
Make headers available in the build directory

This essentially re-does r194825 and makes it possible to run clang
with libc++ without having to install it, even if you don't have any
version of libc++ installed in /usr/.

This behaviour broke in r210577/r211629, which fixed pr18681.

llvm-svn: 220489

9 years agoDebugInfo: Correctly describe the lexical decl context of static member variable...
David Blaikie [Thu, 23 Oct 2014 16:39:49 +0000 (16:39 +0000)]
DebugInfo: Correctly describe the lexical decl context of static member variable definitions.

The previous IR representation used the non-lexical decl context, which
placed the definitions in the same scope as the declarations (ie: within
the class) - this was hidden by the fact that LLVM currently doesn't
respect the context of global variable definitions at all, and always
puts them at the top level (as direct children of the compile_unit).
Having the correct lexical scope improves source fidelity and simplify
backend global variable emission (with changes coming shortly).

Doing something similar for non-member global variables would help
simplify/cleanup things further (see FIXME in the commit) and provide
similar source fidelity benefits to the final debug info.

llvm-svn: 220488

9 years agoRemove explicit (void) use of DwarfFile::DD that was accidentally left in r220452.
David Blaikie [Thu, 23 Oct 2014 16:12:58 +0000 (16:12 +0000)]
Remove explicit (void) use of DwarfFile::DD that was accidentally left in r220452.

Caught in post-commit review by Frédéric.

llvm-svn: 220487

9 years agoDo not emit intermediate register for zero FP immediate
Renato Golin [Thu, 23 Oct 2014 15:31:50 +0000 (15:31 +0000)]
Do not emit intermediate register for zero FP immediate

This updates check for double precision zero floating point constant to allow
use of instruction with immediate value rather than temporary register.
Currently "a == 0.0", where "a" is of "double" type generates:

vmov.i32        d16, #0x0
vcmpe.f64       d0, d16

With this change it becomes:

vcmpe.f64        d0, #0

Patch by Sergey Dmitrouk.

llvm-svn: 220486

9 years agoDisable dsym tests on !Darwin hosts
Ed Maste [Thu, 23 Oct 2014 15:21:45 +0000 (15:21 +0000)]
Disable dsym tests on !Darwin hosts

This was missing from r219984

llvm.org/pr21324

llvm-svn: 220485

9 years agoclang-format two code snippets to make the next patch easy to read.
Rafael Espindola [Thu, 23 Oct 2014 15:20:05 +0000 (15:20 +0000)]
clang-format two code snippets to make the next patch easy to read.

llvm-svn: 220484

9 years agoAdd unittest for extreme alignments.
Rafael Espindola [Thu, 23 Oct 2014 14:45:19 +0000 (14:45 +0000)]
Add unittest for extreme alignments.

llvm-svn: 220483

9 years agoHexagon/Disassembler/LLVMBuild.txt: Update libdeps.
NAKAMURA Takumi [Thu, 23 Oct 2014 11:32:16 +0000 (11:32 +0000)]
Hexagon/Disassembler/LLVMBuild.txt: Update libdeps.

llvm-svn: 220482

9 years agoHexagon/LLVMBuild.txt: Prune CRLF.
NAKAMURA Takumi [Thu, 23 Oct 2014 11:32:03 +0000 (11:32 +0000)]
Hexagon/LLVMBuild.txt: Prune CRLF.

llvm-svn: 220481

9 years ago[CMake] Prune CRLF in CMakeLists.txt(s).
NAKAMURA Takumi [Thu, 23 Oct 2014 11:31:50 +0000 (11:31 +0000)]
[CMake] Prune CRLF in CMakeLists.txt(s).

llvm-svn: 220480

9 years ago[CMake] Prune trailing whitespace.
NAKAMURA Takumi [Thu, 23 Oct 2014 11:31:33 +0000 (11:31 +0000)]
[CMake] Prune trailing whitespace.

llvm-svn: 220479

9 years agoRevert r220427, "[Hexagon] Adding encoding bits for add opcode."
NAKAMURA Takumi [Thu, 23 Oct 2014 11:31:22 +0000 (11:31 +0000)]
Revert r220427, "[Hexagon] Adding encoding bits for add opcode."

It brought cyclic dependecy between HexagonAsmPrinter and HexagonDesc.

llvm-svn: 220478

9 years ago[mips][microMIPS] Implement ADDIUR1SP instruction
Zoran Jovanovic [Thu, 23 Oct 2014 11:13:59 +0000 (11:13 +0000)]
[mips][microMIPS] Implement ADDIUR1SP instruction
Differential Revision: http://reviews.llvm.org/D5153

llvm-svn: 220477

9 years agops][microMIPS] Implement ADDIUR2 instruction
Zoran Jovanovic [Thu, 23 Oct 2014 11:06:34 +0000 (11:06 +0000)]
ps][microMIPS] Implement ADDIUR2 instruction
Differential Revision: http://reviews.llvm.org/D5151

llvm-svn: 220476

9 years agops][microMIPS] Implement LI16 instruction
Zoran Jovanovic [Thu, 23 Oct 2014 10:59:24 +0000 (10:59 +0000)]
ps][microMIPS] Implement LI16 instruction
Differential Revision: http://reviews.llvm.org/D5149

llvm-svn: 220475

9 years ago[mips][microMIPS] Implement CodeGen support for SLL16 and SRL16 instructions
Zoran Jovanovic [Thu, 23 Oct 2014 10:42:01 +0000 (10:42 +0000)]
[mips][microMIPS] Implement CodeGen support for SLL16 and SRL16 instructions
Differential Revision: http://reviews.llvm.org/D5774

llvm-svn: 220474

9 years agoFix code where goto jumped over local variable initialization.
Hafiz Abid Qadeer [Thu, 23 Oct 2014 10:36:53 +0000 (10:36 +0000)]
Fix code where goto jumped over local variable initialization.

llvm-svn: 220473

9 years ago[Thumb2] Improve disassembly of memory hints
Oliver Stannard [Thu, 23 Oct 2014 08:52:58 +0000 (08:52 +0000)]
[Thumb2] Improve disassembly of memory hints

Currently, the ARM disassembler will disassemble the Thumb2 memory hint
instructions (PLD, PLDW and PLI), even for targets which do not have
these instructions. This patch adds the required checks to the
disassmebler.

llvm-svn: 220472

9 years agoAdd support for "fancy" pointers to promise and packaged_task.
Eric Fiselier [Thu, 23 Oct 2014 06:24:45 +0000 (06:24 +0000)]
Add support for "fancy" pointers to promise and packaged_task.

Summary:
This patch is very closely related to D4859. Please see http://reviews.llvm.org/D4859 for more information.

This patch adds support for "fancy" pointers and allocators to promise and packaged_task. The changes made to support this are exactly the same as in D4859.

Test Plan: "fancy" pointer tests were added to each constructor affected by the change.

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4862

llvm-svn: 220471

9 years ago[ARM, stack protector] If supported, use armv7 instructions.
Akira Hatanaka [Thu, 23 Oct 2014 04:17:05 +0000 (04:17 +0000)]
[ARM, stack protector] If supported, use armv7 instructions.

This commit enables using movt/movw to load the stack guard address:

movw r0, :lower16:(L_g3$non_lazy_ptr-(LPC0_0+8))
movt r0, :upper16:(L_g3$non_lazy_ptr-(LPC0_0+8))
ldr r0, [pc, r0]

Previously a pc-relative load was emitted:

ldr r0, LCPI0_0
ldr r0, [pc, r0]

rdar://problem/18740489

llvm-svn: 220470

9 years agoAdd support for "fancy" pointers to shared_ptr. Fixes PR20616
Eric Fiselier [Thu, 23 Oct 2014 04:12:28 +0000 (04:12 +0000)]
Add support for "fancy" pointers to shared_ptr. Fixes PR20616

Summary:
This patch add support for "fancy pointers/allocators" as well as fixing support for shared_pointer and "minimal" allocators.

Fancy pointers are class types that meet the NullablePointer requirements. In our case they are created by fancy allocators. `support/min_allocator.h` is an archetype for these types.

There are three types of changes made in this patch:
1. `_Alloc::template rebind<T>::other` -> `__allocator_traits_rebind<_Alloc, T>::type`. This change was made because allocators don't need a rebind template. `__allocator_traits_rebind` is used instead of `allocator_traits::rebind` because use of `allocator_traits::rebind` requires a workaround for when template aliases are unavailable.
2. `a.deallocate(this, 1)` -> `a.deallocate(pointer_traits<self>::pointer_to(*this), 1)`. This change change is made because fancy pointers aren't always constructible from raw pointers.
3. `p.get()` -> `addressof(*p.get())`. Fancy pointers aren't actually a pointer. When we need a "real" pointer we take the address of dereferencing the fancy pointer. This should give us the actual raw pointer.

Test Plan: Tests were added using `support/min_allocator.h` to each affected shared_ptr overload and creation function. These tests can only be executed in C++11 or greater since min_allocator is only available then. A extra test was added for the non-variadic versions of allocate_shared.

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4859

llvm-svn: 220469

9 years agoAssert that ValueHandleBase::ValueIsRAUWd doesn't change the tracked Value type.
Frederic Riss [Thu, 23 Oct 2014 04:08:42 +0000 (04:08 +0000)]
Assert that ValueHandleBase::ValueIsRAUWd doesn't change the tracked Value type.

This invariant is enforced in Value::replaceAllUsesWith, thus it seems
logical to apply it also to ValueHandles. This commit fixes InstCombine
to not trigger the assertion during the removal of constant bitcasts in
call instructions.

Differential Revision: http://reviews.llvm.org/D5828

llvm-svn: 220468

9 years agoModernize doxygen comments in Support/Dwarf.h
Frederic Riss [Thu, 23 Oct 2014 04:08:38 +0000 (04:08 +0000)]
Modernize doxygen comments in Support/Dwarf.h

In post-commit review of r219442, Rafael pointed out that the comment style
of the newly introduced helper didn't follow LLVM's coding standard.
Modernize the whole file to the new standards.

Differential Revision: http://reviews.llvm.org/D5918

llvm-svn: 220467

9 years ago[dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump.
Frederic Riss [Thu, 23 Oct 2014 04:08:34 +0000 (04:08 +0000)]
[dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump.

The output looks like that:
                      DW_AT_ranges [FORM_data4]    (0x00000000
                         [0x00000001000024a0 - 0x00000001000024c2)
                         [0x0000000100002505 - 0x000000010000268b))

Differential Revision: http://reviews.llvm.org/D5712

llvm-svn: 220466

9 years agoFix a couple of failing tests for C++03 by checking for rvalue reference support...
Marshall Clow [Thu, 23 Oct 2014 03:57:52 +0000 (03:57 +0000)]
Fix a couple of failing tests for C++03 by checking for rvalue reference support first.

llvm-svn: 220465

9 years ago[libcxxabi] Add support for running libc++abi tests with sanitizers
Eric Fiselier [Thu, 23 Oct 2014 03:10:43 +0000 (03:10 +0000)]
[libcxxabi] Add support for running libc++abi tests with sanitizers

Summary: Add support for LLVM_USE_SANITIZER to the libc++abi tests. Currently, if libc++abi is configured with LLVM_USE_SANITIZER then none of the tests will pass.

Reviewers: jroelofs, mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5926

llvm-svn: 220464

9 years agoAdd -ldl to libc++ tests when sanitizers are used.
Eric Fiselier [Thu, 23 Oct 2014 02:54:15 +0000 (02:54 +0000)]
Add -ldl to libc++ tests when sanitizers are used.

Clang 3.6 no longer links the sanitizer runtime library dependancies when
-nodefaultlibs is used. This patch manually links in a missing dependancy.

llvm-svn: 220463

9 years agoAdd llvm-go tool.
Peter Collingbourne [Thu, 23 Oct 2014 02:33:23 +0000 (02:33 +0000)]
Add llvm-go tool.

This tool lets us build LLVM components within the tree by setting up a
$GOPATH that resembles a tree fetched in the normal way with "go get".

It is intended that components such as the Go frontend will be built in-tree
using this tool.

Differential Revision: http://reviews.llvm.org/D5902

llvm-svn: 220462

9 years agoRevert accidentally-committed files in r220460.
Richard Smith [Thu, 23 Oct 2014 02:02:31 +0000 (02:02 +0000)]
Revert accidentally-committed files in r220460.

llvm-svn: 220461

9 years agoRefactor implementation of 'exclude header'.
Richard Smith [Thu, 23 Oct 2014 02:01:19 +0000 (02:01 +0000)]
Refactor implementation of 'exclude header'.

This was not a real header role, and was never exposed to clients of ModuleMap.
Remove the enumeration value for it and track it as marking the header as
'known' rather than creating an extra KnownHeader entry that *every single*
client ignores.

llvm-svn: 220460

9 years ago[msan] Emit checks for constant shadow values under an experimental flag.
Evgeniy Stepanov [Thu, 23 Oct 2014 01:05:46 +0000 (01:05 +0000)]
[msan] Emit checks for constant shadow values under an experimental flag.

Does not change the default behavior.

llvm-svn: 220457

9 years agoFix covered-switch warning.
Richard Smith [Thu, 23 Oct 2014 01:03:45 +0000 (01:03 +0000)]
Fix covered-switch warning.

llvm-svn: 220456

9 years agoRevert r218541 - Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is...
Alexey Samsonov [Thu, 23 Oct 2014 00:46:10 +0000 (00:46 +0000)]
Revert r218541 - Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.

This is a sad thing to do, but all the alternatives look ugly.

Looks like there are legitimate cases when users may want to link
with sanitizer runtimes *and* -nodefaultlibs (and ensure they provide
replacements for system libraries). For example, this happens in libc++
test suite.

"-nodefaultlibs" is told to link only the libraries explicitly provided
by the user, and providing "-fsanitize=address" is a clear indication of
intention to link with ASan runtime.
We can't easily introduce analogue of "-print-libgcc-name": linking with
sanitizers runtimes is not trivial: some runtimes are split into several
archive libraries, which are required to be wrapped in
-whole-archive/-no-whole-archive.

If "-fsanitize=whatever" and "-nodefaultlibs" are provided, system library
dependencies of sanitizer runtimes (-lc/-ldl/-lpthread/-lrt) will *not* be
linked, and user would have to link them in manually. Note that this can
cause problems, as failing to provide "-lrt" might lead to crashes in runtime
during ASan initialization. But looks like we should bite this bullet.

See r218541 review thread for the discussion.

llvm-svn: 220455

9 years ago[DebugInfo] Sink DwarfDebug::addCurrentFnArgument down into DwarfFile.
David Blaikie [Thu, 23 Oct 2014 00:16:05 +0000 (00:16 +0000)]
[DebugInfo] Sink DwarfDebug::addCurrentFnArgument down into DwarfFile.

Variable handling will be sunk into DwarfFile so that abstract variables
and the like can be shared across multiple CUs (to handle cross-CU
inlining, for example).

llvm-svn: 220453

9 years ago[DebugInfo] Add DwarfDebug& to DwarfFile.
David Blaikie [Thu, 23 Oct 2014 00:16:03 +0000 (00:16 +0000)]
[DebugInfo] Add DwarfDebug& to DwarfFile.

Use the DwarfDebug in one function that previously took it as a
parameter, and lay the foundation for use this for other operations
coming soon.

llvm-svn: 220452

9 years ago[DebugInfo] Remove LexicalScopes::isCurrentFunctionScope and CSE a use of LexicalScop...
David Blaikie [Thu, 23 Oct 2014 00:06:27 +0000 (00:06 +0000)]
[DebugInfo] Remove LexicalScopes::isCurrentFunctionScope and CSE a use of LexicalScopes::getCurrentFunctionScope

Now that we're sure the only root (non-abstract) scope is the current
function scope, there's no need for isCurrentFunctionScope, the property
can be tested directly instead.

llvm-svn: 220451

9 years agoUpdate the documentation for API change to CreateASTConsumer the rest of the way.
Nick Lewycky [Wed, 22 Oct 2014 23:57:14 +0000 (23:57 +0000)]
Update the documentation for API change to CreateASTConsumer the rest of the way.

llvm-svn: 220450

9 years agoTest files I forgot to svn add in r220448.
Richard Smith [Wed, 22 Oct 2014 23:52:04 +0000 (23:52 +0000)]
Test files I forgot to svn add in r220448.

llvm-svn: 220449

9 years ago[modules] Add support for 'textual header' directives.
Richard Smith [Wed, 22 Oct 2014 23:50:56 +0000 (23:50 +0000)]
[modules] Add support for 'textual header' directives.

This allows a module to specify that it logically contains a file, but that
said file is non-modular and intended for textual inclusion. This allows
layering checks to work properly in the presence of such files.

llvm-svn: 220448

9 years agoFix Mips nacl-mask test for new bundle-aligned label behavior
Derek Schuff [Wed, 22 Oct 2014 23:32:00 +0000 (23:32 +0000)]
Fix Mips nacl-mask test for new bundle-aligned label behavior

After r220439 the behavior of labels in bundle-align mode changed,
and I neglected to update this test.

llvm-svn: 220447

9 years agoFix typo
Tobias Grosser [Wed, 22 Oct 2014 23:26:48 +0000 (23:26 +0000)]
Fix typo

llvm-svn: 220446

9 years agoRemove incorrect value description for -enable-polly-aligned
Tobias Grosser [Wed, 22 Oct 2014 23:22:41 +0000 (23:22 +0000)]
Remove incorrect value description for -enable-polly-aligned

The description of the parameter value passed to -enable-polly-aligned did
not make any sense at all, but was just a leftover coming from when this option
was copied form -enable-polly-openmp. We just drop it as the option description
gives sufficient information already.

llvm-svn: 220445

9 years ago[MCJIT] Make repeat calls to MCJIT::getPointerToFunction for declarations safe.
Lang Hames [Wed, 22 Oct 2014 23:18:42 +0000 (23:18 +0000)]
[MCJIT] Make repeat calls to MCJIT::getPointerToFunction for declarations safe.

MCJIT::getPointerForFunction adds the resulting address to the global mapping.
This should be done via updateGlobalMapping rather than addGlobalMapping, since
the latter asserts if a mapping already exists.

MCJIT::getPointerToFunction is actually deprecated - hopefully we can remove it
(or more likely re-task it) entirely soon. In the mean time it should at least
work as advertised.

<rdar://problem/18727946>

llvm-svn: 220444

9 years agoUse stringFromIslObj instead of isl_..._dump to print to dbgs()
Tobias Grosser [Wed, 22 Oct 2014 23:16:28 +0000 (23:16 +0000)]
Use stringFromIslObj instead of isl_..._dump to print to dbgs()

This makes sure we consistently use dbgs() when printing debug output.
Previously, the code just mixed calls to isl_*_dump() with printing to dbgs()
and was relying for both methods to interact in predictable ways (same output
stream, no unexpected reordering of outputs).

llvm-svn: 220443

9 years agoBasic: Add ext_delete_void_ptr_operand to -Wdelete-incomplete
David Majnemer [Wed, 22 Oct 2014 23:03:58 +0000 (23:03 +0000)]
Basic: Add ext_delete_void_ptr_operand to -Wdelete-incomplete

This fixes PR21340.

llvm-svn: 220442

9 years agoUse braces in multi-statement DEBUG() code [NFC]
Tobias Grosser [Wed, 22 Oct 2014 23:00:03 +0000 (23:00 +0000)]
Use braces in multi-statement DEBUG() code [NFC]

By adding braces into the DEBUG statement we can make clang-format format code
such as:

  DEBUG(stmt1(); stmt2())

as multi-line code:

  DEBUG({
    stmt1();
    stmt2();
  });

This makes control-flow in debug statements easier to read.

llvm-svn: 220441

9 years agoAttempt to fix the build after r220439
David Majnemer [Wed, 22 Oct 2014 22:46:05 +0000 (22:46 +0000)]
Attempt to fix the build after r220439

llvm-svn: 220440

9 years ago[MC] Attach labels to existing fragments instead of using a separate fragment
Derek Schuff [Wed, 22 Oct 2014 22:38:06 +0000 (22:38 +0000)]
[MC] Attach labels to existing fragments instead of using a separate fragment

Summary:
Currently when emitting a label, a new data fragment is created for it if the
current fragment isn't a data fragment.
This change instead enqueues the label and attaches it to the next fragment
(e.g. created for the next instruction) if possible.

When bundle alignment is not enabled, this has no functionality change (it
just results in fewer extra fragments being created). For bundle alignment,
previously labels would point to the beginning of the bundle padding instead
of the beginning of the emitted instruction. This was not only less efficient
(e.g. jumping to the nops instead of past them) but also led to miscalculation
of the address of the GOT (since MC uses a label difference rather than
emitting a "." symbol).

Fixes https://code.google.com/p/nativeclient/issues/detail?id=3982

Test Plan: regression test attached

Reviewers: jvoung, eliben

Subscribers: jfb, llvm-commits

Differential Revision: http://reviews.llvm.org/D5915

llvm-svn: 220439

9 years agoReverting r220435. Jim Ingham and I discussed this for a bit, and we came up with...
Enrico Granata [Wed, 22 Oct 2014 22:33:08 +0000 (22:33 +0000)]
Reverting r220435. Jim Ingham and I discussed this for a bit, and we came up with a better command model for this feature

llvm-svn: 220437

9 years agoAdd a 'type info' command, which can be fed one or more local variables - and it...
Enrico Granata [Wed, 22 Oct 2014 22:04:40 +0000 (22:04 +0000)]
Add a 'type info' command, which can be fed one or more local variables - and it will spew out the list of formatters that apply to each of those variables, if any

llvm-svn: 220435

9 years agoFix C++ compliance issue. string literals must be const char *
Zachary Turner [Wed, 22 Oct 2014 21:48:56 +0000 (21:48 +0000)]
Fix C++ compliance issue.  string literals must be const char *

llvm-svn: 220434

9 years agoMore cleanup of the CXXFormatterFunctions header
Enrico Granata [Wed, 22 Oct 2014 21:47:27 +0000 (21:47 +0000)]
More cleanup of the CXXFormatterFunctions header

llvm-svn: 220433

9 years agoFixed name lookups for names that contain "::" but aren't actually C++ qualified...
Greg Clayton [Wed, 22 Oct 2014 21:47:13 +0000 (21:47 +0000)]
Fixed name lookups for names that contain "::" but aren't actually C++ qualified C++ names.

To do this, I fixed the  CPPLanguageRuntime::StripNamespacesFromVariableName() function to use a regular expression that correctly determines if the name passed to it is a qualfied C++ name like "a::b::c" or "b::c". The old version of this function was treating '__54-[NSUserScriptTask executeWithInterpreter:arguments::]_block_invoke' as a match with a basename of ']_block_invoke'.

Also fixed a case in the by name lookup of functions where we wouldn't look for the full name if we actually tried to call CPPLanguageRuntime::StripNamespacesFromVariableName() and got an empty basename back.

<rdar://problem/18527866>

llvm-svn: 220432

9 years agoRe-use the GetMatchAtIndex() that uses the StringRef to avoid code duplication and...
Greg Clayton [Wed, 22 Oct 2014 21:43:15 +0000 (21:43 +0000)]
Re-use the GetMatchAtIndex() that uses the StringRef to avoid code duplication and properly detect when a capture is invalid and return false.

llvm-svn: 220431

9 years agoFix CMake build broken after r220421.
Zachary Turner [Wed, 22 Oct 2014 21:18:29 +0000 (21:18 +0000)]
Fix CMake build broken after r220421.

llvm-svn: 220430

9 years agoParse: Ignore "long" and "short" in #pragma section
David Majnemer [Wed, 22 Oct 2014 21:08:43 +0000 (21:08 +0000)]
Parse: Ignore "long" and "short" in #pragma section

This fixes PR21337.

llvm-svn: 220429

9 years agoRemoving the setLBracLoc and setRBracLoc functions from CompoundStmt -- their only...
Aaron Ballman [Wed, 22 Oct 2014 21:06:18 +0000 (21:06 +0000)]
Removing the setLBracLoc and setRBracLoc functions from CompoundStmt -- their only use was with the AST reader, and friendship can be used to handle that. Drive-by rename of "Brac" to "Brace" for the private data members. NFC.

llvm-svn: 220428

9 years ago[Hexagon] Adding encoding bits for add opcode.
Colin LeMahieu [Wed, 22 Oct 2014 20:58:35 +0000 (20:58 +0000)]
[Hexagon] Adding encoding bits for add opcode.
Adding llvm-mc tests.
Removing unit tests.

http://reviews.llvm.org/D5624

llvm-svn: 220427

9 years agoFix up attribute documentation links to MSDN in a nicer way
Reid Kleckner [Wed, 22 Oct 2014 20:54:25 +0000 (20:54 +0000)]
Fix up attribute documentation links to MSDN in a nicer way

llvm-svn: 220426

9 years agoMake a good guess about where MSVC and Windows SDK libraries are for linking.
Zachary Turner [Wed, 22 Oct 2014 20:40:43 +0000 (20:40 +0000)]
Make a good guess about where MSVC and Windows SDK libraries are for linking.

When a user has not configured a standard Visual Studio environment
by running vcvarsall, clang tries its best to find Visual Studio
include files and executables anyway.  This patch makes clang also
try to find system and Windows SDK libraries for linking against,
as well.

Reviewed by: Hans Wennborg
Differential Revision: http://reviews.llvm.org/D5873

llvm-svn: 220425

9 years agoResubmit "Improve Windows toolchain support for non-standard environments."
Zachary Turner [Wed, 22 Oct 2014 20:40:28 +0000 (20:40 +0000)]
Resubmit "Improve Windows toolchain support for non-standard environments."

This resubmits change r220226.  That change broke the chromium
build bots because chromium it ships an hermetic MSVC toolchain
that it expects clang to fallback to by finding it on the path.

This patch fixes the issue by bumping up the prioritization of PATH
when looking for MSVC binaries.

Reviewed by: Hans Wennborg, Reid Kleckner
Differential Revision: http://reviews.llvm.org/D5892

llvm-svn: 220424

9 years agoChange the RegionSet type to a SetVector
David Peixotto [Wed, 22 Oct 2014 20:39:07 +0000 (20:39 +0000)]
Change the RegionSet type to a SetVector

This patch changes the RegionSet type used in ScopDetection from a
std::set to a llvm::SetVector. The reason for the change is to
ensure deterministic output when printing the result of the
analysis. We had a windows buildbot failure for the modified test
because the output was coming in a different order.

Only one test case needed to be modified for this change. We could
use CHECK-DAG directives instead of CHECK in the analysis test cases
because the actual order of scops does not matter, but I think that
change should be done in a separate patch that modifies all the
appliciable tests. I simply modified the test to reflect the
expected deterministic output.

Differential Revision: http://reviews.llvm.org/D5897

llvm-svn: 220423

9 years ago[AArch64] Add support for the .inst directive.
Chad Rosier [Wed, 22 Oct 2014 20:35:57 +0000 (20:35 +0000)]
[AArch64] Add support for the .inst directive.

This has been implement using the MCTargetStreamer interface as is done in the
ARM, Mips and PPC backends.

Phabricator: http://reviews.llvm.org/D5891
PR20964

llvm-svn: 220422

9 years agoReorganize some of the data formatters code to simplify CXXFormattersFunction.h....
Enrico Granata [Wed, 22 Oct 2014 20:34:38 +0000 (20:34 +0000)]
Reorganize some of the data formatters code to simplify CXXFormattersFunction.h. Also, add a synthetic child provider for libc++'s version of std::initializer_list<T>

llvm-svn: 220421

9 years agoFixed a problem in the lldbinline logic where C++ files could not be validly compiled
Enrico Granata [Wed, 22 Oct 2014 20:33:34 +0000 (20:33 +0000)]
Fixed a problem in the lldbinline logic where C++ files could not be validly compiled

llvm-svn: 220420

9 years agoCreate a documentation category for the new calling convention documentation. Drive...
Aaron Ballman [Wed, 22 Oct 2014 20:33:24 +0000 (20:33 +0000)]
Create a documentation category for the new calling convention documentation. Drive-by fixing of duplicate target names from a previous commit.

llvm-svn: 220419

9 years agoAdd support for profiling the matchers used.
Samuel Benzaquen [Wed, 22 Oct 2014 20:31:05 +0000 (20:31 +0000)]
Add support for profiling the matchers used.

Summary:
Add support for profiling the matchers used.
This will be connected with clang-tidy to generate a report to determine
and debug slow checks.

Reviewers: alexfh

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D5911

llvm-svn: 220418

9 years agoTry to fix link errors in mingw cmake -DBUILD_SHARED_LIBS=ON
Reid Kleckner [Wed, 22 Oct 2014 20:20:35 +0000 (20:20 +0000)]
Try to fix link errors in mingw cmake -DBUILD_SHARED_LIBS=ON

llvm-svn: 220417

9 years agoGo: add binding for LLVMSetUnnamedAddr.
Peter Collingbourne [Wed, 22 Oct 2014 20:20:27 +0000 (20:20 +0000)]
Go: add binding for LLVMSetUnnamedAddr.

llvm-svn: 220416

9 years agoAdd documentation for calling convention attributes
Reid Kleckner [Wed, 22 Oct 2014 20:14:27 +0000 (20:14 +0000)]
Add documentation for calling convention attributes

llvm-svn: 220415

9 years agoFix a problem where summary strings could not use a synthetically generated value...
Enrico Granata [Wed, 22 Oct 2014 20:14:09 +0000 (20:14 +0000)]
Fix a problem where summary strings could not use a synthetically generated value as part of themselves

llvm-svn: 220414

9 years agoRemove unused DiagnosticsEngine::NumErrorsSuppressed member.
Rafael Espindola [Wed, 22 Oct 2014 20:09:12 +0000 (20:09 +0000)]
Remove unused DiagnosticsEngine::NumErrorsSuppressed member.

Patch by Brad King!

llvm-svn: 220413

9 years agoStrength reduce constant-sized vectors into arrays. No functionality change.
Benjamin Kramer [Wed, 22 Oct 2014 19:55:26 +0000 (19:55 +0000)]
Strength reduce constant-sized vectors into arrays. No functionality change.

llvm-svn: 220412

9 years agoCorrect importing of the type of a TemplateArgument
David Blaikie [Wed, 22 Oct 2014 19:54:16 +0000 (19:54 +0000)]
Correct importing of the type of a TemplateArgument

It's not clear how this would be tested - I imagine we should have an
ASTImporter test that RAVs the new AST and checks that all the elements
in it are from this ASTContext and not the foreign one... but I know
little about the ASTImporter and how/where that testing might be done.

(post-commit review feedback from Richard Smith on r219900)

llvm-svn: 220411

9 years agoDo not add -gsplit-dwarf to LLVM_DEFINITIONS.
Peter Collingbourne [Wed, 22 Oct 2014 19:49:19 +0000 (19:49 +0000)]
Do not add -gsplit-dwarf to LLVM_DEFINITIONS.

This would cause the flag to appear in the output of "llvm-config --cppflags",
which should contain only preprocessor flags. The -gsplit-dwarf flag in
particular can cause problems with certain downstream users such as cgo.

Differential Revision: http://reviews.llvm.org/D5895

llvm-svn: 220410

9 years agoDebugInfo: Omit scopes in -gmlt to reduce metadata size (on disk and in memory)
David Blaikie [Wed, 22 Oct 2014 19:34:33 +0000 (19:34 +0000)]
DebugInfo: Omit scopes in -gmlt to reduce metadata size (on disk and in memory)

I haven't done any actual impact analysis of this change as it's a
strict improvement, but I'd be curious to know how much it helps.

llvm-svn: 220408

9 years agoFixup for r220403: Use getFileLoc() instead of getSpellingLoc() in SanitizerBlacklist.
Alexey Samsonov [Wed, 22 Oct 2014 19:34:25 +0000 (19:34 +0000)]
Fixup for r220403: Use getFileLoc() instead of getSpellingLoc() in SanitizerBlacklist.

This also handles the case where function name (not its body)
is obtained from macro expansion.

llvm-svn: 220407

9 years agoSort unit test failures by name - submitted for Vince Harron http://reviews.llvm...
Shawn Best [Wed, 22 Oct 2014 19:29:00 +0000 (19:29 +0000)]
Sort unit test failures by name - submitted for Vince Harron reviews.llvm.org/D5904

llvm-svn: 220406

9 years agoLoopVectorize: Simplify code. No functionality change.
Benjamin Kramer [Wed, 22 Oct 2014 19:13:54 +0000 (19:13 +0000)]
LoopVectorize: Simplify code. No functionality change.

llvm-svn: 220405

9 years agoShorten auto iterators for function basic blocks.
Diego Novillo [Wed, 22 Oct 2014 18:39:50 +0000 (18:39 +0000)]
Shorten auto iterators for function basic blocks.

Use consistent naming for basic block instances.

No functional changes.

llvm-svn: 220404

9 years agoSanitizerBlacklist: Use spelling location for blacklisting purposes.
Alexey Samsonov [Wed, 22 Oct 2014 18:26:07 +0000 (18:26 +0000)]
SanitizerBlacklist: Use spelling location for blacklisting purposes.

When SanitizerBlacklist decides if the SourceLocation is blacklisted,
we need to first turn it into a SpellingLoc before fetching the filename
and scanning "src:" entries. Otherwise we will fail to fecth the
correct filename for function definitions coming from macro expansion.

llvm-svn: 220403

9 years agoFix number of operands in documentation for minnum / maxnum
Matt Arsenault [Wed, 22 Oct 2014 18:25:02 +0000 (18:25 +0000)]
Fix number of operands in documentation for minnum / maxnum

llvm-svn: 220402

9 years agotest: Make this test runnable in directories with @ in their names
Justin Bogner [Wed, 22 Oct 2014 18:18:54 +0000 (18:18 +0000)]
test: Make this test runnable in directories with @ in their names

Jenkins likes to use directories with names involving the '@'
character, which breaks the sed expression in this test. Switch to use
'|' on the assumption that it's less likely to show up in a path.

llvm-svn: 220401

9 years agoReland r219810 "Fix late template parsing leak with incremental processing"
Reid Kleckner [Wed, 22 Oct 2014 17:50:19 +0000 (17:50 +0000)]
Reland r219810 "Fix late template parsing leak with incremental processing"

Original message:
Add a second late template parser callback meant to cleanup any
resources allocated by late template parsing.  Call it from the
Sema::ActOnEndOfTranslationUnit method after all pending template
instantiations have been completed.  Teach Parser::ParseTopLevelDecl to
install the cleanup callback when incremental processing is enabled so
that Parser::TemplateIds can be freed.

Patch by Brad King!

llvm-svn: 220400

9 years agoFix VS2012 build; C++11 type aliases are not supported.
Hans Wennborg [Wed, 22 Oct 2014 17:47:49 +0000 (17:47 +0000)]
Fix VS2012 build; C++11 type aliases are not supported.

llvm-svn: 220399

9 years agoMS ABI: Emit more canonical vbptr stores and loads
Reid Kleckner [Wed, 22 Oct 2014 17:26:00 +0000 (17:26 +0000)]
MS ABI: Emit more canonical vbptr stores and loads

This eliminates some i8* GEPs and makes the IR that clang emits a bit
more canonical. More work is needed for vftables, but that isn't a clear
win so I plan to send it for review.

llvm-svn: 220398

9 years agoAmmending 220393 - Removing unused decoding tables.
Colin LeMahieu [Wed, 22 Oct 2014 17:23:01 +0000 (17:23 +0000)]
Ammending 220393 - Removing unused decoding tables.

llvm-svn: 220397

9 years agoAmmending 220393 - Removing unused functions.
Colin LeMahieu [Wed, 22 Oct 2014 17:03:19 +0000 (17:03 +0000)]
Ammending 220393 - Removing unused functions.

llvm-svn: 220396

9 years ago[PATCH] Support select-cc for VSFRC when VSX is enabled
Bill Schmidt [Wed, 22 Oct 2014 16:58:20 +0000 (16:58 +0000)]
[PATCH] Support select-cc for VSFRC when VSX is enabled

A previous patch enabled SELECT_VSRC and SELECT_CC_VSRC for VSX to
handle <2 x double> cases.  This patch adds SELECT_VSFRC and
SELECT_CC_VSFRC to allow use of all 64 vector-scalar registers for the
f64 type when VSX is enabled.  The changes are analogous to those in
the previous patch.  I've added a new variant to vsx.ll to test the
code generation.

(I also cleaned up a little formatting in PPCInstrVSX.td from the
previous patch.)

llvm-svn: 220395

9 years agoUse auto iteration in lib/Transforms/Scalar/SampleProfile.cpp. No functional changes.
Diego Novillo [Wed, 22 Oct 2014 16:51:50 +0000 (16:51 +0000)]
Use auto iteration in lib/Transforms/Scalar/SampleProfile.cpp. No functional changes.

llvm-svn: 220394

9 years ago[Hexagon] Adding basic disassembler.
Colin LeMahieu [Wed, 22 Oct 2014 16:49:14 +0000 (16:49 +0000)]
[Hexagon] Adding basic disassembler.
Marking all instructions as CodeGenOnly since encoding bits are not set yet.
http://reviews.llvm.org/D5829?vs=on&id=15023&whitespace=ignore-all#toc

llvm-svn: 220393

9 years agoPreserving 'nonnull' metadata in SimplifyCFG
Philip Reames [Wed, 22 Oct 2014 16:37:13 +0000 (16:37 +0000)]
Preserving 'nonnull' metadata in SimplifyCFG

When we hoist two loads above an if, we can preserve the nonnull metadata.  We could also do the same for sinking them, but we appear to not handle metadata at all in that case.

Thanks to Hal for the review.

Differential Revision: http://reviews.llvm.org/D5910

llvm-svn: 220392

9 years agoShrinkify libcalls: use float versions of double libm functions with fast-math (bug...
Sanjay Patel [Wed, 22 Oct 2014 15:29:23 +0000 (15:29 +0000)]
Shrinkify libcalls: use float versions of double libm functions with fast-math (bug 17850)

When a call to a double-precision libm function has fast-math semantics
(via function attribute for now because there is no IR-level FMF on calls),
we can avoid fpext/fptrunc operations and use the float version of the call
if the input and output are both float.

We already do this optimization using a command-line option; this patch just
adds the ability for fast-math to use the existing functionality.

I moved the cl::opt from InstructionCombining into SimplifyLibCalls because
it's only ever used internally to that class.

Modified the existing test cases to use the unsafe-fp-math attribute rather
than repeating all tests.

This patch should solve: http://llvm.org/bugs/show_bug.cgi?id=17850

Differential Revision: http://reviews.llvm.org/D5893

llvm-svn: 220390

9 years agoMake two helper functions static.
Rafael Espindola [Wed, 22 Oct 2014 15:05:51 +0000 (15:05 +0000)]
Make two helper functions static.

llvm-svn: 220389

9 years agor600: Fix get_work_dim range metadata
Jan Vesely [Wed, 22 Oct 2014 14:32:53 +0000 (14:32 +0000)]
r600: Fix get_work_dim range metadata

Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 220388

9 years agoRemove unused StmtVector& parameters from declaration parsing functions.
Rafael Espindola [Wed, 22 Oct 2014 14:27:08 +0000 (14:27 +0000)]
Remove unused StmtVector& parameters from declaration parsing functions.

Patch by Eelis van der Weegen!

llvm-svn: 220387

9 years agoChange error to warning when a profile cannot be found.
Diego Novillo [Wed, 22 Oct 2014 13:36:35 +0000 (13:36 +0000)]
Change error to warning when a profile cannot be found.

When the profile for a function cannot be applied, we use to emit an
error. This seems extreme. The compiler can continue, it's just that the
optimization opportunities won't include profile information.

llvm-svn: 220386

9 years ago[PowerPC] Support select-cc for VSX
Bill Schmidt [Wed, 22 Oct 2014 13:13:40 +0000 (13:13 +0000)]
[PowerPC] Support select-cc for VSX

The tests test/CodeGen/Generic/select-cc.ll and
test/CodeGen/PowerPC/select-cc.ll both fail with VSX enabled.  The
problem is that the lowering logic for the SELECT and SELECT_CC
operations doesn't currently support the VSX registers.  This patch
fixes that.

In lib/Target/PowerPC/PPCInstrInfo.td, we have pseudos to handle this
for other register classes.  Similar pseudos are added in
PPCInstrVSX.td (they must be there, because the "vsrc" register class
definition appears there) for the VSRC register class.  The
SELECT_VSRC pseudo is then used in pattern matching for SELECT_CC.

The rest of the patch just adds logic for SELECT_VSRC wherever similar
logic appears for SELECT_VRRC.

There are no new test cases because the existing tests above test
this, along with a variant in test/CodeGen/PowerPC/vsx.ll.

After discussion with Hal, a future patch will add similar _VSFRC
variants to override f64 type handling (currently using F8RC).

llvm-svn: 220385