platform/upstream/llvm.git
9 years agoclang: do not add -pie for tsan
Dmitry Vyukov [Fri, 21 Nov 2014 12:19:01 +0000 (12:19 +0000)]
clang: do not add -pie for tsan

Revision 220571 removes the requirement to use -pie for tsan binaries. So remove -pie from driver.
Also s/hasZeroBaseShadow/requiresPIE/ because that is what it is used for. Msan does not have zero-based shadow, but requires pie. And in general the relation between zero-based shadow and pie is unclear.

http://reviews.llvm.org/D6318

llvm-svn: 222526

9 years ago[x86] Add a bunch of test cases to 256-bit shuffles that exercise
Chandler Carruth [Fri, 21 Nov 2014 12:17:50 +0000 (12:17 +0000)]
[x86] Add a bunch of test cases to 256-bit shuffles that exercise
merging 128-bit subvectors and also shuffling all the elements of those
subvectors. Currently we generate pretty bad code for many of these, but
I'm testing a patch that should dramatically improve this in addition to
making the shuffle lowering robust to other changes.

llvm-svn: 222525

9 years agoclang-format: [Java] Basic lambda support.
Daniel Jasper [Fri, 21 Nov 2014 12:14:12 +0000 (12:14 +0000)]
clang-format: [Java] Basic lambda support.

llvm-svn: 222524

9 years ago[OPENMP] Disable CapturedStmt generation for standalone directives.
Alexey Bataev [Fri, 21 Nov 2014 11:33:46 +0000 (11:33 +0000)]
[OPENMP] Disable CapturedStmt generation for standalone directives.
No functional changes, just code improvement.

llvm-svn: 222523

9 years ago[DAG] Refactor the shuffle combining logic in DAGCombiner. NFC.
Andrea Di Biagio [Fri, 21 Nov 2014 11:33:07 +0000 (11:33 +0000)]
[DAG] Refactor the shuffle combining logic in DAGCombiner. NFC.

This patch simplifies the logic that combines a pair of shuffle nodes into
a single shuffle if there is a legal mask. Also added comments to better
describe the algorithm. No functional change intended.

llvm-svn: 222522

9 years ago[X86] For Silvermont CPU use 16-bit division instead of 64-bit for small positive...
Alexey Volkov [Fri, 21 Nov 2014 11:19:34 +0000 (11:19 +0000)]
[X86] For Silvermont CPU use 16-bit division instead of 64-bit for small positive numbers

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

llvm-svn: 222521

9 years ago[asan] Runtime support for asan-instrument-allocas which enables instrumentation...
Yury Gribov [Fri, 21 Nov 2014 10:32:05 +0000 (10:32 +0000)]
[asan] Runtime support for asan-instrument-allocas which enables instrumentation of variable-sized dynamic allocas. Patch by Max Ostapenko.

Reviewed at http://reviews.llvm.org/D6055

llvm-svn: 222520

9 years ago[asan] Add new hidden compile-time flag asan-instrument-allocas to sanitize variable...
Yury Gribov [Fri, 21 Nov 2014 10:29:50 +0000 (10:29 +0000)]
[asan] Add new hidden compile-time flag asan-instrument-allocas to sanitize variable-sized dynamic allocas. Patch by Max Ostapenko.

Reviewed at http://reviews.llvm.org/D6055

llvm-svn: 222519

9 years agoAdd LLVMScalarOpts to LLVMPowerPCCodeGen.
NAKAMURA Takumi [Fri, 21 Nov 2014 09:14:45 +0000 (09:14 +0000)]
Add LLVMScalarOpts to LLVMPowerPCCodeGen.

llvm-svn: 222516

9 years agoMS ABI: Mangle char16_t and char32_t types
David Majnemer [Fri, 21 Nov 2014 09:06:49 +0000 (09:06 +0000)]
MS ABI: Mangle char16_t and char32_t types

These mangling make clang more compatible with MSVC 2015.
Correctly mangling char16_t and char32_t will take a little more work.

llvm-svn: 222515

9 years agoHandle extra whitespace in linux distribution name.
Eric Fiselier [Fri, 21 Nov 2014 08:54:35 +0000 (08:54 +0000)]
Handle extra whitespace in linux distribution name.

llvm-svn: 222514

9 years agoMark some locale tests as XFAIL on debian and opensuse.
Eric Fiselier [Fri, 21 Nov 2014 08:02:38 +0000 (08:02 +0000)]
Mark some locale tests as XFAIL on debian and opensuse.

llvm-svn: 222513

9 years agoFix missing diagnostic for unsupported TLS for some thread_local variables.
Bob Wilson [Fri, 21 Nov 2014 06:52:52 +0000 (06:52 +0000)]
Fix missing diagnostic for unsupported TLS for some thread_local variables.

Clang r181627 moved a check for block-scope variables into this code for
handling thread storage class specifiers, but in the process, it broke the
logic for checking if the target supports TLS. Fix this with some simple
restructuring of the code. rdar://problem/18796883

llvm-svn: 222512

9 years agofix Bug21211 : reworked test/api/multithreaded/test_listener_event_description.cpp...
Shawn Best [Fri, 21 Nov 2014 06:49:39 +0000 (06:49 +0000)]
fix Bug21211 : reworked test/api/multithreaded/test_listener_event_description.cpp to work properly on Linux/FreeBSD

Issue D5632 fixed an issue where linux would dump spurious output to tty on startup (due to a broadcast stop event). After the checkin, it was noticed on FreeBSD a unit test was now failing. On closer investigation I found the test was using the C++ API to launch an inferior while using an SBListener to monitor the public state changes. As on OSx, it was expecting to see:

eStateRunning
eStateStopped

On Linux/FreeBSD, there is an extra state change

eStateLaunching
eStateRunning
eStateStopped

I reworked the test to work for both cases and re-enabled the test of FreeBSD.

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

llvm-svn: 222511

9 years agoDAGCombiner: Allow the DAGCombiner to combine multiple FDIVs with the same divisor...
Hao Liu [Fri, 21 Nov 2014 06:39:58 +0000 (06:39 +0000)]
DAGCombiner: Allow the DAGCombiner to combine multiple FDIVs with the same divisor info FMULs by the reciprocal.
E.g., ( a / D; b / D ) -> ( recip = 1.0 / D; a * recip; b * recip)

A hook is added to allow the target to control whether it needs to do such combine.

Reviewed in http://reviews.llvm.org/D6334

llvm-svn: 222510

9 years agoRemove a bunch of unnecessary typecasts to 'const TargetRegisterClass *'
Craig Topper [Fri, 21 Nov 2014 05:58:21 +0000 (05:58 +0000)]
Remove a bunch of unnecessary typecasts to 'const TargetRegisterClass *'

llvm-svn: 222509

9 years agoAdd extra new line and remove some trailing whitespace from tablegen RegisterInfo...
Craig Topper [Fri, 21 Nov 2014 05:58:14 +0000 (05:58 +0000)]
Add extra new line and remove some trailing whitespace from tablegen RegisterInfo output file.

llvm-svn: 222508

9 years ago[modules] When explicitly importing a module, it's fine for the imported module
Richard Smith [Fri, 21 Nov 2014 05:37:20 +0000 (05:37 +0000)]
[modules] When explicitly importing a module, it's fine for the imported module
to be newer than we were expecting. That happens if .pcm's get moved between
file systems during a distributed build. (It's still not OK for them to actually
be different, though, so we still check the size and signature matches.)

llvm-svn: 222507

9 years agoPR21323: Fix iterator invalidation issue when looking for redeclarations of a
Richard Smith [Fri, 21 Nov 2014 05:16:13 +0000 (05:16 +0000)]
PR21323: Fix iterator invalidation issue when looking for redeclarations of a
special member function.

No test yet: the only testcases we have for this issue are extremely complex.
Testcase will be added once I get a reasonable reduction.

llvm-svn: 222506

9 years agoFix a silly bug in StreamingMemoryObject.cpp.
Rafael Espindola [Fri, 21 Nov 2014 05:15:41 +0000 (05:15 +0000)]
Fix a silly bug in StreamingMemoryObject.cpp.

The logic for detecting EOF was wrong and would fail if we ever requested
more than 16k past the last read position.

llvm-svn: 222505

9 years ago[PPC] Use SeparateConstOffsetFromGEP
Hal Finkel [Fri, 21 Nov 2014 04:35:51 +0000 (04:35 +0000)]
[PPC] Use SeparateConstOffsetFromGEP

This mirrors r222331, which enabled SeparateConstOffsetFromGEP on AArch64, in
the PowerPC backend. Yields, on a POWER7 machine, a 30% speedup on
SingleSource/Benchmarks/Shootout/nestedloop (this might just be from LICM,
there is a store moved out of the inner loop) and a potential speedup on
MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec/mpeg2decode. Regardless, it
makes some code look cleaner, and synchronizing the backends in this regard
seems like a generally good thing.

llvm-svn: 222504

9 years agoExtend -Wuninitialized to warn when accessing uninitialized base classes in a
Richard Trieu [Fri, 21 Nov 2014 03:10:30 +0000 (03:10 +0000)]
Extend -Wuninitialized to warn when accessing uninitialized base classes in a
constructor.

llvm-svn: 222503

9 years agoAdd accessor marcos to ConstantPlaceHolder, similar to those in the base class.
Richard Trieu [Fri, 21 Nov 2014 02:42:08 +0000 (02:42 +0000)]
Add accessor marcos to ConstantPlaceHolder, similar to those in the base class.

llvm-svn: 222502

9 years agoRework parallel test process count logic
Ed Maste [Fri, 21 Nov 2014 02:41:25 +0000 (02:41 +0000)]
Rework parallel test process count logic

The default value for opt.thread_count was multiprocessing.cpu_count(),
which meant the LLDB_TEST_THREADS environment variable was never used.
It's not easy to pass the -t option to the test run when invoking it
from e.g. 'ninja check-lldb', so having the environment variable as an
option is useful.

Change the logic so that the thread count is set by the first one of:

  1. The -t option to test/dosep.py
  2. The LLDB_TEST_THREADS environment variable
  3. The machine's CPU count from multiprocessing.cpu_count()

llvm-svn: 222501

9 years agoThis Reassociate change unintentionally slipped in r222499
David Majnemer [Fri, 21 Nov 2014 02:37:38 +0000 (02:37 +0000)]
This Reassociate change unintentionally slipped in r222499

llvm-svn: 222500

9 years agoSROA: The alloca type isn't a candidate promotion type for vectors
David Majnemer [Fri, 21 Nov 2014 02:34:55 +0000 (02:34 +0000)]
SROA: The alloca type isn't a candidate promotion type for vectors

The alloca's type is irrelevant, only those types which are used in a
load or store of the exact size of the slice should be considered.

This manifested as an assertion failure when we compared the various
types: we had a size mismatch.

This fixes PR21480.

llvm-svn: 222499

9 years agoChange CommandObjectTargetModulesLoad so that the filename argument
Jason Molenda [Fri, 21 Nov 2014 02:25:15 +0000 (02:25 +0000)]
Change CommandObjectTargetModulesLoad so that the filename argument
is treated as a string instead of a FileSpec.

OptionValueFileSpec::SetValueFromCString() passes the c string to
FileSpec::SetFile(str, true /* resolve */) - and with Zachary's
changes to FileSpec we're using llvm::sys::fs::make_absolute() to
do that "resolve" action now, where we used to use realpath().

One important difference between llvm::sys::fs::make_absolute and
realpath is that when they're handed a filename (no directory),
realpath prepends the current working directory *and if the file exists*,
returns that full path.  If that file doesn't exist, the caller
uses the basename only.

llvm::sys::fs::make_absolute prepends the current working directory
regardless of whether it exists or not.

I considered having FileSpec::SetFile save the initial pathname,
call FileSpec::Resolve, and then check to see if the Resolve return
path exists - and if not, go back to the original one.

But instead I just went with changing 'target modules load' to treat its
filename argument as a string instead of a FileSpec.  This brings it
in line with how 'target modules list' works.

<rdar://problem/18955416>

llvm-svn: 222498

9 years agoClarify the description of the noalias attribute
Hal Finkel [Fri, 21 Nov 2014 02:22:46 +0000 (02:22 +0000)]
Clarify the description of the noalias attribute

The previous description of the noalias attribute did not accurately specify
the implemented semantics, and the terminology used differed unnecessarily
from that used by the C specification to define the semantics of restrict. For
the argument attribute, the semantics can be precisely specified in terms of
objects accessed through pointers based on the arguments, and this is now what
is done.

Saying that the semantics are 'slightly weaker' than that provided by C99
restrict is not really useful without further elaboration, so that has been
removed from the sentence.

noalias on a return value is really used to mean that the function is
malloc-like (and, in fact, we use this attribute to represent
__attribute__((malloc)) in Clang), and this is a stronger guarantee than that
provided by restrict (because it is a property of the pointed-to memory region,
not just a guarantee on object access). Clarifying this is relevant to fixing
(and was motivated by the discussion on) PR21556.

llvm-svn: 222497

9 years agoEnsure llvm-sanitizer is found by the tests when using sanitizers.
Eric Fiselier [Fri, 21 Nov 2014 02:16:19 +0000 (02:16 +0000)]
Ensure llvm-sanitizer is found by the tests when using sanitizers.

llvm-svn: 222496

9 years agoRename lldb registers to contain lldb_ prefix.
Zachary Turner [Fri, 21 Nov 2014 02:00:21 +0000 (02:00 +0000)]
Rename lldb registers to contain lldb_ prefix.

LLDB supports many different register numbering schemes, and these
are typically prefixed with an indicator that lets the user know
what numbering scheme is used.  The gcc numbering scheme is
prefixed with gcc, and there are similar ones for dwarf, gdb,
and gcc_dwarf.

LLDB also contains its own internal numbering scheme, but the enum
for LLDB's numbering scheme was prefixed differently.  This patch
changes the names of these enums to use the same naming scheme for
the enum values as the rest of the register kinds by removing gpr_
and fpu_ prefixes, and instead using lldb_ prefixes for all enum
values.

Differential Revision: http://reviews.llvm.org/D6351
Reviewed by: Greg Clayton

llvm-svn: 222495

9 years ago[MCJIT] Remove JITEventListener::NotifyFreeingMachineCode. This method is dead
Lang Hames [Fri, 21 Nov 2014 01:57:09 +0000 (01:57 +0000)]
[MCJIT] Remove JITEventListener::NotifyFreeingMachineCode. This method is dead
now that the old JIT has been removed.

llvm-svn: 222494

9 years ago[libcxxabi] Cleanup memory in tests to placate ASAN.
Eric Fiselier [Fri, 21 Nov 2014 01:53:51 +0000 (01:53 +0000)]
[libcxxabi] Cleanup memory in tests to placate ASAN.

Summary: ASAN fires on these tests because they don't clean up their memory.

Reviewers: danalbert, jroelofs, mclow.lists

Reviewed By: jroelofs

Subscribers: dblaikie, cfe-commits

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

llvm-svn: 222493

9 years agoAdd more REQUIRES: LOCALE.* to tests.
Dan Albert [Fri, 21 Nov 2014 01:23:04 +0000 (01:23 +0000)]
Add more REQUIRES: LOCALE.* to tests.

llvm-svn: 222492

9 years agoAdd curly braces to workaround an MSVC bug.
Zachary Turner [Fri, 21 Nov 2014 01:19:09 +0000 (01:19 +0000)]
Add curly braces to workaround an MSVC bug.

MSVC can't parse this pattern for range-based for loops.

llvm-svn: 222491

9 years agorelax this testcase to not depend on a specific alignment.
Adrian Prantl [Fri, 21 Nov 2014 00:48:22 +0000 (00:48 +0000)]
relax this testcase to not depend on a specific alignment.

llvm-svn: 222490

9 years ago[X86] Do not custom lower UINT_TO_FP when the target type does not
Quentin Colombet [Fri, 21 Nov 2014 00:47:19 +0000 (00:47 +0000)]
[X86] Do not custom lower UINT_TO_FP when the target type does not
match the custom lowering.

<rdar://problem/19026326>

llvm-svn: 222489

9 years agoVerifier: Check that all instructions have their parent pointers set up
Adrian Prantl [Fri, 21 Nov 2014 00:39:43 +0000 (00:39 +0000)]
Verifier: Check that all instructions have their parent pointers set up
correctly. This helps with catching problems caused by IRBuilder abuse
such as the one fixed in CFE r222487.

llvm-svn: 222488

9 years agoDebug info for blocks: Fix a bug caught by the Verifier.
Adrian Prantl [Fri, 21 Nov 2014 00:35:25 +0000 (00:35 +0000)]
Debug info for blocks: Fix a bug caught by the Verifier.
When emitting nested block definitions, the insert-at-point variant of
DIBuilder::insertDeclare() could be called with the insertion point set
to the end-of-BasicBlock sentinel, causing the parent pointer of the
CallInst to be set to the intentionally bogus value of the sentinel.

Fixed by conditionally invoking the correct version of insertDeclare().
rdar://problem/19034882

llvm-svn: 222487

9 years agoMove ASan non-Linux-specific tests out of the Linux/ directory
Kuba Brecka [Fri, 21 Nov 2014 00:21:43 +0000 (00:21 +0000)]
Move ASan non-Linux-specific tests out of the Linux/ directory

Reviewed at http://reviews.llvm.org/D6244

llvm-svn: 222486

9 years agoDebugInfo: Fix another case of r222377 when we do have a definition of the variable...
David Blaikie [Fri, 21 Nov 2014 00:20:58 +0000 (00:20 +0000)]
DebugInfo: Fix another case of r222377 when we do have a definition of the variable, but we might not be emitting it (such as templates)

llvm-svn: 222485

9 years agoAdd a test for the driver's "-k" option.
Jim Ingham [Fri, 21 Nov 2014 00:14:57 +0000 (00:14 +0000)]
Add a test for the driver's "-k" option.

llvm-svn: 222484

9 years ago[PECOFF] Enable dead-stripping even if /debug option is given.
Rui Ueyama [Thu, 20 Nov 2014 23:59:40 +0000 (23:59 +0000)]
[PECOFF] Enable dead-stripping even if /debug option is given.

/debug makes MSVC link.exe to not remove unused sections from
the resulting executable. We did the same thing before. However,
I realized that the removal of associative section depends on
the dead-stripping pass in LLD, so we cannot disable that. Or
LLD may produce slightly broken executables that have too much
data in it (which could result in nasty subtle bugs).

This patch is a temporary measure to create correct executable.
Currently /debug does not have any real effect for LLD anyway.

I'll improve associative section handling in another patch, so that
they are removed from output without depending on the dead-stripping
pass.

llvm-svn: 222483

9 years agoRemove code that tries to avoid transforming non-dependent call operator types
Richard Smith [Thu, 20 Nov 2014 23:53:14 +0000 (23:53 +0000)]
Remove code that tries to avoid transforming non-dependent call operator types
for lambda expressions. That can't ever work; we need to transform the
parameters in order to create new ones in the new call operator context.

Fixes a rejects-valid when transforming a context containing a
lambda-expression that uses its function parameters in C++14 mode.

llvm-svn: 222482

9 years agoFix more instances of -Wsentinel on Windows with s/NULL/nullptr/
Reid Kleckner [Thu, 20 Nov 2014 23:51:47 +0000 (23:51 +0000)]
Fix more instances of -Wsentinel on Windows with s/NULL/nullptr/

Follow up to r221940, where I must not have caught em all. NFC

llvm-svn: 222481

9 years agoAdd out of line virtual destructors to all LLVMTargetMachine subclasses
Reid Kleckner [Thu, 20 Nov 2014 23:37:18 +0000 (23:37 +0000)]
Add out of line virtual destructors to all LLVMTargetMachine subclasses

These recently all grew a unique_ptr<TargetLoweringObjectFile> member in
r221878.  When anyone calls a virtual method of a class, clang-cl
requires all virtual methods to be semantically valid. This includes the
implicit virtual destructor, which triggers instantiation of the
unique_ptr destructor, which fails because the type being deleted is
incomplete.

This is just part of the ongoing saga of PR20337, which is affecting
Blink as well. Because the MSVC ABI doesn't have key functions, we end
up referencing the vtable and implicit destructor on any virtual call
through a class. We don't actually end up emitting the dtor, so it'd be
good if we could avoid this unneeded type completion work.

llvm-svn: 222480

9 years agoMake the option parsing of -k & -K match the help strings.
Jim Ingham [Thu, 20 Nov 2014 23:37:13 +0000 (23:37 +0000)]
Make the option parsing of -k & -K match the help strings.

llvm-svn: 222479

9 years agoRemove duplicated enum, use the authoritative one.
Zachary Turner [Thu, 20 Nov 2014 23:19:40 +0000 (23:19 +0000)]
Remove duplicated enum, use the authoritative one.

Running a diff against lldb-x86-register-enums.h and the file
modified in this patch, the two enums were completely identical.

Deleting one of them to reduce code noise.

llvm-svn: 222478

9 years agoMove test from r222476 to a better place; this was reduced to the point that it
Richard Smith [Thu, 20 Nov 2014 23:00:25 +0000 (23:00 +0000)]
Move test from r222476 to a better place; this was reduced to the point that it
no longer contained a generic lambda.

llvm-svn: 222477

9 years agoFix crash-on-valid if a lambda-expression appears lexically directly within a
Richard Smith [Thu, 20 Nov 2014 22:56:34 +0000 (22:56 +0000)]
Fix crash-on-valid if a lambda-expression appears lexically directly within a
local class inside a template.

llvm-svn: 222476

9 years agoUpdate Makefile following directory removal in r222466
Mehdi Amini [Thu, 20 Nov 2014 22:48:24 +0000 (22:48 +0000)]
Update Makefile following directory removal in r222466

llvm-svn: 222475

9 years ago[ProcessWindows] Implement a RegisterContextWindows for x86.
Zachary Turner [Thu, 20 Nov 2014 22:47:32 +0000 (22:47 +0000)]
[ProcessWindows] Implement a RegisterContextWindows for x86.

This implements the skeleton of a RegisterContext for Windows.
In particular, this implements support only for x86 general purpose
registers.

After this patch, LLDB on Windows can perform basic debugging
operations in a single-threaded inferior process (breakpoint,
register inspection, frame select, unwinding, etc).

Differential Revision: http://reviews.llvm.org/D6322
Reviewed by: Greg Clayton

llvm-svn: 222474

9 years agoIntercept __crt_va_* used by MSVC "14"
Reid Kleckner [Thu, 20 Nov 2014 22:44:03 +0000 (22:44 +0000)]
Intercept __crt_va_* used by MSVC "14"

Moving further into the implementor's namespace is good, but now we have
one more name to intercept.

llvm-svn: 222473

9 years agoSimplifyCFG: Refactor GatherConstantCompares() result in a struct
Mehdi Amini [Thu, 20 Nov 2014 22:40:25 +0000 (22:40 +0000)]
SimplifyCFG: Refactor GatherConstantCompares() result in a struct

Code seems cleaner and easier to understand this way

This is basically r222416, after fixes for MSVC lack of standard
support, and a few cleaning (got rid of a warning).
Thanks Nakamura Takumi and Nico Weber for the MSVC fixes.

llvm-svn: 222472

9 years agoPR21565: Further refine the conditions for enabling eager parsing of
Richard Smith [Thu, 20 Nov 2014 22:32:11 +0000 (22:32 +0000)]
PR21565: Further refine the conditions for enabling eager parsing of
std::X::swap exception specifications (allowing parsing of non-conforming code
in libstdc++). The old conditions also matched the functions in MSVC's STL,
which were relying on deferred parsing here.

llvm-svn: 222471

9 years ago[Mips] Simplify the code calculates HI16/LO16 relocations
Simon Atanasyan [Thu, 20 Nov 2014 22:29:55 +0000 (22:29 +0000)]
[Mips] Simplify the code calculates HI16/LO16 relocations

No functional changes.

llvm-svn: 222470

9 years ago[Mips] Remove duplicated relocation calculation routines
Simon Atanasyan [Thu, 20 Nov 2014 22:29:49 +0000 (22:29 +0000)]
[Mips] Remove duplicated relocation calculation routines

No functional changes.

llvm-svn: 222469

9 years ago[Mips] Remove unused function argument
Simon Atanasyan [Thu, 20 Nov 2014 22:29:43 +0000 (22:29 +0000)]
[Mips] Remove unused function argument

No functional changes.

llvm-svn: 222468

9 years ago[Mips] Use endian::read/write function to load/save MIPS32 instructions
Simon Atanasyan [Thu, 20 Nov 2014 22:29:37 +0000 (22:29 +0000)]
[Mips] Use endian::read/write function to load/save MIPS32 instructions

No functional changes.

llvm-svn: 222467

9 years ago[Hexagon] [NFC] Deleting empty directory.
Colin LeMahieu [Thu, 20 Nov 2014 22:20:40 +0000 (22:20 +0000)]
[Hexagon] [NFC] Deleting empty directory.

llvm-svn: 222466

9 years agoEnsure all TypoExprs are diagnosed by the tree transform.
Kaelyn Takata [Thu, 20 Nov 2014 22:06:44 +0000 (22:06 +0000)]
Ensure all TypoExprs are diagnosed by the tree transform.

If there is more than one TypoExpr within the expr being transformed and
any but the last TypoExpr seen don't have any viable candidates, the
tree transform will be aborted early and the remaining TypoExprs are
never seen and hence never diagnosed. This adds a simple
RecursiveASTVisitor to find all of the TypoExprs to be diagnosed in the
case where typo correction of the entire expr fails (and the result of
the tree transform is an ExprError).

llvm-svn: 222465

9 years agoWire up delayed typo correction to DiagnoseEmptyLookup and set up
Kaelyn Takata [Thu, 20 Nov 2014 22:06:40 +0000 (22:06 +0000)]
Wire up delayed typo correction to DiagnoseEmptyLookup and set up
Sema::ActOnIdExpression to use the new functionality.

Among other things, this allows recovery in several cases where it
wasn't possible before (e.g. correcting a mistyped static_cast<>).

llvm-svn: 222464

9 years agoAdd a flag to BuildDeclarationNameExpr to not reject invalid decls.
Kaelyn Takata [Thu, 20 Nov 2014 22:06:33 +0000 (22:06 +0000)]
Add a flag to BuildDeclarationNameExpr to not reject invalid decls.

llvm-svn: 222463

9 years agoFactor out the default recovery handling.
Kaelyn Takata [Thu, 20 Nov 2014 22:06:30 +0000 (22:06 +0000)]
Factor out the default recovery handling.

The default handling is extended to properly create member expressions
and Objective-C ivar references.

Also detect and reject cases where multiple corrections have identical
correction distances and are valid, instead of suggesting the first one
that is found.

llvm-svn: 222462

9 years agoAdd a few small helper methods to the TypoCorrectionConsumer.
Kaelyn Takata [Thu, 20 Nov 2014 22:06:29 +0000 (22:06 +0000)]
Add a few small helper methods to the TypoCorrectionConsumer.

llvm-svn: 222461

9 years agoCorrectly set the SourceRange a TypoCorrection will replace.
Kaelyn Takata [Thu, 20 Nov 2014 22:06:26 +0000 (22:06 +0000)]
Correctly set the SourceRange a TypoCorrection will replace.

Also clean up TypoCorrection::setCorrectionRange while we're at it.

llvm-svn: 222460

9 years ago"nexti" should not step over inlined functions.
Jim Ingham [Thu, 20 Nov 2014 22:04:45 +0000 (22:04 +0000)]
"nexti" should not step over inlined functions.

<rdar://problem/16705325>

llvm-svn: 222459

9 years ago[Hexagon] [NFC] Merging InstPrinter directory in to MCTargetDesc since they have...
Colin LeMahieu [Thu, 20 Nov 2014 21:56:35 +0000 (21:56 +0000)]
[Hexagon] [NFC] Merging InstPrinter directory in to MCTargetDesc since they have a circular dependency.

llvm-svn: 222458

9 years ago[mach-o] fix whitespace
Nick Kledzik [Thu, 20 Nov 2014 21:41:53 +0000 (21:41 +0000)]
[mach-o] fix whitespace

llvm-svn: 222457

9 years agoThe Syntax enumeration requires at least three bits to store all of its values. Incre...
Aaron Ballman [Thu, 20 Nov 2014 21:34:56 +0000 (21:34 +0000)]
The Syntax enumeration requires at least three bits to store all of its values. Increase the number of bits for SyntaxUsed. Decrease the number of expression arguments allowed by a single bit so that the bit fields continue to add up to 32-bits evenly.

There is no test for this fix because I could find no reasonable way to trigger a visible failure from it.

Thanks to Doug Gregor for spotting this!

llvm-svn: 222456

9 years ago[mach-o] use reference with "auto" to prevent copies
Nick Kledzik [Thu, 20 Nov 2014 21:19:58 +0000 (21:19 +0000)]
[mach-o] use reference with "auto" to prevent copies

Patch by Jean-Daniel Dupas

llvm-svn: 222455

9 years ago[MCJIT] Remove JITEventListener::NotifyFunctionEmitted - this method is dead
Lang Hames [Thu, 20 Nov 2014 21:16:16 +0000 (21:16 +0000)]
[MCJIT] Remove JITEventListener::NotifyFunctionEmitted - this method is dead
now that the legacy JIT has been removed.

llvm-svn: 222453

9 years ago[PECOFF] Sort export table properly.
Rui Ueyama [Thu, 20 Nov 2014 21:05:05 +0000 (21:05 +0000)]
[PECOFF] Sort export table properly.

Export table entries need to be sorted in ASCII-betical order,
so that the loader can find an entry for a function by binary search.

We sorted the entries by its mangled names. That can be different
from their exported names. As a result, LLD produces incorrect export
table, from which the loader complains that a function that actually
exists in a DLL cannot be found.

This patch fixes that issue.

llvm-svn: 222452

9 years agoFix a trip-count overflow issue in LoopUnroll.
Michael Zolotukhin [Thu, 20 Nov 2014 20:19:55 +0000 (20:19 +0000)]
Fix a trip-count overflow issue in LoopUnroll.

Currently LoopUnroll generates a prologue loop before the main loop
body to execute first N%UnrollFactor iterations. Also, this loop is
used if trip-count can overflow - it's determined by a runtime check.

However, we've been mistakenly optimizing this loop to a linear code for
UnrollFactor = 2, not taking into account that it also serves as a safe
version of the loop if its trip-count overflows.

llvm-svn: 222451

9 years agoRemove decorator for FreeBSD test that now passes
Ed Maste [Thu, 20 Nov 2014 19:43:33 +0000 (19:43 +0000)]
Remove decorator for FreeBSD test that now passes

llvm-svn: 222449

9 years agoCompilation test for PostOrderIterator.
Michael Ilseman [Thu, 20 Nov 2014 19:33:33 +0000 (19:33 +0000)]
Compilation test for PostOrderIterator.

If the template specialization for externally managed sets in
PostOrderIterator call too far out of sync with each other, this unit
test will fail to build. This is especially useful for developers who
may not build Clang (the only in-tree user) every time.

llvm-svn: 222447

9 years agoUpdate template specialization to reflect API changes.
Michael Ilseman [Thu, 20 Nov 2014 19:33:30 +0000 (19:33 +0000)]
Update template specialization to reflect API changes.

po_iterator_storage's insertEdge was updated to reflect the API
changes from many of our insert methods in r222334, however the
template specialization for external storage was not updated. This
updates the specialization.

llvm-svn: 222446

9 years agoBring PostOrderCFGView's insert API up to date with other API changes.
Michael Ilseman [Thu, 20 Nov 2014 19:32:48 +0000 (19:32 +0000)]
Bring PostOrderCFGView's insert API up to date with other API changes.

r222334 updates LLVM data structure's insert API to return a
pair. This change updates PostOrderCFGView accordingly, so that it can
be used interchangably with other sets.

llvm-svn: 222445

9 years agoExtended list of valid frontend options with '-cl-std=CL2.0'.
Anastasia Stulova [Thu, 20 Nov 2014 19:25:00 +0000 (19:25 +0000)]
Extended list of valid frontend options with '-cl-std=CL2.0'.

This option sets language mode for the compilation of a source file to be OpenCL v2.0.

Example: clang -cc1 -cl-std=CL2.0 myfile.cl
llvm-svn: 222444

9 years agoAdd decorator for FreeBSD failure
Ed Maste [Thu, 20 Nov 2014 18:56:11 +0000 (18:56 +0000)]
Add decorator for FreeBSD failure

llvm.org/pr21620

llvm-svn: 222442

9 years agoProperly specify a few checksum values for llgs tests.
Stephane Sezer [Thu, 20 Nov 2014 18:50:46 +0000 (18:50 +0000)]
Properly specify a few checksum values for llgs tests.

Summary: In noack mode, these checksums are ignored by llgs, but some implementations need them still. Specify these checksums to ease integration.

Test Plan: Run the tests before and after the change and make sure nothing breaks.

Reviewers: clayborg, tfiala

Subscribers: lldb-commits

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

llvm-svn: 222441

9 years agoFix a typo in lldb-gdb-remote.txt.
Stephane Sezer [Thu, 20 Nov 2014 18:50:16 +0000 (18:50 +0000)]
Fix a typo in lldb-gdb-remote.txt.

Test Plan: None.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 222440

9 years agoX86: use the correct alloca symbol for Windows Itanium
Saleem Abdulrasool [Thu, 20 Nov 2014 18:01:26 +0000 (18:01 +0000)]
X86: use the correct alloca symbol for Windows Itanium

Windows itanium targets the MSVCRT, and the stack probe symbol is provided by
MSVCRT.  This corrects the emission of stack probes on i686-windows-itanium.

llvm-svn: 222439

9 years agoTesting commit access.
Anastasia Stulova [Thu, 20 Nov 2014 17:57:27 +0000 (17:57 +0000)]
Testing commit access.

llvm-svn: 222438

9 years agoRemove now dead code.
Frederic Riss [Thu, 20 Nov 2014 16:24:29 +0000 (16:24 +0000)]
Remove now dead code.

After LLVM r222434, the Variables field of DISubprograms for forward
declarations will always be null. No need to keep code around to
delete them.

llvm-svn: 222437

9 years agoMake DWARFAcceleratorTable::dump() const.
Frederic Riss [Thu, 20 Nov 2014 16:21:11 +0000 (16:21 +0000)]
Make DWARFAcceleratorTable::dump() const.

As dump() methods  should be. To allow that, do not store the DWARFFormValue
objects used for the dump in the header data.

Per Alexey's suggestion!

llvm-svn: 222436

9 years agoAdd missing copyright headers.
Frederic Riss [Thu, 20 Nov 2014 16:21:06 +0000 (16:21 +0000)]
Add missing copyright headers.

llvm-svn: 222435

9 years agoDo not create a replaceable Variables MDNode for function forward decls.
Frederic Riss [Thu, 20 Nov 2014 15:52:34 +0000 (15:52 +0000)]
Do not create a replaceable Variables MDNode for function forward decls.

These fields would need to be explicitly deleted before we RAUW the temporary
node anyway (this was done in cfe commit r222373). Instead, do not create
these useless nodes in the first place.

llvm-svn: 222434

9 years agoPrepare for the DIBuilder populating DISubprogram's Variables with null.
Frederic Riss [Thu, 20 Nov 2014 15:46:59 +0000 (15:46 +0000)]
Prepare for the DIBuilder populating DISubprogram's Variables with null.

This is a followup to r222373. A better solution to the problem solved
there is to not create the leaked nodes at all (we know that they will
never be used for forward declared functions anyway). To avoid bot
breakage in the interval between the cfe and llvm commits, add a check
that the nMDNode is not null before deleting it. This code can completely
go away after the LLVM part is in.

llvm-svn: 222433

9 years agoReplace variadic operator function pointer with an enum value.
Samuel Benzaquen [Thu, 20 Nov 2014 15:45:53 +0000 (15:45 +0000)]
Replace variadic operator function pointer with an enum value.

Summary:
Replace variadic operator function pointer with an enum value.
Hiding the implementation of the variadic matcher will allow to specialize them for the operation performed.
In particular, it will allow for a more efficient allOf() matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 222432

9 years ago[clang-tidy] Set google-readability-namespace-comments.ShortNamespaceLines to 10
Alexander Kornienko [Thu, 20 Nov 2014 15:05:32 +0000 (15:05 +0000)]
[clang-tidy] Set google-readability-namespace-comments.ShortNamespaceLines to 10

This value is used in cpplint, so we'd better be consistent.

llvm-svn: 222431

9 years agoMCJIT tests passing on ARM after r222414 fixed the relocation
Renato Golin [Thu, 20 Nov 2014 13:32:16 +0000 (13:32 +0000)]
MCJIT tests passing on ARM after r222414 fixed the relocation

llvm-svn: 222430

9 years agoConvert CR+LF -> LF in a test file
Timur Iskhodzhanov [Thu, 20 Nov 2014 12:59:14 +0000 (12:59 +0000)]
Convert CR+LF -> LF in a test file

llvm-svn: 222429

9 years agoRevert r222416, r222422, r222426: the former revision had problems and fixing them...
Timur Iskhodzhanov [Thu, 20 Nov 2014 12:36:43 +0000 (12:36 +0000)]
Revert r222416, r222422, r222426: the former revision had problems and fixing them introduced bugs

llvm-svn: 222428

9 years ago[clang-tidy] Count errors in ClangTidyDiagnosticConsumer
Alexander Kornienko [Thu, 20 Nov 2014 12:05:51 +0000 (12:05 +0000)]
[clang-tidy] Count errors in ClangTidyDiagnosticConsumer

This re-applies r222363 reverted in r222390 after compilation errors in our
out-of-tree clang-tidy tests were fixed.

llvm-svn: 222427

9 years agoFix a typo
Timur Iskhodzhanov [Thu, 20 Nov 2014 11:48:58 +0000 (11:48 +0000)]
Fix a typo

llvm-svn: 222426

9 years ago[DFSan] Add flag to dump the labels when the program terminates.
Lorenzo Martignoni [Thu, 20 Nov 2014 10:01:08 +0000 (10:01 +0000)]
[DFSan] Add flag to dump the labels when the program terminates.

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

llvm-svn: 222425

9 years agoclang-format: [Java] Don't align after "return".
Daniel Jasper [Thu, 20 Nov 2014 09:54:49 +0000 (09:54 +0000)]
clang-format: [Java] Don't align after "return".

Doesn't seem to be common practice in Java.

Before:
  return aaaaaaaaaaaaaaaaaaa
         && bbbbbbbbbbbbbbbbbbb
         && ccccccccccccccccccc;

After:
  return aaaaaaaaaaaaaaaaaaa
      && bbbbbbbbbbbbbbbbbbb
      && ccccccccccccccccccc;

Patch by Harry Terkelsen.

llvm-svn: 222424

9 years agoclang-format: [Java] Don't force break before generic type method.
Daniel Jasper [Thu, 20 Nov 2014 09:48:11 +0000 (09:48 +0000)]
clang-format: [Java] Don't force break before generic type method.

Before:
  Foo.bar()
      .<X>
      baz();

After:
  Foo.bar()
      .<X>baz();

Patch by Harry Terkelsen.

llvm-svn: 222423

9 years agoSimplifyCFG.cpp: Tweak to let msc17 compliant.
NAKAMURA Takumi [Thu, 20 Nov 2014 08:59:02 +0000 (08:59 +0000)]
SimplifyCFG.cpp: Tweak to let msc17 compliant.

  - Use LLVM_DELETED_FUNCTION.
  - Don't use member initializers.
  - Don't use initializer list.

llvm-svn: 222422

9 years agoSimplifyCFG: Refactor GatherConstantCompares() result in a struct
Mehdi Amini [Thu, 20 Nov 2014 06:51:02 +0000 (06:51 +0000)]
SimplifyCFG: Refactor GatherConstantCompares() result in a struct

Code seems cleaner and easier to understand this way

llvm-svn: 222416