platform/upstream/llvm.git
9 years ago[PECOFF] Fix /nodefaultlib option.
Rui Ueyama [Thu, 23 Oct 2014 20:42:07 +0000 (20:42 +0000)]
[PECOFF] Fix /nodefaultlib option.

/nodefaultlib argument is a path name, so that needs to be compared
case-insensitive way. Also the ".lib" extension should be ignored.

llvm-svn: 220508

9 years agoDisabling some MSVC warnings that are of questionable value. Note, these are disabled...
Aaron Ballman [Thu, 23 Oct 2014 20:39:58 +0000 (20:39 +0000)]
Disabling some MSVC warnings that are of questionable value. Note, these are disabled by default in LLVM as well, so there is precedence.

C4146: 'unary minus operator applied to unsigned type, result still unsigned'
C4291: ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception'
C4800: ''type' : forcing value to bool 'true' or 'false' (performance warning)'
llvm-svn: 220507

9 years agoChange all of the build flags to switch /MD and /MDd into /MT, instead of just some...
Aaron Ballman [Thu, 23 Oct 2014 20:24:00 +0000 (20:24 +0000)]
Change all of the build flags to switch /MD and /MDd into /MT, instead of just some of the targets. Fixes PR21241.

llvm-svn: 220506

9 years agoclang-format: Fix incorrect space after "<".
Daniel Jasper [Thu, 23 Oct 2014 20:22:22 +0000 (20:22 +0000)]
clang-format: Fix incorrect space after "<".

Before:
  bool a = 2 <::SomeFunction();

After:
  bool a = 2 < ::SomeFunction();

llvm-svn: 220505

9 years agoChange the name of the field BindTable to bindtable to not over lap the type.
Kevin Enderby [Thu, 23 Oct 2014 19:53:12 +0000 (19:53 +0000)]
Change the name of the field BindTable to bindtable to not over lap the type.

Should fix the build bot issues from commit r220500.

llvm-svn: 220504

9 years agoMake llvm-go test dependency optional.
Peter Collingbourne [Thu, 23 Oct 2014 19:51:40 +0000 (19:51 +0000)]
Make llvm-go test dependency optional.

llvm-svn: 220503

9 years agoRemove code duplication and cut dependency from clangRewrite on
Daniel Jasper [Thu, 23 Oct 2014 19:47:36 +0000 (19:47 +0000)]
Remove code duplication and cut dependency from clangRewrite on
clangAST.

llvm-svn: 220502

9 years agoMake llvm-link behave a bit more like LTO.
Rafael Espindola [Thu, 23 Oct 2014 19:40:45 +0000 (19:40 +0000)]
Make llvm-link behave a bit more like LTO.

* Read modules lazily
* Don't treat the first file specially, instead merge all inputs into an empty
  module.

llvm-svn: 220501

9 years agoUpdate llvm-objdump’s Mach-O symbolizer code for Objective-C references.
Kevin Enderby [Thu, 23 Oct 2014 19:37:31 +0000 (19:37 +0000)]
Update llvm-objdump’s Mach-O symbolizer code for Objective-C references.

This prints disassembly comments for Objective-C references to CFStrings,
Selectors, Classes and method calls.

llvm-svn: 220500

9 years agoCleanup this test a bit.
Rafael Espindola [Thu, 23 Oct 2014 19:36:21 +0000 (19:36 +0000)]
Cleanup this test a bit.

Use simpler names and remove unnecessary fields.

llvm-svn: 220499

9 years agoCleanup this test a bit.
Rafael Espindola [Thu, 23 Oct 2014 19:23:42 +0000 (19:23 +0000)]
Cleanup this test a bit.

Use simpler names and remove unnecessary fields.

llvm-svn: 220498

9 years agoDebugInfo: Simplify/tidy/correct global variable decl/def emission handling.
David Blaikie [Thu, 23 Oct 2014 19:12:43 +0000 (19:12 +0000)]
DebugInfo: Simplify/tidy/correct global variable decl/def emission handling.

This fixes a bug (introduced by fixing the IR emitted from Clang where
the definition of a static member would be scoped within the class,
rather than within its lexical decl context) where the definition of a
static variable would be placed inside a class.

It also improves source fidelity by scoping static class member
definitions inside the lexical decl context in which tehy are written
(eg: namespace n { class foo { static int i; } int foo::i; } - the
definition of 'i' will be within the namespace 'n' in the DWARF output
now).

Lastly, and the original goal, this reduces debug info size slightly
(and makes debug info easier to read, etc) by placing the definitions of
non-member global variables within their namespace, rather than using a
separate namespace-scoped declaration along with a definition at global
scope.

Based on patches and discussion with Frédéric.

llvm-svn: 220497

9 years agopatch to issue warning on comparing parameters with
Fariborz Jahanian [Thu, 23 Oct 2014 19:00:10 +0000 (19:00 +0000)]
patch to issue warning on comparing parameters with
nonnull attribute when comparison is always
true/false. Patch by Steven Wu with few fixes and minor
refactoring and adding tests by me. rdar://18712242

llvm-svn: 220496

9 years agoMake this test a bit stricter.
Rafael Espindola [Thu, 23 Oct 2014 18:52:46 +0000 (18:52 +0000)]
Make this test a bit stricter.

This now:
* Forces the linker to include the internal definition.
* Checks the full output.

llvm-svn: 220495

9 years agoMake this test a bit stricter.
Rafael Espindola [Thu, 23 Oct 2014 18:44:07 +0000 (18:44 +0000)]
Make this test a bit stricter.

This now:
* Forces the linker to include the internal definition.
* Checks the full output.

llvm-svn: 220494

9 years agoAdd a "signature" to AST files to verify that they haven't changed
Ben Langmuir [Thu, 23 Oct 2014 18:05:36 +0000 (18:05 +0000)]
Add a "signature" to AST files to verify that they haven't changed

Since the order of the IDs in the AST file (e.g. DeclIDs, SelectorIDs)
is not stable, it is not safe to load an AST file that depends on
another AST file that has been rebuilt since the importer was built,
even if "nothing changed". We previously used size and modtime to check
this, but I've seen cases where a module rebuilt quickly enough to foil
this check and caused very hard to debug build errors.

To save cycles when we're loading the AST, we just generate a random
nonce value and check that it hasn't changed when we load an imported
module, rather than actually hash the whole file.

This is slightly complicated by the fact that we need to verify the
signature inside addModule, since we might otherwise consider that a
mdoule is "OutOfDate" when really it is the importer that is out of
date. I didn't see any regressions in module load time after this
change.

llvm-svn: 220493

9 years agoRevert "Don't count inreg params when mangling fastcall functions"
Reid Kleckner [Thu, 23 Oct 2014 17:50:42 +0000 (17:50 +0000)]
Revert "Don't count inreg params when mangling fastcall functions"

This reverts commit r214981.

I'm not sure what I was thinking when I wrote this. Testing with MSVC
shows that this function is mangled to '@f@8':
  int __fastcall f(int a, int b);

llvm-svn: 220492

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