platform/upstream/llvm.git
8 years ago[test/sanitizer-common] Move getpass.cc from Linux into Posix
Filipe Cabecinhas [Wed, 9 Mar 2016 15:39:43 +0000 (15:39 +0000)]
[test/sanitizer-common] Move getpass.cc from Linux into Posix

llvm-svn: 263017

8 years agoReorganize _LIBCPP_LOCALE__L_EXTENSIONS
Ben Craig [Wed, 9 Mar 2016 15:39:39 +0000 (15:39 +0000)]
Reorganize _LIBCPP_LOCALE__L_EXTENSIONS

Instead of checking _LIBCPP_LOCALE_L_EXTENSIONS all over, instead check it
once, and define the various *_l symbols once. The private redirector symbol
names are all prefixed with _libcpp_* so that they won't conflict with user
symbols, and so they won't conflict with future C library symbols. In
particular, glibc likes providing private symbols such as __locale_t, so we
should follow a different naming pattern (like _libcpp_*) to avoid problems
on that front.

Tested on Linux with glibc. Hoping for the best on OSX and the various BSDs.

http://reviews.llvm.org/D17456

llvm-svn: 263016

8 years ago[GCC] PR23529 Sema part of attrbute abi_tag support
Dmitry Polukhin [Wed, 9 Mar 2016 15:30:53 +0000 (15:30 +0000)]
[GCC] PR23529 Sema part of attrbute abi_tag support

Original patch by Stefan Bühler http://reviews.llvm.org/D12834

Difference between original and this one:
- fixed all comments in original code review
- added more tests, all new diagnostics now covered by tests
- moved abi_tag on re-declaration checks to Sema::mergeDeclAttributes
  where they actually may work as designed
- clang-format + other stylistic changes

Mangle part will be sent for review as a separate patch.

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

llvm-svn: 263015

8 years agoFix build error due to unsigned compare >= 0 in r263008 (NFC)
Teresa Johnson [Wed, 9 Mar 2016 14:58:23 +0000 (14:58 +0000)]
Fix build error due to unsigned compare >= 0 in r263008 (NFC)

Fixes error from building with clang:

/usr/local/google/home/tejohnson/llvm/llvm_15/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp:407:12:
error: comparison of unsigned expression >= 0 is always true
[-Werror,-Wtautological-compare]
  if ((Imm >= 0x000) && (Imm <= 0x0ff)) {
         ~~~ ^  ~~~~~

llvm-svn: 263014

8 years agoSimplify: SHN_ABS is >= SHN_LORESERVE.
Rafael Espindola [Wed, 9 Mar 2016 14:31:18 +0000 (14:31 +0000)]
Simplify: SHN_ABS is >= SHN_LORESERVE.

llvm-svn: 263012

8 years agoReland r262337 "calculate builtin_object_size if arg is a removable pointer"
Petar Jovanovic [Wed, 9 Mar 2016 14:12:47 +0000 (14:12 +0000)]
Reland r262337 "calculate builtin_object_size if arg is a removable pointer"

Original commit message:
 calculate builtin_object_size if argument is a removable pointer

 This patch fixes calculating correct value for builtin_object_size function
 when pointer is used only in builtin_object_size function call and never
 after that.

 Patch by Strahinja Petrovic.

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

Reland the original change with a small modification (first do a null check
and then do the cast) to satisfy ubsan.

llvm-svn: 263011

8 years agoAdd ARM EHABI support to gcc_personality_v0.
Logan Chien [Wed, 9 Mar 2016 13:20:17 +0000 (13:20 +0000)]
Add ARM EHABI support to gcc_personality_v0.

Until now the only exception APIs supported by gcc_personality_v0
are DWARF EH and SJLJ. This adds support for ARM EHABI as well.

This is achieved by
a) changing the function signature on ARM EHABI,
b) unwinding the stack before returning _URC_CONTINUE_UNWIND.

See "Exception Handling ABI for the ARM Architecture" for details
(http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf).

Patch by Timon Van Overveldt.

llvm-svn: 263010

8 years agoUpdate comments following the addition of PredicatedScalarEvolution. NFC.
Silviu Baranga [Wed, 9 Mar 2016 12:39:06 +0000 (12:39 +0000)]
Update comments following the addition of PredicatedScalarEvolution. NFC.

We changed several functions in LoopAccessAnalysis to use PSE instead of
taking SE and a SCEV predicate as arguments, but didn't update the comments.

This also fixes a comment in ScalarEvolution, where we refered to Preds
when the argument name was A.

llvm-svn: 263009

8 years ago[AMDGPU] Assembler: Support DPP instructions.
Sam Kolton [Wed, 9 Mar 2016 12:29:31 +0000 (12:29 +0000)]
[AMDGPU] Assembler: Support DPP instructions.

Supprot DPP syntax as used in SP3 (except several operands syntax).
Added dpp-specific operands in td-files.
Added DPP flag to TSFlags to determine if instruction is dpp in InstPrinter.
Support for VOP2 DPP instructions in td-files.
Some tests for DPP instructions.

ToDo:
  - VOP2bInst:
    - vcc is considered as operand
    - AsmMatcher doesn't apply mnemonic aliases when parsing operands
  - v_mac_f32
  - v_nop
  - disable instructions with 64-bit operands
  - change dpp_ctrl assembler representation to conform sp3

Review: http://reviews.llvm.org/D17804
llvm-svn: 263008

8 years agoFixing wrong header title name.
Michael Zuckerman [Wed, 9 Mar 2016 11:26:45 +0000 (11:26 +0000)]
Fixing wrong header title name.

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

llvm-svn: 263007

8 years ago[AMDGPU] Assembler: Support abs() syntax.
Nikolay Haustov [Wed, 9 Mar 2016 11:03:21 +0000 (11:03 +0000)]
[AMDGPU] Assembler: Support abs() syntax.

Support legacy SP3 abs(v1) syntax. InstPrinter still uses |v1|.
Add tests.

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

llvm-svn: 263006

8 years ago[AMDGPU] Assembler: Fix s_setpc_b64
Nikolay Haustov [Wed, 9 Mar 2016 10:56:19 +0000 (10:56 +0000)]
[AMDGPU] Assembler: Fix s_setpc_b64

s_setpc_b64 has just one 64-bit source which is the address of instruction to jump to.

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

llvm-svn: 263005

8 years agoPacify gcc's parenthesis warning, which doesn't realize that parens don't matter...
Manuel Klimek [Wed, 9 Mar 2016 10:06:45 +0000 (10:06 +0000)]
Pacify gcc's parenthesis warning, which doesn't realize that parens don't matter here.

llvm-svn: 263004

8 years ago[OPENMP 4.5] Codegen for data members in 'linear' clause
Alexey Bataev [Wed, 9 Mar 2016 09:49:09 +0000 (09:49 +0000)]
[OPENMP 4.5] Codegen for data members in 'linear' clause

OpenMP 4.5 allows privatization of non-static data members in OpenMP
constructs. Patch adds proper codegen support for data members in
'linear' clause

llvm-svn: 263003

8 years ago[OPENMP 4.5] Codegen for data members in 'linear' clause.
Alexey Bataev [Wed, 9 Mar 2016 09:49:00 +0000 (09:49 +0000)]
[OPENMP 4.5] Codegen for data members in 'linear' clause.

OpenMP 4.5 allows to use data members in private clauses. Patch adds
codegen support for 'linear' clause.

llvm-svn: 263002

8 years ago[DFSan] Fix test_inet_pton for big endian archs
Mohit K. Bhakkad [Wed, 9 Mar 2016 08:00:37 +0000 (08:00 +0000)]
[DFSan] Fix test_inet_pton for big endian archs

Reviewers: samsonov

Subscribers: ed, jaydeep, sagar, llvm-commits

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

llvm-svn: 263001

8 years ago[Compiler-rt][MIPS] Defining macros for MIPS archs
Mohit K. Bhakkad [Wed, 9 Mar 2016 07:57:20 +0000 (07:57 +0000)]
[Compiler-rt][MIPS] Defining macros for MIPS archs

Reviewers: samsonov

Subscribers: filcab, jaydeep, sagar, llvm-commits

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

llvm-svn: 263000

8 years agoFix uninitialized member bool. Detected by ASan.
Richard Trieu [Wed, 9 Mar 2016 06:31:25 +0000 (06:31 +0000)]
Fix uninitialized member bool.  Detected by ASan.

llvm-svn: 262999

8 years ago[LoopDataPrefetch] Add stats and debug output
Adam Nemet [Wed, 9 Mar 2016 05:33:21 +0000 (05:33 +0000)]
[LoopDataPrefetch] Add stats and debug output

llvm-svn: 262998

8 years ago[LAA] Improve comment for isStridedPtr
Adam Nemet [Wed, 9 Mar 2016 05:33:19 +0000 (05:33 +0000)]
[LAA] Improve comment for isStridedPtr

llvm-svn: 262997

8 years agoAccept absolute paths in the -fuse-ld option.
Peter Zotov [Wed, 9 Mar 2016 05:18:16 +0000 (05:18 +0000)]
Accept absolute paths in the -fuse-ld option.

This patch extends the -fuse-ld option to accept a full path to an executable
and use it verbatim to invoke the linker. There are generally two reasons
to desire this.

The first reason relates to the sad truth is that Clang is retargetable,
Binutils are not.

While any Clang from a binary distribution is sufficient to compile code
for a wide range of architectures and prefixed BFD linkers (e.g.
installed as /usr/bin/arm-none-linux-gnueabi-ld) as well as cross-compiled
libc's (for non-bare-metal targets) are widely available, including on all
Debian derivatives, it is impossible to use them together because
the -fuse-ld= option allows to specify neither a linker prefix nor
a full path to one.

The second reason is linker development, both when porting existing linkers
to new architectures and when working on a new linker such as LLD.

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

llvm-svn: 262996

8 years ago[WebAssembly] Update comments about irreducible control flow.
Dan Gohman [Wed, 9 Mar 2016 04:17:36 +0000 (04:17 +0000)]
[WebAssembly] Update comments about irreducible control flow.

llvm-svn: 262995

8 years agoUse lto_bool_t instead of a raw `bool` (fixup for r262977).
Sean Silva [Wed, 9 Mar 2016 04:05:28 +0000 (04:05 +0000)]
Use lto_bool_t instead of a raw `bool` (fixup for r262977).

Hopefully this should bring
llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast back to life.

llvm-svn: 262994

8 years agoFix ThinLTO test: depends on the X86 backend
Mehdi Amini [Wed, 9 Mar 2016 04:04:40 +0000 (04:04 +0000)]
Fix ThinLTO test: depends on the X86 backend

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 262993

8 years ago[lto] Avoid duplicate symbol error for appending linkage.
Sean Silva [Wed, 9 Mar 2016 03:42:39 +0000 (03:42 +0000)]
[lto] Avoid duplicate symbol error for appending linkage.

Summary:
Is there any other code needed for correctly handling appending linkage?
Do we need to do something more with @llvm.global_ctors in
SymbolTable.cpp:addBitcodeFile; otherwise the combined bitcode module
won't have all the global ctors.

Reviewers: rafael

Subscribers: Bigcheese, llvm-commits, joker.eph

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

llvm-svn: 262992

8 years ago[index] Add a message for the assertion, NFC.
Argyrios Kyrtzidis [Wed, 9 Mar 2016 02:53:12 +0000 (02:53 +0000)]
[index] Add a message for the assertion, NFC.

llvm-svn: 262991

8 years agovoid foo() is not a valid C prototype, one has to write void foo(void)
Mehdi Amini [Wed, 9 Mar 2016 02:36:09 +0000 (02:36 +0000)]
void foo() is not a valid C prototype, one has to write void foo(void)

Remove a warning introduced in r262977

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 262990

8 years agoReturn StringRef instead of a naked char*; NFC
Sanjoy Das [Wed, 9 Mar 2016 02:34:19 +0000 (02:34 +0000)]
Return StringRef instead of a naked char*; NFC

llvm-svn: 262989

8 years ago[IRCE] Reflow comments; NFC
Sanjoy Das [Wed, 9 Mar 2016 02:34:15 +0000 (02:34 +0000)]
[IRCE] Reflow comments; NFC

llvm-svn: 262988

8 years agoFix library dependency for llvm-lto after r262977
Mehdi Amini [Wed, 9 Mar 2016 02:34:13 +0000 (02:34 +0000)]
Fix library dependency for llvm-lto after r262977

It is a transitive dependency, so static build are OK but not build
with individual DSO for each LLVM library.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 262987

8 years agoLast round of preliminary cleanup in my refactoring of aliases.
Enrico Granata [Wed, 9 Mar 2016 02:27:57 +0000 (02:27 +0000)]
Last round of preliminary cleanup in my refactoring of aliases.

The next step is to actually turn CommandAlias into a full-blown CommandObject citizen.

This is tricky given the current architecture of the CommandInterpreter but I think I have found a reasonable path forward.
The current plan is to make class CommandAlias : public CommandObject, and have all the several GetCommand calls not actually traverse through the alias to the underlying command object
The only times that an alias will be traversed are:
a) execution; when time comes to run an alias, I will just grab the underlying command and options, and make the interpreter execute that according to its current algorithm
b) subcommand traversal; if one has an alias to a multiword command, grabbing a subcommand will see through to the subcommand

Other operations, e.g. command listing, command names, command helps, ..., will all use the alias directly. This will, in turn, lead to the removal of the separate alias dictionary, and just mix user commands and aliases in one map

llvm-svn: 262986

8 years ago[index] libclang: Make sure to treat forward ObjC protocols as ObjCProtocolRef declar...
Argyrios Kyrtzidis [Wed, 9 Mar 2016 02:12:46 +0000 (02:12 +0000)]
[index] libclang: Make sure to treat forward ObjC protocols as ObjCProtocolRef declarations, and fix related crash.

rdar://25035376

llvm-svn: 262985

8 years ago[index] Fix assertion hit when indexing re-declarations of built-in functions.
Argyrios Kyrtzidis [Wed, 9 Mar 2016 02:12:40 +0000 (02:12 +0000)]
[index] Fix assertion hit when indexing re-declarations of built-in functions.

llvm-svn: 262984

8 years agoAvoid unnecessary qualification.
Sean Silva [Wed, 9 Mar 2016 02:02:26 +0000 (02:02 +0000)]
Avoid unnecessary qualification.

Thanks to Rui for spotting this.

llvm-svn: 262983

8 years ago[WebAssembly] Implement irreducible control flow.
Dan Gohman [Wed, 9 Mar 2016 02:01:14 +0000 (02:01 +0000)]
[WebAssembly] Implement irreducible control flow.

This implements a very simple conservative transformation that doesn't
require more than linear code size growth. There's room for much more
optimization in this space.

llvm-svn: 262982

8 years agoFix GOLD plugin build after r262976
Mehdi Amini [Wed, 9 Mar 2016 01:55:15 +0000 (01:55 +0000)]
Fix GOLD plugin build after r262976

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 262981

8 years agoRemove trailing newline from test case; NFC
Sanjoy Das [Wed, 9 Mar 2016 01:51:44 +0000 (01:51 +0000)]
Remove trailing newline from test case; NFC

llvm-svn: 262980

8 years ago[SCEV] Slightly generalize getRangeViaFactoring
Sanjoy Das [Wed, 9 Mar 2016 01:51:02 +0000 (01:51 +0000)]
[SCEV] Slightly generalize getRangeViaFactoring

Building on the previous change, this generalizes
ScalarEvolution::getRangeViaFactoring to work with
{Ext(C?A:B)+k0,+,Ext(C?A:B)+k1} where Ext can be a zero extend, sign
extend or truncate operation, and k0 and k1 are constants.

llvm-svn: 262979

8 years ago[SCEV] Slightly generalize getRangeViaFactoring
Sanjoy Das [Wed, 9 Mar 2016 01:50:57 +0000 (01:50 +0000)]
[SCEV] Slightly generalize getRangeViaFactoring

This change generalizes ScalarEvolution::getRangeViaFactoring to work
with {Ext(C?A:B),+,Ext(C?A:B)} where Ext can be a zero extend, sign
extend or truncate operation.

llvm-svn: 262978

8 years agolibLTO: add a ThinLTOCodeGenerator on the model of LTOCodeGenerator.
Mehdi Amini [Wed, 9 Mar 2016 01:37:22 +0000 (01:37 +0000)]
libLTO: add a ThinLTOCodeGenerator on the model of LTOCodeGenerator.

This is intended to provide a parallel (threaded) ThinLTO scheme
for linker plugin use through the libLTO C API.

The intent of this patch is to provide a first implementation as a
proof-of-concept and allows linker to start supporting ThinLTO by
definiing the libLTO C API. Some part of the libLTO API are left
unimplemented yet. Following patches will add support for these.

The current implementation can link all clang/llvm binaries.

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 262977

8 years agoFunctionIndex is not optional for renameModuleForThinLTO(), make it a reference ...
Mehdi Amini [Wed, 9 Mar 2016 01:37:14 +0000 (01:37 +0000)]
FunctionIndex is not optional for renameModuleForThinLTO(), make it a reference (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 262976

8 years ago[lto] Record whether a variable is TLS.
Sean Silva [Wed, 9 Mar 2016 00:47:47 +0000 (00:47 +0000)]
[lto] Record whether a variable is TLS.

Summary:

Reviewers: rafael

Subscribers: Bigcheese, llvm-commits, joker.eph

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

llvm-svn: 262975

8 years agoAssume GV is not null for now.
Rafael Espindola [Wed, 9 Mar 2016 00:31:06 +0000 (00:31 +0000)]
Assume GV is not null for now.

It will come back when we add support for inline asm in .bc files.

llvm-svn: 262972

8 years agoReadd testcase accidentally removed in r262888.
Richard Smith [Wed, 9 Mar 2016 00:12:38 +0000 (00:12 +0000)]
Readd testcase accidentally removed in r262888.

llvm-svn: 262971

8 years ago[TestRegisterVariables] Adjust compiler range in expected failure decorator.
Siva Chandra [Wed, 9 Mar 2016 00:02:00 +0000 (00:02 +0000)]
[TestRegisterVariables] Adjust compiler range in expected failure decorator.

Subscribers: lldb-commits

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

llvm-svn: 262970

8 years ago[Modules] Modernize, use range-based loops.
Davide Italiano [Tue, 8 Mar 2016 23:58:08 +0000 (23:58 +0000)]
[Modules] Modernize, use range-based loops.

llvm-svn: 262969

8 years ago[lto] Don't add variables with private linkage to the symbol table.
Sean Silva [Tue, 8 Mar 2016 23:50:56 +0000 (23:50 +0000)]
[lto] Don't add variables with private linkage to the symbol table.

Summary:
This causes the issue in PR26872 to go away now that we aren't creating
symbols for the string literals, but that may just be concealing a
deeper problem, so best to keep that PR open.

Reviewers: rafael

Subscribers: Bigcheese, llvm-commits, joker.eph

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

llvm-svn: 262968

8 years agoFix crash in access check for aggregate initialization of base classes. It's
Richard Smith [Tue, 8 Mar 2016 23:17:35 +0000 (23:17 +0000)]
Fix crash in access check for aggregate initialization of base classes. It's
not obvious how to access-check these, so pick a conservative rule until we get
feedback from CWG.

llvm-svn: 262966

8 years agoFix -Werror build.
Richard Smith [Tue, 8 Mar 2016 23:16:16 +0000 (23:16 +0000)]
Fix -Werror build.

llvm-svn: 262965

8 years agoAArch64: remove tests of intrinsics completely duplicated elsewhere.
Tim Northover [Tue, 8 Mar 2016 23:10:58 +0000 (23:10 +0000)]
AArch64: remove tests of intrinsics completely duplicated elsewhere.

llvm-svn: 262964

8 years agoP0017R1: In C++1z, an aggregate class can have (public non-virtual) base classes...
Richard Smith [Tue, 8 Mar 2016 22:17:41 +0000 (22:17 +0000)]
P0017R1: In C++1z, an aggregate class can have (public non-virtual) base classes; these are initialized as if they were data members.

llvm-svn: 262963

8 years ago[llvm-pdbdump] Dump line table information.
Zachary Turner [Tue, 8 Mar 2016 21:42:24 +0000 (21:42 +0000)]
[llvm-pdbdump] Dump line table information.

This patch adds the -lines command line option which will dump
source/line information for each compiland and source file.

llvm-svn: 262962

8 years agofix typo; NFC
Sanjay Patel [Tue, 8 Mar 2016 21:41:13 +0000 (21:41 +0000)]
fix typo; NFC

llvm-svn: 262961

8 years agoSilence duplicate diagnostics because parsing of a standards-based attribute triggers...
Aaron Ballman [Tue, 8 Mar 2016 21:31:32 +0000 (21:31 +0000)]
Silence duplicate diagnostics because parsing of a standards-based attribute triggers parsing diagnostics that may also be picked up during semantic analysis.

llvm-svn: 262960

8 years agoAdd CommandAlias.cpp to CMakeLists
Enrico Granata [Tue, 8 Mar 2016 21:29:49 +0000 (21:29 +0000)]
Add CommandAlias.cpp to CMakeLists

llvm-svn: 262959

8 years agoMove CommandAlias to its own file; also
Enrico Granata [Tue, 8 Mar 2016 21:23:30 +0000 (21:23 +0000)]
Move CommandAlias to its own file; also
Store std::unique_ptr<CommandAlias> instead of instances

llvm-svn: 262958

8 years agoRemove an unnecessary hack.
Rafael Espindola [Tue, 8 Mar 2016 21:17:31 +0000 (21:17 +0000)]
Remove an unnecessary hack.

It doesn't look like anything is depending on using local dynamic tls
relocations with preemptable  symbols.

llvm-svn: 262957

8 years agouse range-based for loop; NFCI
Sanjay Patel [Tue, 8 Mar 2016 20:53:48 +0000 (20:53 +0000)]
use range-based for loop; NFCI

llvm-svn: 262956

8 years agoDelete isTlsDynRel.
Rafael Espindola [Tue, 8 Mar 2016 20:24:36 +0000 (20:24 +0000)]
Delete isTlsDynRel.

It was a badly specified hack for when a tls relocation should be
propagated to the dynamic relocation table.

This replaces it with a not as bad hack of saying that a local dynamic
tls relocation is never preempted.

I will try to remove even that second hack in the next patch.

llvm-svn: 262955

8 years agoUse defined hidden symbols for out of range tests.
Rafael Espindola [Tue, 8 Mar 2016 19:51:58 +0000 (19:51 +0000)]
Use defined hidden symbols for out of range tests.

When the symbol can be preempted the error is not entirely accurate.

This just makes upcoming patches more readable.

llvm-svn: 262954

8 years agofix variable name; NFC
Sanjay Patel [Tue, 8 Mar 2016 19:07:42 +0000 (19:07 +0000)]
fix variable name; NFC

llvm-svn: 262953

8 years agouse range-based loop; NFCI
Sanjay Patel [Tue, 8 Mar 2016 19:06:12 +0000 (19:06 +0000)]
use range-based loop; NFCI

llvm-svn: 262952

8 years agoAdd self to CODE_OWNERS
Hans Wennborg [Tue, 8 Mar 2016 19:01:15 +0000 (19:01 +0000)]
Add self to CODE_OWNERS

Apparently this makes my email address easier to find.

llvm-svn: 262951

8 years agoMade self.expect() errors a little more readable in the testsuite.
Sean Callanan [Tue, 8 Mar 2016 18:58:48 +0000 (18:58 +0000)]
Made self.expect() errors a little more readable in the testsuite.

self.expect() had two problems:

- If there was a substrs argument, then it overwrote the variable containing
  the command to run with the last substr.  That meant nonsense command text in
  testsuite errors.

- The actual output is not printed, which makes fixing testsuite failures a bit
  annoying (you end up having to use the -tv arguments to dotest).

This fixes both of these issues.  We could do even better, pretty-printing the
criteria for "correct" output, but this at least makes dealing with errors a bit
better.

llvm-svn: 262950

8 years agocmake: include what you use
Saleem Abdulrasool [Tue, 8 Mar 2016 18:56:00 +0000 (18:56 +0000)]
cmake: include what you use

Add a missing include.  This is important in the case HandleLLVMOptions is
included prior to the missing CheckCXXSourceCompiles or CheckCXXCompilerFlag
which includes CheckCXXSourceCompiles.

llvm-svn: 262949

8 years ago[CMake] Refactor add_llvm_implicit_projects to be reusable
Chris Bieneman [Tue, 8 Mar 2016 18:43:28 +0000 (18:43 +0000)]
[CMake] Refactor add_llvm_implicit_projects to be reusable

This adds llvm_add_implicit_projects which takes a project name and is wrapped by add_llvm_implicit_projects.

llvm-svn: 262948

8 years agoSupport floating point values in 128-bit SSE vector registers
Adrian Prantl [Tue, 8 Mar 2016 18:35:09 +0000 (18:35 +0000)]
Support floating point values in 128-bit SSE vector registers

The System-V x86_64 ABI requires floating point values to be passed
in 128-but SSE vector registers (xmm0, ...). When printing such a
variable this currently yields an <invalid load address>.

This patch makes LLDB's DWARF expression evaluator accept 128-bit
registers as scalars. It also relaxes the check that the size of the
result of the DWARF expression be equal to the size of the variable to a
greater-than. DWARF defers to the ABI how smaller values are being placed
in a larger register.

Implementation note: I found the code in Value::SetContext() that changes
the m_value_type after the fact to be questionable. I added a sanity check
that the Value's memory buffer has indeed been written to (this is
necessary, because we may have a scalar value in a vector register), but
really I feel like this is the wrong place to be setting it.

Reviewed by Greg Clayton.

http://reviews.llvm.org/D17897
rdar://problem/24944340

llvm-svn: 262947

8 years ago[AArch64] Disable the MI scheduler to turn bots green after r262942.
Chad Rosier [Tue, 8 Mar 2016 17:33:34 +0000 (17:33 +0000)]
[AArch64] Disable the MI scheduler to turn bots green after r262942.

llvm-svn: 262944

8 years agoRevert r262759 and r262760.
Quentin Colombet [Tue, 8 Mar 2016 17:29:11 +0000 (17:29 +0000)]
Revert r262759 and r262760.
The fix consisting in using the library call for atomic compare and swap when
the instruction is not safe to use may be incorrect. Indeed the library call may
not exist on all platform. In other words, we need a better fix!

llvm-svn: 262943

8 years ago[AArch64] Add MMOs to unscaled pairs.
Chad Rosier [Tue, 8 Mar 2016 17:16:38 +0000 (17:16 +0000)]
[AArch64] Add MMOs to unscaled pairs.

Test to be committed in follow up commit, per discussion in D17097.
http://reviews.llvm.org/D17097

llvm-svn: 262942

8 years agoRevert "ELF: Add /lib and /usr/lib as default search paths."
Rafael Espindola [Tue, 8 Mar 2016 17:13:12 +0000 (17:13 +0000)]
Revert "ELF: Add /lib and /usr/lib as default search paths."

It was causing errors like

/lib/libc.so.6 is incompatible with elf_x86_64

when linking on Fedora.

Every system has different default paths. It seems better to just trust
the driver to pass the correct -L options.

This reverts commit 262910.

llvm-svn: 262941

8 years agorangify, fix function names; NFCI
Sanjay Patel [Tue, 8 Mar 2016 17:12:32 +0000 (17:12 +0000)]
rangify, fix function names; NFCI

llvm-svn: 262940

8 years agoInvoke DAG postprocessing in the post-RA scheduler
Krzysztof Parzyszek [Tue, 8 Mar 2016 16:54:20 +0000 (16:54 +0000)]
Invoke DAG postprocessing in the post-RA scheduler

This was inadvertently omitted from r262774, which added the mutation
interface.

llvm-svn: 262939

8 years agoTurning on the /bigobj flag for two more files that will not link with MSVC 2015...
Aaron Ballman [Tue, 8 Mar 2016 16:34:37 +0000 (16:34 +0000)]
Turning on the /bigobj flag for two more files that will not link with MSVC 2015 Win64 Debug due to the section limit.

llvm-svn: 262938

8 years agodon't repeat function names in documentation comments; NFC
Sanjay Patel [Tue, 8 Mar 2016 16:26:39 +0000 (16:26 +0000)]
don't repeat function names in documentation comments; NFC

llvm-svn: 262937

8 years ago[ARM] Simplify ARMInstr*.td by getting rid of identity PatFrags (NFC)
Artyom Skrobov [Tue, 8 Mar 2016 16:23:54 +0000 (16:23 +0000)]
[ARM] Simplify ARMInstr*.td by getting rid of identity PatFrags (NFC)

Reviewers: t.p.northover, grosbach, resistor

Subscribers: aemerson, rengolin, llvm-commits

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

llvm-svn: 262936

8 years agoRevert r262599 "[X86][SSE] Improve vector ZERO_EXTEND by combining to ZERO_EXTEND_VEC...
Hans Wennborg [Tue, 8 Mar 2016 16:21:41 +0000 (16:21 +0000)]
Revert r262599 "[X86][SSE] Improve vector ZERO_EXTEND by combining to ZERO_EXTEND_VECTOR_INREG"

This caused PR26870.

llvm-svn: 262935

8 years agoFix problem with uninitilialized bool found by asan.
Manuel Klimek [Tue, 8 Mar 2016 16:17:48 +0000 (16:17 +0000)]
Fix problem with uninitilialized bool found by asan.

llvm-svn: 262934

8 years agoAdd Visual Studio native visualizers for several Clang types
Mike Spertus [Tue, 8 Mar 2016 16:14:23 +0000 (16:14 +0000)]
Add Visual Studio native visualizers for several Clang types

This is one of a series of changes to improve the MSVC visualization of Clang types.
This one focuses on Record and SubstTemplateTypeParmType meaning that, for example,
a TemplateArgumentLoc no longer displays incomprehensibly in the locals window as

  {Argument={DeclArg={Kind=1 QT=0x033acb00 D=0xcccccccc {DeclType=???}}...

but instead much more usefully as

  Type template parameter: SubstTemplateTypeParm: {Identifier (("T"))} => Record, {Identifier (("A"))}

Additional types and improvements will be made in subsequent commits

llvm-svn: 262933

8 years agoRemove a couple tabs that crept in
Marshall Clow [Tue, 8 Mar 2016 15:45:06 +0000 (15:45 +0000)]
Remove a couple tabs that crept in

llvm-svn: 262932

8 years agoImplement P0272R1: Give 'std::string' a non-const '.data()' member function
Marshall Clow [Tue, 8 Mar 2016 15:44:30 +0000 (15:44 +0000)]
Implement P0272R1: Give 'std::string' a non-const '.data()' member function

llvm-svn: 262931

8 years agoAdd DAG mutation interface to the DFA packetizer
Krzysztof Parzyszek [Tue, 8 Mar 2016 15:33:51 +0000 (15:33 +0000)]
Add DAG mutation interface to the DFA packetizer

llvm-svn: 262930

8 years agoAVX512: Add extract_subvector patterns v8i1->v4i1 , v4i1->v2i1.
Igor Breger [Tue, 8 Mar 2016 15:21:25 +0000 (15:21 +0000)]
AVX512: Add extract_subvector patterns v8i1->v4i1 , v4i1->v2i1.

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

llvm-svn: 262929

8 years agoImplement P0253R1: Fixing a design mistake in the searchers interface.
Marshall Clow [Tue, 8 Mar 2016 15:12:52 +0000 (15:12 +0000)]
Implement P0253R1: Fixing a design mistake in the searchers interface.

llvm-svn: 262928

8 years ago[Fix r262788] Fix missed prototype with the old llvm* name.
Filipe Cabecinhas [Tue, 8 Mar 2016 14:22:13 +0000 (14:22 +0000)]
[Fix r262788] Fix missed prototype with the old llvm* name.

llvm-svn: 262927

8 years ago[gold] Avoid assertion failures when taking a pointer to an empty vector.
Benjamin Kramer [Tue, 8 Mar 2016 14:02:46 +0000 (14:02 +0000)]
[gold] Avoid assertion failures when taking a pointer to an empty vector.

llvm-svn: 262926

8 years agoFix log in Broadcaster causing a crash
Tamas Berghammer [Tue, 8 Mar 2016 13:33:14 +0000 (13:33 +0000)]
Fix log in Broadcaster causing a crash

llvm-svn: 262925

8 years ago[llvm-config] Get rid of code related to the Makefile builds
Filipe Cabecinhas [Tue, 8 Mar 2016 11:49:24 +0000 (11:49 +0000)]
[llvm-config] Get rid of code related to the Makefile builds

Summary: I left --build-system for backwards compat, in case there are scripts using it. Feel free to ask for its removal too.

Reviewers: chapuni, tstellarAMD

Subscribers: llvm-commits

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

llvm-svn: 262924

8 years agoTry to fix windows build after rL262863
Tamas Berghammer [Tue, 8 Mar 2016 11:43:56 +0000 (11:43 +0000)]
Try to fix windows build after rL262863

llvm-svn: 262923

8 years agoBump libclang API version after r262318
Kevin Funk [Tue, 8 Mar 2016 10:34:23 +0000 (10:34 +0000)]
Bump libclang API version after r262318

llvm-svn: 262922

8 years agoSema: Methods in unavailable classes are unavailable
Duncan P. N. Exon Smith [Tue, 8 Mar 2016 10:28:52 +0000 (10:28 +0000)]
Sema: Methods in unavailable classes are unavailable

Similar to the template cases in r262050, when a C++ method in an
unavailable struct/class calls unavailable API, don't diagnose an error.
I.e., this case was failing:

    void foo() __attribute__((unavailable));
    struct __attribute__((unavailable)) A {
      void bar() { foo(); }
    };

Since A is unavailable, A::bar is allowed to call foo.  However, we were
emitting a diagnostic here.  This commit checks up the context chain
from A::bar, in a manner inspired by SemaDeclAttr.cpp:isDeclUnavailable.

I expected to find other related issues but failed to trigger them:

- I wondered if DeclBase::getAvailability should check for
  `TemplateDecl` instead of `FunctionTemplateDecl`, but I couldn't find
  a way to trigger this.  I left behind a few extra tests to make sure
  we don't regress.

- I wondered if Sema::isFunctionConsideredUnavailable should be
  symmetric, checking up the context chain of the callee (this commit
  only checks up the context chain of the caller).  However, I couldn't
  think of a testcase that didn't require first referencing the
  unavailable type; this, we already diagnose.

rdar://problem/25030656

llvm-svn: 262921

8 years agoUse c_str() instead of GetCString() to fix build
Ewan Crawford [Tue, 8 Mar 2016 10:03:23 +0000 (10:03 +0000)]
Use c_str() instead of GetCString() to fix build

llvm-svn: 262920

8 years ago[X86] Regenerated vector float extension tests
Simon Pilgrim [Tue, 8 Mar 2016 09:17:12 +0000 (09:17 +0000)]
[X86] Regenerated vector float extension tests

llvm-svn: 262919

8 years agoRemove pr25342 test-case.
Junmo Park [Tue, 8 Mar 2016 07:42:12 +0000 (07:42 +0000)]
Remove pr25342 test-case.

This commit removes pr25342 for reverting r262670 clearly.

llvm-svn: 262918

8 years agoAlso clang-format *.c run-time library files
Tobias Grosser [Tue, 8 Mar 2016 07:34:58 +0000 (07:34 +0000)]
Also clang-format *.c run-time library files

llvm-svn: 262917

8 years agoRevert "[InstCombine] Combine A->B->A BitCast"
Junmo Park [Tue, 8 Mar 2016 07:09:46 +0000 (07:09 +0000)]
Revert "[InstCombine] Combine A->B->A BitCast"

This reverts commit r262670 due to compile failure.

llvm-svn: 262916

8 years agoSema: Treat 'strict' availability flag like unavailable
Duncan P. N. Exon Smith [Tue, 8 Mar 2016 06:12:54 +0000 (06:12 +0000)]
Sema: Treat 'strict' availability flag like unavailable

This is a follow-up to r261512, which made the 'strict' availability
attribute flag behave like 'unavailable'.  However, that fix was
insufficient.  The following case would (erroneously) error when the
deployment target was older than 10.9:

    struct __attribute__((availability(macosx,strict,introduced=10.9))) A;
    __attribute__((availability(macosx,strict,introduced=10.9))) void f(A*);

The use of A* in the argument list for f is valid here, since f and A
have the same availability.

The fix is to return AR_Unavailable from DeclBase::getAvailability
instead of AR_NotYetIntroduced.  This also reverts the special handling
added in r261163, instead relying on the well-tested logic for
AR_Unavailable.

rdar://problem/23791325

llvm-svn: 262915

8 years agoThis is actually a FileSpec, so use .GetCString() instead
Enrico Granata [Tue, 8 Mar 2016 05:59:47 +0000 (05:59 +0000)]
This is actually a FileSpec, so use .GetCString() instead

llvm-svn: 262914

8 years agoUse .c_str() here to unbreak the Linux build
Enrico Granata [Tue, 8 Mar 2016 05:57:52 +0000 (05:57 +0000)]
Use .c_str() here to unbreak the Linux build

llvm-svn: 262913

8 years agoA few more improvements on the way to the command alias refactoring
Enrico Granata [Tue, 8 Mar 2016 05:37:15 +0000 (05:37 +0000)]
A few more improvements on the way to the command alias refactoring

- move alias help generation to CommandAlias, out of CommandInterpreter
- make alias creation use argument strings instead of OptionArgVectorSP; the former is a more reasonable currency than the latter
- remove m_is_alias from CommandObject, it wasn't actually being used

llvm-svn: 262912