platform/upstream/llvm.git
9 years ago Fix the ELF shared library build targets
Greg Fitzgerald [Fri, 23 Jan 2015 18:52:44 +0000 (18:52 +0000)]
 Fix the ELF shared library build targets

 lldELF is used by each ELF backend.  lldELF's ELFLinkingContext
 also held a reference to each backend, creating a link-time
 cycle.  This patch moves the backend references to lldDriver.

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

llvm-svn: 226922

9 years agoAdd the option, -data-in-code, to llvm-objdump used with -macho to print the Mach...
Kevin Enderby [Fri, 23 Jan 2015 18:52:17 +0000 (18:52 +0000)]
Add the option, -data-in-code, to llvm-objdump used with -macho to print the Mach-O data in code table.

llvm-svn: 226921

9 years agoClassify functions by EH personality type rather than using the triple
Reid Kleckner [Fri, 23 Jan 2015 18:49:01 +0000 (18:49 +0000)]
Classify functions by EH personality type rather than using the triple

This mostly reverts commit r222062 and replaces it with a new enum. At
some point this enum will grow at least for other MSVC EH personalities.

Also beefs up the way we were sniffing the personality function.
Previously we would emit the Itanium LSDA despite using
__C_specific_handler.

Reviewers: majnemer

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

llvm-svn: 226920

9 years agoDebug Info / PR22309: Allow union types to be emitted as unsigned constants.
Adrian Prantl [Fri, 23 Jan 2015 18:01:39 +0000 (18:01 +0000)]
Debug Info / PR22309: Allow union types to be emitted as unsigned constants.

llvm-svn: 226919

9 years agoRemove some local variables in place of just querying for them
Eric Christopher [Fri, 23 Jan 2015 17:22:44 +0000 (17:22 +0000)]
Remove some local variables in place of just querying for them
in the couple of asserts.

llvm-svn: 226917

9 years agoProcess the -fno-signed-zeros optimization flag (PR20870)
Sanjay Patel [Fri, 23 Jan 2015 16:40:50 +0000 (16:40 +0000)]
Process the -fno-signed-zeros optimization flag (PR20870)

The driver currently accepts but ignores the -fno-signed-zeros flag.
This patch passes the flag through and enables 'nsz' fast-math-flag
generation in IR.

The existing OpenCL flag for the same functionality is made into an
alias here. It may be removed in a subsequent patch.

This should resolve bug 20870 ( http://llvm.org/bugs/show_bug.cgi?id=20870 );
patches for the optimizer were checked in at:
http://llvm.org/viewvc/llvm-project?view=revision&revision=225050
http://llvm.org/viewvc/llvm-project?view=revision&revision=224583

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

llvm-svn: 226915

9 years agoReplace size() calls on containers with empty() calls where appropriate. NFC
Alexander Kornienko [Fri, 23 Jan 2015 15:36:10 +0000 (15:36 +0000)]
Replace size() calls on containers with empty() calls where appropriate. NFC

http://reviews.llvm.org/D7090

Patch by Gábor Horváth!

llvm-svn: 226914

9 years ago[sanitizer] Fix an edge case in MemoryRangeIsAvailable.
Evgeniy Stepanov [Fri, 23 Jan 2015 15:14:27 +0000 (15:14 +0000)]
[sanitizer] Fix an edge case in MemoryRangeIsAvailable.

llvm-svn: 226913

9 years ago[clang-tidy] Use shrink_to_fit instead of copy and swap trick
Alexander Kornienko [Fri, 23 Jan 2015 15:10:37 +0000 (15:10 +0000)]
[clang-tidy] Use shrink_to_fit instead of copy and swap trick

The shrink_to_fit() method is more readable and more effective than
the copy and swap trick to reduce the capacity of a shrinkable container.
Note that, the shrink_to_fit() method is only available in C++11 and up.

Example:

std::vector<int>(v).swap(v); will be replaced with v.shrink_to_fit();

http://reviews.llvm.org/D7087

Patch by Gábor Horváth!

llvm-svn: 226912

9 years ago[clang-tidy] Small readability-container-size-empty cleanup
Alexander Kornienko [Fri, 23 Jan 2015 14:43:06 +0000 (14:43 +0000)]
[clang-tidy] Small readability-container-size-empty cleanup

Utilized the hasEitherOperand instead of explicit anyOf.

http://reviews.llvm.org/D7142

Patch by Gábor Horváth!

llvm-svn: 226911

9 years ago[Sanitizers] Intercept statfs() on FreeBSD
Viktor Kutuzov [Fri, 23 Jan 2015 14:39:23 +0000 (14:39 +0000)]
[Sanitizers] Intercept statfs() on FreeBSD
Committed unreviewed with permission.

llvm-svn: 226910

9 years agoFix handling of data-disassemble command arguments.
Deepak Panickal [Fri, 23 Jan 2015 14:31:56 +0000 (14:31 +0000)]
Fix handling of data-disassemble command arguments.

llvm-svn: 226909

9 years agoSema: code completion for variadic prototypes.
Francisco Lopes da Silva [Fri, 23 Jan 2015 13:17:51 +0000 (13:17 +0000)]
Sema: code completion for variadic prototypes.

llvm-svn: 226908

9 years agoCleanup do-gtest.py
Tamas Berghammer [Fri, 23 Jan 2015 11:02:28 +0000 (11:02 +0000)]
Cleanup do-gtest.py

* Add comments
* Refactor output manipulation (cleanup + minor bug fixes)
* Add better error reporting on test failure

llvm-svn: 226907

9 years agoFix indentation in ValueObject.cpp (test commit)
Tamas Berghammer [Fri, 23 Jan 2015 10:54:21 +0000 (10:54 +0000)]
Fix indentation in ValueObject.cpp (test commit)

llvm-svn: 226906

9 years ago[mips] Add new error message and improve testing for parsing the .module directive.
Toma Tabacu [Fri, 23 Jan 2015 10:40:19 +0000 (10:40 +0000)]
[mips] Add new error message and improve testing for parsing the .module directive.

Summary:
We used to silently ignore any empty .module's and we used to give an error saying that we found
an "unexpected token at start of statement" when the value of the option wasn't an identifier (e.g. if it was a number).

We now give an error saying that we "expected .module option identifier" in both of those cases.

I also fixed the other tests in mips-abi-bad.s, which all seemed to be broken.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 226905

9 years agoThis patch fixes issue with lowering below mentioned pattern :-
Jyoti Allur [Fri, 23 Jan 2015 09:10:03 +0000 (09:10 +0000)]
This patch fixes issue with lowering below mentioned pattern :-
_foo:
        smull  r0, r1, r1, r0
smull  r2, r3, r3, r2
adds r0, r2, r0
adc r1, r3, r1
bx lr

to

_foo:
        smull  r0, r1, r1, r0
smlal  r0, r1, r3, r2
bx lr

llvm-svn: 226904

9 years agoTest commit.
Denis Protivensky [Fri, 23 Jan 2015 08:56:47 +0000 (08:56 +0000)]
Test commit.

llvm-svn: 226903

9 years ago[x86] Change u8imm operands to always print as unsigned. This makes shuffle masks...
Craig Topper [Fri, 23 Jan 2015 08:00:59 +0000 (08:00 +0000)]
[x86] Change u8imm operands to always print as unsigned. This makes shuffle masks and the like make way more sense.

llvm-svn: 226902

9 years agoDAGCombine: always constant fold FMA when target disable FP exceptions
Mehdi Amini [Fri, 23 Jan 2015 07:07:20 +0000 (07:07 +0000)]
DAGCombine: always constant fold FMA when target disable FP exceptions

Summary: When trying to constant fold an FMA in the DAG, getNode()
fails to fold the FMA if an operand is not finite. In this case this
patch allows the constant folding if !TLI->hasFloatingPointExceptions()

Reviewers: resistor

Reviewed By: resistor

Subscribers: hfinkel, llvm-commits

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

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

9 years agoAdd USES_TERMINAL to libcxx lit tests, if available
Filipe Cabecinhas [Fri, 23 Jan 2015 06:59:51 +0000 (06:59 +0000)]
Add USES_TERMINAL to libcxx lit tests, if available

llvm-svn: 226900

9 years ago[ADT] Add move operations to SmallVector<T,N> from SmallVectorImpl<T>.
Lang Hames [Fri, 23 Jan 2015 06:25:17 +0000 (06:25 +0000)]
[ADT] Add move operations to SmallVector<T,N> from SmallVectorImpl<T>.

This makes it possible to move between SmallVectors of different sizes.

Thanks to Dave Blaikie and Duncan Smith for patch feedback.

llvm-svn: 226899

9 years agoFix 80 column violation
Craig Topper [Fri, 23 Jan 2015 06:18:35 +0000 (06:18 +0000)]
Fix 80 column violation

llvm-svn: 226898

9 years ago[X86] Add IntrNoMem to the AVX512 conflict intrinsics.
Craig Topper [Fri, 23 Jan 2015 06:11:45 +0000 (06:11 +0000)]
[X86] Add IntrNoMem to the AVX512 conflict intrinsics.

llvm-svn: 226897

9 years ago[pr22293] Don't crash during codegen of a recursive destructor.
Rafael Espindola [Fri, 23 Jan 2015 05:26:38 +0000 (05:26 +0000)]
[pr22293] Don't crash during codegen of a recursive destructor.

In ItaniumCXXABI::EmitCXXDestructors we first emit the base destructor
and then try to emit the complete one as an alias.

If in the base ends up calling the complete destructor, the GD for the
complete will be in the list of deferred decl by the time we replace
it with an alias and delete the original GV.

llvm-svn: 226896

9 years agoAdd STB_GNU_UNIQUE to the ELF writer.
Rafael Espindola [Fri, 23 Jan 2015 04:44:35 +0000 (04:44 +0000)]
Add STB_GNU_UNIQUE to the ELF writer.

This lets llvm-mc assemble files produced by gcc.

llvm-svn: 226895

9 years agoDon't use iterator for the same reason as r226883.
Rui Ueyama [Fri, 23 Jan 2015 01:44:51 +0000 (01:44 +0000)]
Don't use iterator for the same reason as r226883.

llvm-svn: 226893

9 years agodebug printfs that got left in. I blame greg.
Jason Molenda [Fri, 23 Jan 2015 01:34:19 +0000 (01:34 +0000)]
debug printfs that got left in.  I blame greg.

llvm-svn: 226892

9 years agoWorkaround for what looks like an OS X-specific libedit issue
Kate Stone [Fri, 23 Jan 2015 01:06:10 +0000 (01:06 +0000)]
Workaround for what looks like an OS X-specific libedit issue

Other platforms may benefit from something similar if issues arise.  The
libedit library doesn't explicitly initialize the curses termcap library,
which it gets away with until TERM is set to VT100 where it stumbles over
an implementation assumption that may not exist on other platforms.

<rdar://problem/17581929>

llvm-svn: 226891

9 years agoPrune an out-of-date \param since r226476. [-Wdocumentation]
NAKAMURA Takumi [Fri, 23 Jan 2015 01:05:12 +0000 (01:05 +0000)]
Prune an out-of-date \param since r226476. [-Wdocumentation]

llvm-svn: 226890

9 years agoTwo fixes for compact unwind decoding for frameless large-stack-size
Jason Molenda [Fri, 23 Jan 2015 01:02:32 +0000 (01:02 +0000)]
Two fixes for compact unwind decoding for frameless large-stack-size
i386/x86_64 functions.  The stack size was being multiplied by the
pointer size incorrectly.  The register permutation placeholders
(UNWIND_X86_REG_NONE) were decrementing the stack offset of the
saved registers when it should not have been.

<rdar://problem/19570035>

llvm-svn: 226889

9 years agoReformat.
NAKAMURA Takumi [Fri, 23 Jan 2015 01:02:07 +0000 (01:02 +0000)]
Reformat.

llvm-svn: 226888

9 years agoMipsAsmParser.cpp: Suppress a warning introduced in r226657. [-Wunused-variable]
NAKAMURA Takumi [Fri, 23 Jan 2015 01:01:52 +0000 (01:01 +0000)]
MipsAsmParser.cpp: Suppress a warning introduced in r226657. [-Wunused-variable]

llvm-svn: 226887

9 years agoRemove the "/" from the end of rpath paths. Having it there causes the
Jim Ingham [Fri, 23 Jan 2015 00:39:13 +0000 (00:39 +0000)]
Remove the "/" from the end of rpath paths.  Having it there causes the
paths we get from dladdr to have "//" in it internally, and while that is
formally correct it is just asking for somebody to misparse it...

llvm-svn: 226886

9 years agoFix reference to sysroot in this test (broken in r226875).
Richard Smith [Fri, 23 Jan 2015 00:30:44 +0000 (00:30 +0000)]
Fix reference to sysroot in this test (broken in r226875).

llvm-svn: 226885

9 years agoFix the extra whitespace from r226878.
Kuba Brecka [Fri, 23 Jan 2015 00:14:22 +0000 (00:14 +0000)]
Fix the extra whitespace from r226878.

llvm-svn: 226884

9 years agoMake access to LinkingContext::getNode safe.
Rui Ueyama [Fri, 23 Jan 2015 00:09:05 +0000 (00:09 +0000)]
Make access to LinkingContext::getNode safe.

llvm-svn: 226883

9 years agoPR22299: Relocate code for handling -fmodule-map-file= so that we don't try to
Richard Smith [Fri, 23 Jan 2015 00:01:13 +0000 (00:01 +0000)]
PR22299: Relocate code for handling -fmodule-map-file= so that we don't try to
produce diagnostics with source locations before the diagnostics system is
ready for them.

llvm-svn: 226882

9 years agoR600: Try to use lower types for 64bit division if possible
Jan Vesely [Thu, 22 Jan 2015 23:42:43 +0000 (23:42 +0000)]
R600: Try to use lower types for 64bit division if possible

v2: add and enable tests for SI

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
llvm-svn: 226881

9 years agoSelectionDAG: Add KnownBits and SignBits computation for EXTRACT_ELEMENT
Jan Vesely [Thu, 22 Jan 2015 23:42:41 +0000 (23:42 +0000)]
SelectionDAG: Add KnownBits and SignBits computation for EXTRACT_ELEMENT

v2: use getZExtValue
    add missing break
    codestyle

v3: add few more comments

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
llvm-svn: 226880

9 years agoR600: Simplify LowerUDIVREM
Jan Vesely [Thu, 22 Jan 2015 23:42:39 +0000 (23:42 +0000)]
R600: Simplify LowerUDIVREM

optimizations can handle removing the Hi part operations.
The generated code is identical for R600, ~10% icount reduction for SI

v2: rebase

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
llvm-svn: 226879

9 years agoFix/workaround for OS X truncated stacktraces taken by external tools
Kuba Brecka [Thu, 22 Jan 2015 23:36:47 +0000 (23:36 +0000)]
Fix/workaround for OS X truncated stacktraces taken by external tools

This patch is a proposed solution for https://code.google.com/p/address-sanitizer/issues/detail?id=375:

When the stacktraces are captured and printed by ASan itself, they are fine, but when the program has already printed the report (or is just printing it), capturing a stacktrace via other means is broken. "Other means" include OS X CrashReporter, debuggers or calling backtrace() within the program. For example calling backtrace() from a sanitizer_set_death_callback function prints a very truncated stacktrace.

Reviewed at http://reviews.llvm.org/D7103

llvm-svn: 226878

9 years ago[Mips] Fix type of 64-bit integer in case of MIPS N64 ABI
Simon Atanasyan [Thu, 22 Jan 2015 23:16:48 +0000 (23:16 +0000)]
[Mips] Fix type of 64-bit integer in case of MIPS N64 ABI

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

llvm-svn: 226877

9 years agoIR: Change GenericDwarfNode::getHeader() to StringRef
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 23:10:55 +0000 (23:10 +0000)]
IR: Change GenericDwarfNode::getHeader() to StringRef

Simplify the API to use a `StringRef` directly rather than exposing the
`MDString` bits underneath.

llvm-svn: 226876

9 years agoReorganize test/Modules:
Richard Smith [Thu, 22 Jan 2015 23:07:47 +0000 (23:07 +0000)]
Reorganize test/Modules:
 * Put all input files under Inputs/, move corresponding tests into test/Modules.
 * Rename a modulemap test file to [...].modulemap, and teach lit that such files are tests.

llvm-svn: 226875

9 years agoIR: DwarfNode => DebugNode, NFC
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 22:47:44 +0000 (22:47 +0000)]
IR: DwarfNode => DebugNode, NFC

These things are potentially used for non-DWARF data (see the discussion
in PR22235), so take the `Dwarf` out of the name.  Since the new name
gives fewer clues, update the doxygen to properly describe what they
are.

llvm-svn: 226874

9 years ago[X86][AVX] Added (V)MOVDDUP / (V)MOVSLDUP / (V)MOVSHDUP memory folding + tests.
Simon Pilgrim [Thu, 22 Jan 2015 22:39:59 +0000 (22:39 +0000)]
[X86][AVX] Added (V)MOVDDUP / (V)MOVSLDUP / (V)MOVSHDUP memory folding + tests.

Minor tweak now that D7042 is complete, we can enable stack folding for (V)MOVDDUP and do proper testing.

Added missing AVX ymm folding patterns and fixed alignment for AVX VMOVSLDUP / VMOVSHDUP.

llvm-svn: 226873

9 years agoLine endings fixes. NFC.
Simon Pilgrim [Thu, 22 Jan 2015 22:27:37 +0000 (22:27 +0000)]
Line endings fixes. NFC.

llvm-svn: 226872

9 years ago[X86][SSE] Simplified PSUBUS tests
Simon Pilgrim [Thu, 22 Jan 2015 22:19:58 +0000 (22:19 +0000)]
[X86][SSE] Simplified PSUBUS tests

Removed loops from PSUBUS tests - ensures folding is tested. Also renamed SSE2 tests SSSE3 to match cpu.

This is a follow up commit agreed in http://reviews.llvm.org/D7094

llvm-svn: 226871

9 years agoMake the ?: precedence warning handle pointers to the left of ?
Hans Wennborg [Thu, 22 Jan 2015 22:11:56 +0000 (22:11 +0000)]
Make the ?: precedence warning handle pointers to the left of ?

Previously, Clang would fail to warn on:

  int n = x + foo ? 1 : 2;

when foo is a pointer.

llvm-svn: 226870

9 years ago[Object] Fix a bug in a condition introduced in r226217 - visibility can't be
Lang Hames [Thu, 22 Jan 2015 22:04:47 +0000 (22:04 +0000)]
[Object] Fix a bug in a condition introduced in r226217 - visibility can't be
both hidden and default.

Bug found by inspection by Rafael Espindola. No test: As discussed in the commit
message for r226217 we don't have a good way to test this yet.

llvm-svn: 226869

9 years ago[PM] Actually add the new pass manager support for the assumption cache.
Chandler Carruth [Thu, 22 Jan 2015 21:53:09 +0000 (21:53 +0000)]
[PM] Actually add the new pass manager support for the assumption cache.

I had already factored this analysis specifically to enable doing this,
but hadn't actually committed the necessary wiring to get at this from
the new pass manager. This also nicely shows how the separate cache
object can be directly managed by the new pass manager.

This analysis didn't have any direct tests and so I've added a printer
pass and a boring test case. I chose to print the i1 value which is
being assumed rather than the call to llvm.assume as that seems much
more useful for testing... but suggestions on an even better printing
strategy welcome. My main goal was to make sure things actually work. =]

llvm-svn: 226868

9 years agoRemove dead leak detector parts that fell out of use in r224703.
Benjamin Kramer [Thu, 22 Jan 2015 21:43:01 +0000 (21:43 +0000)]
Remove dead leak detector parts that fell out of use in r224703.

llvm-svn: 226867

9 years agoIR: Update references to temporaries before deleting
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 21:36:45 +0000 (21:36 +0000)]
IR: Update references to temporaries before deleting

During `MDNode::deleteTemporary()`, call `replaceAllUsesWith(nullptr)`
to update all tracking references to `nullptr`.

This fixes PR22280, where inverted destruction order between tracking
references and the temporaries themselves caused a use-after-free in
`LLParser`.

An alternative fix would be to add an assertion that there are no users,
and continue to fix inverted destruction order in clients (like
`LLParser`), but instead I decided to make getting-teardown-right easy.
(If someone disagrees let me know.)

llvm-svn: 226866

9 years agoSema: code completion for pointer and reference to functions.
Francisco Lopes da Silva [Thu, 22 Jan 2015 21:14:08 +0000 (21:14 +0000)]
Sema: code completion for pointer and reference to functions.

llvm-svn: 226865

9 years agoRefactoring cl::parser construction and initialization.
Chris Bieneman [Thu, 22 Jan 2015 21:01:12 +0000 (21:01 +0000)]
Refactoring cl::parser construction and initialization.

Summary:
Some parsers need references back to the option they are members of. This is used for handling the argument string as well as by the various pass name parsers for making pass names into flags.

Making parsers that need to refer back to the option have a reference to the option eliminates some of the members of various parsers, and enables further code cleanup.

Reviewers: dexonsmith

Subscribers: llvm-commits

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

llvm-svn: 226864

9 years agoWhen reporting constraints that should be constant, the type doesn't
Joerg Sonnenberger [Thu, 22 Jan 2015 21:01:00 +0000 (21:01 +0000)]
When reporting constraints that should be constant, the type doesn't
really help. Improve diagnostics.

llvm-svn: 226863

9 years agoDon't use -z,defs on FreeBSD.
Rafael Espindola [Thu, 22 Jan 2015 20:57:30 +0000 (20:57 +0000)]
Don't use -z,defs on FreeBSD.

Looks like environ is defined only in the main binary.

llvm-svn: 226862

9 years ago[emacs] Use c-mode-common-hook, derive from "gnu"
Ramkumar Ramachandra [Thu, 22 Jan 2015 20:56:25 +0000 (20:56 +0000)]
[emacs] Use c-mode-common-hook, derive from "gnu"

Make it clear that the "llvm.org" style is deriving from "gnu" style,
and use the c-mode-common-hook instead of c-mode-hook and c++-mode-hook.

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

llvm-svn: 226861

9 years agoReplace more runCmd('continue') with process control API.
Enrico Granata [Thu, 22 Jan 2015 20:53:04 +0000 (20:53 +0000)]
Replace more runCmd('continue') with process control API.

llvm-svn: 226860

9 years agoChange wildcard . to literal . in regex for copying python.
Zachary Turner [Thu, 22 Jan 2015 20:30:29 +0000 (20:30 +0000)]
Change wildcard . to literal . in regex for copying python.

On Windows we copy python27(_d).dll to the bin directory.  We do
this by looking at the PYTHON_LIBRARY specified by the user, which
is something like C:\foo\python27_d.lib, and replacing ".lib" with
".dll".  But ".lib" as a regex will also match "flib", etc.  So
make this a literal . instead of a wildcard .

llvm-svn: 226858

9 years agoIntrinsics: introduce llvm_any_ty aka ValueType Any
Ramkumar Ramachandra [Thu, 22 Jan 2015 20:14:38 +0000 (20:14 +0000)]
Intrinsics: introduce llvm_any_ty aka ValueType Any

Specifically, gc.result benefits from this greatly. Instead of:

gc.result.int.*
gc.result.float.*
gc.result.ptr.*
...

We now have a gc.result.* that can specialize to literally any type.

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

llvm-svn: 226857

9 years agoMake OSX test run firewall friendly.
Oleksiy Vyalov [Thu, 22 Jan 2015 20:03:21 +0000 (20:03 +0000)]
Make OSX test run firewall friendly.

http://reviews.llvm.org/D7115

llvm-svn: 226856

9 years ago[libcxxabi] Teach CMake better ways to find the libc++ source directory (and misc...
Eric Fiselier [Thu, 22 Jan 2015 20:00:06 +0000 (20:00 +0000)]
[libcxxabi] Teach CMake better ways to find the libc++ source directory (and misc cleanup).

Summary:
The main section of this patch teaches CMake  a new option `LIBCXXABI_LIBCXX_PATH` that specifies the path to the libcxx source root. This information is passed to lit so that it can better find libc++'s python module. `LIBCXXABI_LIBCXX_PATH` is also used to help find the libc++ headers.

The rest of this patch is misc cleanup, mostly to make pep8 and pylint happy.
I've also copied libc++'s .gitignore into libc++abi.

Reviewers: jroelofs, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

llvm-svn: 226855

9 years agoAdd a benchmark test case that shows how much slower repeat 'continue' commands are...
Enrico Granata [Thu, 22 Jan 2015 19:33:53 +0000 (19:33 +0000)]
Add a benchmark test case that shows how much slower repeat 'continue' commands are than going through the SB API directly

llvm-svn: 226852

9 years agoError::Clear() should reset the type to invalid instead of generic.
Zachary Turner [Thu, 22 Jan 2015 19:30:05 +0000 (19:30 +0000)]
Error::Clear() should reset the type to invalid instead of generic.

This matches the behavior of the default constructor, so is
technically more correct.

Patch by Chaoren Lin
Differential Revision: http://reviews.llvm.org/D7113

llvm-svn: 226851

9 years agoRevert "Don't remove a landing pad if the invoke requires a table entry."
Reid Kleckner [Thu, 22 Jan 2015 19:29:46 +0000 (19:29 +0000)]
Revert "Don't remove a landing pad if the invoke requires a table entry."

This reverts commit r176827.

Björn Steinbrink pointed out that this didn't actually fix the bug
(PR15555) it was attempting to fix.

With this reverted, we can now remove landingpad cleanups that
immediately resume unwinding, converting the invoke to a call.

llvm-svn: 226850

9 years agoDon't stomp the triple when loading a PECOFF target.
Zachary Turner [Thu, 22 Jan 2015 18:59:05 +0000 (18:59 +0000)]
Don't stomp the triple when loading a PECOFF target.

When you create a target, it tries to look for the platform's list
of supported architectures for a match.  The match it finds can
contain specific triples, like i386-pc-windows-msvc.  Later, we
overwrite this value with the most generic triple that can apply
to any platform with COFF support, causing some of the fields of
the triple to get overwritten.

This patch changes the behavior to only merge in values from the COFF
triple if the fields of the matching triple were unknown/unspecified
to begin with.

This fixes load address resolution on Windows, since it enables the
DynamicLoaderWindows to be used instead of DynamicLoaderStatic.

Reviewed by: Greg Clayton
Differential Revision: http://reviews.llvm.org/D7120

llvm-svn: 226849

9 years agoAdd the option, -indirect-symbols, used with -macho to print the Mach-O indirect...
Kevin Enderby [Thu, 22 Jan 2015 18:55:27 +0000 (18:55 +0000)]
Add the option, -indirect-symbols, used with -macho to print the Mach-O indirect symbol table to llvm-objdump.

llvm-svn: 226848

9 years agoFix PR#22284. Add a new overload to deque::insert to handle forward iterators. Update...
Marshall Clow [Thu, 22 Jan 2015 18:33:29 +0000 (18:33 +0000)]
Fix PR#22284. Add a new overload to deque::insert to handle forward iterators. Update tests to exercise this case.

llvm-svn: 226847

9 years agoFix the -*-version-min option to not try and use the current OS version for iOS and...
Greg Clayton [Thu, 22 Jan 2015 18:25:49 +0000 (18:25 +0000)]
Fix the -*-version-min option to not try and use the current OS version for iOS and the simulator since llvm/clang will assert and kill LLDB.

llvm-svn: 226846

9 years agomerge consecutive stores of extracted vector elements (PR21711)
Sanjay Patel [Thu, 22 Jan 2015 18:21:26 +0000 (18:21 +0000)]
merge consecutive stores of extracted vector elements (PR21711)

This is a 2nd try at the same optimization as http://reviews.llvm.org/D6698.
That patch was checked in at r224611, but reverted at r225031 because it
caused a failure outside of the regression tests.

The cause of the crash was not recognizing consecutive stores that have mixed
source values (loads and vector element extracts), so this patch adds a check
to bail out if any store value is not coming from a vector element extract.

This patch also refactors the shared logic of the constant source and vector
extracted elements source cases into a helper function.

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

llvm-svn: 226845

9 years ago[libcxx] Allow use of ShTest in libc++ tests along with other changes.
Eric Fiselier [Thu, 22 Jan 2015 18:05:58 +0000 (18:05 +0000)]
[libcxx] Allow use of ShTest in libc++ tests along with other changes.

Summary:
This patch allows the use of LIT's ShTest format in the libc++ test suite. ShTests have the suffix '.sh.cpp'. It also introduces a series of other changes. These changes are:

- More functionality including parsing test metadata has been moved into LIT.
- LibcxxTestFormat now supports multi-part suffixes.
- the `CXXCompiler` functionality has been used to shrink the size of LibcxxTestFormat.
- The recursive loading of the site config has been turned into `libcxx.test.config.loadSiteConfig` so it can be used with libc++abi.
- Temporary files are now created in the build directory of libc++. This follows how it is down in ShTest.
- `not.py` was added as a utility executable that mirrors the functionality of LLVM's `not` executable.
- The first ShTest test was added under test/libcxx/double_include.sh.cpp

Reviewers: jroelofs, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

llvm-svn: 226844

9 years agoFix the condition in this assertion, and also make it into an unreachable.
Adrian Prantl [Thu, 22 Jan 2015 17:52:08 +0000 (17:52 +0000)]
Fix the condition in this assertion, and also make it into an unreachable.

llvm-svn: 226843

9 years agoRevert "PR21408: Workaround the appearance of duplicate variables due to problems...
David Blaikie [Thu, 22 Jan 2015 17:49:59 +0000 (17:49 +0000)]
Revert "PR21408: Workaround the appearance of duplicate variables due to problems when inlining two calls to the same function from the same call site."

The underlying bug has been fixed in r226736 so there's no need to
workaround this anymore.

This reverts commit r220923.

llvm-svn: 226842

9 years agoAArch64: decode all MRS/MSR forms early to avoid saving FeatureBits.
Tim Northover [Thu, 22 Jan 2015 17:23:04 +0000 (17:23 +0000)]
AArch64: decode all MRS/MSR forms early to avoid saving FeatureBits.

Currently, we're adding a uint64_t describing the current subtarget so
that matching can check whether the specified register is valid.
However, we want to move to a bitset for those bits (x86 has more than
64 of them).

This can't live in a union so it's probably better to do the checks
early (especially as there are only 3 of them).

llvm-svn: 226841

9 years agoRun clang-format on parts of DebugInfo.h
Adrian Prantl [Thu, 22 Jan 2015 16:55:27 +0000 (16:55 +0000)]
Run clang-format on parts of DebugInfo.h

llvm-svn: 226838

9 years agoDocument DIExpression.
Adrian Prantl [Thu, 22 Jan 2015 16:55:24 +0000 (16:55 +0000)]
Document DIExpression.

llvm-svn: 226837

9 years agoRewrite DIExpression::printInternal() to use the iterator interface.
Adrian Prantl [Thu, 22 Jan 2015 16:55:22 +0000 (16:55 +0000)]
Rewrite DIExpression::printInternal() to use the iterator interface.
NFC.

llvm-svn: 226836

9 years agoRename DIExpressionIterator to DIExpression::iterator.
Adrian Prantl [Thu, 22 Jan 2015 16:55:20 +0000 (16:55 +0000)]
Rename DIExpressionIterator to DIExpression::iterator.
Addresses review feedback from Duncan.

llvm-svn: 226835

9 years agoFix a comment.
Adrian Prantl [Thu, 22 Jan 2015 16:55:16 +0000 (16:55 +0000)]
Fix a comment.

llvm-svn: 226834

9 years ago[sanitizer] Move sched_getparam test under Linux/.
Evgeniy Stepanov [Thu, 22 Jan 2015 15:34:50 +0000 (15:34 +0000)]
[sanitizer] Move sched_getparam test under Linux/.

llvm-svn: 226832

9 years ago[ASan/Win] Fix PR20944 -- run ASan gtests as part of check-asan on Windows
Timur Iskhodzhanov [Thu, 22 Jan 2015 14:54:22 +0000 (14:54 +0000)]
[ASan/Win] Fix PR20944 -- run ASan gtests as part of check-asan on Windows

llvm-svn: 226831

9 years ago[pr21886] Change MCJIT/ELF to support MSVC C++ mangled symbol.
Rafael Espindola [Thu, 22 Jan 2015 14:20:45 +0000 (14:20 +0000)]
[pr21886] Change MCJIT/ELF to support MSVC C++ mangled symbol.

The ELF format is used on Windows by the MCJIT engine. Thus, on Windows, the
ELFObjectWriter can encounter symbols mangled using the MS Visual Studio C++
name mangling. Symbols mangled using the MSVC C++ name mangling can legally
have "@@@" as a substring. The EFLObjectWriter should not interpret the "@@@"
substring as specifying GNU-style symbol versioning. The ELFObjectWriter
therefore check for the MSVC C++ name mangling prefix which is either "?", "@?",
"imp_?" or "imp_?@".

llvm-svn: 226830

9 years agotsan: use hacky call only on x86_64
Dmitry Vyukov [Thu, 22 Jan 2015 14:13:56 +0000 (14:13 +0000)]
tsan: use hacky call only on x86_64

required for mips64 and aarch64 ports

llvm-svn: 226829

9 years agoPass -Wl,-z,defs when building shared libraries, but not with the sanitizers.
Rafael Espindola [Thu, 22 Jan 2015 14:06:51 +0000 (14:06 +0000)]
Pass -Wl,-z,defs when building shared libraries, but not with the sanitizers.

llvm-svn: 226828

9 years ago[sanitizer] Intercept sched_getparam.
Evgeniy Stepanov [Thu, 22 Jan 2015 14:03:07 +0000 (14:03 +0000)]
[sanitizer] Intercept sched_getparam.

llvm-svn: 226827

9 years agoSilencing a -Wsign-compare warning (all uses of this constant are within unsigned...
Aaron Ballman [Thu, 22 Jan 2015 13:57:41 +0000 (13:57 +0000)]
Silencing a -Wsign-compare warning (all uses of this constant are within unsigned expressions anyway); NFC.

llvm-svn: 226826

9 years ago[sanitizer] Fix windows build.
Evgeniy Stepanov [Thu, 22 Jan 2015 13:47:12 +0000 (13:47 +0000)]
[sanitizer] Fix windows build.

llvm-svn: 226825

9 years agoEnable backtrace_test for ARM.
Logan Chien [Thu, 22 Jan 2015 13:40:16 +0000 (13:40 +0000)]
Enable backtrace_test for ARM.

llvm-svn: 226824

9 years agoAdd -funwind-tables to CMAKE_C_FLAGS.
Logan Chien [Thu, 22 Jan 2015 13:39:08 +0000 (13:39 +0000)]
Add -funwind-tables to CMAKE_C_FLAGS.

Without -funwind-tables, the compiler won't generate the unwinding
table for these C functions.  However, the functions in libunwind,
such as `_Unwind_Backtrace()`, WILL unwind stack to get the backtrace.

llvm-svn: 226823

9 years agoForce unwind frame with user-defined personality.
Logan Chien [Thu, 22 Jan 2015 13:38:11 +0000 (13:38 +0000)]
Force unwind frame with user-defined personality.

If libcxxabi is compiled as a shared library, and the
executable references the user-defined personality routines
(e.g.  __gxx_personality_v0), then the pointer comparison in
Unwind-EHABI.cpp won't work.  This is due to the fact that
the PREL31 will point to the PLT stubs for the personality
routines (in the executable), while the __gxx_personality_v0
symbol reference is yet another (different) PLT stub (in the
libunwind.)

This will cause _Unwind_Backtrace() stops to unwind the frame
whenever it reaches __gxx_personality_v0().  This CL fix the
problem by calling the user-defined personality routines
with an undocumented API for force unwinding.

llvm-svn: 226822

9 years ago[msan] Better use-after-free reports.
Evgeniy Stepanov [Thu, 22 Jan 2015 13:33:16 +0000 (13:33 +0000)]
[msan] Better use-after-free reports.

By attaching an extra integer tag to heap origins, we are able
to distinguish between uninits
 - created by heap allocation,
 - created by heap deallocation (i.e. use-after-free),
 - created by __msan_allocated_memory call,
 - etc.

See https://code.google.com/p/memory-sanitizer/issues/detail?id=35.

llvm-svn: 226821

9 years agoFix _Unwind_Backtrace for libc++abi built with libgcc.
Logan Chien [Thu, 22 Jan 2015 13:28:39 +0000 (13:28 +0000)]
Fix _Unwind_Backtrace for libc++abi built with libgcc.

Implement an undocumented _US_FORCE_UNWIND flag for force
unwinding.

llvm-svn: 226820

9 years agoAllow libc++abi to be built without unwinder.
Logan Chien [Thu, 22 Jan 2015 13:27:36 +0000 (13:27 +0000)]
Allow libc++abi to be built without unwinder.

This CL adds a new compilation flags LIBCXXABI_USE_LLVM_UNWINDER
to specify whether the LLVM unwinder is enabled.  Besides, all
unwinder-specific code are guarded with this definition.

Now, libc++abi will be able to use the unwinding routine from libgcc
when LIBCXXABI_USE_LLVM_UNWINDER is disabled.

llvm-svn: 226819

9 years agoRemove _Unwind_{Get,Set}{GR,IP} from ARM EHABI build.
Logan Chien [Thu, 22 Jan 2015 13:25:55 +0000 (13:25 +0000)]
Remove _Unwind_{Get,Set}{GR,IP} from ARM EHABI build.

This commit partially reverts r219629.

This functions are not a part of ARM EHABI specification, and AFAIK,
the de facto implementation does not export these functions.

Without this change, any programs compiled with this unwind.h
will be incompatible with other implementations due to linkage
error.

llvm-svn: 226818

9 years agoReplace size call with empty call where appripriate in clang/tools/extra
Alexander Kornienko [Thu, 22 Jan 2015 13:14:29 +0000 (13:14 +0000)]
Replace size call with empty call where appripriate in clang/tools/extra

This patch is the result of applying fixes of the ContainerSizeEmpty Clang-Tidy
checker which was committed recently.

http://reviews.llvm.org/D7085

Patch by Gábor Horváth!

llvm-svn: 226817

9 years ago[DAGCombine] Produce better code for constant splats
Michael Kuperstein [Thu, 22 Jan 2015 13:07:28 +0000 (13:07 +0000)]
[DAGCombine] Produce better code for constant splats

This solves PR22276.
Splats of constants would sometimes produce redundant shuffles, sometimes ridiculously so (see the PR for details). Fold these shuffles into BUILD_VECTORs early on instead.

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

Fixed recommit of r226811.

llvm-svn: 226816

9 years agoMark |TLI| variables used to suppress -Wunused-variable warnings.
Alexander Potapenko [Thu, 22 Jan 2015 13:03:33 +0000 (13:03 +0000)]
Mark |TLI| variables used to suppress -Wunused-variable warnings.
(These vars are only used in assertions)

llvm-svn: 226815

9 years agoRevert r226811, MSVC accepts code sane compilers don't.
Michael Kuperstein [Thu, 22 Jan 2015 12:48:07 +0000 (12:48 +0000)]
Revert r226811, MSVC accepts code sane compilers don't.

llvm-svn: 226814