platform/upstream/llvm.git
9 years agoAdd disassembler tests for mips2 platform. There are no functional changes.
Vladimir Medic [Mon, 15 Dec 2014 15:58:20 +0000 (15:58 +0000)]
Add disassembler tests for mips2 platform. There are no functional changes.

llvm-svn: 224252

9 years agoThis is the first in a series of patches that add missing disassembler tests for...
Vladimir Medic [Mon, 15 Dec 2014 15:22:33 +0000 (15:22 +0000)]
This is the first in a series of patches that add missing disassembler tests for mips platform. The patches are divided per version of mips CPU to keep the patches smaller and ease the review. There are no functional changes, code is changed only if new tests reveal a bug.This patch adds disassembler tests for mips1 CPU.

llvm-svn: 224251

9 years agoAdd voidType() matcher.
Samuel Benzaquen [Mon, 15 Dec 2014 15:09:22 +0000 (15:09 +0000)]
Add voidType() matcher.

Summary: Add voidType() matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 224250

9 years agoChanging a cast from unsigned to uint64_t, should be NFC in practice.
Aaron Ballman [Mon, 15 Dec 2014 14:25:12 +0000 (14:25 +0000)]
Changing a cast from unsigned to uint64_t, should be NFC in practice.

llvm-svn: 224249

9 years agoAdded a test related to 224247 revision
Elena Demikhovsky [Mon, 15 Dec 2014 14:14:10 +0000 (14:14 +0000)]
Added a test related to 224247 revision

llvm-svn: 224248

9 years agoSink store based on alias analysis
Elena Demikhovsky [Mon, 15 Dec 2014 14:09:53 +0000 (14:09 +0000)]
Sink store based on alias analysis
 - by Ella Bolshinsky
The alias analysis is used define whether the given instruction
is a barrier for store sinking. For 2 identical stores, following
instructions are checked in the both basic blocks, to determine
whether they are sinking barriers.

http://reviews.llvm.org/D6420

llvm-svn: 224247

9 years ago[X86] Break false dependencies before partial register updates when the source operan...
Michael Kuperstein [Mon, 15 Dec 2014 13:18:21 +0000 (13:18 +0000)]
[X86] Break false dependencies before partial register updates when the source operand is in memory

Adds the various "rm" instruction variants into the list of instructions that have a partial register update. Also adds all variants of SQRTSD that were missing in the original list.

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

llvm-svn: 224246

9 years agoReplace ReaderError with DynamicError.
Rui Ueyama [Mon, 15 Dec 2014 12:20:13 +0000 (12:20 +0000)]
Replace ReaderError with DynamicError.

ReaderErrorCategory was used only at one place. We now have a
DynamicErrorCategory for this kind of one-time error, so use it.
The calling function doesn't really care the type of an error, so
ReaderErrorCategory was actually dead code.

llvm-svn: 224245

9 years agoTypo Correction in Test Case. NFC.
Suyog Sarda [Mon, 15 Dec 2014 12:19:46 +0000 (12:19 +0000)]
Typo Correction in Test Case. NFC.

llvm-svn: 224244

9 years ago[ubsan][arm] supporting misaligned testcase
Kumar Sukhani [Mon, 15 Dec 2014 12:16:36 +0000 (12:16 +0000)]
[ubsan][arm] supporting misaligned testcase

After previous commit: http://reviews.llvm.org/rL224242, misaligned testcase is now supported on ARM also

llvm-svn: 224243

9 years ago[UBSan][MIPS] Adding support of MIPS64 in UBSan testing
Kumar Sukhani [Mon, 15 Dec 2014 10:52:06 +0000 (10:52 +0000)]
[UBSan][MIPS] Adding support of MIPS64 in UBSan testing

On mips64 addresses are 40-bit. Where as a 48 bit address is used in TypeCheck/misaligned.cpp.
Using regular expression for that address.

reviewed by : samsonov
submitted by: sagar

llvm-svn: 224242

9 years agoAVX-512: Added EXPAND instructions and intrinsics.
Elena Demikhovsky [Mon, 15 Dec 2014 10:03:52 +0000 (10:03 +0000)]
AVX-512: Added EXPAND instructions and intrinsics.

llvm-svn: 224241

9 years agoSema: Don't diagnose string + int if the int is value dependent
David Majnemer [Mon, 15 Dec 2014 10:00:35 +0000 (10:00 +0000)]
Sema: Don't diagnose string + int if the int is value dependent

Don't send a value dependent expression into the expression evaluator,
HandleSizeof would crash.  Making HandleSizeof handle dependent types
would noisily warn about the operation even if everything turns out OK
after instantiation.

This fixes PR21848.

llvm-svn: 224240

9 years ago[UBSan][MIPS] Adding support for MIPS64
Kumar Sukhani [Mon, 15 Dec 2014 09:20:06 +0000 (09:20 +0000)]
[UBSan][MIPS] Adding support for MIPS64

No MIPS64 architecture dependant code

reviewed by : samsonov
submitted by: sagar

llvm-svn: 224239

9 years agoPreprocessor: Recover instead of mutating a token in ExpandBuiltinMacro
David Majnemer [Mon, 15 Dec 2014 09:03:58 +0000 (09:03 +0000)]
Preprocessor: Recover instead of mutating a token in ExpandBuiltinMacro

We would CreateString on arbitrary garbage instead of just skipping to
the end of the builtin macro.  Eventually, this would cause us to crash
because we would end up replacing the contents of a character token with
a numeric literal.

This fixes PR21825.

llvm-svn: 224238

9 years agoSema: Don't leave switch stack inconsistent when recovering
David Majnemer [Mon, 15 Dec 2014 07:46:12 +0000 (07:46 +0000)]
Sema: Don't leave switch stack inconsistent when recovering

We would exit Sema::ActOnFinishSwitchStmt early if we didn't have a
body.  This would leave an extra SwitchStmt on the SwitchStack.

This fixes PR21841.

llvm-svn: 224237

9 years agoRemove dead code.
Rui Ueyama [Mon, 15 Dec 2014 07:22:29 +0000 (07:22 +0000)]
Remove dead code.

This field was not even initialized properly.

llvm-svn: 224236

9 years agoProtect doParse() because that's not a public interface.
Rui Ueyama [Mon, 15 Dec 2014 07:14:32 +0000 (07:14 +0000)]
Protect doParse() because that's not a public interface.

llvm-svn: 224235

9 years agoTest for 'omp for' (for r224233).
Alexander Musman [Mon, 15 Dec 2014 07:08:38 +0000 (07:08 +0000)]
Test for 'omp for' (for r224233).

llvm-svn: 224234

9 years agoFirst patch with codegen of the 'omp for' directive. It implements
Alexander Musman [Mon, 15 Dec 2014 07:07:06 +0000 (07:07 +0000)]
First patch with codegen of the 'omp for' directive. It implements
the simplest case, which is used when no chunk_size is specified in
the schedule(static) or no 'schedule' clause is specified - the
iteration space is divided by the library into chunks that are
approximately equal in size, and at most one chunk is distributed
to each thread. In this case, we do not need an outer loop in each
thread - each thread requests once which iterations range it should
handle (using __kmpc_for_static_init runtime call) and then runs the
inner loop on this range.

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

llvm-svn: 224233

9 years agoParse: Don't reorder tokens using ConsumeToken
David Majnemer [Mon, 15 Dec 2014 07:00:05 +0000 (07:00 +0000)]
Parse: Don't reorder tokens using ConsumeToken

ConsumeToken doesn't work with special tokens.  Instead, just use PP.Lex
to eat the token.

This fixes PR21817.

llvm-svn: 224232

9 years agoFixed test/CodeGen/atomic_ops.c for compatibility with hexagon target
Alexey Bataev [Mon, 15 Dec 2014 06:12:42 +0000 (06:12 +0000)]
Fixed test/CodeGen/atomic_ops.c for compatibility with hexagon target

llvm-svn: 224231

9 years agoBugfix for Codegen of atomic load/store/other ops.
Alexey Bataev [Mon, 15 Dec 2014 05:25:25 +0000 (05:25 +0000)]
Bugfix for Codegen of atomic load/store/other ops.
Currently clang fires assertions on x86-64 on any atomic operations for long double operands. Patch fixes codegen for such operations.
Differential Revision: http://reviews.llvm.org/D6499

llvm-svn: 224230

9 years agoFix line mapping information in LLVM JIT profiling with Vtune
Alexey Bataev [Mon, 15 Dec 2014 04:45:43 +0000 (04:45 +0000)]
Fix line mapping information in LLVM JIT profiling with Vtune
The line mapping information for dynamic code is reported incorrectly. It causes VTune to map LLVM generated code to source lines incorrectly. This patch fix this issue.
Patch by Denis Pravdin.
Differential Revision: http://reviews.llvm.org/D6603

llvm-svn: 224229

9 years agoMSVC: A wide string literal from L#macro_arg in a macro
Alexey Bataev [Mon, 15 Dec 2014 04:18:11 +0000 (04:18 +0000)]
MSVC: A wide string literal from L#macro_arg in a macro
Clang should form a wide string literal from L#macro_arg in a function-like macro in -fms-compatibility mode.
Fix for http://llvm.org/PR9984.
Differential Revision: http://reviews.llvm.org/D6604

llvm-svn: 224228

9 years agoThreadLocal: Move Unix-specific code out of Support/ThreadLocal.cpp
David Majnemer [Mon, 15 Dec 2014 01:19:53 +0000 (01:19 +0000)]
ThreadLocal: Move Unix-specific code out of Support/ThreadLocal.cpp

Just a cleanup, no functionality change is intended.

llvm-svn: 224227

9 years agoStringPool: Cleanup typos in unittest comments
David Majnemer [Mon, 15 Dec 2014 01:04:49 +0000 (01:04 +0000)]
StringPool: Cleanup typos in unittest comments

No functional change intended.

llvm-svn: 224226

9 years agoThreadLocal: Return a mutable pointer if templated with a non-const type
David Majnemer [Mon, 15 Dec 2014 01:04:45 +0000 (01:04 +0000)]
ThreadLocal: Return a mutable pointer if templated with a non-const type

It makes more sense for ThreadLocal<const T>::get to return a const T*
and ThreadLocal<T>::get to return a T*.

llvm-svn: 224225

9 years agoUse unique_ptr to remove explicit delete.
Craig Topper [Mon, 15 Dec 2014 00:40:07 +0000 (00:40 +0000)]
Use unique_ptr to remove explicit delete.

llvm-svn: 224224

9 years agoDon't break single-line raw string literals.
Alexander Kornienko [Sun, 14 Dec 2014 20:47:11 +0000 (20:47 +0000)]
Don't break single-line raw string literals.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 224223

9 years agoUpdate test case with more accurate column information now that Clang produces same
David Blaikie [Sun, 14 Dec 2014 18:49:31 +0000 (18:49 +0000)]
Update test case with more accurate column information now that Clang produces same

llvm-svn: 224222

9 years agoDebugInfo: More accurate line information for placement new.
David Blaikie [Sun, 14 Dec 2014 18:48:18 +0000 (18:48 +0000)]
DebugInfo: More accurate line information for placement new.

This actually came up as a break in UBSan tests (look for a follow-up
commit to this one to see the UBSan test fallout) when I tried a broader
fix to location information.

I have some other ideas about how to do that broader change & will keep
looking into it.

llvm-svn: 224221

9 years agoCodeGen: Compound literals with funny types shouldn't crash
David Majnemer [Sun, 14 Dec 2014 12:16:43 +0000 (12:16 +0000)]
CodeGen: Compound literals with funny types shouldn't crash

CodeGen assumed that a compound literal with array type should have a
corresponding LLVM IR array type.

We had two bugs in this area:
- Zero sized arrays in compound literals would lead to the creation of
  an opaque type.  This is unnecessary, we should just create an array
  type with a bound of zero.
- Funny record types (like unions) lead to exotic IR types for compound
  literals.  In this case, CodeGen must be prepared to deal with the
  possibility that it might not have an array IR type.

This fixes PR21912.

llvm-svn: 224219

9 years agoLoop Vectorizer minor changes in the code -
Elena Demikhovsky [Sun, 14 Dec 2014 09:43:50 +0000 (09:43 +0000)]
Loop Vectorizer minor changes in the code -
some comments, function names, identation.

Reviewed here: http://reviews.llvm.org/D6527

llvm-svn: 224218

9 years agoAPInt: udivrem should use machine instructions for single-word APInts
David Majnemer [Sun, 14 Dec 2014 09:41:56 +0000 (09:41 +0000)]
APInt: udivrem should use machine instructions for single-word APInts

This mirrors the behavior of APInt::udiv and APInt::urem.  Some
architectures, like X86, have a single instruction which can compute
both division and remainder.

llvm-svn: 224217

9 years agoScalarEvolution: Remove SCEVUDivision, it's unused
David Majnemer [Sun, 14 Dec 2014 09:12:33 +0000 (09:12 +0000)]
ScalarEvolution: Remove SCEVUDivision, it's unused

This is just a code simplification, no functionality change is intended.

llvm-svn: 224216

9 years agoAST: Limit zero-sized constexpr behavior to array types
David Majnemer [Sun, 14 Dec 2014 08:40:47 +0000 (08:40 +0000)]
AST: Limit zero-sized constexpr behavior to array types

Restricting this "extension" to array types maximizes our standards
conformance while not miscompiling real-world programs.

llvm-svn: 224215

9 years agoClean up #include dependency.
Rui Ueyama [Sun, 14 Dec 2014 07:57:35 +0000 (07:57 +0000)]
Clean up #include dependency.

Core/File.h does not use LinkingContext.h, so remove that dependency.

llvm-svn: 224214

9 years ago[PowerPC] Handle cmp op promotion for SELECT[_CC] nodes in PPCTL::DAGCombineExtBoolTrunc
Hal Finkel [Sun, 14 Dec 2014 05:53:19 +0000 (05:53 +0000)]
[PowerPC] Handle cmp op promotion for SELECT[_CC] nodes in PPCTL::DAGCombineExtBoolTrunc

PPCTargetLowering::DAGCombineExtBoolTrunc contains logic to remove unwanted
truncations and extensions when dealing with nodes of the form:
  zext(binary-ops(binary-ops(trunc(x), trunc(y)), ...)

There was a FIXME in the implementation (now removed) regarding the fact that
the function would abort the transformations if any of the non-output operands
of a SELECT or SELECT_CC node would need to be promoted (because they were
also output operands, for example). As a result, we continued to generate
unnecessary zero-extends for code such as this:

  unsigned foo(unsigned a, unsigned b) {
    return  (a <= b) ? a : b;
  }

which would produce:

  cmplw 0, 3, 4
  isel 3, 4, 3, 1
  rldicl 3, 3, 0, 32
  blr

and now we produce:

  cmplw 0, 3, 4
  isel 3, 4, 3, 1
  blr

which is better in the obvious way.

llvm-svn: 224213

9 years agoRemove PECOFFLibraryNode.
Rui Ueyama [Sun, 14 Dec 2014 05:08:53 +0000 (05:08 +0000)]
Remove PECOFFLibraryNode.

This class is empty, provides no additional feature to the base class.

llvm-svn: 224212

9 years agoMore WinLinkInputGraph cleanup.
Rui Ueyama [Sun, 14 Dec 2014 05:04:22 +0000 (05:04 +0000)]
More WinLinkInputGraph cleanup.

This function is called only from WinLinkDriver.cpp.
Move the function to that file and mark as static.

llvm-svn: 224211

9 years agoLex: Don't crash if both conflict markers are on the same line
David Majnemer [Sun, 14 Dec 2014 04:53:11 +0000 (04:53 +0000)]
Lex: Don't crash if both conflict markers are on the same line

We would check if the terminator marker is on a newline.  However, the
logic would end up out-of-bounds if the terminator marker immediately
follows the start marker.

This fixes PR21820.

llvm-svn: 224210

9 years ago[PECOFF] Resolve file name in the driver, not in InputElement.
Rui Ueyama [Sun, 14 Dec 2014 02:50:29 +0000 (02:50 +0000)]
[PECOFF] Resolve file name in the driver, not in InputElement.

llvm-svn: 224209

9 years agoSimplify InputGraph API.
Rui Ueyama [Sun, 14 Dec 2014 02:04:01 +0000 (02:04 +0000)]
Simplify InputGraph API.

These member functions returns either no_more_files error or a File object.
We could simply return a nullptr instead of a no_more_files.
This function will be removed soon as a part of InputGraph cleanup.
I had to do that step by step.

llvm-svn: 224208

9 years agoRemove dead code.
Rui Ueyama [Sun, 14 Dec 2014 02:03:54 +0000 (02:03 +0000)]
Remove dead code.

llvm-svn: 224207

9 years agoRemove code duplication.
Rui Ueyama [Sun, 14 Dec 2014 02:03:47 +0000 (02:03 +0000)]
Remove code duplication.

llvm-svn: 224206

9 years agoIf a non-template constructor instantiated to X(X),
John McCall [Sun, 14 Dec 2014 01:46:53 +0000 (01:46 +0000)]
If a non-template constructor instantiated to X(X),
ignore it during overload resolution when initializing
X from a value of type cv X.

Previously, our rule here only ignored specializations
of constructor templates.  That's probably because the
standard says that constructors are outright ill-formed
if their first parameter is literally X and they're
callable with one argument.  However, Clang only
enforces that prohibition against non-implicit
instantiations; I'm not sure why, but it seems to be
deliberate.  Given that, the most sensible thing to
do is to just ignore the "illegal" constructor
regardless of where it came from.

Also, stop ignoring such constructors silently:
print a note explaining why they're being ignored.

Fixes <rdar://19199836>.

llvm-svn: 224205

9 years agoSema: attribute((annotate)) must have at least one argument
David Majnemer [Sun, 14 Dec 2014 01:05:01 +0000 (01:05 +0000)]
Sema: attribute((annotate)) must have at least one argument

Sema::handleAnnotateAttr expects that some basic validation is done on
the given AttributeList.  However, ProcessAccessDeclAttributeList called
it directly.  Instead, pass the list to ProcessDeclAttribute.

This fixes PR21847.

llvm-svn: 224204

9 years agoReapply "[ARM] Combine base-updating/post-incrementing vector load/stores."
Ahmed Bougacha [Sat, 13 Dec 2014 23:22:12 +0000 (23:22 +0000)]
Reapply "[ARM] Combine base-updating/post-incrementing vector load/stores."

r223862 tried to also combine base-updating load/stores.
r224198 reverted it, as "it created a regression on the test-suite
on test MultiSource/Benchmarks/Ptrdist/anagram by scrambling the order
in which the words are shown."
Reapply, with a fix to ignore non-normal load/stores.
Truncstores are handled elsewhere (you can actually write a pattern for
those, whereas for postinc loads you can't, since they return two values),
but it should be possible to also combine extloads base updates, by checking
that the memory (rather than result) type is of the same size as the addend.

Original commit message:
We used to only combine intrinsics, and turn them into VLD1_UPD/VST1_UPD
when the base pointer is incremented after the load/store.

We can do the same thing for generic load/stores.

Note that we can only combine the first load/store+adds pair in
a sequence (as might be generated for a v16f32 load for instance),
because other combines turn the base pointer addition chain (each
computing the address of the next load, from the address of the last
load) into independent additions (common base pointer + this load's
offset).

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

llvm-svn: 224203

9 years agoclang-cl: Fix handling of the /volatile flag (PR21893)
Hans Wennborg [Sat, 13 Dec 2014 22:44:46 +0000 (22:44 +0000)]
clang-cl: Fix handling of the /volatile flag (PR21893)

The /volatile:iso flag is our default behaviour, so it can be ignored.

Parse /volatile:ms as unsupported.

llvm-svn: 224202

9 years agoclang-cl: ignore /cgthreads (PR21894)
Hans Wennborg [Sat, 13 Dec 2014 22:24:16 +0000 (22:24 +0000)]
clang-cl: ignore /cgthreads (PR21894)

llvm-svn: 224201

9 years agoclang-cl: Make /Gd ignored instead of unsupported
Hans Wennborg [Sat, 13 Dec 2014 22:13:23 +0000 (22:13 +0000)]
clang-cl: Make /Gd ignored instead of unsupported

/Gd is the default calling convention setting, so we don't
need to take any action.

llvm-svn: 224200

9 years agoclang-cl: Add unsupported /Gv option (PR21892)
Hans Wennborg [Sat, 13 Dec 2014 22:06:23 +0000 (22:06 +0000)]
clang-cl: Add unsupported /Gv option (PR21892)

We don't currently support any of the calling convention options.

llvm-svn: 224199

9 years agoRevert "[ARM] Combine base-updating/post-incrementing vector load/stores."
Renato Golin [Sat, 13 Dec 2014 20:23:18 +0000 (20:23 +0000)]
Revert "[ARM] Combine base-updating/post-incrementing vector load/stores."

This reverts commit r223862, as it created a regression on the test-suite
on test MultiSource/Benchmarks/Ptrdist/anagram by scrambling the order
in which the words are shown. We'll investigate the issue and re-apply
when safe.

llvm-svn: 224198

9 years agoFix Doxygen command misspellings.
Benjamin Kramer [Sat, 13 Dec 2014 19:19:07 +0000 (19:19 +0000)]
Fix Doxygen command misspellings.

Found by -Wdocumentation.

llvm-svn: 224197

9 years agoSilencing a -Wsign-compare warning; NFC.
Aaron Ballman [Sat, 13 Dec 2014 16:55:02 +0000 (16:55 +0000)]
Silencing a -Wsign-compare warning; NFC.

llvm-svn: 224195

9 years agoSilencing a *lot* of -Wsign-compare warnings; NFC.
Aaron Ballman [Sat, 13 Dec 2014 16:53:15 +0000 (16:53 +0000)]
Silencing a *lot* of -Wsign-compare warnings; NFC.

llvm-svn: 224194

9 years agoParse: MS property members cannot have an in-class initializer
David Majnemer [Sat, 13 Dec 2014 11:34:16 +0000 (11:34 +0000)]
Parse: MS property members cannot have an in-class initializer

We would crash trying to treat a property member as a field.  These
shoudl be forbidden anyway, reject programs which contain them.

This fixes PR21840.

llvm-svn: 224193

9 years ago[ELF] Clean up OPT_INPUT handler. NFC.
Rui Ueyama [Sat, 13 Dec 2014 09:36:44 +0000 (09:36 +0000)]
[ELF] Clean up OPT_INPUT handler. NFC.

llvm-svn: 224192

9 years agoMake YAML files own MemoryBuffer.
Rui Ueyama [Sat, 13 Dec 2014 08:59:50 +0000 (08:59 +0000)]
Make YAML files own MemoryBuffer.

YAML files have references such as StringRef to the underlying
MemoryBuffer, so we shouldn't deallocate the buffer.

llvm-svn: 224191

9 years agoMove definitions to the correct file.
Rui Ueyama [Sat, 13 Dec 2014 08:59:46 +0000 (08:59 +0000)]
Move definitions to the correct file.

llvm-svn: 224190

9 years agoSema: Constexpr functions must have return statements which have an expr
David Majnemer [Sat, 13 Dec 2014 08:12:56 +0000 (08:12 +0000)]
Sema: Constexpr functions must have return statements which have an expr

clang lets programmers be pretty cavalier when it comes to void return
statements in functions which have non-void return types.  However, we
cannot be so forgiving in constexpr functions: evaluation will go off
the rails very quickly.

Instead, keep the return statement in the AST but mark the function as
invalid.  Doing so gives us nice diagnostics while making constexpr
evaluation halt.

This fixes PR21859.

llvm-svn: 224189

9 years agoMake the platform process connect path less chatty.
Stephane Sezer [Sat, 13 Dec 2014 05:23:51 +0000 (05:23 +0000)]
Make the platform process connect path less chatty.

Summary:
If a stream contains an empty string, no need to append it to the output
(otherwise we end up with a blank line). Also, no need to print a status
message when the state changes to connected, as this string brings no
information -- "Process 0" does not mean anything to the user, and the
process being connected has no meaning either.

Test Plan:
Connect to a remote linux platform mode daemon with `platform select
remote-linux` followed by `platform connect ...`, create a target and
run it, observe the output. Also, run the full test suite (dosep.py).

Before:
    (lldb) [...] connect, etc.
    (lldb) r
    Process 0 connected

    Process 5635 launched: '/Users/sas/Source/test' (x86_64)
    Process 5635 stopped

After:
    (lldb) [...] connect, etc.
    (lldb) r
    Process 5635 launched: '/Users/sas/Source/test' (x86_64)
    Process 5635 stopped

Reviewers: tfiala, vharron, clayborg

Subscribers: lldb-commits

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

llvm-svn: 224188

9 years agoUse range-based for loops.
Craig Topper [Sat, 13 Dec 2014 05:12:19 +0000 (05:12 +0000)]
Use range-based for loops.

llvm-svn: 224187

9 years agoRename argument strings of codegen passes to avoid collisions with command line
Akira Hatanaka [Sat, 13 Dec 2014 04:52:04 +0000 (04:52 +0000)]
Rename argument strings of codegen passes to avoid collisions with command line
options.

This commit changes the command line arguments (PassInfo::PassArgument) of two
passes, MachineFunctionPrinter and MachineScheduler, to avoid collisions with
command line options that have the same argument strings.

This bug manifests when the PassList construct (defined in opt.cpp) is used
in a tool that links with codegen passes. To reproduce the bug, paste the
following lines into llc.cpp and run llc.

#include "llvm/IR/LegacyPassNameParser.h"
static llvm::cl::list<const llvm::PassInfo*, bool, llvm::PassNameParser>
PassList(llvm::cl::desc("Optimizations available:"));

rdar://problem/19212448

llvm-svn: 224186

9 years agoNFC: Minor formatting fix
Will Wilson [Sat, 13 Dec 2014 04:38:19 +0000 (04:38 +0000)]
NFC: Minor formatting fix

llvm-svn: 224185

9 years agoPretty print support for template arg enum constants
Will Wilson [Sat, 13 Dec 2014 04:31:07 +0000 (04:31 +0000)]
Pretty print support for template arg enum constants

llvm-svn: 224184

9 years agoFix two small bugs in typo correction. One assertion failure building member expressi...
Nick Lewycky [Sat, 13 Dec 2014 02:54:28 +0000 (02:54 +0000)]
Fix two small bugs in typo correction. One assertion failure building member expressions because the lookup finds a different name than the original, fixed by updating the LookupResult's name with the name of the found decl. Second is that we also diagnose delayed typo exprs in the index of an array subscript expression.

The testcase shows a third bug with a FIXME in it.

llvm-svn: 224183

9 years agoUse the newer python syntax for exceptions
Justin Bogner [Sat, 13 Dec 2014 02:49:27 +0000 (02:49 +0000)]
Use the newer python syntax for exceptions

We've dropped support for python 2.5, so now we can use the forward
compatible "except ... as" syntax.

llvm-svn: 224182

9 years agoUse the newer python syntax for exceptions
Justin Bogner [Sat, 13 Dec 2014 02:46:56 +0000 (02:46 +0000)]
Use the newer python syntax for exceptions

We've dropped support for python 2.5, so now we can use the forward
compatible "except ... as" syntax.

llvm-svn: 224181

9 years agoUpdate to new bindings.
Peter Collingbourne [Sat, 13 Dec 2014 02:26:00 +0000 (02:26 +0000)]
Update to new bindings.

llvm-svn: 224180

9 years agoGo bindings: introduce Value.ConstantAsMetadata.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:57 +0000 (02:25 +0000)]
Go bindings: introduce Value.ConstantAsMetadata.

llvm-svn: 224179

9 years agoGo bindings: introduce llvm.TemporaryMDNode.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:54 +0000 (02:25 +0000)]
Go bindings: introduce llvm.TemporaryMDNode.

llvm-svn: 224178

9 years agoGo bindings: introduce Metadata.ReplaceAllUsesWith.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:51 +0000 (02:25 +0000)]
Go bindings: introduce Metadata.ReplaceAllUsesWith.

llvm-svn: 224177

9 years agoGo bindings: expose the Metadata type.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:49 +0000 (02:25 +0000)]
Go bindings: expose the Metadata type.

Also modifies SetCurrentDebugLocation to take individual arguments rather
than an MDNode.

llvm-svn: 224176

9 years agoGo bindings: remove contextless metadata bindings.
Peter Collingbourne [Sat, 13 Dec 2014 02:25:45 +0000 (02:25 +0000)]
Go bindings: remove contextless metadata bindings.

llvm-svn: 224175

9 years agoMove a bunch of method implementations over to the C++ file; remove the need for...
Enrico Granata [Sat, 13 Dec 2014 02:07:50 +0000 (02:07 +0000)]
Move a bunch of method implementations over to the C++ file; remove the need for a few includes. All in all, good stuff

llvm-svn: 224174

9 years agoImplement feedback on r224172 in PR21899
Reid Kleckner [Sat, 13 Dec 2014 01:11:23 +0000 (01:11 +0000)]
Implement feedback on r224172 in PR21899

Based on suggestions from Kaelyn.

llvm-svn: 224173

9 years agoTypo correction: Ignore temporary binding exprs after overload resolution
Reid Kleckner [Sat, 13 Dec 2014 00:53:10 +0000 (00:53 +0000)]
Typo correction: Ignore temporary binding exprs after overload resolution

Transformation of a CallExpr doesn't always result in a new CallExpr.

Fixes PR21899.

llvm-svn: 224172

9 years agoTests will timeout if they exceed time limit.
Vince Harron [Sat, 13 Dec 2014 00:08:19 +0000 (00:08 +0000)]
Tests will timeout if they exceed time limit.

Default time limit is 5 minutes.

Override the default timeout of 5 minutes with LLDB_TEST_TIMEOUT.
LLDB_TEST_TIMEOUT=10m

Override the timeout for individual tests with LLDB_[TESTNAME]_TIMEOUT.
E.g., LLDB_TESTCONCURRENTEVENTS_TIMEOUT=2m

Set to "0" to run without timeout.

Submitted for Chaoren Lin

llvm-svn: 224171

9 years agoSyntheticChildrenFrontEnd::* should also be built when python is disabled
Keno Fischer [Sat, 13 Dec 2014 00:05:58 +0000 (00:05 +0000)]
SyntheticChildrenFrontEnd::* should also be built when python is disabled

Summary:
This moves
- SyntheticChildrenFrontEnd::CreateValueObjectFromExpression
- SyntheticChildrenFrontEnd::CreateValueObjectFromAddress
- SyntheticChildrenFrontEnd::CreateValueObjectFromData
outside the `#ifndef LLDB_DISABLE_PYTHON` since it doesn't seem to depend on python being available and indeed breaks the build when python is disabled.

Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 224170

9 years ago[PowerPC] Add a DAGToDAG peephole to remove unnecessary zero-exts
Hal Finkel [Fri, 12 Dec 2014 23:59:36 +0000 (23:59 +0000)]
[PowerPC] Add a DAGToDAG peephole to remove unnecessary zero-exts

On PPC64, we end up with lots of i32 -> i64 zero extensions, not only from all
of the usual places, but also from the ABI, which specifies that values passed
are zero extended. Almost all 32-bit PPC instructions in PPC64 mode are defined
to do *something* to the higher-order bits, and for some instructions, that
action clears those bits (thus providing a zero-extended result). This is
especially common after rotate-and-mask instructions. Adding an additional
instruction to zero-extend the results of these instructions is unnecessary.

This PPCISelDAGToDAG peephole optimization examines these zero-extensions, and
looks back through their operands to see if all instructions will implicitly
zero extend their results. If so, we convert these instructions to their 64-bit
variants (which is an internal change only, the actual encoding of these
instructions is the same as the original 32-bit ones) and remove the
unnecessary zero-extension (changing where the INSERT_SUBREG instructions are
to make everything internally consistent).

llvm-svn: 224169

9 years agoValueTracking: Don't recurse too deeply in computeKnownBitsFromAssume
David Majnemer [Fri, 12 Dec 2014 23:59:29 +0000 (23:59 +0000)]
ValueTracking: Don't recurse too deeply in computeKnownBitsFromAssume

Respect the MaxDepth recursion limit, doing otherwise will trigger an
assert in computeKnownBits.

This fixes PR21891.

llvm-svn: 224168

9 years agoImplement the __builtin_call_with_static_chain GNU extension.
Peter Collingbourne [Fri, 12 Dec 2014 23:41:25 +0000 (23:41 +0000)]
Implement the __builtin_call_with_static_chain GNU extension.

The extension has the following syntax:

  __builtin_call_with_static_chain(Call, Chain)
  where Call must be a function call expression and Chain must be of pointer type

This extension performs a function call Call with a static chain pointer
Chain passed to the callee in a designated register. This is useful for
calling foreign language functions whose ABI uses static chain pointers
(e.g. to implement closures).

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

llvm-svn: 224167

9 years ago[ARMConstantIsland] Insert tbb/tbh optimization where previous jump table resided.
Chad Rosier [Fri, 12 Dec 2014 23:27:40 +0000 (23:27 +0000)]
[ARMConstantIsland] Insert tbb/tbh optimization where previous jump table resided.

llvm-svn: 224165

9 years agoFrontend: Canonicalize to native paths when dumping module dependencies
Justin Bogner [Fri, 12 Dec 2014 23:12:27 +0000 (23:12 +0000)]
Frontend: Canonicalize to native paths when dumping module dependencies

Mixed path separators (ie, both / and \\) can mess up the sort order
of the VFS map when dumping module dependencies, as was recently
exposed by r224055 and papered over in r224145. Instead, we should
simply use native paths for consistency.

This also adds a TODO to add handling of .. in paths. There was some
code for this before r224055, but it was untested and probably broken.

llvm-svn: 224164

9 years agoAdd option to turn off installation of headers.
Eric Fiselier [Fri, 12 Dec 2014 22:52:58 +0000 (22:52 +0000)]
Add option to turn off installation of headers.

llvm-svn: 224162

9 years agoSome more cleanup of the ValueObjectConstResultImpl code. NFC.
Enrico Granata [Fri, 12 Dec 2014 22:37:44 +0000 (22:37 +0000)]
Some more cleanup of the ValueObjectConstResultImpl code. NFC.

llvm-svn: 224160

9 years agoPass EC by reference to MemoryBufferMMapFile to return error code.
Yaron Keren [Fri, 12 Dec 2014 22:27:53 +0000 (22:27 +0000)]
Pass EC by reference to MemoryBufferMMapFile to return error code.

Patch by Kim Grasman!

llvm-svn: 224159

9 years agoFix up this test case
Enrico Granata [Fri, 12 Dec 2014 22:11:32 +0000 (22:11 +0000)]
Fix up this test case

llvm-svn: 224157

9 years agoutils: update vim syntax highlighting for LLVM IR
Saleem Abdulrasool [Fri, 12 Dec 2014 21:52:44 +0000 (21:52 +0000)]
utils: update vim syntax highlighting for LLVM IR

Add missing externally_initialized keyword from SVN r174340.  Also reflow the
text.

llvm-svn: 224155

9 years agoClean up static analyzer warnings.
Michael Ilseman [Fri, 12 Dec 2014 21:48:03 +0000 (21:48 +0000)]
Clean up static analyzer warnings.

Clang's static analyzer found several potential cases of undefined
behavior, use of un-initialized values, and potentially null pointer
dereferences in tablegen, Support, MC, and ADT. This cleans them up
with specific assertions on the assumptions of the code.

llvm-svn: 224154

9 years ago[Hexagon] Adding double word add/min/minu/max/maxu instructions and tests.
Colin LeMahieu [Fri, 12 Dec 2014 21:29:25 +0000 (21:29 +0000)]
[Hexagon] Adding double word add/min/minu/max/maxu instructions and tests.

llvm-svn: 224153

9 years agoRevert r224149, llvm-dsymutil was already here.
Nico Weber [Fri, 12 Dec 2014 21:25:07 +0000 (21:25 +0000)]
Revert r224149, llvm-dsymutil was already here.

I saw a failure on an internal bot, opened this file, saw it was missing,
thought "aha!", tried to land, got an "file is out of date", synced, didn't see
the file listed right above the line I added (cause I didn't add it in the
right place) and landed. Apologies!

llvm-svn: 224152

9 years agoAdd a test case to validate that AddressOf() and GetLoadAddress() work on a ValueObje...
Enrico Granata [Fri, 12 Dec 2014 21:23:55 +0000 (21:23 +0000)]
Add a test case to validate that AddressOf() and GetLoadAddress() work on a ValueObjectConstResult. This test passing is the baseline of functionality we want to ensure for our const results

llvm-svn: 224151

9 years ago[Hexagon] Adding J class call instructions.
Colin LeMahieu [Fri, 12 Dec 2014 21:12:27 +0000 (21:12 +0000)]
[Hexagon] Adding J class call instructions.

llvm-svn: 224150

9 years agoAdd llvm-dsymutil to test/CMakeLists.txt
Nico Weber [Fri, 12 Dec 2014 20:56:49 +0000 (20:56 +0000)]
Add llvm-dsymutil to test/CMakeLists.txt

r224134 added this and runs it from a test, but doesn't build it with test
binaries.

llvm-svn: 224149

9 years ago[Sanitizer] Introduce Allocator::may_return_null bool flag.
Alexey Samsonov [Fri, 12 Dec 2014 20:07:35 +0000 (20:07 +0000)]
[Sanitizer] Introduce Allocator::may_return_null bool flag.

Summary:
Turn "allocator_may_return_null" common flag into an
Allocator::may_return_null bool flag. We want to make sure
that common flags are immutable after initialization. There
are cases when we want to change this flag in the allocator
at runtime: e.g. in unit tests and during ASan activation
on Android.

Test Plan: regression test suite, real-life applications

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

llvm-svn: 224148

9 years agoThe so-called "trivial implementation" has been with us for a few years now. It's...
Enrico Granata [Fri, 12 Dec 2014 19:26:08 +0000 (19:26 +0000)]
The so-called "trivial implementation" has been with us for a few years now. It's probably safe to assume it works.. so remove the #if stuff

llvm-svn: 224147

9 years agoIR: Don't track nullptr on metadata RAUW
Duncan P. N. Exon Smith [Fri, 12 Dec 2014 19:24:33 +0000 (19:24 +0000)]
IR: Don't track nullptr on metadata RAUW

The RAUW support in `Metadata` supports going to `nullptr` specifically
to handle values being deleted, causing `ValueAsMetadata` to be deleted.

Fix the case where the reference is from a `TrackingMDRef` (as opposed
to an `MDOperand` or a `MetadataAsValue`).

This is surprisingly rare -- metadata tracked by `TrackingMDRef` going
to null -- but it came up in an openSUSE bootstrap during inlining.  The
tracking ref was held by the `ValueMap` because it was referencing a
local, the basic block containing the local became dead after it had
been merged in, and when the local was deleted, the tracking ref
asserted in an `isa`.

llvm-svn: 224146