platform/upstream/llvm.git
9 years agoprofile: Fix link errors in this test on darwin
Justin Bogner [Fri, 29 May 2015 22:41:25 +0000 (22:41 +0000)]
profile: Fix link errors in this test on darwin

llvm-svn: 238622

9 years agoAdd descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.
Evgeniy Stepanov [Fri, 29 May 2015 22:31:28 +0000 (22:31 +0000)]
Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.

This is done by creating a named shared memory region, unlinking it
and setting up a private (i.e. copy-on-write) mapping of that instead
of a regular anonymous mapping. I've experimented with regular
(sparse) files, but they can not be scaled to the size of MSan shadow
mapping, at least on Linux/X86_64 and ext3 fs.

Controlled by a common flag, decorate_proc_maps, disabled by default.

This patch has a few shortcomings:
* not all mappings are annotated, especially in TSan.
* our handling of memset() of shadow via mmap() puts small anonymous
  mappings inside larger named mappings, which looks ugly and can, in
  theory, hit the mapping number limit.

llvm-svn: 238621

9 years ago[docs] fix the declarations of the llvm.nvvm.ptr.gen.to.* intrinsics
Jingyue Wu [Fri, 29 May 2015 22:18:03 +0000 (22:18 +0000)]
[docs] fix the declarations of the llvm.nvvm.ptr.gen.to.* intrinsics

Summary:
These intrinsics should take a generic input address space and outputs a
non-generic address space.

Test Plan: no

Reviewers: jholewinski, eliben

Reviewed By: eliben

Subscribers: eliben, jholewinski, llvm-commits

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

llvm-svn: 238620

9 years agoDisable FP elimination in funcs using 32-bit MSVC EH personalities
Reid Kleckner [Fri, 29 May 2015 21:58:11 +0000 (21:58 +0000)]
Disable FP elimination in funcs using 32-bit MSVC EH personalities

The value in 'ebp' acts as an implicit argument to the outlined
handlers, and is recovered with frameaddress(1).

llvm-svn: 238619

9 years agoCOFF: Move machine type auto-detection to SymbolTable.
Peter Collingbourne [Fri, 29 May 2015 21:47:36 +0000 (21:47 +0000)]
COFF: Move machine type auto-detection to SymbolTable.

The new mechanism is less code, and fixes the case where all inputs
are archives.

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

llvm-svn: 238618

9 years agoRemove getData.
Rafael Espindola [Fri, 29 May 2015 21:45:01 +0000 (21:45 +0000)]
Remove getData.

This completes the mechanical part of merging MCSymbol and MCSymbolData.

llvm-svn: 238617

9 years agoXFAIL additional signal vs exception tests failing on FreeBSD
Ed Maste [Fri, 29 May 2015 21:42:53 +0000 (21:42 +0000)]
XFAIL additional signal vs exception tests failing on FreeBSD

We need to apply to FreeBSD a change equivalent to r238549.

llvm.org/pr23699

llvm-svn: 238616

9 years agoXFAIL TestHandleSegv on FreeBSD
Ed Maste [Fri, 29 May 2015 21:34:12 +0000 (21:34 +0000)]
XFAIL TestHandleSegv on FreeBSD

We need to apply to FreeBSD a change equivalent to r238549.

llvm.org/pr23699

llvm-svn: 238615

9 years agoARM: fix ACLE predefine for iOS's "-arch armv7s".
Tim Northover [Fri, 29 May 2015 21:28:25 +0000 (21:28 +0000)]
ARM: fix ACLE predefine for iOS's "-arch armv7s".

We were getting "#define __ARM_ARCH_7 -S__ 1" which is really not a good idea.

llvm-svn: 238614

9 years agoOnly add the EH state insertion pass on 32-bit Windows
Reid Kleckner [Fri, 29 May 2015 20:43:10 +0000 (20:43 +0000)]
Only add the EH state insertion pass on 32-bit Windows

llvm-svn: 238612

9 years agoRemove the MCSymbolData typedef.
Rafael Espindola [Fri, 29 May 2015 20:41:47 +0000 (20:41 +0000)]
Remove the MCSymbolData typedef.

The getData member function is next.

llvm-svn: 238611

9 years agoFix build - GetRemoteWorkingDirectory returns FileSpec instead of ConstString.
Oleksiy Vyalov [Fri, 29 May 2015 20:32:26 +0000 (20:32 +0000)]
Fix build - GetRemoteWorkingDirectory returns FileSpec instead of ConstString.

llvm-svn: 238610

9 years agoMerge MCSymbol and MCSymbolData.
Rafael Espindola [Fri, 29 May 2015 20:31:23 +0000 (20:31 +0000)]
Merge MCSymbol and MCSymbolData.

As a transition hack leave MCSymbolData as a typedef of MCSymbol. I will be
removing that in a second.

llvm-svn: 238609

9 years ago[lib/Fuzzer] relax an assertion
Kostya Serebryany [Fri, 29 May 2015 20:31:17 +0000 (20:31 +0000)]
[lib/Fuzzer] relax an assertion

llvm-svn: 238608

9 years agoRename getOrCreateSymbolData to registerSymbol and return void.
Rafael Espindola [Fri, 29 May 2015 20:21:02 +0000 (20:21 +0000)]
Rename getOrCreateSymbolData to registerSymbol and return void.

Another step in merging MCSymbol and MCSymbolData.

llvm-svn: 238607

9 years agoFix PlatformAndroid::GetFile - check for relative source path and concatenate it...
Oleksiy Vyalov [Fri, 29 May 2015 20:02:07 +0000 (20:02 +0000)]
Fix PlatformAndroid::GetFile - check for relative source path and concatenate it with current working directory if needed.

llvm-svn: 238606

9 years agoWorking directory FileSpec should use remote path syntax to display correctly.
Chaoren Lin [Fri, 29 May 2015 19:52:37 +0000 (19:52 +0000)]
Working directory FileSpec should use remote path syntax to display correctly.

Summary: Depends on D9728.

Reviewers: ovyalov, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 238605

9 years agoRefactor many file functions to use FileSpec over strings.
Chaoren Lin [Fri, 29 May 2015 19:52:29 +0000 (19:52 +0000)]
Refactor many file functions to use FileSpec over strings.

Summary:
This should solve the issue of sending denormalized paths over gdb-remote
if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the
server handle any denormalization.

Reviewers: ovyalov, zturner, vharron, clayborg

Reviewed By: clayborg

Subscribers: tberghammer, emaste, lldb-commits

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

llvm-svn: 238604

9 years agoImprove test for g++ 4.6
Ed Maste [Fri, 29 May 2015 19:52:02 +0000 (19:52 +0000)]
Improve test for g++ 4.6

Skip the g++ 4.6 test if we're not going to build any C++ source.
If a test has C++ source files we automatically determine which C++
compiler to use based on $CC (for example, clang++ if CC=clang).
However, this is not done for tests without C++ source and CXX will
be GNU make's default of g++.  This produces suprious "g++: not found"
errors in testrun output on systems without a gcc/g++.

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

llvm-svn: 238603

9 years agoReplace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
Benjamin Kramer [Fri, 29 May 2015 19:43:39 +0000 (19:43 +0000)]
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types

If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.

Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

llvm-svn: 238602

9 years agoReplace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
Benjamin Kramer [Fri, 29 May 2015 19:42:19 +0000 (19:42 +0000)]
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types

If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.

Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

llvm-svn: 238601

9 years agoTestHandleSegv: also assert that we have a thread
Ed Maste [Fri, 29 May 2015 19:38:41 +0000 (19:38 +0000)]
TestHandleSegv: also assert that we have a thread

If get_stopped_thread(... eStopReasonSignal) returns no thread, the
thread.IsValid assertion would throw AttributeError: 'NoneType' object
has no attribute 'IsValid'.

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

llvm-svn: 238600

9 years agoImplement snprintf for MSVC with correct return value.
Chaoren Lin [Fri, 29 May 2015 19:34:57 +0000 (19:34 +0000)]
Implement snprintf for MSVC with correct return value.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 238599

9 years agoMove Flags from MCSymbolData to MCSymbol.
Rafael Espindola [Fri, 29 May 2015 19:07:51 +0000 (19:07 +0000)]
Move Flags from MCSymbolData to MCSymbol.

llvm-svn: 238598

9 years agoFix build without asserts.
Rafael Espindola [Fri, 29 May 2015 19:04:38 +0000 (19:04 +0000)]
Fix build without asserts.

llvm-svn: 238597

9 years agoPass MCSymbols to the helper functions in MCELF.h.
Rafael Espindola [Fri, 29 May 2015 18:47:23 +0000 (18:47 +0000)]
Pass MCSymbols to the helper functions in MCELF.h.

llvm-svn: 238596

9 years agoAdd '+' sign at the end of echo message for debugserver
Ying Chen [Fri, 29 May 2015 18:44:08 +0000 (18:44 +0000)]
Add '+' sign at the end of echo message for debugserver

Summary:
-ammend to r238538
-Fix test failure of TestGdbRemoteAuxvSupport.py and TestLldbGdbServer.py on MacOSX

Test Plan:
./dotest -p TestGdbRemoteAuxvSupport.py
./dotest -p TestLldbGdbServer.py

Reviewers: chaoren, clayborg

Subscribers: lldb-commits

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

llvm-svn: 238595

9 years agoFix hanging test suite when dosep.py is invoked directly.
Chaoren Lin [Fri, 29 May 2015 18:43:46 +0000 (18:43 +0000)]
Fix hanging test suite when dosep.py is invoked directly.

Reviewers: zturner, sivachandra

Subscribers: lldb-commits

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

llvm-svn: 238594

9 years ago[CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions
Chris Bieneman [Fri, 29 May 2015 18:36:20 +0000 (18:36 +0000)]
[CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitions

Summary: This patch moves all the clang library targets into a ClangTargets export list, and installs it using the CMake install(EXPORT...) command.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

llvm-svn: 238593

9 years ago[CMake] Bug 23468 - LLVM_OPTIMIZED_TABLEGEN does not work with Visual Studio
Chris Bieneman [Fri, 29 May 2015 18:34:41 +0000 (18:34 +0000)]
[CMake] Bug 23468 - LLVM_OPTIMIZED_TABLEGEN does not work with Visual Studio

Summary: Multi-configuration builds put their binaries into ${CMAKE_BINARY_DIR}/Release/bin/. The table-gen cross-compilation support needs to take that into account.

Reviewers: yaron.keren

Reviewed By: yaron.keren

Subscribers: llvm-commits

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

llvm-svn: 238592

9 years agoUse an explicitly defaulted constructor.
Rafael Espindola [Fri, 29 May 2015 18:31:17 +0000 (18:31 +0000)]
Use an explicitly defaulted constructor.

llvm-svn: 238591

9 years agoUnbreak mac build.
Greg Clayton [Fri, 29 May 2015 18:28:01 +0000 (18:28 +0000)]
Unbreak mac build.

llvm-svn: 238590

9 years agoPass a MCSymbol to needsRelocateWithSymbol.
Rafael Espindola [Fri, 29 May 2015 18:26:09 +0000 (18:26 +0000)]
Pass a MCSymbol to needsRelocateWithSymbol.

llvm-svn: 238589

9 years agoMachineCopyPropagation: Remove the copies instead of using KILL instructions.
Matthias Braun [Fri, 29 May 2015 18:19:25 +0000 (18:19 +0000)]
MachineCopyPropagation: Remove the copies instead of using KILL instructions.

For some history here see the commit messages of r199797 and r169060.

The original intent was to fix cases like:

%EAX<def> = COPY %ECX<kill>, %RAX<imp-def>
%RCX<def> = COPY %RAX<kill>

where simply removing the copies would have RCX undefined as in terms of
machine operands only the ECX part of it is defined. The machine
verifier would complain about this so 169060 changed such COPY
instructions into KILL instructions so some super-register imp-defs
would be preserved. In r199797 it was finally decided to always do this
regardless of super-register defs.

But this is wrong, consider:
R1 = COPY R0
...
R0 = COPY R1
getting changed to:
R1 = KILL R0
...
R0 = KILL R1

It now looks like R0 dies at the first KILL and won't be alive until the
second KILL, while in reality R0 is alive and must not change in this
part of the program.

As this only happens after register allocation there is not much code
still performing liveness queries so the issue was not noticed.  In fact
I didn't manage to create a testcase for this, without unrelated changes
I am working on at the moment.

The fix is simple: As of r223896 the MachineVerifier allows reads from
partially defined registers, so the whole transforming COPY->KILL thing
is not necessary anymore. This patch also changes a similar (but more
benign case as the def and src are the same register) case in the
VirtRegRewriter.

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

llvm-svn: 238588

9 years agoRe-add #include "lldb-python.h" back in two places.
Zachary Turner [Fri, 29 May 2015 18:18:26 +0000 (18:18 +0000)]
Re-add #include "lldb-python.h" back in two places.

Fixing these two instances will require some work, so for now
I'm adding these 2 includes back to get the build working.

llvm-svn: 238587

9 years agoYAML traits need to be in the llvm::yaml namespace.
Frederic Riss [Fri, 29 May 2015 18:14:55 +0000 (18:14 +0000)]
YAML traits need to be in the llvm::yaml namespace.

Hope this fixes the bits, eg:
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/27147

llvm-svn: 238586

9 years agoUse sanitizer_atomic_clang.h with clang-cl instead of the MSVC variant
Reid Kleckner [Fri, 29 May 2015 17:56:39 +0000 (17:56 +0000)]
Use sanitizer_atomic_clang.h with clang-cl instead of the MSVC variant

llvm-svn: 238585

9 years ago[YAMLIO] Make line-wrapping configurable and test it.
Frederic Riss [Fri, 29 May 2015 17:56:28 +0000 (17:56 +0000)]
[YAMLIO] Make line-wrapping configurable and test it.

Summary:
We would wrap flow mappings and sequences when they go over a hardcoded 70
characters limit. Make the wrapping column configurable (and default to 70
co the change should be NFC for current users). Passing 0 allows to completely
suppress the wrapping which makes it easier to handle in tools like FileCheck.

Reviewers: bogner

Subscribers: llvm-commits

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

llvm-svn: 238584

9 years agoMove common symbol related information from MCSectionData to MCSymbol.
Rafael Espindola [Fri, 29 May 2015 17:48:04 +0000 (17:48 +0000)]
Move common symbol related information from MCSectionData to MCSymbol.

llvm-svn: 238583

9 years agoStore MCSymbols in PendingLabels.
Rafael Espindola [Fri, 29 May 2015 17:41:59 +0000 (17:41 +0000)]
Store MCSymbols in PendingLabels.

llvm-svn: 238582

9 years agoDon't #include "lldb-python.h" from anywhere.
Zachary Turner [Fri, 29 May 2015 17:41:47 +0000 (17:41 +0000)]
Don't #include "lldb-python.h" from anywhere.

Since interaction with the python interpreter is moving towards
being more isolated, we won't be able to include this header from
normal files anymore, all includes of it should be localized to
the python library which will live under source/bindings/API/Python
after a future patch.

None of the files that were including this header actually depended
on it anyway, so it was just a dead include in every single instance.

llvm-svn: 238581

9 years agoMove SymbolSize from MCSymbolData to MCSymbol.
Rafael Espindola [Fri, 29 May 2015 17:24:52 +0000 (17:24 +0000)]
Move SymbolSize from MCSymbolData to MCSymbol.

llvm-svn: 238580

9 years agoFix crash in MCExpr::print.
Pete Cooper [Fri, 29 May 2015 17:19:11 +0000 (17:19 +0000)]
Fix crash in MCExpr::print.

Symbols are no longer required to be named, but this leads to a crash here if an
unnamed symbol checks that its first character is '$'.

Change the code to first check for a name, then check its first character.

No test case i'm afraid as this is debugging code, but any test case with temp labels
and 'llc --debug --filetype=obj' would have crashed.

llvm-svn: 238579

9 years agoAdd support for VSX FMA single-precision instructions to the PPC back end
Nemanja Ivanovic [Fri, 29 May 2015 17:13:25 +0000 (17:13 +0000)]
Add support for VSX FMA single-precision instructions to the PPC back end

This patch corresponds to review:
http://reviews.llvm.org/D9941

It adds the various FMA instructions introduced in the version 2.07 of
the ISA along with the testing for them. These are operations on single
precision scalar values in VSX registers.

llvm-svn: 238578

9 years agoExploit non-negative numerators
Tobias Grosser [Fri, 29 May 2015 17:08:19 +0000 (17:08 +0000)]
Exploit non-negative numerators

isl marks known non-negative numerators in modulo (and soon also division)
operations. We now exploit this by generating unsigned operations. This is
beneficial as unsigned operations with power-of-two denominators will be
translated by isl to fast bitshift or bitwise and operations.

llvm-svn: 238577

9 years agoMIR Serialization: use correct line and column numbers for LLVM IR errors.
Alex Lorenz [Fri, 29 May 2015 17:05:41 +0000 (17:05 +0000)]
MIR Serialization: use correct line and column numbers for LLVM IR errors.

This commit translates the line and column numbers for LLVM IR
errors from the numbers in the YAML block scalar to the numbers
in the MIR file so that the MIRParser users can report LLVM IR
errors with the correct line and column numbers.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 238576

9 years ago[WinEH] Emit EH tables for __CxxFrameHandler3 on 32-bit x86
Reid Kleckner [Fri, 29 May 2015 17:00:57 +0000 (17:00 +0000)]
[WinEH] Emit EH tables for __CxxFrameHandler3 on 32-bit x86

Small (really small!) C++ exception handling examples work on 32-bit x86
now.

This change disables the use of .seh_* directives in WinException when
CFI is not in use. It also uses absolute symbol references in the tables
instead of imagerel32 relocations.

Also fixes a cache invalidation bug in MMI personality classification.

llvm-svn: 238575

9 years ago[NVPTXFavorNonGenericAddrSpaces] recursively trace into GEP and BitCast
Jingyue Wu [Fri, 29 May 2015 17:00:27 +0000 (17:00 +0000)]
[NVPTXFavorNonGenericAddrSpaces] recursively trace into GEP and BitCast

Summary:
This patch allows NVPTXFavorNonGenericAddrSpaces to remove addrspacecast
from longer chains consisting of GEPs and BitCasts. For example, it can
now optimize

  %0 = addrspacecast [10 x float] addrspace(3)* @a to [10 x float]*
  %1 = gep [10 x float]* %0, i64 0, i64 %i
  %2 = bitcast float* %1 to i32*
  %3 = load i32* %2 ; emits ld.u32

to

  %0 = gep [10 x float] addrspace(3)* @a, i64 0, i64 %i
  %1 = bitcast float addrspace(3)* %0 to i32 addrspace(3)*
  %3 = load i32 addrspace(3)* %1 ; emits ld.shared.f32

Test Plan: @ld_int_from_global_float in access-non-generic.ll

Reviewers: broune, eliben, jholewinski, meheff

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 238574

9 years ago[DependenceAnalysis] Extend unifySubscriptType for handling coupled subscript groups.
Jingyue Wu [Fri, 29 May 2015 16:58:08 +0000 (16:58 +0000)]
[DependenceAnalysis] Extend unifySubscriptType for handling coupled subscript groups.

Summary:
In continuation to an earlier commit to DependenceAnalysis.cpp by jingyue (r222100), the type for all subscripts in a coupled group need to be the same since constraints from one subscript may be propagated to another during testing. During testing, new SCEVs may be created and the operands for these need to be the same.
This patch extends unifySubscriptType() to work on lists of subscript pairs, ensuring a common extended type for all of them.

Test Plan:
Added a test case to NonCanonicalizedSubscript.ll which causes dependence analysis to crash without this fix.

All regression tests pass.

Reviewers: spop, sebpop, jingyue

Reviewed By: jingyue

Subscribers: llvm-commits

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

llvm-svn: 238573

9 years agoImprove handling of print value argument in -stack-list-* commands.
Hafiz Abid Qadeer [Fri, 29 May 2015 16:48:40 +0000 (16:48 +0000)]
Improve handling of print value argument in -stack-list-* commands.

It was reviewed in http://reviews.llvm.org/D10106.
Patch by paulmaybee.

llvm-svn: 238572

9 years agoCOFF: Add /subsystem option.
Rui Ueyama [Fri, 29 May 2015 16:34:31 +0000 (16:34 +0000)]
COFF: Add /subsystem option.

llvm-svn: 238571

9 years agoCOFF: Add /version option.
Rui Ueyama [Fri, 29 May 2015 16:28:29 +0000 (16:28 +0000)]
COFF: Add /version option.

llvm-svn: 238570

9 years agoCOFF: Add /heap option.
Rui Ueyama [Fri, 29 May 2015 16:23:40 +0000 (16:23 +0000)]
COFF: Add /heap option.

llvm-svn: 238569

9 years agoAdd /stack option.
Rui Ueyama [Fri, 29 May 2015 16:21:11 +0000 (16:21 +0000)]
Add /stack option.

llvm-svn: 238568

9 years agoCOFF: Add /base option.
Rui Ueyama [Fri, 29 May 2015 16:18:15 +0000 (16:18 +0000)]
COFF: Add /base option.

llvm-svn: 238567

9 years agoAllow CMAKE_OSX_ARCHITECTURES to build fat library.
Jonathan Peyton [Fri, 29 May 2015 16:13:56 +0000 (16:13 +0000)]
Allow CMAKE_OSX_ARCHITECTURES to build fat library.

The CMAKE_OSX_ARCHITECTURES CMake variable allows users to build
universal fat libraries that contain both i386 and x86_64 code.  These
changes allow this build by having the z_Linux_asm.s file detect the architecture
itself instead of receiving it through the build system.

Also, there was a LIBOMP_OSX_ARCHITECTURES CMake variable added to allow
people to only build libomp as a fat library and not the entire LLVM/Clang system.
http://lists.cs.uiuc.edu/pipermail/openmp-dev/2015-May/000626.html

llvm-svn: 238566

9 years agoCOFF: Add /help option.
Rui Ueyama [Fri, 29 May 2015 16:11:52 +0000 (16:11 +0000)]
COFF: Add /help option.

llvm-svn: 238565

9 years agoCOFF: Add /machine option.
Rui Ueyama [Fri, 29 May 2015 16:06:00 +0000 (16:06 +0000)]
COFF: Add /machine option.

llvm-svn: 238564

9 years agoCOFF: Move Windows-specific function under Windows-specific marker.
Rui Ueyama [Fri, 29 May 2015 15:49:09 +0000 (15:49 +0000)]
COFF: Move Windows-specific function under Windows-specific marker.

llvm-svn: 238563

9 years agoCOFF: Fill imort table HintName field.
Rui Ueyama [Fri, 29 May 2015 15:45:35 +0000 (15:45 +0000)]
COFF: Fill imort table HintName field.

Currently we set the field to zero, but as per the spec, we should
set numbers we read from import library files. The loader uses the
values as starting offsets for binary search when looking up imported
symbols from DLL.

llvm-svn: 238562

9 years agolibcxx: Switch to use __gnu_unwind_frame() for libunwind.
Logan Chien [Fri, 29 May 2015 15:34:24 +0000 (15:34 +0000)]
libcxx: Switch to use __gnu_unwind_frame() for libunwind.

As a step to fix libunwind unw_step(), a new function
__gnu_unwind_frame() has been introduced to libunwind, and it is
required to use this function so that some libunwind internal data
structure can be updated properly.

llvm-svn: 238561

9 years agolibunwind: Fix unw_step() for ARM EHABI.
Logan Chien [Fri, 29 May 2015 15:33:38 +0000 (15:33 +0000)]
libunwind: Fix unw_step() for ARM EHABI.

This commit fixes the unw_step() for ARM EHABI.  However, this commit
also changes the implementation details for ARM EHABI.

The first change is that the personality function should call
__gnu_unwind_frame() for default (or de facto) frame unwinding based on
the ARM-defined unwind opcode.  The function __gnu_unwind_frame() will
in turn calls unw_step() which actually unwinds the frame.

The second change is that the implementation _Unwind_Backtrace() should
no longer calls unw_step() to unwind the frame; since according to ARM
EHABI, the personality function should unwind the frame for us.

Special thanks to Anton for helpful suggestion on the initial version of
this patch.

llvm-svn: 238560

9 years agoSimplify now that symbols contain the correct section.
Rafael Espindola [Fri, 29 May 2015 15:07:27 +0000 (15:07 +0000)]
Simplify now that symbols contain the correct section.

The complexity in here was because before r233995 variable symbols would report
the incorrect section.

llvm-svn: 238559

9 years agoXFAIL two tests for android
Pavel Labath [Fri, 29 May 2015 14:54:46 +0000 (14:54 +0000)]
XFAIL two tests for android

bug #23694

llvm-svn: 238558

9 years ago[Objdump] Removing unused parameter.
Colin LeMahieu [Fri, 29 May 2015 14:48:25 +0000 (14:48 +0000)]
[Objdump] Removing unused parameter.

llvm-svn: 238557

9 years ago[Hexagon] Disassembling, printing, and emitting instructions a whole-bundle at a...
Colin LeMahieu [Fri, 29 May 2015 14:44:13 +0000 (14:44 +0000)]
[Hexagon] Disassembling, printing, and emitting instructions a whole-bundle at a time which is the semantic unit for Hexagon.  Fixing tests to use the new format.  Disabling tests in the direct object emission path for a followup patch.

llvm-svn: 238556

9 years agoFix ELFObjectWriter::isLocal for signature symbols.
Rafael Espindola [Fri, 29 May 2015 14:20:40 +0000 (14:20 +0000)]
Fix ELFObjectWriter::isLocal for signature symbols.

And with that simplify the logic for inserting them in ExternalSymbolData or
LocalSymbolData.

No functionality change overall since the old code avoided the isLocal bug.

llvm-svn: 238555

9 years ago[mips] Remove 2 unused variables in MipsTargetStreamer.cpp. NFC.
Toma Tabacu [Fri, 29 May 2015 13:52:56 +0000 (13:52 +0000)]
[mips] Remove 2 unused variables in MipsTargetStreamer.cpp. NFC.

llvm-svn: 238554

9 years ago[ARM] Adjust -march checking
John Brawn [Fri, 29 May 2015 13:10:44 +0000 (13:10 +0000)]
[ARM] Adjust -march checking

getCanonicalArchName can return an empty string for an architecture
that is well-formed but meaningless. Use parseArch to determine if
it's actually valid or not.

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

llvm-svn: 238553

9 years agoRemoving a switch statement that only contains a default; NFC.
Aaron Ballman [Fri, 29 May 2015 13:00:07 +0000 (13:00 +0000)]
Removing a switch statement that only contains a default; NFC.

llvm-svn: 238552

9 years ago[NativeProcessLinux] clean up #includes
Pavel Labath [Fri, 29 May 2015 12:53:54 +0000 (12:53 +0000)]
[NativeProcessLinux] clean up #includes

llvm-svn: 238551

9 years agoFix assertion on C++ attributes in fillAttributedTypeLoc
Alexander Musman [Fri, 29 May 2015 11:24:32 +0000 (11:24 +0000)]
Fix assertion on C++ attributes in fillAttributedTypeLoc
this fixes http://llvm.org/PR17424
fillAttributedTypeLoc() function is only called with AttributeLists of either
DeclarationChunk (which is used for each type in a declarator being parsed) or
DeclSpec (which captures information about declaration specifiers).
As C++11 attributes actually appertain to declarators, they are moved straight
to the declarator’s attr list in distributeFunctionTypeAttrFromDeclSpec()
function.
'Put them wherever you like' semantics is not supported for C++11 attributes
(but is allowed for GNU attributes, for example). So when we meet an attribute
while parsing the declaration, we cannot be sure if it appertains to either
DeclarationChunk or DeclSpec.

This investigation correlates with the history of changes of SemaType.cpp:
• Asserts in fillAttributedTypeLoc() were added on 3 Mar 2011 in r126986
(http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-
        20110228/039638.html);
• Distributing C++11 attrs to the declarator was added on 14 Jan 2013
in r172504 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-
        20130114/071830.html).
Considering all written above I changed asserts in fillAttributedTypeLoc()
to nullptr checks.

This fixes PR17424 and related assertion on
[[gnu::fastcall]] void __stdcall foo();

Author: Alexey Frolov

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

llvm-svn: 238550

9 years agoReport inferior SIGSEGV as a signal instead of an exception on linux
Pavel Labath [Fri, 29 May 2015 10:13:03 +0000 (10:13 +0000)]
Report inferior SIGSEGV as a signal instead of an exception on linux

Summary:
Previously, we reported inferior receiving SIGSEGV (or SIGILL, SIGFPE, SIGBUS) as an "exception"
to LLDB, presumably to match OSX behaviour. Beside the fact that we were basically lying to the
user, this was also causing problems with inferiors which handle SIGSEGV by themselves, since
LLDB was unable to reinject this signal back into the inferior.

This commit changes LLGS to report SIGSEGV as a signal. This has necessitated some changes in the
test-suite, which had previously used eStopReasonException to locate threads that crashed. Now it
uses platform-specific logic, which in the case of linux searches for eStopReasonSignaled with
signal=SIGSEGV.

I have also added the ability to set the description of StopInfoUnixSignal using the description
field of the gdb-remote packet. The linux stub uses this to display additional information about
the segfault (invalid address, address access protected, etc.).

Test Plan: All tests pass on linux and osx.

Reviewers: ovyalov, clayborg, emaste

Subscribers: emaste, lldb-commits

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

llvm-svn: 238549

9 years ago[clang-tidy] Fix for llvm.org/PR23355
Szabolcs Sipos [Fri, 29 May 2015 09:49:59 +0000 (09:49 +0000)]
[clang-tidy] Fix for llvm.org/PR23355

misc-static-assert and misc-assert-side-effect will handle __builtin_expect based asserts correctly.

llvm-svn: 238548

9 years agoRefactor MacroInfo so macro arguments can be iterated with range-based for loops.
Daniel Marjamaki [Fri, 29 May 2015 09:15:24 +0000 (09:15 +0000)]
Refactor MacroInfo so macro arguments can be iterated with range-based for loops.

No functional change intended.

Patch by Sebastian Edman!

llvm-svn: 238547

9 years agoRun clang-format on MacroInfo.h
Daniel Marjamaki [Fri, 29 May 2015 08:26:48 +0000 (08:26 +0000)]
Run clang-format on MacroInfo.h

llvm-svn: 238546

9 years ago[ASan] Fix flaky tests (see https://llvm.org/bugs/show_bug.cgi?id=23230).
Yury Gribov [Fri, 29 May 2015 06:45:13 +0000 (06:45 +0000)]
[ASan] Fix flaky tests (see https://llvm.org/bugs/show_bug.cgi?id=23230).
Patch by Maria Guseva!

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

llvm-svn: 238545

9 years agoclang-format: [JS] Support ES6 computed property names.
Daniel Jasper [Fri, 29 May 2015 06:19:49 +0000 (06:19 +0000)]
clang-format: [JS] Support ES6 computed property names.

Before:
  var x = {
        [a]: 1,
    b: 2
  };

After:
  var x = {
    [a]: 1,
    b: 2
  };

llvm-svn: 238544

9 years ago[TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit...
Craig Topper [Fri, 29 May 2015 05:51:32 +0000 (05:51 +0000)]
[TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit as they weren't able to be called.

I don't think converting the inputs to the Ops was the right behavior anyway.

llvm-svn: 238543

9 years agoNFC: tab => spaces
Jingyue Wu [Fri, 29 May 2015 05:43:03 +0000 (05:43 +0000)]
NFC: tab => spaces

llvm-svn: 238542

9 years agoChange ProcessEventData over to use a std::weak_ptr to a process intead of a std...
Greg Clayton [Fri, 29 May 2015 03:20:37 +0000 (03:20 +0000)]
Change ProcessEventData over to use a std::weak_ptr to a process intead of a std::shared_ptr. Anyone consuming events for a process should have the process around long enough to grab the event and anyone that holds onto an event for too long won't keep the process around.

llvm-svn: 238541

9 years agoThis should have been a reference
Matthias Braun [Fri, 29 May 2015 02:59:59 +0000 (02:59 +0000)]
This should have been a reference

llvm-svn: 238540

9 years agoCodeGen: Use mop_iterator instead of MIOperands/ConstMIOperands
Matthias Braun [Fri, 29 May 2015 02:56:46 +0000 (02:56 +0000)]
CodeGen: Use mop_iterator instead of MIOperands/ConstMIOperands

MIOperands/ConstMIOperands are classes iterating over the MachineOperand
of a MachineInstr, however MachineInstr::mop_iterator does the same
thing.

I assume these two iterators exist to have a uniform interface to
iterate over the operands of a machine instruction bundle and a single
machine instruction. However in practice I find it more confusing to have 2
different iterator classes, so this patch transforms (nearly all) the
code to use mop_iterators.

The only exception being MIOperands::anlayzePhysReg() and
MIOperands::analyzeVirtReg() still needing an equivalent, I leave that
as an exercise for the next patch.

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

This version is slightly modified from the proposed revision in that it
introduces MachineInstr::getOperandNo to avoid the extra counting
variable in the few loops that previously used MIOperands::getOperandNo.

llvm-svn: 238539

9 years agowip: Remove some unused functions
Justin Bogner [Fri, 29 May 2015 02:42:14 +0000 (02:42 +0000)]
wip: Remove some unused functions

llvm-svn: 238538

9 years agoAdd a test for the MachineCopyPropagation change landed in r238518.
Quentin Colombet [Fri, 29 May 2015 01:40:00 +0000 (01:40 +0000)]
Add a test for the MachineCopyPropagation change landed in r238518.

llvm-svn: 238537

9 years ago[TableGen][AsmMatcherEmitter] Only parse isolated tokens as registers.
Ahmed Bougacha [Fri, 29 May 2015 01:03:37 +0000 (01:03 +0000)]
[TableGen][AsmMatcherEmitter] Only parse isolated tokens as registers.

Fixes PR23455, where, when TableGen generates the matcher from the
AsmString, it splits "cmp${cc}ss" into tokens, and the "ss" suffix
is recognized as the SS register.

I can't think of a situation where that's a feature, not a bug, hence:
when a token is "isolated", i.e., it is followed and preceded by
separators, it shouldn't be parsed as a register.

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

llvm-svn: 238536

9 years agoAdd '+' sign at the end of echo package
Ying Chen [Fri, 29 May 2015 01:02:07 +0000 (01:02 +0000)]
Add '+' sign at the end of echo package

Summary:
-Fix lldb test failures introduced by r238530
-This fix TestGdbRemoteAuxvSupport.py and TestLldbGdbServer.py

Test Plan:
./dotest -p TestGdbRemoteAuxvSupport.py
./dotest -p TestLldbGdbServer.py

Reviewers: clayborg, chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238535

9 years ago[TableGen][AsmMatcherEmitter] Factor out AsmOperand creation. NFC.
Ahmed Bougacha [Fri, 29 May 2015 00:55:55 +0000 (00:55 +0000)]
[TableGen][AsmMatcherEmitter] Factor out AsmOperand creation.  NFC.

llvm-svn: 238534

9 years agoAdd support for the qEcho command to lldb-server in the common packets.
Greg Clayton [Fri, 29 May 2015 00:15:15 +0000 (00:15 +0000)]
Add support for the qEcho command to lldb-server in the common packets.

llvm-svn: 238533

9 years ago[TestLldbGdbServer and TestGdbRemoteXXX] Use "ls -l" instead of "readlink"
Siva Chandra [Fri, 29 May 2015 00:14:16 +0000 (00:14 +0000)]
[TestLldbGdbServer and TestGdbRemoteXXX] Use "ls -l" instead of "readlink"

Summary:
Old Android devices, for example API 16, do not have the "readlink"
command. To take care of such devices, this commit changes to use "ls -l"
instead of "readlink" to get the lldb-server exe path.

The tests fixed with this change for an Android API 16 arm device are:

TestGdbRemoteAttach
TestGdbRemoteAuxvSupport
TestGdbRemoteExpeditedRegisters
TestGdbRemoteKill
TestGdbRemoteProcessInfo
TestGdbRemoteSegFault
TestGdbRemoteThreadsInStopReply
TestGdbRemote_qThreadStopInfo

Further, all tests in TestLldbGdbServer pass (previously erroring out),
except one which times out.

Test Plan:
Run dosep.py with 8 test threads targetting Android API 16
device.

Reviewers: vharron, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, aemerson, lldb-commits

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

llvm-svn: 238532

9 years ago[IR] fptrunc-of-fptrunc isn't an EliminableCastPair.
Ahmed Bougacha [Fri, 29 May 2015 00:04:30 +0000 (00:04 +0000)]
[IR] fptrunc-of-fptrunc isn't an EliminableCastPair.

Double and single rounding can produce different results.
This is the IR counterpart to r228911.

llvm-svn: 238531

9 years agoAdd a new "qEcho" packet with the following format:
Greg Clayton [Fri, 29 May 2015 00:01:55 +0000 (00:01 +0000)]
Add a new "qEcho" packet with the following format:

qEcho:%s

where '%s' is any valid string. The response to this packet is the exact packet itself with no changes, just reply with what you received!

This will help us to recover from packets timing out much more gracefully. Currently if a packet times out, LLDB quickly will hose up the debug session. For example, if we send a "abc" packet and we expect "ABC" back in response, but the "abc" command takes longer than the current timeout value this will happen:

--> "abc"
<-- <<<error: timeout>>>

Now we want to send "def" and get "DEF" back:

--> "def"
<-- "ABC"

We got the wrong response for the "def" packet because we didn't sync up with the server to clear any current responses from previously issues commands.

The fix is to modify GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock() so that when it gets a timeout, it syncs itself up with the client by sending a "qEcho:%u" where %u is an increasing integer, one for each time we timeout. We then wait for 3 timeout periods to sync back up. So the above "abc" session would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second
<-- "abc"
<-- "qEcho:1"

The first timeout is from trying to get the response, then we know we timed out and we send the "qEcho:1" packet and wait for 3 timeout periods to get back in sync knowing that we might actually get the response for the "abc" packet in the mean time...

In this case we would actually succeed in getting the response for "abc". But lets say the remote GDB server is deadlocked and will never response, it would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second
<-- <<<error: timeout>>> 1 second

We then disconnect and say we lost connection.

We might also have a bad GDB server that just dropped the "abc" packet on the floor. We can still recover in this case and it would look like:

--> "abc"
<-- <<<error: timeout>>> 1 second
--> "qEcho:1"
<-- "qEcho:1"

Then we know our remote GDB server is still alive and well, and it just dropped the "abc" response on the floor and we can continue to debug.

<rdar://problem/21082939>

llvm-svn: 238530

9 years agoFix TestMultithreaded.
Chaoren Lin [Fri, 29 May 2015 00:01:15 +0000 (00:01 +0000)]
Fix TestMultithreaded.

llvm-svn: 238529

9 years agoAdd "Failing Tests .." line to dosep logs
Ying Chen [Thu, 28 May 2015 23:51:49 +0000 (23:51 +0000)]
Add "Failing Tests .." line to dosep logs

Summary:
-Buildbot parser depends on this line as start flag
-Will remove the dependency from buildbot parser, but it takes some time to take effect
-Will remove this line from printout after buildbot master reconfig

Reviewers: chaoren, vharron

Subscribers: lldb-commits

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

llvm-svn: 238527

9 years agoRemove dead code.
Richard Smith [Thu, 28 May 2015 23:38:53 +0000 (23:38 +0000)]
Remove dead code.

llvm-svn: 238526

9 years agoMachineFrameInfo: Simplify pristine register calculation.
Matthias Braun [Thu, 28 May 2015 23:20:35 +0000 (23:20 +0000)]
MachineFrameInfo: Simplify pristine register calculation.

About pristine regsiters:
Pristine registers "hold a value that is useless to the current
function, but that must be preserved - they are callee saved registers
that have not been saved." This concept saves compile time as it frees
the prologue/epilogue inserter from adding every such register to every
basic blocks live-in list.

However the current code in getPristineRegs is formulated in a
complicated way: Inside the function prologue and epilogue all callee
saves are considered pristine, while in the rest of the code only the
non-saved ones are considered pristine.  This requires logic to
differentiate between prologue/epilogue and the rest and in the presence
of shrink-wrapping this even becomes complicated/expensive.  It's also
unnecessary because the prologue epilogue inserters already mark
callee-save registers that are saved/restores properly in the respective
blocks in the prologue/epilogue (see updateLiveness() in
PrologueEpilogueInserter.cpp). So only declaring non-saved/restored
callee saved registers as pristine just works.

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

llvm-svn: 238524

9 years agoFix typos in variable/grammar names.
Eric Christopher [Thu, 28 May 2015 23:07:39 +0000 (23:07 +0000)]
Fix typos in variable/grammar names.

llvm-svn: 238523

9 years agoRemove warning when testing for timeout command.
Chaoren Lin [Thu, 28 May 2015 23:00:10 +0000 (23:00 +0000)]
Remove warning when testing for timeout command.

llvm-svn: 238522

9 years agoRename Win64Exception.(cpp|h) to WinException.(cpp|h)
Reid Kleckner [Thu, 28 May 2015 22:47:01 +0000 (22:47 +0000)]
Rename Win64Exception.(cpp|h) to WinException.(cpp|h)

This is in preparation for reusing this for 32-bit x86 EH table
emission.  Also updates the type name for consistency. NFC

llvm-svn: 238521

9 years ago[x86] Move the vector popcount tests into non-ISA files, and instead
Chandler Carruth [Thu, 28 May 2015 22:46:48 +0000 (22:46 +0000)]
[x86] Move the vector popcount tests into non-ISA files, and instead
organize them by the width of vector.

This makes it a lot easier to see that we're covering all of the vector
types but not doing so excessively. This also adds tests across the
spectrum of SSE versions in addition to the AVX versions.

If you're really tired of seeing the *massive* sprawl of scalarized code
for this, don't worry, I'm just about to land Bruno's patch that
dramatically improve the situation for SSSE3 and newer.

llvm-svn: 238520