platform/upstream/llvm.git
9 years ago[Msan] Fix the iconv.cc test to build and pass on FreeBSD
Viktor Kutuzov [Sat, 25 Apr 2015 11:07:05 +0000 (11:07 +0000)]
[Msan] Fix the iconv.cc test to build and pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9252

llvm-svn: 235799

9 years ago[asan] Print SHADOW_SCALE and SHADOW_GRANULARITY as decimal values.
Daniel Sanders [Sat, 25 Apr 2015 10:57:35 +0000 (10:57 +0000)]
[asan] Print SHADOW_SCALE and SHADOW_GRANULARITY as decimal values.

Summary:
During the review of http://reviews.llvm.org/D9199 where I had originally
changed the debug_mapping.cc test to accept hexadecimal values, we realized
that SHADOW_SCALE and SHADOW_GRANULARITY ought to be printed as decimal values.
This patch makes that change.

This patch also adds a '0x' prefix to the SHADOW_OFFSET to make it clear that
it is hexadecimal while the other two are decimal.

Reviewers: kcc, timurrrr, samsonov

Reviewed By: timurrrr, samsonov

Subscribers: samsonov, llvm-commits, sagar

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

llvm-svn: 235798

9 years agounwind: clean up warnings from the build
Saleem Abdulrasool [Sat, 25 Apr 2015 02:06:15 +0000 (02:06 +0000)]
unwind: clean up warnings from the build

Now thta the build is split, clean up some of the warnings in the build:
  cc1: warning: command line option '-nostdinc++' is valid for C++/ObjC++ but not for C
  cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C

Append the C++ specific flags specifically to the C++ sources.  Avoids the
spurious warnings due to invalid flags being passed during the compilation of
C++ sources.

llvm-svn: 235797

9 years agobuild: make libunwind a proper project
Saleem Abdulrasool [Sat, 25 Apr 2015 01:47:39 +0000 (01:47 +0000)]
build: make libunwind a proper project

This allows the build infrastructure to properly detect and build libunwind.

llvm-svn: 235796

9 years agolibunwind: add new build logic
Saleem Abdulrasool [Sat, 25 Apr 2015 01:46:35 +0000 (01:46 +0000)]
libunwind: add new build logic

This replicates most of the build infrastructure from libc++abi ported to
libunwind.  This allows building libunwind without requiring libc++abi.

llvm-svn: 235795

9 years agolibc++abi: remove build infrastructure for unwind
Saleem Abdulrasool [Sat, 25 Apr 2015 01:46:29 +0000 (01:46 +0000)]
libc++abi: remove build infrastructure for unwind

This removes the libunwind build infrastructure as libunwind is gaining its own
CMakeLists.txt.  The removal must occur first due to the multiple definitions of
the same target.

llvm-svn: 235794

9 years agoInstrProf: Fix coverage maps for conditional operators
Justin Bogner [Fri, 24 Apr 2015 23:37:57 +0000 (23:37 +0000)]
InstrProf: Fix coverage maps for conditional operators

This fixes a crash when we're emitting coverage and a macro appears
between two binary conditional operators, ie, "foo ?: MACRO ?: bar",
and fixes the interaction of macros and conditional operators in
general.

llvm-svn: 235793

9 years agoFix build error from accidental change
Andrew Kaylor [Fri, 24 Apr 2015 23:34:46 +0000 (23:34 +0000)]
Fix build error from accidental change

llvm-svn: 235792

9 years ago[WinEH] Find correct cloned entry block for outlined handler functions.
Andrew Kaylor [Fri, 24 Apr 2015 23:27:32 +0000 (23:27 +0000)]
[WinEH] Find correct cloned entry block for outlined handler functions.

llvm-svn: 235791

9 years agoEliminate redundant Alias test and improve Common Short Spellings test http://review...
Adrian McCarthy [Fri, 24 Apr 2015 23:18:15 +0000 (23:18 +0000)]
Eliminate redundant Alias test and improve Common Short Spellings test  reviews.llvm.org/D9268

llvm-svn: 235790

9 years ago[WinEH] Find correct cloned entry block for outlined handler functions.
Andrew Kaylor [Fri, 24 Apr 2015 23:10:38 +0000 (23:10 +0000)]
[WinEH] Find correct cloned entry block for outlined handler functions.

llvm-svn: 235789

9 years agoAssert that Process::FindInEnvPath() is passed a relative path.
Nico Weber [Fri, 24 Apr 2015 22:18:46 +0000 (22:18 +0000)]
Assert that Process::FindInEnvPath() is passed a relative path.

It misbehaves with absolute paths. (So does path::append().)
Goes with clang r235787.

llvm-svn: 235788

9 years agoclang-cl: Don't look up absolute paths in %LIB%.
Nico Weber [Fri, 24 Apr 2015 22:16:53 +0000 (22:16 +0000)]
clang-cl: Don't look up absolute paths in %LIB%.

Before this patch, passing a non-existent absolute path to clang-cl would cause
stat'ing of impossible paths. For example, `clang-cl -c d:\adsfasdf.txt` would
cause a stat of
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIBd:\asdfadsf.cc

llvm-svn: 235787

9 years agoLinker: Copy over function metadata attachments
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 22:07:31 +0000 (22:07 +0000)]
Linker: Copy over function metadata attachments

Update `lib/Linker` to handle `Function` metadata attachments.  The
attachments stick with the function body.

llvm-svn: 235786

9 years agoIR: Add assembly/bitcode support for function metadata attachments
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 22:04:41 +0000 (22:04 +0000)]
IR: Add assembly/bitcode support for function metadata attachments

Add serialization support for function metadata attachments (added in
r235783).  The syntax is:

    define @foo() !attach !0 {

Metadata attachments are only allowed on functions with bodies.  Since
they come before the `{`, they're not really part of the body; since
they require a body, they're not really part of the header.  In
`LLParser` I gave them a separate function called from `ParseDefine()`,
`ParseOptionalFunctionMetadata()`.

In bitcode, I'm using the same `METADATA_ATTACHMENT` record used by
instructions.  Instruction metadata attachments are included in a
special "attachment" block at the end of a `Function`.  The attachment
records are laid out like this:

    InstID (KindID MetadataID)+

Note that these records always have an odd number of fields.  The new
code takes advantage of this to recognize function attachments (which
don't need an instruction ID):

    (KindID MetadataID)+

This means we can use the same attachment block already used for
instructions.

This is part of PR23340.

llvm-svn: 235785

9 years agoVerifier: Function metadata attachments require a body
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:53:27 +0000 (21:53 +0000)]
Verifier: Function metadata attachments require a body

Add a verifier check that only functions with bodies have metadata
attachments.  This should help catch bugs in frontends and
transformation passes.  Part of PR23340.

llvm-svn: 235784

9 years agoIR: Add Function metadata attachments
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:51:02 +0000 (21:51 +0000)]
IR: Add Function metadata attachments

Add IR support for `Metadata` attachments.  Assembly and bitcode support
will follow shortly, but for now we just have unit tests.  This is part
of PR23340.

llvm-svn: 235783

9 years agoLLParser: Simplify ParseInstructionMetadata(), NFC
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:29:36 +0000 (21:29 +0000)]
LLParser: Simplify ParseInstructionMetadata(), NFC

Remove unused `PFS` variable and take the `Instruction` by reference.
(Not really related to PR23340, but might as well clean this up while
I'm here.)

llvm-svn: 235782

9 years ago[DAGCombiner] Fix the type used in canFoldInAddressingMode to account for the
Quentin Colombet [Fri, 24 Apr 2015 21:28:00 +0000 (21:28 +0000)]
[DAGCombiner] Fix the type used in canFoldInAddressingMode to account for the
right scaling.

In the function canFoldInAddressingMode, VT is computed as the type of the
destination/source of a LOAD/STORE operations, instead of the memory type of the
operation.
On targets with a scaling factor on the offset of the LOAD/STORE operations, the
function may return false for actually valid cases. This may then prevent the
selection of profitable pre or post indexed load/store operations, and instead
select pre or post indexed load/store for unprofitable cases.

Patch by Francois de Ferriere <francois.de-ferriere@st.com>!

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

llvm-svn: 235780

9 years ago[ASan/Win] Increase the size of the PC array for coverage on Windows
Timur Iskhodzhanov [Fri, 24 Apr 2015 21:24:51 +0000 (21:24 +0000)]
[ASan/Win] Increase the size of the PC array for coverage on Windows

llvm-svn: 235779

9 years agoLLParser: Split out ParseMetadataAttachment(), NFC
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:21:57 +0000 (21:21 +0000)]
LLParser: Split out ParseMetadataAttachment(), NFC

Make the code reusable for `Function` metadata attachments (PR23340).

llvm-svn: 235778

9 years ago[opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of PointerType::getElem...
David Blaikie [Fri, 24 Apr 2015 21:16:07 +0000 (21:16 +0000)]
[opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of PointerType::getElementType

llvm-svn: 235777

9 years agoUse MemoryBufferRef instead of MemoryBuffer&. NFC.
Rafael Espindola [Fri, 24 Apr 2015 21:10:50 +0000 (21:10 +0000)]
Use MemoryBufferRef instead of MemoryBuffer&. NFC.

This just reduces the noise from another patch.

llvm-svn: 235776

9 years agoAsmWriter: Parameterize the syntactic separator for attachments
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:06:21 +0000 (21:06 +0000)]
AsmWriter: Parameterize the syntactic separator for attachments

Parameterize the separator for attachments, since `Function` metadata
attachments (PR23340) aren't going to use a `,` (comma).  No real
functionality change.

llvm-svn: 235775

9 years agoAsmWriter: Only collect attachment names once per module
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:03:05 +0000 (21:03 +0000)]
AsmWriter: Only collect attachment names once per module

Collect metadata names once per `AssemblyWriter` instead of every time
we need to print some attachments.  Just a drive-by; this caught my eye
while I was refactoring the code in r235772.

llvm-svn: 235774

9 years agoRemove an unused variable to prevent -Werror build failures.
Kaelyn Takata [Fri, 24 Apr 2015 21:02:18 +0000 (21:02 +0000)]
Remove an unused variable to prevent -Werror build failures.

llvm-svn: 235773

9 years agoAsmWriter: Split out code for printing Metadata attachments, NFC
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:59:52 +0000 (20:59 +0000)]
AsmWriter: Split out code for printing Metadata attachments, NFC

Refactor the code for printing `Instruction` metadata attachments so it
can be reused for `Function`.

llvm-svn: 235772

9 years agoSimplifyCFG: Correctly handle switch lookup tables which fully cover the input type...
Hans Wennborg [Fri, 24 Apr 2015 20:57:56 +0000 (20:57 +0000)]
SimplifyCFG: Correctly handle switch lookup tables which fully cover the input type and use bit tests to check for holes

When using bit tests for hole checks, we call AddPredecessorToBlock to give the
phi node a value from the bit test block. This would break if we've
previously called removePredecessor on the default destination because the
switch is fully covered.

Test case by Mark Lacey.

llvm-svn: 235771

9 years agoIR: Use a bitmask to access GlobalObject subclass data
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:47:23 +0000 (20:47 +0000)]
IR: Use a bitmask to access GlobalObject subclass data

Make room for more than just `Function::isMaterializable()` in the
`GlobalObject` subclass data bitfield.  Since we're treating it like a
bitfield, change `Function::Function()` to zero-out the whole thing.

llvm-svn: 235770

9 years agoIR: Extract set logic from Instruction attachments, NFC
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:36:25 +0000 (20:36 +0000)]
IR: Extract set logic from Instruction attachments, NFC

Extract the set logic for metadata attachments from `Instruction` so it
can be reused for `Function` (PR23340).

This data structure makes a `SmallVector<>` look (a little) like a map,
just doing the bare minimum to support the `Instruction` (and soon,
`Function`) metadata API.

llvm-svn: 235769

9 years ago[SEH] Implement GetExceptionCode in __except blocks
Reid Kleckner [Fri, 24 Apr 2015 20:25:05 +0000 (20:25 +0000)]
[SEH] Implement GetExceptionCode in __except blocks

This introduces an intrinsic called llvm.eh.exceptioncode. It is lowered
by copying the EAX value live into whatever basic block it is called
from. Obviously, this only works if you insert it late during codegen,
because otherwise mid-level passes might reschedule it.

llvm-svn: 235768

9 years agoIR: Use remove_if for Instruction::dropUnknownMetadata()
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:23:44 +0000 (20:23 +0000)]
IR: Use remove_if for Instruction::dropUnknownMetadata()

Technically the operations are different -- the old logic moved items
from the back into the opened-up slots, instead of the usual
`remove_if()` logic of a slow and a fast iterator -- but unless a
profile tells us otherwise I prefer the simpler logic here.  Regardless,
there shouldn't be an observable function change.

llvm-svn: 235767

9 years agounwind: remove libc++abi tests
Saleem Abdulrasool [Fri, 24 Apr 2015 20:21:43 +0000 (20:21 +0000)]
unwind: remove libc++abi tests

These are related to libc++abi's personality routine and not core unwinding.
These have been restored in libc++abi, and are no longer needed here.

llvm-svn: 235766

9 years agolibc++abi: move tests back
Saleem Abdulrasool [Fri, 24 Apr 2015 20:20:54 +0000 (20:20 +0000)]
libc++abi: move tests back

These are apparently related to libc++'s unwind personality handler and not
unwind core.  Move them back to the correct location.

llvm-svn: 235765

9 years agoIR: Remove MDMapTy and MDPairTy typedefs, NFC
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:19:13 +0000 (20:19 +0000)]
IR: Remove MDMapTy and MDPairTy typedefs, NFC

Remove some typedefs in preparation for factoring out attachment logic
from `Instruction`.

llvm-svn: 235764

9 years agoIR: Rename LLVMContextImpl::MetadataStore to InstructionMetadata
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:16:42 +0000 (20:16 +0000)]
IR: Rename LLVMContextImpl::MetadataStore to InstructionMetadata

Rename `MetadataStore` to the more explicit `InstructionMetadata`.  This
will make room for `FunctionMetadata` (start of PR23340).

llvm-svn: 235763

9 years agoFix compilation warnings without cl_khr_fp64
Jan Vesely [Fri, 24 Apr 2015 19:54:17 +0000 (19:54 +0000)]
Fix compilation warnings without cl_khr_fp64

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 235762

9 years ago[LSan] Add function attribute forgotten in r235728.
Alexey Samsonov [Fri, 24 Apr 2015 19:45:46 +0000 (19:45 +0000)]
[LSan] Add function attribute forgotten in r235728.

llvm-svn: 235761

9 years agolibc++abi: remove the duplicated unwind content
Saleem Abdulrasool [Fri, 24 Apr 2015 19:40:31 +0000 (19:40 +0000)]
libc++abi: remove the duplicated unwind content

The unwinder has been moved into its own project setup at
http://svn.llvm.org/projects/libunwind/trunk.  This simply removes the now
duplicated content.  This move was previously discussed on llvmdev at [1].

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/081507.html

llvm-svn: 235759

9 years agounwind: move src/Unwind, include/, and test/ unwind content
Saleem Abdulrasool [Fri, 24 Apr 2015 19:39:17 +0000 (19:39 +0000)]
unwind: move src/Unwind, include/, and test/ unwind content

This moves the majority of the unwind sources into the new project layout for
libunwind.  This was previously discussed on llvmdev at [1].  This is a
purely movement related change, with the build infrastructure currently still
residing in the libc++abi repository.

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/081507.html

llvm-svn: 235758

9 years ago[opaque pointer type] Update test cases now that the type for an invoke is just a...
David Blaikie [Fri, 24 Apr 2015 19:33:25 +0000 (19:33 +0000)]
[opaque pointer type] Update test cases now that the type for an invoke is just a function type, not a pointer-to-function type

llvm-svn: 235756

9 years ago[opaque pointer type] Add textual IR support for explicit type parameter to the invok...
David Blaikie [Fri, 24 Apr 2015 19:32:54 +0000 (19:32 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter to the invoke instruction

Same as r235145 for the call instruction - the justification, tradeoffs,
etc are all the same. The conversion script worked the same without any
false negatives (after replacing 'call' with 'invoke').

llvm-svn: 235755

9 years ago[PATCH] [Hexagon] Adding a test case for calling convention.
Sundeep Kushwaha [Fri, 24 Apr 2015 19:22:02 +0000 (19:22 +0000)]
[PATCH] [Hexagon] Adding a test case for calling convention.

http://reviews.llvm.org/D9241

llvm-svn: 235754

9 years ago[AsmPrinter] Make AsmPrinter's OutStreamer member a unique_ptr.
Lang Hames [Fri, 24 Apr 2015 19:11:51 +0000 (19:11 +0000)]
[AsmPrinter] Make AsmPrinter's OutStreamer member a unique_ptr.

AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a
reference for this is crufty.

llvm-svn: 235752

9 years agoSimplify parseMemberFiles to take a single file.
Rafael Espindola [Fri, 24 Apr 2015 19:08:51 +0000 (19:08 +0000)]
Simplify parseMemberFiles to take a single file.

llvm-svn: 235751

9 years agoRevert r235749 - Accidentally commited cruft from the wrong path.
Lang Hames [Fri, 24 Apr 2015 19:08:30 +0000 (19:08 +0000)]
Revert r235749 - Accidentally commited cruft from the wrong path.

llvm-svn: 235750

9 years ago[CodeGen] Make AsmPrinter's OutStreamer member a unique_ptr.
Lang Hames [Fri, 24 Apr 2015 19:04:55 +0000 (19:04 +0000)]
[CodeGen] Make AsmPrinter's OutStreamer member a unique_ptr.

AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a
reference for this is crufty.

llvm-svn: 235749

9 years agoSimplify now that there is only one file. NFC.
Rafael Espindola [Fri, 24 Apr 2015 19:01:30 +0000 (19:01 +0000)]
Simplify now that there is only one file. NFC.

llvm-svn: 235747

9 years agounwind: stage 2 of creating project structure
Saleem Abdulrasool [Fri, 24 Apr 2015 18:58:18 +0000 (18:58 +0000)]
unwind: stage 2 of creating project structure

llvm-svn: 235746

9 years agoReturn ErrorOr<std::unique_ptr<File>>. NFC.
Rafael Espindola [Fri, 24 Apr 2015 18:51:30 +0000 (18:51 +0000)]
Return ErrorOr<std::unique_ptr<File>>. NFC.

llvm-svn: 235744

9 years agoRemove unused enum value. NFC.
Rafael Espindola [Fri, 24 Apr 2015 18:36:57 +0000 (18:36 +0000)]
Remove unused enum value. NFC.

llvm-svn: 235742

9 years agoReturn an ErrorOr<std::unique_ptr<File>>. NFC.
Rafael Espindola [Fri, 24 Apr 2015 18:33:50 +0000 (18:33 +0000)]
Return an ErrorOr<std::unique_ptr<File>>. NFC.

llvm-svn: 235741

9 years ago[Test] Explictly pass target architecture.
Davide Italiano [Fri, 24 Apr 2015 18:18:34 +0000 (18:18 +0000)]
[Test] Explictly pass target architecture.

If we're not being explicit, the test fails on windows.
Reported and tested by Aaron Ballman!

llvm-svn: 235739

9 years agoRevert changes to LTO test case since llvm-lto can't handle textual IR inputs
David Blaikie [Fri, 24 Apr 2015 18:13:27 +0000 (18:13 +0000)]
Revert changes to LTO test case since llvm-lto can't handle textual IR inputs

llvm-svn: 235738

9 years agoLook for both .debug and dsym debugging symbol information for stripped executable.
Robert Flack [Fri, 24 Apr 2015 18:09:54 +0000 (18:09 +0000)]
Look for both .debug and dsym debugging symbol information for stripped executable.

Currently Symbols::LocateExecutableSymbolFile on MacOSX only looks for external
dsym debugging information, however if running on a stripped dwarf executable it
should also check for a .debug file as well.

Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestSharedLibStrippedSymbols.py
This test now passes when running a remote Mac -> Linux test, and still passes
running locally on Mac or locally on Linux.

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

llvm-svn: 235737

9 years agoSkip extra LLVM IR assemble/disassemble steps in some tests
David Blaikie [Fri, 24 Apr 2015 18:06:09 +0000 (18:06 +0000)]
Skip extra LLVM IR assemble/disassemble steps in some tests

llvm-svn: 235736

9 years ago[opaque pointer type] bitcode: add explicit callee type to invoke instructions
David Blaikie [Fri, 24 Apr 2015 18:06:06 +0000 (18:06 +0000)]
[opaque pointer type] bitcode: add explicit callee type to invoke instructions

llvm-svn: 235735

9 years agoFix LoopInterchange/reductions.ll test for debug builds
Andrew Kaylor [Fri, 24 Apr 2015 17:39:16 +0000 (17:39 +0000)]
Fix LoopInterchange/reductions.ll test for debug builds

llvm-svn: 235734

9 years agoTeach AArch64\lit.local.cfg the new triple names windows-gnu and windows-msvc.
Yaron Keren [Fri, 24 Apr 2015 17:14:16 +0000 (17:14 +0000)]
Teach AArch64\lit.local.cfg the new triple names windows-gnu and windows-msvc.

Tests were failing when built with -DLLVM_DEFAULT_TARGET_TRIPLE=i686-pc-windows-gnu.

llvm-svn: 235733

9 years ago[CMake] Fix for PR 23328: LLVM_OPTIMIZED_TABLEGEN broken
Chris Bieneman [Fri, 24 Apr 2015 17:09:20 +0000 (17:09 +0000)]
[CMake] Fix for PR 23328: LLVM_OPTIMIZED_TABLEGEN broken

In CMake dependencies can be filenames or targets, and targets can't be filenames. The Ninja generator handles filename dependencies because it generates targets for every output file from a command. For example:

add_custom_command(OUTPUT foo.txt COMMAND touch foo.txt)

With the Ninja generator this generates a target foo.txt, but with the Makefile generator it doesn't. This is probably because Ninja explicitly requires these hard dependency ties, and Make just behaves oddly in general.

To fix this we need to make the tablegen actions depend on a target rather than a filename.

llvm-svn: 235732

9 years agoLinker: Update -override testcase to check callers
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 16:56:24 +0000 (16:56 +0000)]
Linker: Update -override testcase to check callers

Check that `@main` is calling `@foo2` (the renamed internal function),
not the `@foo` with external linkage that's been pulled in from the
override file.

llvm-svn: 235730

9 years agoSwitch lowering: fix APInt overflow causing infinite loop / OOM
Hans Wennborg [Fri, 24 Apr 2015 16:53:55 +0000 (16:53 +0000)]
Switch lowering: fix APInt overflow causing infinite loop / OOM

llvm-svn: 235729

9 years ago[lsan] Add an interface function for on-demand leak checking.
Sergey Matveev [Fri, 24 Apr 2015 16:53:15 +0000 (16:53 +0000)]
[lsan] Add an interface function for on-demand leak checking.

Summary:
Add an interface function which can be used to periodically trigger
leak detection in a long-running process.

NB: The meaning of the kIgnored tag has been changed to allow easy clean-up
between subsequent leak checks. Previously, this tag was applied to explicitly
ignored (i.e. with __lsan_disable() or __lsan_ignore_object()) chunks *and* any
chunks only reachable from those. With this change, it's only applied to
explicitly ignored chunks.

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 235728

9 years agoRevert r235726 "interface"
Sergey Matveev [Fri, 24 Apr 2015 16:51:21 +0000 (16:51 +0000)]
Revert r235726 "interface"

Accidentally committed from local branch. :(

llvm-svn: 235727

9 years agointerface
Sergey Matveev [Fri, 24 Apr 2015 16:49:04 +0000 (16:49 +0000)]
interface

llvm-svn: 235726

9 years ago[WinEH] Split the landingpad BB instead of cloning it
Reid Kleckner [Fri, 24 Apr 2015 16:22:19 +0000 (16:22 +0000)]
[WinEH] Split the landingpad BB instead of cloning it

This means we don't have to RAUW the landingpad instruction and
landingpad BB, which is a nice win.

llvm-svn: 235725

9 years agoDelete unnecessary generality in loadFile.
Rafael Espindola [Fri, 24 Apr 2015 15:51:45 +0000 (15:51 +0000)]
Delete unnecessary generality in loadFile.

loadFile could load mulitple files just because yaml has a feature for
putting multiple documents in one file.

Designing a linker around what yaml can do seems like a bad idea to
me. This patch changes it to read a single file.

There are further improvements to be done to the api and they
will follow shortly.

llvm-svn: 235724

9 years agoFix typo in comment.
Diego Novillo [Fri, 24 Apr 2015 15:46:41 +0000 (15:46 +0000)]
Fix typo in comment.

llvm-svn: 235723

9 years agoAdd COMPILER_RT_ABI attribute to declarations of builtin functions in unittests
Derek Schuff [Fri, 24 Apr 2015 15:45:57 +0000 (15:45 +0000)]
Add COMPILER_RT_ABI attribute to declarations of builtin functions in unittests

Summary:
This makes their local declarations match their definitions for ARM targets,
where they have a different calling convention.

This really only affects functions that use floating point types (since the
runtime functions use soft-float, and some targets may default to hard-float)
but it seemed good to make it uniform and do the int-only ones too.

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

llvm-svn: 235722

9 years agoUse the cleaner syntx value initialization to zero initialize POD structs.
Yaron Keren [Fri, 24 Apr 2015 15:39:47 +0000 (15:39 +0000)]
Use the cleaner syntx value initialization to zero initialize POD structs.
Suggestion from David Blaikie!

llvm-svn: 235721

9 years agoSilence clang warning: private field 'data_' is not used.
Yaron Keren [Fri, 24 Apr 2015 15:10:15 +0000 (15:10 +0000)]
Silence clang warning: private field 'data_' is not used.

llvm-svn: 235720

9 years agoSilence clang warning: missing field 'Dr0' initializer.
Yaron Keren [Fri, 24 Apr 2015 14:26:27 +0000 (14:26 +0000)]
Silence clang warning: missing field 'Dr0' initializer.

llvm-svn: 235719

9 years ago[mips][FastISel] Specify which types we handle for integer extension.
Vasileios Kalintiris [Fri, 24 Apr 2015 13:48:19 +0000 (13:48 +0000)]
[mips][FastISel] Specify which types we handle for integer extension.

Summary:
Perform integer extension only when the destination type is one of
i8, i16 & i32 and when the source type is i1, i8 or i16. For other
combinations we fall back to SelectionDAG.

This fixes the test MultiSource/Benchmarks/7zip that was failing in our
out-of-tree MIPS buildbots.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235718

9 years agoRemoving dead code; NFC. This code was triggering a C4718 warning (recursive call...
Aaron Ballman [Fri, 24 Apr 2015 12:51:45 +0000 (12:51 +0000)]
Removing dead code; NFC. This code was triggering a C4718 warning (recursive call has no side effects, deleting) with MSVC.

llvm-svn: 235717

9 years agoFix condition detection in EmulateInstructionARM
Tamas Berghammer [Fri, 24 Apr 2015 12:13:44 +0000 (12:13 +0000)]
Fix condition detection in EmulateInstructionARM

The condition detection code is calculating the result of the condition
based on the first 3 bit of the condition and then negate it if the LSB
of the condition is set. It works for the normal conditions but 0b1110
and 0b1111 are special as both of them should evaluate to true
independently the value of CPSR. This CL removes the negating logic from
those cases.

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

llvm-svn: 235715

9 years agoFix order of b and blx instrction in EmulateInstructionARM
Tamas Berghammer [Fri, 24 Apr 2015 12:13:41 +0000 (12:13 +0000)]
Fix order of b and blx instrction in EmulateInstructionARM

In the previous ordering some "blx <label>" instruction was recognised
as "b #imm24" instructions causing a failure in the instruction
emulator.

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

llvm-svn: 235714

9 years agoFix write register context for arm "add<c> <Rd>, sp, #imm"
Tamas Berghammer [Fri, 24 Apr 2015 12:13:38 +0000 (12:13 +0000)]
Fix write register context for arm "add<c> <Rd>, sp, #imm"

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

llvm-svn: 235713

9 years agoUse self.fail() in MiGdbSetShowTestCase.test_lldbmi_gdb_set_target_async_off (MI)
Ilia K [Fri, 24 Apr 2015 11:41:42 +0000 (11:41 +0000)]
Use self.fail() in MiGdbSetShowTestCase.test_lldbmi_gdb_set_target_async_off (MI)

llvm-svn: 235712

9 years agoFix CMICmnLLDBDebuggerHandleEvents::GetProcessStdout/GetProcessStderr to use stream...
Ilia K [Fri, 24 Apr 2015 11:33:36 +0000 (11:33 +0000)]
Fix CMICmnLLDBDebuggerHandleEvents::GetProcessStdout/GetProcessStderr to use stream-record (MI)

llvm-svn: 235711

9 years ago[BitcodeReader] Fix asserts when we read a non-vector type for insert/extract/shuffle
Filipe Cabecinhas [Fri, 24 Apr 2015 11:30:15 +0000 (11:30 +0000)]
[BitcodeReader] Fix asserts when we read a non-vector type for insert/extract/shuffle

Added some additional checking for vector types + tests.

Bug found with AFL fuzz.

llvm-svn: 235710

9 years agoFix CMICmnMIOutOfBandRecord to accept stream-records (MI)
Ilia K [Fri, 24 Apr 2015 11:27:36 +0000 (11:27 +0000)]
Fix CMICmnMIOutOfBandRecord to accept stream-records (MI)

Previously the CMICmnMIOutOfBandRecord class worked only with async-records.

llvm-svn: 235709

9 years ago[Mips] Simplify the code a bit using early return
Simon Atanasyan [Fri, 24 Apr 2015 11:14:24 +0000 (11:14 +0000)]
[Mips] Simplify the code a bit using early return

No functional changes.

llvm-svn: 235708

9 years agoclang-format: Don't wrap after short first segments of builder calls.
Daniel Jasper [Fri, 24 Apr 2015 10:08:09 +0000 (10:08 +0000)]
clang-format: Don't wrap after short first segments of builder calls.

Before:
  a()
      .aaaaa()
      .aaaaa()
      .aaaaa();

After:
  a().aaaaa()
      .aaaaa()
      .aaaaa();

llvm-svn: 235707

9 years ago[ARM] Update TODO notes
Denis Protivensky [Fri, 24 Apr 2015 09:55:11 +0000 (09:55 +0000)]
[ARM] Update TODO notes

llvm-svn: 235706

9 years ago[ARM] Implement R_ARM_COPY relocation
Denis Protivensky [Fri, 24 Apr 2015 08:53:02 +0000 (08:53 +0000)]
[ARM] Implement R_ARM_COPY relocation

This adds support of copying objects from shared libraries.

llvm-svn: 235705

9 years ago[Msan] XFAIL the ftime.cc test on FreeBSD
Viktor Kutuzov [Fri, 24 Apr 2015 07:54:38 +0000 (07:54 +0000)]
[Msan] XFAIL the ftime.cc test on FreeBSD
Differential Revision: http://reviews.llvm.org/D9222

llvm-svn: 235704

9 years ago[Msan] Fix the backtrace.cc tests to build and pass on FreeBSD
Viktor Kutuzov [Fri, 24 Apr 2015 07:52:47 +0000 (07:52 +0000)]
[Msan] Fix the backtrace.cc tests to build and pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9221

llvm-svn: 235703

9 years agoclang-format: More selectively detect QT's "signals".
Daniel Jasper [Fri, 24 Apr 2015 07:50:34 +0000 (07:50 +0000)]
clang-format: More selectively detect QT's "signals".

llvm-svn: 235702

9 years ago[Sanitizers] Do not call internal_sigdelset() on non-Linux
Viktor Kutuzov [Fri, 24 Apr 2015 07:48:26 +0000 (07:48 +0000)]
[Sanitizers] Do not call internal_sigdelset() on non-Linux
Differential Revision: http://reviews.llvm.org/D9220

llvm-svn: 235701

9 years agoCorrect extractelement constant folding
Pawel Bylica [Fri, 24 Apr 2015 07:42:35 +0000 (07:42 +0000)]
Correct extractelement constant folding

Summary: Constant folding of extractelement with out-of-bound index produces undef also for indexes bigger than 64bit (instead of crash assert failure as before)

Test Plan: Unit tests included.

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: llvm-commits

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

llvm-svn: 235700

9 years agoFix APInt long division algorithm
Pawel Bylica [Fri, 24 Apr 2015 07:38:39 +0000 (07:38 +0000)]
Fix APInt long division algorithm

Summary: This patch fixes step D4 of Knuth's division algorithm implementation. Negative sign of the step result was not always detected due to incorrect "borrow" handling.

Test Plan: Unit test that reveals the bug included.

Reviewers: chandlerc, yaron.keren

Reviewed By: yaron.keren

Subscribers: llvm-commits

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

llvm-svn: 235699

9 years ago[TableGen] Clang changes for r235697 to stop leaking Expanders and Operators in SetTh...
Craig Topper [Fri, 24 Apr 2015 06:53:50 +0000 (06:53 +0000)]
[TableGen] Clang changes for r235697 to stop leaking Expanders and Operators in SetTheory.

llvm-svn: 235698

9 years ago[TableGen] Don't leak Expanders and Operators in SetTheory.
Craig Topper [Fri, 24 Apr 2015 06:49:44 +0000 (06:49 +0000)]
[TableGen] Don't leak Expanders and Operators in SetTheory.

llvm-svn: 235697

9 years ago[TableGen] Fix all remaining memory leaks of Init and RecTy objects.
Craig Topper [Fri, 24 Apr 2015 05:38:48 +0000 (05:38 +0000)]
[TableGen] Fix all remaining memory leaks of Init and RecTy objects.

llvm-svn: 235696

9 years agoResurrect r235688
Jingyue Wu [Fri, 24 Apr 2015 04:22:39 +0000 (04:22 +0000)]
Resurrect r235688

We should skip vector types which are not SCEVable.

test/CodeGen/NVPTX/sched2.ll passes

llvm-svn: 235695

9 years ago[OPENMP] Codegen for 'firstprivate' clause in 'single' directive.
Alexey Bataev [Fri, 24 Apr 2015 04:21:15 +0000 (04:21 +0000)]
[OPENMP] Codegen for 'firstprivate' clause in 'single' directive.

Emit the following code for 'single' directive with 'firtstprivate' clause:

if (@__kmpc_single()) {
  <init for firstprivates>
  @__kmpc_end_single();
}
@__kmpc_cancel_barrier(); // To avoid data race in firstprivate init
Differential Revision: http://reviews.llvm.org/D9223

llvm-svn: 235694

9 years agoRemove unused variable to silence GCC warning
David Majnemer [Fri, 24 Apr 2015 04:14:25 +0000 (04:14 +0000)]
Remove unused variable to silence GCC warning

llvm-svn: 235693

9 years ago[OPENMP] Do not emit implicit barrier for single directive with 'copyprivate' clause(s).
Alexey Bataev [Fri, 24 Apr 2015 04:00:39 +0000 (04:00 +0000)]
[OPENMP] Do not emit implicit barrier for single directive with 'copyprivate' clause(s).

Runtime function for 'copyprivate' directive generates implicit barriers, so no need to emit it.
Differential Revision: http://reviews.llvm.org/D9215

llvm-svn: 235692

9 years ago[OPENMP] Codegen for 'firstprivate' clause in 'sections' directive.
Alexey Bataev [Fri, 24 Apr 2015 03:37:03 +0000 (03:37 +0000)]
[OPENMP] Codegen for 'firstprivate' clause in 'sections' directive.

If there are 2 or more sections in a 'section' directive the following code is generated:

<init for firstprivates>
@__kmpc_cancel_barrier();// To avoid data race in firstprivate init
@__kmpc_for_static_init_4();
<BODY for sections directive>
@__kmpc_for_static_fini()
If there is only one section, the following code is generated:

if (@__kmpc_single()) {
  <init for firstprivates>
  @__kmpc_end_single();
}
@__kmpc_cancel_barrier(); // To avoid data race in firstprivate init
Differential Revision: http://reviews.llvm.org/D9214

llvm-svn: 235691

9 years agoRevert r235688
Jingyue Wu [Fri, 24 Apr 2015 03:26:11 +0000 (03:26 +0000)]
Revert r235688

Seems breaking builds

llvm-svn: 235690