7 years ago[EarlyCSE] Constify ParseMemoryInst methods (NFC).
Arnaud A. de Grandmaison [Tue, 6 Oct 2015 13:35:30 +0000 (13:35 +0000)]
[EarlyCSE] Constify ParseMemoryInst methods (NFC).

llvm-svn: 249400

7 years agoAdd a new module for the C++ Core Guidelines, and the first checker for those guideli...
Aaron Ballman [Tue, 6 Oct 2015 13:31:00 +0000 (13:31 +0000)]
Add a new module for the C++ Core Guidelines, and the first checker for those guidelines: cppcoreguidelines-pro-type-reinterpret-cast.

Patch by Matthias Gehre!

llvm-svn: 249399

7 years ago[LSAN] Mark death callback as unstable while we investigate the cause in AArch64
Renato Golin [Tue, 6 Oct 2015 13:29:44 +0000 (13:29 +0000)]
[LSAN] Mark death callback as unstable while we investigate the cause in AArch64

llvm-svn: 249398

7 years agoExternal symbols need a full dynamic reloc, not R_X86_64_RELATIVE.
Rafael Espindola [Tue, 6 Oct 2015 12:39:58 +0000 (12:39 +0000)]
External symbols need a full dynamic reloc, not R_X86_64_RELATIVE.

We were already doing the right thing if the symbol was seen in a shared
library, but not if it was completely missing.

llvm-svn: 249397

7 years agoMake sure the CastInst is valid before trying to create it
Filipe Cabecinhas [Tue, 6 Oct 2015 12:37:54 +0000 (12:37 +0000)]
Make sure the CastInst is valid before trying to create it

Bug found with afl-fuzz.

llvm-svn: 249396

7 years agoBasicTests: Suppress InMemoryFileSystemTest.WindowsPath on win32 while investigating.
NAKAMURA Takumi [Tue, 6 Oct 2015 12:16:27 +0000 (12:16 +0000)]
BasicTests: Suppress InMemoryFileSystemTest.WindowsPath on win32 while investigating.

llvm-svn: 249395

7 years agoclang-format: Add empty line before code-blocks in Docs.
Daniel Jasper [Tue, 6 Oct 2015 12:11:51 +0000 (12:11 +0000)]
clang-format: Add empty line before code-blocks in Docs.

llvm-svn: 249394

7 years agoFixed typo
George Rimar [Tue, 6 Oct 2015 12:08:08 +0000 (12:08 +0000)]
Fixed typo

llvm-svn: 249393

7 years agoclang-format: Make IncludeCategories configurable in .clang-format file.
Daniel Jasper [Tue, 6 Oct 2015 11:54:18 +0000 (11:54 +0000)]
clang-format: Make IncludeCategories configurable in .clang-format file.

This was made much easier by introducing an IncludeCategory struct to
replace the previously used std::pair.

Also, cleaned up documentation and added examples.

llvm-svn: 249392

7 years agoAdds a way for tools to deduce the target config from a compiler name.
Manuel Klimek [Tue, 6 Oct 2015 10:45:03 +0000 (10:45 +0000)]
Adds a way for tools to deduce the target config from a compiler name.

Adds `addTargetAndModeForProgramName`, a utility function that will add
appropriate `-target foo` and `--driver-mode=g++` tokens to a command
line for driver invocations of the form `a/b/foo-g++`. It is intended to
support tooling: for example, should a compilation database record some
invocation of `foo-g++` without these implicit flags, a Clang tool may
use this function to add them back.

Patch by Luke Zarko.

llvm-svn: 249391

7 years ago[InstCombine] Teach SimplifyDemandedVectorElts how to handle ConstantVector select...
Andrea Di Biagio [Tue, 6 Oct 2015 10:34:53 +0000 (10:34 +0000)]
[InstCombine] Teach SimplifyDemandedVectorElts how to handle ConstantVector select masks with ConstantExpr elements (PR24922)

If the mask of a select instruction is a ConstantVector, method
SimplifyDemandedVectorElts iterates over the mask elements to identify which
values are selected from the select inputs.

Before this patch, method SimplifyDemandedVectorElts always used method
Constant::isNullValue() to check if a value in the mask was zero. Unfortunately
that method always returns false when called on a ConstantExpr.

This patch fixes the problem in SimplifyDemandedVectorElts by adding an explicit
check for ConstantExpr values. Now, if a value in the mask is a ConstantExpr, we
avoid calling isNullValue() on it.

Fixes PR24922.

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

llvm-svn: 249390

7 years ago[VFS] Port SimpleFormatContext to InMemoryFileSystem.
Benjamin Kramer [Tue, 6 Oct 2015 10:23:34 +0000 (10:23 +0000)]
[VFS] Port SimpleFormatContext to InMemoryFileSystem.

llvm-svn: 249389

7 years ago[VFS] Port applyAllReplacements to InMemoryFileSystem.
Benjamin Kramer [Tue, 6 Oct 2015 10:23:17 +0000 (10:23 +0000)]
[VFS] Port applyAllReplacements to InMemoryFileSystem.

llvm-svn: 249388

7 years agoFix segmentation fault in lldb_private::Symbols::LocateExecutableSymbolFile()
Bruce Mitchener [Tue, 6 Oct 2015 10:17:34 +0000 (10:17 +0000)]
Fix segmentation fault in lldb_private::Symbols::LocateExecutableSymbolFile()

When `module_spec.GetFileSpec().GetDirectory().AsCString()` returned a `nullptr` this line caused a segmentation fault:

`std::string module_directory = module_spec.GetFileSpec().GetDirectory().AsCString()`

Some context:
I was remote debugging an executable built with Clang in an Ubuntu VM on my Windows machine using lldb-mi. I copied the executable and nothing else from the Ubuntu VM to the Windows machine.

Then started lldb-server in the Ubuntu VM:

./bin/lldb-server gdbserver *:8888 -- /home/enlight/Projects/dbgmits/build/Debug/data_tests_target

And ran `lldb-mi --interpreter` on Windows with the following commands:

-file-exec-and-symbols C:\Projects\data_tests_target
-target-select remote


After which the segmentation fault occurred at the aforementioned line. Inside this method `module_spec.GetFileSpec()` returns an empty `FileSpec` (no dir, no filename), while `module_spec.GetSymbolFileSpec().GetFilename()` returns `"libc-2.19.so"`.

Patch thanks to Vadim Macagon.

Reviewers: brucem, zturner, clayborg

Subscribers: lldb-commits

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

llvm-svn: 249387

7 years ago[mips][disassembler] Changed CHECK-EB directives to CHECK so div/divu are tested.
Daniel Sanders [Tue, 6 Oct 2015 10:08:14 +0000 (10:08 +0000)]
[mips][disassembler] Changed CHECK-EB directives to CHECK so div/divu are tested.

llvm-svn: 249386

7 years ago[VFS] Transition clang-format to use an in-memory FS.
Benjamin Kramer [Tue, 6 Oct 2015 10:04:08 +0000 (10:04 +0000)]
[VFS] Transition clang-format to use an in-memory FS.

Apart from being cleaner this also means that clang-format no longer has
access to the host file system. This isn't necessary because clang-format
never reads includes :)

Includes minor tweaks and bugfixes found in the VFS implementation while
running clang-format tests.

llvm-svn: 249385

7 years ago[mips][disassembler] Merged disassembler tests into the corresponding ISA/ASE subdire...
Daniel Sanders [Tue, 6 Oct 2015 10:02:35 +0000 (10:02 +0000)]
[mips][disassembler] Merged disassembler tests into the corresponding ISA/ASE subdirectories.

llvm-svn: 249384

7 years ago[mips][disassembler] Moved DSP tests into proper place and corrected formatting.
Daniel Sanders [Tue, 6 Oct 2015 09:28:48 +0000 (09:28 +0000)]
[mips][disassembler] Moved DSP tests into proper place and corrected formatting.

llvm-svn: 249383

7 years ago[builtins] Enable building of the builtins library for MIPS targets.
Vasileios Kalintiris [Tue, 6 Oct 2015 09:02:38 +0000 (09:02 +0000)]
[builtins] Enable building of the builtins library for MIPS targets.

Reviewers: howard.hinnant, samsonov

Subscribers: samsonov, dsanders, llvm-commits

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

llvm-svn: 249382

7 years ago[MIPS] Emulate microMIPS instructions
Bhushan D. Attarde [Tue, 6 Oct 2015 08:52:08 +0000 (08:52 +0000)]
[MIPS] Emulate microMIPS instructions

    This patch includes:

    1. Emulation of prologue/epilogue and branch instructions for microMIPS.
    2. Setting up alternate disassembler (to be used for microMIPS).
       So there will be two disassembler instances, one for microMIPS and other for MIPS.
       Appropriate disassembler will be used based on the address class of instruction address.

    3. Some of the branch instructions does not have fixed sized delay slot, that means delay slot instruction can be of 2-byte or 4-byte.
       For this "m_next_inst_size" has been introduced which stores the size of next instruction (i.e size of delay slot instruction in case of branch).
       This can be used wherever the size of next instruction is required.

    4. A minor change to use mips32 register names instead of mips64 names.

    Reviewers: clayborg, tberghammer
    Subscribers: mohit.bhakkad, sagar, jaydeep, nitesh.jain, lldb-commits
    Differential Revision: http://reviews.llvm.org/D13282

llvm-svn: 249381

7 years agoRenderScript command for printing allocation information
Ewan Crawford [Tue, 6 Oct 2015 08:42:32 +0000 (08:42 +0000)]
RenderScript command for printing allocation information

This patch adds a new command 'language renderscript allocation list' for printing the details of all loaded RS allocations.

In order to work out this information lldb JITs the runtime for the data it wants.
This has a penalty of a couple seconds latency, so is only done once for each allocation and the results cached.

If the user later wants to recalculate this information however, they can force lldb to do so with the --refresh flag.

Reviewed by: jingham, clayborg
Subscribers: lldb-commits, ADodds, domipheus, dean, tberghammer, danalbert, srhines
Differential Revision: http://reviews.llvm.org/D13247

llvm-svn: 249380

7 years agoBug 25050: X87 FPU Special Purpose Registers
Abhishek Aggarwal [Tue, 6 Oct 2015 07:04:03 +0000 (07:04 +0000)]
Bug 25050: X87 FPU Special Purpose Registers

  - For x86_64-FreeBSD Platform:
    -- LLDB now provides correct values of X87 FPU
       Special Purpose Registers like fstat, ftag, fctrl etc..

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>
Reviewers: emaste, mikesart, clayborg

Subscribers: emaste

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

llvm-svn: 249379

7 years ago[TwoAddressInstructionPass] When looking for a 3 addr conversion after commuting...
Craig Topper [Tue, 6 Oct 2015 05:39:59 +0000 (05:39 +0000)]
[TwoAddressInstructionPass] When looking for a 3 addr conversion after commuting, make sure regB has been updated to take into account the commute.

llvm-svn: 249378

7 years ago[LLDB][MIPS] Fix hit_count for mips watchpoints
Mohit K. Bhakkad [Tue, 6 Oct 2015 05:25:17 +0000 (05:25 +0000)]
[LLDB][MIPS] Fix hit_count for mips watchpoints

Reviewers: clayborg, jingham.
Subscribers: jaydeep, bhushan, dsanders, sagar, nitesh.jain, zturner, jasonmolenda, lldb-commits.
Differential Revision: http://reviews.llvm.org/D13241

llvm-svn: 249377

7 years agobuiltins: fix build
Saleem Abdulrasool [Tue, 6 Oct 2015 04:33:08 +0000 (04:33 +0000)]
builtins: fix build

Unfortunately, int_utils.h needs to depend on int_lib for the common macro
definitions.  However, currently, int_utils.h is included by int_lib.h.  Reorder
the inclusion to work around this.

llvm-svn: 249376

7 years agobuiltins: Use MSVC-equivalents of attributes
Saleem Abdulrasool [Tue, 6 Oct 2015 04:33:05 +0000 (04:33 +0000)]
builtins: Use MSVC-equivalents of attributes

This allows us to build the builtins using MSVC.  NFC.

Patch by Tee Hao Wei!

llvm-svn: 249375

7 years agobuiltins: tweak constant spelling
Saleem Abdulrasool [Tue, 6 Oct 2015 04:33:02 +0000 (04:33 +0000)]
builtins: tweak constant spelling

Use 4294967296.f instead of 0x1p32f to fix MSVC.  NFC.

Patch by Tee Hao Wei!

llvm-svn: 249374

7 years agobuiltins: tweak Windows build
Saleem Abdulrasool [Tue, 6 Oct 2015 04:32:59 +0000 (04:32 +0000)]
builtins: tweak Windows build

Include Windows.h instead of winbase.h and windef.h

Patch by Tee Hao Wei!

llvm-svn: 249373

7 years agoAdd comments for LWG issues 2219 and 2367
Eric Fiselier [Tue, 6 Oct 2015 04:12:30 +0000 (04:12 +0000)]
Add comments for LWG issues 2219 and 2367

llvm-svn: 249372

7 years ago[bpf] Avoid extra pointer arithmetic for stack access
Alexei Starovoitov [Tue, 6 Oct 2015 04:00:53 +0000 (04:00 +0000)]
[bpf] Avoid extra pointer arithmetic for stack access

For the program like below
struct key_t {
  int pid;
  char name[16];
extern void test1(char *);
int test() {
  struct key_t key = {};
  return 0;
For key.name, the llc/bpf may generate the below code:
  R1 = R10  // R10 is the frame pointer
  R1 += -24 // framepointer adjustment
  R1 |= 4   // R1 is then used as the first parameter of test1
OR operation is not recognized by in-kernel verifier.

This patch introduces an intermediate FI_ri instruction and
generates the following code that can be properly verified:
  R1 = R10
  R1 += -20

Patch by Yonghong Song <yhs@plumgrid.com>

llvm-svn: 249371

7 years ago[X86] Teach constant hoisting that ANDs with 64-bit immediates in the range 0x8000000...
Craig Topper [Tue, 6 Oct 2015 02:50:24 +0000 (02:50 +0000)]
[X86] Teach constant hoisting that ANDs with 64-bit immediates in the range 0x80000000-0xffffffff can be handled cheaply and don't need to be hoisted.

Most importantly, this keeps constant hoisting from preventing instruction selections ability to turn an AND with 0xffffffff into a move into a 32-bit subregister.

llvm-svn: 249370

7 years ago[X86] Remove unnecessary AddComplexity directive. The instruction is already wrapped...
Craig Topper [Tue, 6 Oct 2015 02:50:21 +0000 (02:50 +0000)]
[X86] Remove unnecessary AddComplexity directive. The instruction is already wrapped in the equivalent earlier. NFC

llvm-svn: 249369

7 years ago[elf2] Address style comments.
Michael J. Spencer [Tue, 6 Oct 2015 02:13:54 +0000 (02:13 +0000)]
[elf2] Address style comments.

llvm-svn: 249368

7 years ago[elf2] Add __preinit_array, and __fini_array start and end symbols.
Michael J. Spencer [Tue, 6 Oct 2015 01:16:17 +0000 (01:16 +0000)]
[elf2] Add __preinit_array, and __fini_array start and end symbols.

llvm-svn: 249367

7 years agoIntroduce a FormattersMatchData class which contains all the information that data...
Enrico Granata [Tue, 6 Oct 2015 01:02:47 +0000 (01:02 +0000)]
Introduce a FormattersMatchData class which contains all the information that data formatters need in one place, and also allows for lazy computation of expensive chunks of information if need be

This is a NFC commit that is essentially plumbing the new currency through the system

llvm-svn: 249366

7 years ago[elf2] Ignore __tls_get_addr when static linking.
Michael J. Spencer [Tue, 6 Oct 2015 00:45:42 +0000 (00:45 +0000)]
[elf2] Ignore __tls_get_addr when static linking.

llvm-svn: 249365

7 years ago[WebAssembly] Switch to a more traditional assembly syntax
Dan Gohman [Tue, 6 Oct 2015 00:27:55 +0000 (00:27 +0000)]
[WebAssembly] Switch to a more traditional assembly syntax

This new syntax is built around putting each instruction on its own line
in a "mnemonic op, op, op" like syntax. It also uses conventional data
section directives like ".byte" and so on rather than requiring everything
to be in hierarchical S-expression format. This is a more natural syntax
for a ".s" file format from the perspective of LLVM MC and related tools,
while remaining easy to translate into other forms as needed.

llvm-svn: 249364

7 years agoMark 2259 and 2473 as complete. Add some more notes
Marshall Clow [Mon, 5 Oct 2015 23:27:10 +0000 (23:27 +0000)]
Mark 2259 and 2473 as complete. Add some more notes

llvm-svn: 249363

7 years agodsymutil: Don't prune forward declarations inside of an imported TAG_module
Adrian Prantl [Mon, 5 Oct 2015 23:11:20 +0000 (23:11 +0000)]
dsymutil: Don't prune forward declarations inside of an imported TAG_module
if there exists not definition for the type.
For this to work, we need to clone the imported modules before building
the decl context chains of the DIEs in the non-skeleton CUs.

llvm-svn: 249362

7 years agoSBTarget::Attach(SBAttachInfo &) was changed to not be asynchronous back in February...
Greg Clayton [Mon, 5 Oct 2015 22:58:37 +0000 (22:58 +0000)]
SBTarget::Attach(SBAttachInfo &) was changed to not be asynchronous back in February and this affected Xcode's abililty to cancel an attach to process by name.

Added the ability to specify if an attach by name should be synchronous or not in SBAttachInfo and ProcessAttachInfo.


llvm-svn: 249361

7 years agoFix R_X86_64_RELATIVE for local symbols that refer to other sections.
Rafael Espindola [Mon, 5 Oct 2015 22:49:16 +0000 (22:49 +0000)]
Fix R_X86_64_RELATIVE for local symbols that refer to other sections.

We were mixing up the relocated and target sections.

llvm-svn: 249360

7 years ago[ELF2/AArch64] Read the right amount of bytes.
Davide Italiano [Mon, 5 Oct 2015 22:43:42 +0000 (22:43 +0000)]
[ELF2/AArch64] Read the right amount of bytes.

This was clearly wrong (thanks Rui for spotting), and I honestly would
like to get this tested so such mistakes won't repeat. Unfortunately, I
wasn't (easily) able to craft a test that exposes the bad behavior.
Ideally, we would like to get tests of this kind for all relocations, but
at the time of writing, this is not true. So, for now just fix this bug
and try to re-evaluate a way to test this in the future.

llvm-svn: 249359

7 years ago[compiler-rt] Properly detect lack of available system libraries for arch in clang_da...
Keno Fischer [Mon, 5 Oct 2015 22:24:12 +0000 (22:24 +0000)]
[compiler-rt] Properly detect lack of available system libraries for arch in clang_darwin.mk

Summary: This is the Makefile analog of r247833, except that the test also had to be changed such that clang actually attempts to link the program as opposed to just building it. Because of that change, I also switched the order to checking for ld/clang architecture support, because now lack of ld support would make the clang check fail. This fixes PR24776.

Reviewers: beanz

Subscribers: llvm-commits

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

llvm-svn: 249358

7 years agoHandle a common symbol needing a R_X86_64_RELATIVE.
Rafael Espindola [Mon, 5 Oct 2015 21:23:08 +0000 (21:23 +0000)]
Handle a common symbol needing a R_X86_64_RELATIVE.

llvm-svn: 249357

7 years agoMove helper classes into an anonymous namespace. NFC.
Benjamin Kramer [Mon, 5 Oct 2015 21:20:26 +0000 (21:20 +0000)]
Move helper classes into an anonymous namespace. NFC.

llvm-svn: 249356

7 years agoRemove duplicated default arguments. NFC.
Benjamin Kramer [Mon, 5 Oct 2015 21:20:19 +0000 (21:20 +0000)]
Remove duplicated default arguments. NFC.

llvm-svn: 249355

7 years agoMark 2380 and 2384 as complete; no changes needed
Marshall Clow [Mon, 5 Oct 2015 21:11:20 +0000 (21:11 +0000)]
Mark 2380 and 2384 as complete; no changes needed

llvm-svn: 249354

7 years agoInclude existing addend when computing R_X86_64_RELATIVE.
Rafael Espindola [Mon, 5 Oct 2015 21:09:37 +0000 (21:09 +0000)]
Include existing addend when computing R_X86_64_RELATIVE.

llvm-svn: 249353

7 years agoPatch for 2466 is ready
Marshall Clow [Mon, 5 Oct 2015 21:08:49 +0000 (21:08 +0000)]
Patch for 2466 is ready

llvm-svn: 249352

7 years agoRemove AutoFDO profile handling for GCC's LIPO. NFC.
Diego Novillo [Mon, 5 Oct 2015 21:08:05 +0000 (21:08 +0000)]
Remove AutoFDO profile handling for GCC's LIPO. NFC.

Given the work we are doing on ThinLTO, we will never need to support
module groups and working sets in GCC's implementation of LIPO. These
are currently dead code, and will continue to be so.

llvm-svn: 249351

7 years agoMake this test a bit more strict.
Rafael Espindola [Mon, 5 Oct 2015 20:54:39 +0000 (20:54 +0000)]
Make this test a bit more strict.

Before the ADDR variables could match the empty string.

llvm-svn: 249350

7 years agoFixed a possible overflow in a test of allocator::max_size().
Marshall Clow [Mon, 5 Oct 2015 20:50:25 +0000 (20:50 +0000)]
Fixed a possible overflow in a test of allocator::max_size().

llvm-svn: 249349

7 years agoMark a couple more issues 'ready'
Marshall Clow [Mon, 5 Oct 2015 20:35:30 +0000 (20:35 +0000)]
Mark a couple more issues 'ready'

llvm-svn: 249348

7 years agoMark 2072 as complete; we already do this
Marshall Clow [Mon, 5 Oct 2015 20:21:54 +0000 (20:21 +0000)]
Mark 2072 as complete; we already do this

llvm-svn: 249347

7 years agoFix the MSVC build.
Rafael Espindola [Mon, 5 Oct 2015 20:20:50 +0000 (20:20 +0000)]
Fix the MSVC build.

No idea what asymmetry MSVC is findind.

llvm-svn: 249346

7 years agoPatch ready for 2127
Marshall Clow [Mon, 5 Oct 2015 20:16:30 +0000 (20:16 +0000)]
Patch ready for 2127

llvm-svn: 249345

7 years ago[WinEH] Update CATCHRET's operand to match its successor
David Majnemer [Mon, 5 Oct 2015 20:09:16 +0000 (20:09 +0000)]
[WinEH] Update CATCHRET's operand to match its successor

The CATCHRET operand did not match the MachineFunction's CFG.  This
mismatch happened because FrameLowering created a new MachineBasicBlock
and updated the CFG but forgot to update the CATCHRET operand.

Let's make sure this doesn't happen again by strengthing the funclet
membership analysis: it can now reason about the membership of all basic
blocks, not just those inside of funclets.

llvm-svn: 249344

7 years agoAdding a checker (cert-dcl50-cpp) that detects the definition of a C-style variadic...
Aaron Ballman [Mon, 5 Oct 2015 20:08:59 +0000 (20:08 +0000)]
Adding a checker (cert-dcl50-cpp) that detects the definition of a C-style variadic function in C++ code. Corresponds to the CERT C++ secure coding rule: https://securecoding.cert.org/confluence/display/cplusplus/DCL50-CPP.+Do+not+define+a+C-style+variadic+function

llvm-svn: 249343

7 years agoRevert r107690 (for PR7417) and add a testcase that it breaks. The approach of
Richard Smith [Mon, 5 Oct 2015 20:05:21 +0000 (20:05 +0000)]
Revert r107690 (for PR7417) and add a testcase that it breaks. The approach of
that change turns out to not be reasonable: mutating the AST of a parsed
template during instantiation is not a sound thing to do, does not work across
chained PCH / modules builds, and is in any case a special-case workaround to a
more general problem that should be solved centrally.

llvm-svn: 249342

7 years agoAdding an AST node matcher for NonTypeTemplateParmDecl objects.
Aaron Ballman [Mon, 5 Oct 2015 19:44:42 +0000 (19:44 +0000)]
Adding an AST node matcher for NonTypeTemplateParmDecl objects.

llvm-svn: 249341

7 years agoCreate R_X86_64_RELATIVE when needed.
Rafael Espindola [Mon, 5 Oct 2015 19:30:12 +0000 (19:30 +0000)]
Create R_X86_64_RELATIVE when needed.

The dynamic relocation code needs refactoring, but it is probably better
to do it with this test passing.

llvm-svn: 249340

7 years ago[libcxx] Reexport std::bad_array_length symbols from libc++abi on OS X.
Eric Fiselier [Mon, 5 Oct 2015 19:28:48 +0000 (19:28 +0000)]
[libcxx] Reexport std::bad_array_length symbols from libc++abi on OS X.

On OS X libc++ needs to reexport libc++abi's symbols in order for them to be provided. We explicitly list the symbols to reexport it libcxx/lib/libc++abi2.exp. This patch adds the symbols required by std::bad_array_length which have been missing for some time.

However there is a problem. std::bad_array_length was add to libc++abi in September of 2013 by commit r190479, about a year after everything else. Therefore I think older OS X version  have libc++abi versions without std::bad_array_length. On those systems
libc++ won't build with this change because we will try and export undefined symbols.

The workaround I would write to support older systems depends on the amount of people who would need it.   If only a small number of developers are affected it might be sufficient to provide a CMake switch like `LIBCPP_LIBCPPABI_HAS_BAD_ARRAY_LENGTH` which is
ON by default and can be disabled by those who need it. Otherwise I think we should try to automatically detect if the symbols are present in `/usr/lib/libc++abi.dylib` and configure accordingly. I would prefer the first solution because writing CMake sucks.

Reviewers: mclow.lists, aprantl

Subscribers: aprantl, cfe-commits

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

llvm-svn: 249339

7 years ago[sanitizer] Enable lsan for AArch64
Adhemerval Zanella [Mon, 5 Oct 2015 19:16:42 +0000 (19:16 +0000)]
[sanitizer] Enable lsan for AArch64

llvm-svn: 249338

7 years ago[lsan] [aarch64] Add support for AArch64
Adhemerval Zanella [Mon, 5 Oct 2015 19:16:09 +0000 (19:16 +0000)]
[lsan] [aarch64] Add support for AArch64

This patch add support for leak sanitizer for aarch64.  Similar to
MIPS it uses a SizeClassAllocator32 due VMA constraints (aarch64
currently supports 39 and 42-bit VMA).

llvm-svn: 249337

7 years agoRe-introduce the unique_ptr removed in r249328 and just make
Adrian Prantl [Mon, 5 Oct 2015 18:54:30 +0000 (18:54 +0000)]
Re-introduce the unique_ptr removed in r249328 and just make
~CodeGenABITypes out-of-line, which should have the same effect.

Thanks to David Blaikie for pointing this out!

llvm-svn: 249336

7 years agoSimplify code. No functionality change.
Jakub Staszak [Mon, 5 Oct 2015 18:53:30 +0000 (18:53 +0000)]
Simplify code. No functionality change.

llvm-svn: 249335

7 years agoAdd comments about the issues
Marshall Clow [Mon, 5 Oct 2015 18:48:10 +0000 (18:48 +0000)]
Add comments about the issues

llvm-svn: 249334

7 years agoPrivate page for status of Kona issues and papers. Will be deleted after the Kona...
Marshall Clow [Mon, 5 Oct 2015 18:40:13 +0000 (18:40 +0000)]
Private page for status of Kona issues and papers. Will be deleted after the Kona meeting. Not to be linked to from other pages.

llvm-svn: 249333

7 years agoReleaseNotes: note the new Windows version requirement
Hans Wennborg [Mon, 5 Oct 2015 18:38:49 +0000 (18:38 +0000)]
ReleaseNotes: note the new Windows version requirement

llvm-svn: 249332

7 years ago[msan] Correct a typo in poison stack pattern command line description.
Evgeniy Stepanov [Mon, 5 Oct 2015 18:01:17 +0000 (18:01 +0000)]
[msan] Correct a typo in poison stack pattern command line description.

Patch by Jon Eyolfson.

llvm-svn: 249331

7 years agoAMDGPU/SI: Add a helper for creating aliases for the _e32 instructions
Tom Stellard [Mon, 5 Oct 2015 17:57:39 +0000 (17:57 +0000)]
AMDGPU/SI: Add a helper for creating aliases for the _e32 instructions

We are currently only using these aliases for VOPC instructions,
but this helper will make it easier to use them everywhere.

These aliases allow for the automatic matching of instructions
with forced 32-bit encoding.  Eventually, we should be able to remove
the custom C++ logic we have for this in the assembler.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 249330

7 years agoUndo the unique_ptr'fication of CodeGenABITypes::CGM introduced in r248762.
Adrian Prantl [Mon, 5 Oct 2015 17:41:16 +0000 (17:41 +0000)]
Undo the unique_ptr'fication of CodeGenABITypes::CGM introduced in r248762.
include/clang/CodeGenABITypes.h is in meant to be included by external
users, but using a unique_ptr on the private CodeGenModule introduces a
dependency on the type definition that prevents such a use.


llvm-svn: 249328

7 years agoMergeFunctions: Clear GlobalNumbers ValueMap
Arnold Schwaighofer [Mon, 5 Oct 2015 17:26:36 +0000 (17:26 +0000)]
MergeFunctions: Clear GlobalNumbers ValueMap

Otherwise, the map will observe changes as long as MergeFunctions is alive. This
is bad because follow-up passes could replace-all-uses-with on the key of an
entry in the map. The value handle callback of ValueMap however asserts that the
key type matches.


llvm-svn: 249327

7 years agoDon't copy STT_SECTION from the inputs.
Rafael Espindola [Mon, 5 Oct 2015 16:25:43 +0000 (16:25 +0000)]
Don't copy STT_SECTION from the inputs.

This matches the behavior of gold and bfd ld.

llvm-svn: 249326

7 years agoImplement LWG#2063, and update the issues links to point to the github generated...
Marshall Clow [Mon, 5 Oct 2015 16:17:34 +0000 (16:17 +0000)]
Implement LWG#2063, and update the issues links to point to the github generated pages

llvm-svn: 249325

7 years agoRemove an extra blank line.
Igor Kudrin [Mon, 5 Oct 2015 16:05:18 +0000 (16:05 +0000)]
Remove an extra blank line.

llvm-svn: 249324

7 years agoInclude hidden and internal symbols in the regular symbol table.
Rafael Espindola [Mon, 5 Oct 2015 15:24:04 +0000 (15:24 +0000)]
Include hidden and internal symbols in the regular symbol table.

This matches the behavior of bfd ld and gold. It is also convenient for
testing other changes.

llvm-svn: 249323

7 years ago[ARM] Modify codegen for memcpy intrinsic to prefer LDM/STM.
Scott Douglass [Mon, 5 Oct 2015 14:49:54 +0000 (14:49 +0000)]
[ARM] Modify codegen for memcpy intrinsic to prefer LDM/STM.

We were previously codegen'ing memcpy as regular load/store operations and
hoping that the register allocator would allocate registers in ascending order
so that we could apply an LDM/STM combine after register allocation. According
to the commit that first introduced this code (r37179), we planned to teach the
register allocator to allocate the registers in ascending order. This never got
implemented, and up to now we've been stuck with very poor codegen.

A much simpler approach for achieving better codegen is to create MEMCPY pseudo
instructions, attach scratch virtual registers to them and then, post register
allocation, expand the MEMCPYs into LDM/STM pairs using the scratch registers.
The register allocator will have picked arbitrary registers which we sort when
expanding the MEMCPY. This approach also avoids the need to repeatedly calculate
offsets which ultimately ought to be eliminated pre-RA in order to decrease
register pressure.

Fixes PR9199 and PR23768.

[This is based on Peter Collingbourne's r238473 which was reverted.]

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

Change-Id: I727543c2e94136e0f80b8e22d5642d7b9ee5b458
Author: Peter Collingbourne <peter@pcc.me.uk>
llvm-svn: 249322

7 years agoAdding a narrowing AST matcher for FunctionDecl::isVariadic(), plus tests and documen...
Aaron Ballman [Mon, 5 Oct 2015 14:41:27 +0000 (14:41 +0000)]
Adding a narrowing AST matcher for FunctionDecl::isVariadic(), plus tests and documentation.

llvm-svn: 249321

7 years agoMake test resilient against windows path separators.
Benjamin Kramer [Mon, 5 Oct 2015 14:15:13 +0000 (14:15 +0000)]
Make test resilient against windows path separators.

llvm-svn: 249320

7 years ago[VFS] Fix the windows build by including the right headers.
Benjamin Kramer [Mon, 5 Oct 2015 14:06:36 +0000 (14:06 +0000)]
[VFS] Fix the windows build by including the right headers.

llvm-svn: 249319

7 years ago[VFS] Fix compilation on systems where time_t is not int64_t.
Benjamin Kramer [Mon, 5 Oct 2015 14:02:15 +0000 (14:02 +0000)]
[VFS] Fix compilation on systems where time_t is not int64_t.

No functional change intended.

llvm-svn: 249318

7 years ago[mips][microMIPS] Implement JALRC16, JRCADDIUSP and JRC16 instructions
Zoran Jovanovic [Mon, 5 Oct 2015 14:00:09 +0000 (14:00 +0000)]
[mips][microMIPS] Implement JALRC16, JRCADDIUSP and JRC16 instructions
Differential Revision: http://reviews.llvm.org/D11219

llvm-svn: 249317

7 years ago[VFS] Add working directories to every virtual file system.
Benjamin Kramer [Mon, 5 Oct 2015 13:55:20 +0000 (13:55 +0000)]
[VFS] Add working directories to every virtual file system.

For RealFileSystem this is getcwd()/chdir(), the synthetic file systems can
make up one for themselves. OverlayFileSystem now synchronizes the working
directories when a new FS is added to the overlay or the overlay working
directory is set. This allows purely artificial file systems that have zero
ties to the underlying disks.

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

llvm-svn: 249316

7 years ago[VFS] Add an in-memory file system implementation.
Benjamin Kramer [Mon, 5 Oct 2015 13:55:14 +0000 (13:55 +0000)]
[VFS] Add an in-memory file system implementation.

This is a simple file system tree of memory buffers that can be filled by a
client. In conjunction with an OverlayFS it can be used to make virtual
files accessible right next to physical files. This can be used as a
replacement for the virtual file handling in FileManager and which I intend
to remove eventually.

llvm-svn: 249315

7 years ago[VFS] Move class out of method so it looks less like Java.
Benjamin Kramer [Mon, 5 Oct 2015 13:55:09 +0000 (13:55 +0000)]
[VFS] Move class out of method so it looks less like Java.

No functionality change.

llvm-svn: 249314

7 years ago[MC layer][AArch64] llvm-mc accepts 4-bit immediate values for
Alexandros Lamprineas [Mon, 5 Oct 2015 13:42:31 +0000 (13:42 +0000)]
[MC layer][AArch64] llvm-mc accepts 4-bit immediate values for
"msr pan, #imm", while only 1-bit immediate values should be valid.
Changed encoding and decoding for msr pstate instructions.

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

llvm-svn: 249313

7 years agoclang-format: Small doc fix.
Daniel Jasper [Mon, 5 Oct 2015 13:30:42 +0000 (13:30 +0000)]
clang-format: Small doc fix.

llvm-svn: 249312

7 years ago[mips] Changed the way symbols are handled in dla and la instructions to allow simple...
Daniel Sanders [Mon, 5 Oct 2015 13:19:29 +0000 (13:19 +0000)]
[mips] Changed the way symbols are handled in dla and la instructions to allow simple expressions.

An instruction like "(d)la $5, symbol+8" previously would have crashed the
assembler as it contains an expression. This is now fixed.
A few tests cases have also been changed to reflect these changes, however
these should only be syntax changes. Some new test cases have also been

Patch by Scott Egerton.

Reviewers: vkalintiris, dsanders

Subscribers: llvm-commits

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

llvm-svn: 249311

7 years ago[VFS] Remove setName from the file interface.
Benjamin Kramer [Mon, 5 Oct 2015 13:15:33 +0000 (13:15 +0000)]
[VFS] Remove setName from the file interface.

This streamlines the interface a bit and makes Status more immutable.
No functional change intended.

llvm-svn: 249310

7 years ago[Support] Add a version of fs::make_absolute with a custom CWD.
Benjamin Kramer [Mon, 5 Oct 2015 13:02:43 +0000 (13:02 +0000)]
[Support] Add a version of fs::make_absolute with a custom CWD.

This will be used soon from clang.

llvm-svn: 249309

7 years agoThe Driver does not set the +strict-align flag when targeting
Alexandros Lamprineas [Mon, 5 Oct 2015 12:45:10 +0000 (12:45 +0000)]
The Driver does not set the +strict-align flag when targeting
[ARM] armv6m + netbsd. Tests are misssing for armv6m + darwin as well.

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

llvm-svn: 249308

7 years ago[asan][mips] Fix ABI incompatibility crash in pthread_create() following r248325.
Daniel Sanders [Mon, 5 Oct 2015 12:43:47 +0000 (12:43 +0000)]
[asan][mips] Fix ABI incompatibility crash in pthread_create() following r248325.

Like i386, Mips needs a versioned interceptor but must select GLIBC_2.2.

llvm-svn: 249307

7 years ago[mips][p5600] Add -mcpu=p5600 option.
Daniel Sanders [Mon, 5 Oct 2015 12:24:30 +0000 (12:24 +0000)]
[mips][p5600] Add -mcpu=p5600 option.


Reviewers: vkalintiris, atanasyan

Subscribers: cfe-commits

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

llvm-svn: 249306

7 years agoUse better mocks in modernize-make-unique, and fix matcher.
Angel Garcia Gomez [Mon, 5 Oct 2015 12:20:17 +0000 (12:20 +0000)]
Use better mocks in modernize-make-unique, and fix matcher.

Summary: Add the second template argument to the unique_ptr mock, and update the matcher so that it only matches against cases where the second argument is the default.

Reviewers: klimek

Subscribers: alexfh, cfe-commits

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

llvm-svn: 249305

7 years agoAdded missing test for [ARM] AttributeParser. Check that build attribute
Alexandros Lamprineas [Mon, 5 Oct 2015 12:13:29 +0000 (12:13 +0000)]
Added missing test for [ARM] AttributeParser. Check that build attribute
Tag_Advanced_SIMD_arch is set correctly when targeting v8.1-a NEON.

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

llvm-svn: 249304

7 years agoFix pr24486.
Rafael Espindola [Mon, 5 Oct 2015 12:07:05 +0000 (12:07 +0000)]
Fix pr24486.

This extends the work done in r233995 so that now getFragment (in addition to
getSection) also works for variable symbols.

With that the existing logic to decide if a-b can be computed works even if
a or b are variables. Given that, the expression evaluation can avoid expanding
variables as aggressively and that in turn lets the relocation code see the
original variable.

In order for this to work with the asm streamer, there is now a dummy fragment
per section. It is used to assign a section to a symbol when no other fragment

This patch is a joint work by Maxim Ostapenko andy myself.

llvm-svn: 249303

7 years agoUse llvm::errc instead of std::errc.
Rafael Espindola [Mon, 5 Oct 2015 11:49:35 +0000 (11:49 +0000)]
Use llvm::errc instead of std::errc.

llvm-svn: 249302

7 years ago[OpenCL] Fix casting a true boolean to an integer vector.
Anastasia Stulova [Mon, 5 Oct 2015 11:27:41 +0000 (11:27 +0000)]
[OpenCL] Fix casting a true boolean to an integer vector.

OpenCL v1.1 s6.2.2: for the boolean value true, every bit in the result vector should be set.

This change treats the i1 value as signed for the purposes of performing the cast to integer,
and therefore sign extend into the result.

Patch by Neil Hickey!


llvm-svn: 249301

7 years agoDocument a bug in loop-convert and fix one of its subcases.
Angel Garcia Gomez [Mon, 5 Oct 2015 11:15:39 +0000 (11:15 +0000)]
Document a bug in loop-convert and fix one of its subcases.

Summary: Now that we prioritize copying trivial types over using const-references where possible, I found some cases where, after the transformation, the loop was using the address of the local copy instead of the original object.

Reviewers: klimek

Subscribers: alexfh, cfe-commits

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

llvm-svn: 249300