platform/upstream/llvm.git
9 years ago[CodeGen] Use standard -not gnueabi- naming for f16 libcalls on Darwin.
Ahmed Bougacha [Thu, 14 May 2015 01:00:51 +0000 (01:00 +0000)]
[CodeGen] Use standard -not gnueabi- naming for f16 libcalls on Darwin.

Other targets probably should as well.  Since r237161, compiler-rt has
both, but I don't see why anything other than gnueabi would use a
gnueabi naming scheme.

llvm-svn: 237324

9 years ago[Builtins] Implement f2h/h2f by jumping to trunc/extend.
Ahmed Bougacha [Thu, 14 May 2015 00:50:28 +0000 (00:50 +0000)]
[Builtins] Implement f2h/h2f by jumping to trunc/extend.

Follow-up to r237161; seems like we can't use aliases, but we
can do better than duplicating the bodies, especially when that
body, after inlining, isn't as small as it looks.

Better approaches welcome.  Perhaps the best thing is just to have
an #ifndef __APPLE__ over the GNUEABI names, since they're not used
there.

llvm-svn: 237323

9 years agoImplement an objc tagged-pointer info command that will provide information about...
Enrico Granata [Thu, 14 May 2015 00:46:47 +0000 (00:46 +0000)]
Implement an objc tagged-pointer info command that will provide information about what LLDB thinks an ObjC tagged pointer represents

llvm-svn: 237322

9 years ago[modules] Fix a #include cycle when building a module for our builtin headers.
Richard Smith [Thu, 14 May 2015 00:45:20 +0000 (00:45 +0000)]
[modules] Fix a #include cycle when building a module for our builtin headers.

xmmintrin.h includes emmintrin.h and vice versa if SSE2 is enabled. We break
this cycle for a modules build, and instead make the xmmintrin.h module
re-export the immintrin.h module. Also included is a fix for an assert in the
serialization code if a module exports another module that was declared later
in the same module map.

llvm-svn: 237321

9 years agoFix a #include cycle in the libclang headers. "Eventually" is now.
Richard Smith [Thu, 14 May 2015 00:22:12 +0000 (00:22 +0000)]
Fix a #include cycle in the libclang headers. "Eventually" is now.

llvm-svn: 237320

9 years agoAdded XTIMEOUT for TestAttachDenied.py
Vince Harron [Wed, 13 May 2015 23:59:03 +0000 (23:59 +0000)]
Added XTIMEOUT for TestAttachDenied.py

llvm-svn: 237319

9 years agoRevert r237046. See the testcase on the thread where r237046 was committed.
Nick Lewycky [Wed, 13 May 2015 23:41:47 +0000 (23:41 +0000)]
Revert r237046. See the testcase on the thread where r237046 was committed.

llvm-svn: 237317

9 years agoAdd mips64el trap opcode to PlatformFreeBSD as well
Ed Maste [Wed, 13 May 2015 23:12:51 +0000 (23:12 +0000)]
Add mips64el trap opcode to PlatformFreeBSD as well

llvm-svn: 237315

9 years agoYAML: Implement block scalar parsing.
Alex Lorenz [Wed, 13 May 2015 23:10:51 +0000 (23:10 +0000)]
YAML: Implement block scalar parsing.

This commit implements the parsing of YAML block scalars.
Some code existed for it before, but it couldn't parse block
scalars.

This commit adds a new yaml node type to represent the block
scalar values.

This commit also deletes the 'spec-09-27' and 'spec-09-28' tests
as they are identical to the test file 'spec-09-26'.

This commit introduces 3 new utility functions to the YAML scanner
class: `skip_s_space`, `advanceWhile` and `consumeLineBreakIfPresent`.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 237314

9 years agoRestore breaks lost in shuffling GetSoftwareBreakpointTrapOpcode
Ed Maste [Wed, 13 May 2015 23:09:43 +0000 (23:09 +0000)]
Restore breaks lost in shuffling GetSoftwareBreakpointTrapOpcode

llvm-svn: 237313

9 years ago[opaque pointer type] Use the value type of the GlobalVariable rather than accessing...
David Blaikie [Wed, 13 May 2015 22:55:01 +0000 (22:55 +0000)]
[opaque pointer type] Use the value type of the GlobalVariable rather than accessing it through the pointee's type

llvm-svn: 237312

9 years ago[opaque pointer type] Use GlobalVariable::getValueType rather than accessing it throu...
David Blaikie [Wed, 13 May 2015 22:54:54 +0000 (22:54 +0000)]
[opaque pointer type] Use GlobalVariable::getValueType rather than accessing it through the GV's pointee type

llvm-svn: 237311

9 years ago[X86] Fix PR23271 - RIP-relative decoding bug in disassembler.
Douglas Katzman [Wed, 13 May 2015 22:44:52 +0000 (22:44 +0000)]
[X86] Fix PR23271 - RIP-relative decoding bug in disassembler.

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

llvm-svn: 237310

9 years agoConstruct ArrayRef<const T*> from vector<T>
Pete Cooper [Wed, 13 May 2015 22:43:09 +0000 (22:43 +0000)]
Construct ArrayRef<const T*> from vector<T>

ArrayRef already has a SFINAE constructor which can construct ArrayRef<const T*> from ArrayRef<T*>.

This adds methods to do the same directly from SmallVector and std::vector.  This avoids an intermediate step through the use of makeArrayRef.

Also update the users of this in LICM and SROA to remove the now unnecessary makeArrayRef call.

Reviewed by David Blaikie.

llvm-svn: 237309

9 years ago[lib/Fuzzer] update docs about test corpuses in git
Kostya Serebryany [Wed, 13 May 2015 22:42:28 +0000 (22:42 +0000)]
[lib/Fuzzer] update docs about test corpuses in git

llvm-svn: 237308

9 years agoInstrProf: Fix display of large numbers in llvm-cov
Justin Bogner [Wed, 13 May 2015 22:41:48 +0000 (22:41 +0000)]
InstrProf: Fix display of large numbers in llvm-cov

llvm-cov was truncating numbers that were larger than a particular
fixed width, which is as confusing as it is useless. Instead, we use
engineering notation with SI prefix for magnitude.

llvm-svn: 237307

9 years agoAdd AArch64 and MIPS breakpoint opcodes and sort cases
Ed Maste [Wed, 13 May 2015 22:40:01 +0000 (22:40 +0000)]
Add AArch64 and MIPS breakpoint opcodes and sort cases

New opcodes from PlatformLinux.cpp

llvm-svn: 237306

9 years agoBreak \# in a depfile the same way as gcc.
Paul Robinson [Wed, 13 May 2015 22:33:50 +0000 (22:33 +0000)]
Break \# in a depfile the same way as gcc.

Backslash followed by # in a filename should have both characters
escaped, if you do it the way GNU Make wants.  GCC doesn't, so we do
it the way GCC does rather than the way GNU Make wants.

llvm-svn: 237304

9 years agoInitial FreeBSD/arm live debugging support
Ed Maste [Wed, 13 May 2015 22:33:12 +0000 (22:33 +0000)]
Initial FreeBSD/arm live debugging support

Patch by Tom Rix, except using the RegisterContextFreeBSD_arm files
added in r235305 instead.

llvm-svn: 237303

9 years agoRearrange PlatformFreeBSD to match PlatformLinux
Ed Maste [Wed, 13 May 2015 22:26:24 +0000 (22:26 +0000)]
Rearrange PlatformFreeBSD to match PlatformLinux

No functional change, but this simplifies diffs of the two.

llvm-svn: 237302

9 years agoAdd llvm::all_of which wraps std::all_of.
Pete Cooper [Wed, 13 May 2015 22:19:13 +0000 (22:19 +0000)]
Add llvm::all_of which wraps std::all_of.

This version doesn't need begin/end but can instead just take a type which has begin/end methods.

Use this to replace an eligible foreach loop in LoopInfo found by David Blaikie in r237224.

Reviewed by David Blaikie.

llvm-svn: 237301

9 years agoFix typo on Instruction::insert{After,Before}(). NFC
Jonathan Roelofs [Wed, 13 May 2015 22:14:43 +0000 (22:14 +0000)]
Fix typo on Instruction::insert{After,Before}(). NFC

llvm-svn: 237300

9 years agoMake GNUInline consistent with whether we use traditional GNU inline semantics.
Peter Collingbourne [Wed, 13 May 2015 22:07:22 +0000 (22:07 +0000)]
Make GNUInline consistent with whether we use traditional GNU inline semantics.

Previously we were setting LangOptions::GNUInline (which controls whether we
use traditional GNU inline semantics) if the language did not have the C99
feature flag set. The trouble with this is that C++ family languages also
do not have that flag set, so we ended up setting this flag in C++ modes
(and working around it in a few places downstream by also checking CPlusPlus).

The fix is to check whether the C89 flag is set for the target language,
rather than whether the C99 flag is cleared. This also lets us remove most
CPlusPlus checks. We continue to test CPlusPlus when deciding whether to
pre-define the __GNUC_GNU_INLINE__ macro for consistency with GCC.

There is a change in semantics in two other places
where we weren't checking both CPlusPlus and GNUInline
(FunctionDecl::doesDeclarationForceExternallyVisibleDefinition and
FunctionDecl::isInlineDefinitionExternallyVisible), but this change seems to
put us back into line with GCC's semantics (test case: test/CodeGen/inline.c).

While at it, forbid -fgnu89-inline in C++ modes, as GCC doesn't support it,
it didn't have any effect before, and supporting it just makes things more
complicated.

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

llvm-svn: 237299

9 years agoInstrProf: Treat functions with a coverage map but no profile as unreached
Justin Bogner [Wed, 13 May 2015 22:03:04 +0000 (22:03 +0000)]
InstrProf: Treat functions with a coverage map but no profile as unreached

If we have a coverage mapping but no profile data for a function,
calling it mismatched is misleading. This can just as easily be
unreachable code that was stripped from the binary. Instead, treat
these the same as functions where we have an explicit "zero" coverage
map by setting the count to zero for each mapped region.

llvm-svn: 237298

9 years agoMC: clang-format MCSymbol.h, NFC
Duncan P. N. Exon Smith [Wed, 13 May 2015 21:41:14 +0000 (21:41 +0000)]
MC: clang-format MCSymbol.h, NFC

llvm-svn: 237297

9 years agoFix dependency file escaping.
Paul Robinson [Wed, 13 May 2015 21:18:15 +0000 (21:18 +0000)]
Fix dependency file escaping.

When writing a dependency (.d) file, if space or # is immediately
preceded by one or more backslashes, escape the backslashes as well as
the space or # character. Otherwise leave backslash alone.
This straddles the fence between BSD Make (which does no escaping at
all, and does not support space or # in filespecs) and GNU Make (which
does support escaping, but will fall back to the filespec as-written
if the escaping doesn't match an existing file).

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

llvm-svn: 237296

9 years agoARM: remove possible vestiges of the legacy JIT???
Tim Northover [Wed, 13 May 2015 20:28:41 +0000 (20:28 +0000)]
ARM: remove possible vestiges of the legacy JIT???

There's no need to manually pass modifier strings around to tell an operand how
to print now, that information is encoded in the operand itself since the MC
layer came along.

llvm-svn: 237295

9 years agoARM: remove custom jump table UID
Tim Northover [Wed, 13 May 2015 20:28:38 +0000 (20:28 +0000)]
ARM: remove custom jump table UID

We were creating and propagating two separate indices for each jump table (from
back in the mists of time). However, the generic index used by other backends
is sufficient to emit a unique symbol so this was unneeded.

llvm-svn: 237294

9 years agoARM: refactor optimizeThumb2JumpTables.
Tim Northover [Wed, 13 May 2015 20:28:32 +0000 (20:28 +0000)]
ARM: refactor optimizeThumb2JumpTables.

The previous logic mixed 2 separate questions:
  + Can we form a TBB/TBH instruction?
  + Can we remove the jump-table calculation before it?

It then performed a bunch of random tests on the instructions earlier in the
basic block, which were probably sufficient to answer 2 but only because of the
very limited ways in which a t2BR_JT can actually be created.

For example there's no reason to expect the LeaInst to define the same base
register as the following indexing calulation. In practice this means we might
have missed opportunities to form TBB/TBH, in theory you could end up
misidentifying a sequence and removing the wrong LEA:

     %R1 = t2LEApcrelJT ...
     %R2 = t2LEApcrelJT ...
     <... using and killing %R2 ...>
     %R2 = t2ADDr %R1, $Ridx

Before we would have looked for an LEA defining %R2 and found the wrong one. We
just got lucky that jump table setup was (almost?) always confined to a single
basic block and there was only one jump table per block.

llvm-svn: 237293

9 years agoDon't import lock on Windows.
Zachary Turner [Wed, 13 May 2015 20:21:33 +0000 (20:21 +0000)]
Don't import lock on Windows.

lock imports fcntl, which doesn't exist on Windows.  If we need
to use this class on Windows, we will need to implement something
based on the CreateMutex API.

llvm-svn: 237292

9 years agoFix broken test, this wasn't supposed to get committed.
Zachary Turner [Wed, 13 May 2015 20:21:22 +0000 (20:21 +0000)]
Fix broken test, this wasn't supposed to get committed.

llvm-svn: 237291

9 years ago[Statepoints][Docs] Fix a couple of out of date examples.
Sanjoy Das [Wed, 13 May 2015 20:20:10 +0000 (20:20 +0000)]
[Statepoints][Docs] Fix a couple of out of date examples.

Things I had missed in r237285.

llvm-svn: 237290

9 years ago[Statepoints][Docs] Fix typo: change a period to a comma.
Sanjoy Das [Wed, 13 May 2015 20:19:51 +0000 (20:19 +0000)]
[Statepoints][Docs] Fix typo: change a period to a comma.

llvm-svn: 237289

9 years agoSelect expected remote libc++ library name based on remote platform.
Robert Flack [Wed, 13 May 2015 20:17:34 +0000 (20:17 +0000)]
Select expected remote libc++ library name based on remote platform.

Select expected remote libc++ library name based on remote platform. This is
used to verify libc++ is in the loaded image list by various tests which use it.

Test Plan:
Passes the following tests mac -> linux with this patch:
TestDataFormatterLibccIterator.py
TestDataFormatterLibccMap.py
TestDataFormatterLibccMultiMap.py
TestDataFormatterLibcxxMultiSet.py
TestDataFormatterLibcxxSet.py
TestDataFormatterUnordered.py

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

llvm-svn: 237288

9 years ago[Safepoints][Verifier] Fix a tautological Assert.
Sanjoy Das [Wed, 13 May 2015 20:11:59 +0000 (20:11 +0000)]
[Safepoints][Verifier] Fix a tautological Assert.

llvm-svn: 237287

9 years ago[PlaceSafepoints] New attributes for patchable statepoints.
Sanjoy Das [Wed, 13 May 2015 20:11:31 +0000 (20:11 +0000)]
[PlaceSafepoints] New attributes for patchable statepoints.

Summary:
This patch teaches the PlaceSafepoints pass about two `CallSite`
function attributes:

 * "statepoint-id": if the string value of this attribute can be parsed
   as an integer, then it is propagated to the ID parameter of the
   statepoint created.

 * "statepoint-num-patch-bytes": if the string value of this attribute
   can be parsed as an integer, then it is propagated to the `num patch
   bytes` parameter of the statepoint created.

This change intentionally does not assert on a malformed value for these
attributes, given that they're not "official" attributes.

Reviewers: reames, pgavlin

Subscribers: llvm-commits

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

llvm-svn: 237286

9 years ago[PlaceSafepoints] Update docs for r237214.
Sanjoy Das [Wed, 13 May 2015 20:11:24 +0000 (20:11 +0000)]
[PlaceSafepoints] Update docs for r237214.

Show the two new ID and NumPatchBytes fields in the PlaceSafepoint
examples in Statepoints.rst to avoid confusion.

llvm-svn: 237285

9 years ago[LoopIdiomRecognize] Use auto + range-based loop. NFC intended.
Davide Italiano [Wed, 13 May 2015 19:51:21 +0000 (19:51 +0000)]
[LoopIdiomRecognize] Use auto + range-based loop. NFC intended.

llvm-svn: 237284

9 years agoFix line endings.
Zachary Turner [Wed, 13 May 2015 19:45:06 +0000 (19:45 +0000)]
Fix line endings.

I must have committed these with windows line endings a few months
ago when I did this work.

llvm-svn: 237283

9 years agoFix an issue with finding python on Windows.
Zachary Turner [Wed, 13 May 2015 19:44:57 +0000 (19:44 +0000)]
Fix an issue with finding python on Windows.

Someone must have changed the behavior of FileSpec slightly
relating to whether or not there is a trailing backslash when calling
GetPath() and GetDirectory().  This caused ScriptInterpreterPython
to find the wrong values when initializing sys.path, and as a result
we couldn't find the lldb module.

This patch fixes the issue, and also adds a test to make sure that
GetDirectory() does not return a string containing a trailing slash.

llvm-svn: 237282

9 years agoRemove DoAttachToProcessWithId(lldb::pid_t).
Zachary Turner [Wed, 13 May 2015 19:44:44 +0000 (19:44 +0000)]
Remove DoAttachToProcessWithId(lldb::pid_t).

There were two versions of DoAttachToprocessWithId.  One that takes
a pid_t, and the other which takes a pid_t and a ProcessAttachInfo.
There were no callers of the former version, and all of the
implementations of this version were simply forwarding calls to
one version or the other.

llvm-svn: 237281

9 years agoHave Platform::KillProcess try to use the process plugin first.
Zachary Turner [Wed, 13 May 2015 19:44:24 +0000 (19:44 +0000)]
Have Platform::KillProcess try to use the process plugin first.

llvm-svn: 237280

9 years agoAdd a comment clarifying what func_name_type_mask is.
Jim Ingham [Wed, 13 May 2015 19:01:15 +0000 (19:01 +0000)]
Add a comment clarifying what func_name_type_mask is.

llvm-svn: 237279

9 years agoChange Linux Platform to support non-host Linux architectures
Ted Woodward [Wed, 13 May 2015 18:52:56 +0000 (18:52 +0000)]
Change Linux Platform to support non-host Linux architectures

Summary:
This was originally http://reviews.llvm.org/D8709 , but I didn't commit it correctly.

Since then GetSupportedArchitectureAtIndex() has been changed. That change, http://reviews.llvm.org/D9511 , breaks non-x86 linux implementations, so this change goes back to the old implementation and adds remote linux support from D8709.

D8709 summary:

The Linux Platform currently will only say the Host architecture is supported. This patch retains that behavior for the Host Platform, but adds a list of architectures for the Remote Platform.

Reviewers: clayborg, flackr

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 237278

9 years ago[llvm-bcanalyzer] Add -show-binary-blobs option.
Jordan Rose [Wed, 13 May 2015 18:51:49 +0000 (18:51 +0000)]
[llvm-bcanalyzer] Add -show-binary-blobs option.

-dump mode normally omits blob data that contains unprintable characters.
When -show-binary-blobs is passed, it unilaterally escapes all blobs,
allowing those with binary data to be displayed.

llvm-svn: 237276

9 years agoMC: Modernize MCOperand API naming. NFC.
Jim Grosbach [Wed, 13 May 2015 18:37:00 +0000 (18:37 +0000)]
MC: Modernize MCOperand API naming. NFC.

MCOperand::Create*() methods renamed to MCOperand::create*().

llvm-svn: 237275

9 years ago[opaque pointer type] Constant Folding: Use GEPOperator to access the pointee source...
David Blaikie [Wed, 13 May 2015 18:35:29 +0000 (18:35 +0000)]
[opaque pointer type] Constant Folding: Use GEPOperator to access the pointee source type rather than going through the first operand's pointer type

llvm-svn: 237274

9 years ago[opaque pointer type] Pass the explicit function type down to the instruction constru...
David Blaikie [Wed, 13 May 2015 18:35:26 +0000 (18:35 +0000)]
[opaque pointer type] Pass the explicit function type down to the instruction constructor when parsing invoke instructions

llvm-svn: 237273

9 years ago[lib/Fuzzer] enable -use_counters=1 by default
Kostya Serebryany [Wed, 13 May 2015 18:31:46 +0000 (18:31 +0000)]
[lib/Fuzzer] enable -use_counters=1 by default

llvm-svn: 237272

9 years agoCheck the host platform to determine logging channel to test in TestRegisters.py
Robert Flack [Wed, 13 May 2015 18:23:10 +0000 (18:23 +0000)]
Check the host platform to determine logging channel to test in TestRegisters.py

Checks the host platform to determine logging channel to test in
TestRegisters.py as the logging runs host side.

Test Plan:
./dotest.py $DOTEST_OPTS -v -t -p TestRegisters.py
This passes mac -> linux as it's logging the correct channel.

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

llvm-svn: 237271

9 years agoEnable workaround for finding functions in global namespace on linux binaries on
Robert Flack [Wed, 13 May 2015 18:20:02 +0000 (18:20 +0000)]
Enable workaround for finding functions in global namespace on linux binaries on
all hosts.

We require a workaround to be able to locate global and anonymous namespace
functions in the dwarf symbols on linux binaries. This patch enables this code
on all platforms so that we can still find these symbols when debugging from a
different host platform.

Test Plan:
The following tests begin passing when running with a mac host to linux client:
TestCallCPPFunction.py
TestCallStopAndContinue.py
TestExprs.py
TestExprsChar.py
TestNamespace.py
TestOverloadedFunctions.py
TestRvalueReferences.py
TestThreadExit.py

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

llvm-svn: 237270

9 years ago[NaryReassociate] avoid running forever
Jingyue Wu [Wed, 13 May 2015 18:12:24 +0000 (18:12 +0000)]
[NaryReassociate] avoid running forever

Avoid running forever by checking we are not reassociating an expression into
the same form.

Tested with @avoid_infinite_loops in nary-add.ll

llvm-svn: 237269

9 years agoMade considerable updates to the documentation explaining how to add a new attribute...
Aaron Ballman [Wed, 13 May 2015 18:06:48 +0000 (18:06 +0000)]
Made considerable updates to the documentation explaining how to add a new attribute to clang. Cleans up some of the existing wording, as well as adding new information and better explanations.

llvm-svn: 237268

9 years agoSilence Visual C++ warning C4189: 'Result' : local variable is initialized but not...
Yaron Keren [Wed, 13 May 2015 17:56:46 +0000 (17:56 +0000)]
Silence Visual C++ warning C4189: 'Result' : local variable is initialized but not referenced.

Sadly, LLVM_ATTRIBUTE_UNUSED does nothing with Visual C++ which means
we'll have to workaround such cases again and again.

llvm-svn: 237267

9 years ago[Hexagon] Generate loop1 instruction for nested loops
Brendon Cahoon [Wed, 13 May 2015 17:56:03 +0000 (17:56 +0000)]
[Hexagon] Generate loop1 instruction for nested loops

loop1 is for the outer loop and loop0 is for the inner loop.

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

llvm-svn: 237266

9 years agoAdd function entry counts from sample profiles.
Diego Novillo [Wed, 13 May 2015 17:04:29 +0000 (17:04 +0000)]
Add function entry counts from sample profiles.

This patch uses the new function profile metadata "function_entry_count"
to annotate entry counts from sample profiles.

In a sampling profile, the total samples collected at the function entry
are an approximation for the number of times that function was invoked.

llvm-svn: 237265

9 years agoImplement std::experimental::sample.
Evgeniy Stepanov [Wed, 13 May 2015 16:55:41 +0000 (16:55 +0000)]
Implement std::experimental::sample.

Following specification in "C++ Extensions for Library Fundamentals":
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#alg.random.sample

llvm-svn: 237264

9 years agoclang-format: Improve nested block / lambda indentation when wrapping
Daniel Jasper [Wed, 13 May 2015 16:09:21 +0000 (16:09 +0000)]
clang-format: Improve nested block / lambda indentation when wrapping
before binary/ternary operators.

Basically, it doesn't seem right to indent a nested block aligned to a
binary or ternary operator.

Before:
  int i = aaaaaa ? 1  //
                 : [] {
                   return 2;  //
                 }();
  llvm::errs() << "number of twos is "
               << std::count_if(v.begin(), v.end(), [](int x) {
                 return x == 2;  // force break
               });

After:
  int i = aaaaaa ? 1  //
                 : [] {
                     return 2;  //
                   }();
  llvm::errs() << "number of twos is "
               << std::count_if(v.begin(), v.end(), [](int x) {
                    return x == 2;  // force break
                  });

llvm-svn: 237263

9 years ago[mips] [IAS] Preemptively fix warning introduced by r237255. NFC.
Toma Tabacu [Wed, 13 May 2015 16:02:41 +0000 (16:02 +0000)]
[mips] [IAS] Preemptively fix warning introduced by r237255. NFC.

Some compilers warn about using the ternary operator with an unsigned variable
and enum.
I haven't seen this trigger in the llvm.org buildbots yet, but it probably will
at some point.

Reported by Daniel Sanders.

llvm-svn: 237262

9 years agoUpdate ELFObjectWriter::reset() following r236255.
Yaron Keren [Wed, 13 May 2015 15:17:19 +0000 (15:17 +0000)]
Update ELFObjectWriter::reset() following r236255.

llvm-svn: 237261

9 years agoAdd function entry count metadata.
Diego Novillo [Wed, 13 May 2015 15:13:45 +0000 (15:13 +0000)]
Add function entry count metadata.

Summary:
This adds three Function methods to handle function entry counts:
setEntryCount() and getEntryCount().

Entry counts are stored under the MD_prof metadata node with the name
"function_entry_count". They are unsigned 64 bit values set by profilers
(instrumentation and sample profiler changes coming up).

Added documentation for new profile metadata and tests.

Reviewers: dexonsmith, bogner

Subscribers: llvm-commits

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

llvm-svn: 237260

9 years agoTest commit: Remove unnecessary spaces.
Teresa Johnson [Wed, 13 May 2015 15:04:14 +0000 (15:04 +0000)]
Test commit: Remove unnecessary spaces.

llvm-svn: 237259

9 years ago[Hexagon] Generate hardware loop when loop has a critical edge
Brendon Cahoon [Wed, 13 May 2015 14:54:24 +0000 (14:54 +0000)]
[Hexagon] Generate hardware loop when loop has a critical edge

The hardware loop pass should try to generate a hardware loop
instruction when the original loop has a critical edge.

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

llvm-svn: 237258

9 years ago[mips][microMIPSr6] Implement CLO and CLZ instructions
Jozef Kolek [Wed, 13 May 2015 14:18:11 +0000 (14:18 +0000)]
[mips][microMIPSr6] Implement CLO and CLZ instructions

This patch implements CLO and CLZ instructions using mapping.

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

llvm-svn: 237257

9 years agoRevert r237247 - [AArch64] Codegen VMAX/VMIN.. as it is causing failures in SPEC2000...
Silviu Baranga [Wed, 13 May 2015 14:03:18 +0000 (14:03 +0000)]
Revert r237247 - [AArch64] Codegen VMAX/VMIN.. as it is causing failures in SPEC2000/2006

llvm-svn: 237256

9 years ago[mips] [IAS] Unify common functionality of LA and LI.
Toma Tabacu [Wed, 13 May 2015 13:56:16 +0000 (13:56 +0000)]
[mips] [IAS] Unify common functionality of LA and LI.

Summary: A side-effect of this is that LA gains proper handling of unsigned and positive signed 16-bit immediates and more accurate error messages.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237255

9 years agoRemoved mentioning of OpenMP as unsupported feature (patch2 from A.Bokhanko)
Andrey Churbanov [Wed, 13 May 2015 13:42:59 +0000 (13:42 +0000)]
Removed mentioning of OpenMP as unsupported feature (patch2 from A.Bokhanko)

llvm-svn: 237253

9 years agoUpdate isl to 9f767f1766a0
Tobias Grosser [Wed, 13 May 2015 13:10:13 +0000 (13:10 +0000)]
Update isl to 9f767f1766a0

This fixes a bug in the isl scheduler (http://llvm.org/PR21934)

Otherwise mostly minor changes.

llvm-svn: 237250

9 years agoclang-format: Fix incorrect */& classification.
Daniel Jasper [Wed, 13 May 2015 12:54:30 +0000 (12:54 +0000)]
clang-format: Fix incorrect */& classification.

Before:
  void f() { f(new a(), c *d); }

After:
  void f() { f(new a(), c * d); }

llvm-svn: 237249

9 years agoRefactor lldb-mi's prompt
Ilia K [Wed, 13 May 2015 12:18:20 +0000 (12:18 +0000)]
Refactor lldb-mi's prompt

Summary:
This patch fixes/cleans code around of (gdb) prompt:
# Add CMICmnStreamStdout::WritePrompt
# Clean up CMICmnStreamStdout::TextToStdout (don't lock
  the m_mutex twice because it will be locked in CMICmnStreamStdout::WritePriv)
# Remove unused CMICmnStreamStdin::m_bShowPrompt field
# Refactor CMICmnLLDBDebuggerHandleEvents to use CMICmnStreamStdout::WritePrompt
  instead of TextToStdout("(gdb)")
# Refactor CMIDriver to use CMICmnStreamStdout::WritePrompt instead of
  ```
    if (bOk && m_rStdin.GetEnablePrompt())
        bOk = m_rStdOut.WriteMIResponse(m_rStdin.GetPrompt());
  ```

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 237248

9 years ago[AArch64] Codegen VMAX/VMIN for safe math cases
Artyom Skrobov [Wed, 13 May 2015 12:01:09 +0000 (12:01 +0000)]
[AArch64] Codegen VMAX/VMIN for safe math cases

llvm-svn: 237247

9 years agoclang-format: Fix semicolon less macro-detection.
Daniel Jasper [Wed, 13 May 2015 11:35:53 +0000 (11:35 +0000)]
clang-format: Fix semicolon less macro-detection.

It was fooled by the comment.

Before:
  SOME_UNRELATED_MACRO
      /*static*/ int i;

After:
  SOME_UNRELATED_MACRO
  /*static*/ int i;

llvm-svn: 237246

9 years agoReverting r237234, "Use std::bitset for SubtargetFeatures"
Michael Kuperstein [Wed, 13 May 2015 10:28:46 +0000 (10:28 +0000)]
Reverting r237234, "Use std::bitset for SubtargetFeatures"

The buildbots are still not satisfied.
MIPS and ARM are failing (even though at least MIPS was expected to pass).

llvm-svn: 237245

9 years agoclang-format: [ObjC] Further improve wrapping of methods calls without inputs.
Daniel Jasper [Wed, 13 May 2015 10:23:03 +0000 (10:23 +0000)]
clang-format: [ObjC] Further improve wrapping of methods calls without inputs.

Before:
  [aaaaaaaaaaaaaaaaaaaaaaa
      .aaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];

After:
  [aaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaa[aaaaaaaaaaaaaaaaaaaaa]
      aaaaaaaaaaaaaaaaaaaaaa];

llvm-svn: 237244

9 years ago[OPENMP] Fixed codegen for firstprivate variables, also marked as lastprivate.
Alexey Bataev [Wed, 13 May 2015 10:23:02 +0000 (10:23 +0000)]
[OPENMP] Fixed codegen for firstprivate variables, also marked as lastprivate.

In some rare cases shared copies of lastprivate/firstprivate variables were not updated after the loop directive.

llvm-svn: 237243

9 years ago[mips] [IAS] Merge the micromips-expressions.s test into expr1.s. NFC.
Toma Tabacu [Wed, 13 May 2015 09:53:53 +0000 (09:53 +0000)]
[mips] [IAS] Merge the micromips-expressions.s test into expr1.s. NFC.

Summary: Also did some minor reformatting in the resulting test.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237242

9 years agoclang-format: [ObjC] Make IndentWrappedFunctionNames work with ObjC functions
Daniel Jasper [Wed, 13 May 2015 09:38:25 +0000 (09:38 +0000)]
clang-format: [ObjC] Make IndentWrappedFunctionNames work with ObjC functions

llvm-svn: 237241

9 years agoFix arm instruction emulation of add (imm) and sub (imm)
Tamas Berghammer [Wed, 13 May 2015 09:25:06 +0000 (09:25 +0000)]
Fix arm instruction emulation of add (imm) and sub (imm)

Differential revision: http://reviews.llvm.org/D9704

llvm-svn: 237240

9 years agoRemote Non-Stop Support
Ewan Crawford [Wed, 13 May 2015 09:18:18 +0000 (09:18 +0000)]
Remote Non-Stop Support

Summary:

This patch is the beginnings of support for Non-stop mode in the remote protocol. Letting a user examine stopped threads, while other threads execute freely.

Non-stop mode is enabled using the setting target.non-stop-mode, which sends a QNonStop packet when establishing the remote connection.
Changes are also made to treat the '?' stop reply packet differently in non-stop mode, according to spec https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Non_002dStop.html#Remote-Non_002dStop.
A setting for querying the remote for default thread on setup is also included.

Handling of '%' async notification packets will be added next.

Reviewers: clayborg

Subscribers: lldb-commits, ADodds, ted, deepak2427

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

llvm-svn: 237239

9 years agoFix a few compile warnings
Ilia K [Wed, 13 May 2015 09:04:59 +0000 (09:04 +0000)]
Fix a few compile warnings

llvm-svn: 237238

9 years ago[DebugInfo] Debug locations for constant SD nodes
Sergey Dmitrouk [Wed, 13 May 2015 08:58:03 +0000 (08:58 +0000)]
[DebugInfo] Debug locations for constant SD nodes

Several updates for [DebugInfo] Add debug locations to constant SD nodes (r235989).
Includes:

 *  re-enabling the change (disabled recently);
 *  missing change for FP constants;
 *  resetting debug location of constant node if it's used more than at one place
    to prevent emission of wrong locations in case of coalesced constants;
 *  a couple of additional tests.

Now all look ups in CSEMap are wrapped by additional method.

Comment in D9084 suggests that debug locations aren't useful for "target constants",
so there might be one more change related to this API (namely, dropping debug
locations for getTarget*Constant methods).

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

llvm-svn: 237237

9 years agoclang-format: Prefer formatting local lambdas like functions.
Daniel Jasper [Wed, 13 May 2015 08:47:16 +0000 (08:47 +0000)]
clang-format: Prefer formatting local lambdas like functions.

Before:
  auto my_lambda =
      [](const string &some_parameter) { return some_parameter.size(); };

After:
  auto my_lambda = [](const string &some_parameter) {
    return some_parameter.size();
  };

llvm-svn: 237235

9 years agoUse std::bitset for SubtargetFeatures
Michael Kuperstein [Wed, 13 May 2015 08:27:08 +0000 (08:27 +0000)]
Use std::bitset for SubtargetFeatures

Previously, subtarget features were a bitfield with the underlying type being uint64_t.
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first two times this was committed (r229831, r233055), it caused several buildbot failures.
At least some of the ARM and MIPS ones were due to gcc/binutils issues, and should now be fixed.

llvm-svn: 237234

9 years agoclang-format: Support column layout with comment after {.
Daniel Jasper [Wed, 13 May 2015 08:16:00 +0000 (08:16 +0000)]
clang-format: Support column layout with comment after {.

Before:
  vector<int> iiiiiiiiiiiiiii = {                      //
      11111111112222222222333333333334444444444, //
      1111111112222222223333333333444444444,     //
      111111112222222233333333344444444};

After:
  vector<int> iiiiiiiiiiiiiii = {                      //
      11111111112222222222333333333334444444444, //
      111111111,  222222222,  3333333333,  444444444,  //
      11111111,   22222222,   333333333,   44444444};

llvm-svn: 237233

9 years agoAVX-512: fixed a bug in encoding of VPSRAQ instrcution,
Elena Demikhovsky [Wed, 13 May 2015 07:35:05 +0000 (07:35 +0000)]
AVX-512: fixed a bug in encoding of VPSRAQ instrcution,
added a bunch of encoding tests.

llvm-svn: 237232

9 years agoUse ArrayRef::slice instead of manually constructing an ArrayRef from ArrayRef iterat...
Craig Topper [Wed, 13 May 2015 06:57:51 +0000 (06:57 +0000)]
Use ArrayRef::slice instead of manually constructing an ArrayRef from ArrayRef iterators. NFC

llvm-svn: 237231

9 years agoDarwin - fix intermitent crashes in import crashinfo
Vince Harron [Wed, 13 May 2015 05:00:23 +0000 (05:00 +0000)]
Darwin - fix intermitent crashes in import crashinfo

Summary:
"import crashinfo" was probably failing because multiple dotest invocations
are all trying to compile crashinfo.so at the same time.

I've put a mutex around the compile step to prevent this.

Reviewers: clayborg, chying

Subscribers: lldb-commits

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

llvm-svn: 237230

9 years agoUse a more accurate implementation for exp
Tom Stellard [Wed, 13 May 2015 03:55:09 +0000 (03:55 +0000)]
Use a more accurate implementation for exp

Using exp2(x * M_LOG2E_F) does not give us accurate enough results for
OpenCL.  If you look at the new exp implementation you'll see that
it does multiply the input by M_LOG2E_F, but it still uses the original
input in part of the calculation.

This exp implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 237229

9 years agoImplement exp2 using OpenCL C rather than using an intrinsic
Tom Stellard [Wed, 13 May 2015 03:55:07 +0000 (03:55 +0000)]
Implement exp2 using OpenCL C rather than using an intrinsic

Not all targets support the intrinsic, so it's better to have a
generic implementation which does not use it.

This exp2 implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 237228

9 years agoConstify arguments to methods in LICM. NFC
Pete Cooper [Wed, 13 May 2015 01:12:18 +0000 (01:12 +0000)]
Constify arguments to methods in LICM.  NFC

llvm-svn: 237227

9 years agoChange LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&.
Pete Cooper [Wed, 13 May 2015 01:12:16 +0000 (01:12 +0000)]
Change LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&.

The array passed to LoadAndStorePromoter's constructor was a constant reference to a SmallVectorImpl, which is just the same as passing an ArrayRef.

Also, the data in the array can be 'const Instruction*' instead of 'Instruction*'.  Its not possible to convert a SmallVectorImpl<T*> to SmallVectorImpl<const T*>, but ArrayRef does provide such a method.

Currently this added calls to makeArrayRef which should be a nop, but i'm going to kick off a discussion about improving ArrayRef to not need these.

llvm-svn: 237226

9 years agoConstify arguments in AliasSetTracker methods. NFC
Pete Cooper [Wed, 13 May 2015 01:12:12 +0000 (01:12 +0000)]
Constify arguments in AliasSetTracker methods.  NFC

llvm-svn: 237225

9 years agoChange a loop in LoopInfo to foreach. NFC
Pete Cooper [Wed, 13 May 2015 01:12:09 +0000 (01:12 +0000)]
Change a loop in LoopInfo to foreach.  NFC

llvm-svn: 237224

9 years agoConstify arguments to methods in LoopInfo. NFC
Pete Cooper [Wed, 13 May 2015 01:12:06 +0000 (01:12 +0000)]
Constify arguments to methods in LoopInfo.  NFC

llvm-svn: 237223

9 years ago[LLD] Properly relocate the LSDA field of MachO eh-frames.
Lang Hames [Wed, 13 May 2015 00:44:47 +0000 (00:44 +0000)]
[LLD] Properly relocate the LSDA field of MachO eh-frames.

Previously the LSDA field was not being relocated during linking, leading to
failures for some EH tests.

llvm-svn: 237222

9 years agoDon't change the selected platform when creating the dummy target.
Robert Flack [Wed, 13 May 2015 00:39:24 +0000 (00:39 +0000)]
Don't change the selected platform when creating the dummy target.

A dummy target is used by TargetList::CreateTargetInternal to prime newly
created targets. the first time this is done it creates the dummy target. The
dummy target is created with the host platform (See
TargetList::CreateDummyTarget) which results in switching the selected platform
back to the host platform even when creating a target for a different platform.
This change avoids changing the selected platform while creating the dummy
target to prevent this side effect.

Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestCreateAfterAttach.py
Tests using process attach (e.g. TestCreateAfterAttach.py, TestHelloWorld.py)
now run successfully mac -> linux.

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

llvm-svn: 237221

9 years ago[PlaceSafepoints] Reduce dominator tree recalculation
Philip Reames [Wed, 13 May 2015 00:32:23 +0000 (00:32 +0000)]
[PlaceSafepoints] Reduce dominator tree recalculation

Reduce recalculation of the dominator tree by identifying all sites that will need a safepoint poll before doing any of the insertion. This allows us to invalidate the dominator info once, rather than once per safepoint poll inserted.

While I'm at it, update findLocationForEntrySafepoint to properly update the dom tree now that the interface has been made easy. When first written, it wasn't per comment in the code.

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

llvm-svn: 237220

9 years ago[LLD] Add support for MachO ripRel32MinusNAnon relocations.
Lang Hames [Wed, 13 May 2015 00:29:43 +0000 (00:29 +0000)]
[LLD] Add support for MachO ripRel32MinusNAnon relocations.

llvm-svn: 237219

9 years agoFixed a ton of gcc compile warnings
Vince Harron [Wed, 13 May 2015 00:25:54 +0000 (00:25 +0000)]
Fixed a ton of gcc compile warnings

Removed some unused variables, added some consts, changed some casts
to const_cast. I don't think any of these changes are very
controversial.

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

llvm-svn: 237218

9 years ago[LLD] Add a mutex to prevent concurrent modification of the dylib maps in
Lang Hames [Wed, 13 May 2015 00:17:08 +0000 (00:17 +0000)]
[LLD] Add a mutex to prevent concurrent modification of the dylib maps in
MachOLinkingContext.

llvm-svn: 237217