platform/upstream/llvm.git
9 years agoCOFF: Make link order compatible with MSVC link.exe.
Rui Ueyama [Tue, 23 Jun 2015 23:56:39 +0000 (23:56 +0000)]
COFF: Make link order compatible with MSVC link.exe.

Previously, we added files in directive sections to the symbol
table as we read the sections, so the link order was depth-first.
That's not compatible with MSVC link.exe nor the old LLD.

This patch is to queue files so that new files are added to the
end of the queue and processed last. Now addFile() doesn't parse
files nor resolve symbols. You need to call run() to process
queued files.

llvm-svn: 240483

9 years agoMIR Serialization: Serialize immediate machine operands.
Alex Lorenz [Tue, 23 Jun 2015 23:42:28 +0000 (23:42 +0000)]
MIR Serialization: Serialize immediate machine operands.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 240481

9 years agofix typo; NFC
Sanjay Patel [Tue, 23 Jun 2015 23:26:22 +0000 (23:26 +0000)]
fix typo; NFC

llvm-svn: 240480

9 years agoFix test failure if this value doesn't end up named %0.
Richard Smith [Tue, 23 Jun 2015 23:13:31 +0000 (23:13 +0000)]
Fix test failure if this value doesn't end up named %0.

llvm-svn: 240479

9 years agodon't repeat function names in comments; NFC
Sanjay Patel [Tue, 23 Jun 2015 23:05:08 +0000 (23:05 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 240478

9 years agoAdd "-mcpu=" option to llvm-rtdyld
Petar Jovanovic [Tue, 23 Jun 2015 22:52:19 +0000 (22:52 +0000)]
Add "-mcpu=" option to llvm-rtdyld

This patch adds the -mcpu= option to llvm-rtdyld. With this option, one
can test relocations for different types of CPUs (e.g. Mips64r6).

Patch by Vladimir Radosavljevic.

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

llvm-svn: 240477

9 years agoUse range-based loops when handling OPT_print_search_dirs.
Douglas Katzman [Tue, 23 Jun 2015 22:43:50 +0000 (22:43 +0000)]
Use range-based loops when handling OPT_print_search_dirs.

llvm-svn: 240476

9 years agoMIR Parser: Use correct source locations for machine instruction diagnostics.
Alex Lorenz [Tue, 23 Jun 2015 22:39:23 +0000 (22:39 +0000)]
MIR Parser: Use correct source locations for machine instruction diagnostics.

This commit translates the source locations for MIParser diagnostics from
the locations in the machine instruction string to the locations in the
MIR file.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 240474

9 years agoUpdate SafeStack TODO in the safestack.cc
Peter Collingbourne [Tue, 23 Jun 2015 22:26:48 +0000 (22:26 +0000)]
Update SafeStack TODO in the safestack.cc

This patch clarifies the TODO note at the top of safestack.cc and brings
it more in sync with what we (the CPI team) actually plan to work on in
the future.

Patch by Volodymyr Kuznetsov!

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

llvm-svn: 240473

9 years agoSafeStack documentation improvements
Peter Collingbourne [Tue, 23 Jun 2015 22:24:45 +0000 (22:24 +0000)]
SafeStack documentation improvements

This patch makes the following improvements to the SafeStack documentation:

Explicitly states the security guarantees of the SafeStack
Clarifies which of the security guarantees are probabilistic
Re-orders security limitations to put the most severe ones first
Explains how `__attribute__((no_sanitize("safe-stack")))` works and how to use it safely
Explains that SafeStack should be combined with a forward-edge protection mechanism, such as CPI, IFCC or others
Multiple readability and stylistic improvements

Patch by Volodymyr Kuznetsov!

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

llvm-svn: 240472

9 years agoDevirtualize Constant::destroyConstant.
Pete Cooper [Tue, 23 Jun 2015 21:55:11 +0000 (21:55 +0000)]
Devirtualize Constant::destroyConstant.

This reorganizes destroyConstant and destroyConstantImpl.

Now there is only destroyConstant in Constant itself, while
subclasses are required to implement destroyConstantImpl.

destroyConstantImpl no longer calls delete but is instead only
responsible for removing the constant from any maps in which it
is contained.

Reviewed by Duncan Exon Smith.

llvm-svn: 240471

9 years agoWorking on reconciling out-of-tree patches to compiler-rt for building for iOS.
Chris Bieneman [Tue, 23 Jun 2015 21:39:57 +0000 (21:39 +0000)]
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.

Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.

Darwin doesn't have _Unwind_VRS_Get, instead use _Unwind_GetIP directly.

Note: this change does not enable building for iOS, as there are more changes to come.

Reviewers: kubabrecka, bogner, samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

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

llvm-svn: 240470

9 years agoWorking on reconciling out-of-tree patches to compiler-rt for building for iOS.
Chris Bieneman [Tue, 23 Jun 2015 21:39:54 +0000 (21:39 +0000)]
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.

Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.

This change ifdefs out headers and functionality that aren't available on iOS, and adds support for iOS and the iOS simulator to as an.

Note: this change does not enable building for iOS, as there are more changes to come.

Reviewers: glider, kubabrecka, bogner, samsonov

Reviewed By: samsonov

Subscribers: samsonov, zaks.anna, llvm-commits

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

llvm-svn: 240469

9 years agoWorking on reconciling out-of-tree patches to compiler-rt for building for iOS.
Chris Bieneman [Tue, 23 Jun 2015 21:39:52 +0000 (21:39 +0000)]
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.

Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.

This change ifdefs out headers and functionality that aren't available on iOS.

Note: this change does not enable building for iOS, as there are more changes to come.

Reviewers: glider, kubabrecka, bogner, samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

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

llvm-svn: 240468

9 years agoWorking on reconciling out-of-tree patches to compiler-rt for building for iOS.
Chris Bieneman [Tue, 23 Jun 2015 21:39:49 +0000 (21:39 +0000)]
Working on reconciling out-of-tree patches to compiler-rt for building for iOS.

Summary:
This is one of many changes needed for compiler-rt to get it building on iOS.

This change does the following:
- Don't include crt_externs on iOS (it isn't available)
- Support ARM thread state objects

Note: this change does not enable building for iOS, as there are more changes to come.

Reviewers: glider, kubabrecka, bogner, samsonov

Reviewed By: samsonov

Subscribers: samsonov, aemerson, llvm-commits

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

llvm-svn: 240467

9 years agoImplement the "qSymbol" packet in order to be able to read queue information in debug...
Greg Clayton [Tue, 23 Jun 2015 21:27:50 +0000 (21:27 +0000)]
Implement the "qSymbol" packet in order to be able to read queue information in debugserver and return the info in the stop reply packets.

A "qSymbol::" is sent when shared libraries have been loaded by hooking into the Process::ModulesDidLoad() function from within ProcessGDBRemote. This function was made virtual so that the ProcessGDBRemote version is called, which then first calls the Process::ModulesDidLoad(), and then it queries for any symbol lookups that the remote GDB server might want to do.

This allows debugserver to request the "dispatch_queue_offsets" symbol so that it can read the queue name, queue kind and queue serial number and include this data as part of the stop reply packet. Previously each thread would have to do 3 memory reads in order to read the queue name.

This is part of reducing the number of packets that are sent between LLDB and the remote GDB server.

<rdar://problem/21494354>

llvm-svn: 240466

9 years ago[X86][SSE] Added full set of 128-bit vector shift tests.
Simon Pilgrim [Tue, 23 Jun 2015 21:18:15 +0000 (21:18 +0000)]
[X86][SSE] Added full set of 128-bit vector shift tests.

Removed some old duplicate tests.

llvm-svn: 240465

9 years ago[Driver] Give GnuTool LLVM_LIBRARY_VISIBILITY.
Benjamin Kramer [Tue, 23 Jun 2015 21:15:15 +0000 (21:15 +0000)]
[Driver] Give GnuTool LLVM_LIBRARY_VISIBILITY.

This is consistent with all other classes in Tools.h.

llvm-svn: 240464

9 years agoImprove error handling for PR22560.
Bob Wilson [Tue, 23 Jun 2015 21:10:24 +0000 (21:10 +0000)]
Improve error handling for PR22560.

The ARM _MoveToCoprocessor and _MoveFromCoprocessor builtins require
integer constants for most arguments, but clang was not checking that.
With this change, we now report meaningful errors instead of crashing
in the backend.

llvm-svn: 240463

9 years agoPR22560: Fix argument order for ARM _MoveToCoprocessor builtins.
Bob Wilson [Tue, 23 Jun 2015 21:10:15 +0000 (21:10 +0000)]
PR22560: Fix argument order for ARM _MoveToCoprocessor builtins.

The Microsoft-extension _MoveToCoprocessor and _MoveToCoprocessor2
builtins take the register value to be moved as the first argument,
but the corresponding mcr and mcr2 LLVM intrinsics expect that value
to be the third argument. Handle this as a special case, while still
leaving those intrinsics as generic MSBuiltins. I considered the
alternative of handling these in EmitARMBuiltinExpr, but that does
not work well for the follow-up change that I'm going to make to improve
the error handling for PR22560 -- we need the GetBuiltinType() checks
for ICEArguments, and the ARM version of that code is only used for
Neon intrinsics where the last argument is special and not
checked in the normal way.

llvm-svn: 240462

9 years agoFix the handling of the run lock in cases where you needed to run
Jim Ingham [Tue, 23 Jun 2015 21:02:45 +0000 (21:02 +0000)]
Fix the handling of the run lock in cases where you needed to run
a hand-called function from the private state thread.  The problem
was that on the way out of the private state thread, we try to drop
the run lock.  That is appropriate for the main private state thread,
but not the secondary private state thread.  Only the thread that
spawned them can know whether this is an appropriate thing to do or
not.

<rdar://problem/21375352>

llvm-svn: 240461

9 years agoLet llvm::ReplaceInstWithInst copy debug location from old to new instruction.
Alexey Samsonov [Tue, 23 Jun 2015 21:00:08 +0000 (21:00 +0000)]
Let llvm::ReplaceInstWithInst copy debug location from old to new instruction.

Currently some users of this function do this explicitly, and all the
rest forget to do this.

ThreadSanitizer was one of such users, and had missing debug
locations for calls into TSan runtime handling atomic operations,
eventually leading to poorly symbolized stack traces and malfunctioning
suppressions.

This is another change relevant to PR23837.

llvm-svn: 240460

9 years agoPass 2 more variables to lit tests.
Evgeniy Stepanov [Tue, 23 Jun 2015 20:57:26 +0000 (20:57 +0000)]
Pass 2 more variables to lit tests.

Pass ADB and ADB_SERIAL environment variables to lit tests.
This would allow running Android tests in compiler-rt when
there is more than one device attached to the host.

llvm-svn: 240459

9 years agoReplace srem by function call in nonaffine test cases
Tobias Grosser [Tue, 23 Jun 2015 20:55:05 +0000 (20:55 +0000)]
Replace srem by function call in nonaffine test cases

This makes the test cases nonaffine even if Polly some days gains support for
the srem instruction, an instruction which is currently not modeled but which
can clearly be modeled statically. A call to a function without definition
will always remain non-affine, as there is just insufficient static information
for it to be modeled more precisely.

llvm-svn: 240458

9 years agoAdd git patch files to .gitignore
Tobias Grosser [Tue, 23 Jun 2015 20:55:01 +0000 (20:55 +0000)]
Add git patch files to .gitignore

llvm-svn: 240457

9 years agoMark a couple of features as 'in progress'
Marshall Clow [Tue, 23 Jun 2015 20:48:55 +0000 (20:48 +0000)]
Mark a couple of features as 'in progress'

llvm-svn: 240456

9 years agoPedantically rename all Tool subclasses to be nouns, not verbs. NFC
Douglas Katzman [Tue, 23 Jun 2015 20:42:09 +0000 (20:42 +0000)]
Pedantically rename all Tool subclasses to be nouns, not verbs. NFC

Classes in Tools.h inherit ultimately from Tool, which is a noun,
but subclasses of Tool were named for their operation, such as "Compile",
wherein the constructor call "Compile(args...)" could be misconstrued
as actually causing a compile to happen.

Likewise various other methods were not harmonious with their effect,
in that "BuildLinker()" returned a "new namespace::Link(...)"
instead of a "new namespace::Linker(...)" which it now does.

Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names.
And there is no particulary great way to name the "Lipo-er" and a few others.

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

llvm-svn: 240455

9 years ago[lld] Add MachO thread-local storage support.
Lang Hames [Tue, 23 Jun 2015 20:35:31 +0000 (20:35 +0000)]
[lld] Add MachO thread-local storage support.

This allows LLD to correctly link MachO objects that use thread-local storage.

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

llvm-svn: 240454

9 years ago[MS ABI] Account for the virtual inheritance quirk when mangling
David Majnemer [Tue, 23 Jun 2015 20:34:18 +0000 (20:34 +0000)]
[MS ABI] Account for the virtual inheritance quirk when mangling

Virtual inheritance member pointers are always relative to the vbindex,
even when the member pointer doesn't point into a virtual base.  This is
corrected by adjusting the non-virtual offset backwards from the vbptr
back to the top of the most derived class.  While we performed this
adjustment when manifesting member pointers as constants or when
performing conversions, we didn't perform the adjustment when mangling
them.

llvm-svn: 240453

9 years agoInstrProf: Fix a crash when an implicit def appears in a macro
Justin Bogner [Tue, 23 Jun 2015 20:29:09 +0000 (20:29 +0000)]
InstrProf: Fix a crash when an implicit def appears in a macro

llvm-svn: 240452

9 years agoRemove a few uses of lldb.target, which is not valid
Jim Ingham [Tue, 23 Jun 2015 20:26:45 +0000 (20:26 +0000)]
Remove a few uses of lldb.target, which is not valid
in a scripted command.

llvm-svn: 240451

9 years agoFix incorrect truncation at the overflow boundary
Pirama Arumuga Nainar [Tue, 23 Jun 2015 20:24:53 +0000 (20:24 +0000)]
Fix incorrect truncation at the overflow boundary

Summary:
This patch fixes incorrect truncation when the input wider value is
exactly 2^dstBits.  For that value, the overflow to infinity is not
correctly handled.  The fix is to replace a strict '>' with '>='.

Currently,
__truncdfsf2(340282366900000000000000000000000000000.0) returns infinity
__truncdfsf2(340282366920938463463374607431768211456.0) returns 0
__truncdfsf2(400000000000000000000000000000000000000.0) returns infinity

Likewise, __truncdfhf2 and __truncsfhf2 (and consequently gnu_f2h_ieee)
are discontinuous at 65536.0.

This patch adds tests for all three cases, along with adding a missing
header include to fp_test.h.

Reviewers: joerg, ab, srhines

Subscribers: llvm-commits

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

llvm-svn: 240450

9 years ago[msan] Mark one test as only supported on x86
Jay Foad [Tue, 23 Jun 2015 20:17:45 +0000 (20:17 +0000)]
[msan] Mark one test as only supported on x86

Summary: This test uses x86 intrinsics, so it can't work on other platforms.

Reviewers: garious, eugenis, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 240449

9 years agoRevert "[FaultMaps] Move FaultMapParser to Object/"
Sanjoy Das [Tue, 23 Jun 2015 20:09:03 +0000 (20:09 +0000)]
Revert "[FaultMaps] Move FaultMapParser to Object/"

This reverts commit r240364 (git c49542e5bb186).  The issue r240364 was
trying to fix was fixed independently in r240362.

llvm-svn: 240448

9 years agoCOFF: Fix null pointer dereference.
Peter Collingbourne [Tue, 23 Jun 2015 20:02:31 +0000 (20:02 +0000)]
COFF: Fix null pointer dereference.

llvm-svn: 240447

9 years ago[MachO] Initialize all fields of NormalizedFile.
Benjamin Kramer [Tue, 23 Jun 2015 19:55:04 +0000 (19:55 +0000)]
[MachO] Initialize all fields of NormalizedFile.

The ObjectFileYAML.roundTrip serializes a default-constructed
NormalizedFile to YAML, triggering uninitialized memory reads.

While there use in-class member initializers.

llvm-svn: 240446

9 years agoAdd missing dependencies for the CMake shared lld build.
Benjamin Kramer [Tue, 23 Jun 2015 19:54:57 +0000 (19:54 +0000)]
Add missing dependencies for the CMake shared lld build.

llvm-svn: 240445

9 years agoFix FIXME comments in MiBreakTestCase.test_lldbmi_break_insert_settings as suggested...
Dawn Perchik [Tue, 23 Jun 2015 19:21:44 +0000 (19:21 +0000)]
Fix FIXME comments in MiBreakTestCase.test_lldbmi_break_insert_settings as suggested by abidh (MI)

llvm-svn: 240444

9 years agoMake the typo resolution in r240441 apply to all function calls.
Kaelyn Takata [Tue, 23 Jun 2015 19:13:17 +0000 (19:13 +0000)]
Make the typo resolution in r240441 apply to all function calls.

Regular function calls (such as to cabs()) run into the same problem
with handling dependent exprs, not just builtins with custom type
checking.

Fixes PR23775.

llvm-svn: 240443

9 years agoAdding the missing LTO API to lto.exports
Steven Wu [Tue, 23 Jun 2015 18:56:48 +0000 (18:56 +0000)]
Adding the missing LTO API to lto.exports

Summary:
lto_codegen_set_should_embed_uselists is introduced in r235943 but not
added to lto.exports. Add to export list to expose the API.

Reviewers: dexonsmith

Subscribers: rafael, llvm-commits

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

llvm-svn: 240442

9 years agoEnsure delayed typos have been corrected in calls to builtins before
Kaelyn Takata [Tue, 23 Jun 2015 18:42:21 +0000 (18:42 +0000)]
Ensure delayed typos have been corrected in calls to builtins before
checking those calls when not in C++ mode, since those code paths can't
handle dependent exprs.

Fixes PR23740.

llvm-svn: 240441

9 years agoAdd support for displaying the language in the frame-format string.
Dawn Perchik [Tue, 23 Jun 2015 18:35:31 +0000 (18:35 +0000)]
Add support for displaying the language in the frame-format string.

Enable ${language} to be specified in the frame-format string to see
the current frame's compile unit language in "frame info".

Test Plan:
debug a C++ program, run to main, and run the lldb commands:
    settings set frame-format "frame lang=${language}\n"
    frame info
you should see:
    frame lang=c++
test case added in:
    ./dotest.py --executable lldb -f SettingsCommandTestCase.test_set_frame_format
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10561

llvm-svn: 240440

9 years agoDon't pass a 32 bit value to "%08" PRIx64.
Rafael Espindola [Tue, 23 Jun 2015 18:34:25 +0000 (18:34 +0000)]
Don't pass a 32 bit value to "%08" PRIx64.

Should fix the arm bots.

llvm-svn: 240439

9 years agoThis change fixes three bugs in loop unswitching. This change causes an 81% speed...
Mark Heffernan [Tue, 23 Jun 2015 18:26:50 +0000 (18:26 +0000)]
This change fixes three bugs in loop unswitching. This change causes an 81% speed-up on a benchmark that is based on EigenConvolutionKernel2D from Eigen3, where the lack of loop unswitching blocks hoisting of loads out of a nested loop (see bug 23816 for how loop unswitching and load hoisting are related).

Change 1: Unswitching on trivial conditions should always happen regardless of the computed unswitching cost, as really the cost is zero. While there is code to make that happen, the logic that checks the unswitching cost against a threshold was moved to an earlier point (revision 147935) than the point where trivial unswitching is detected, so trivial unswitching is currently blocked by the cost threshold. This change fixes that.

Change 2: Before revision 147935 (from 2012-01-11), the threshold parameter was a per-loop threshold. So an unswitching happened only if the cost of the unswitching was less than the threshold. In an indirect way (and I believe unintentionally), the logic for this since then has been that the threshold is an over-all budget across all loops for all loop unswitching done by a given LoopUnswitch loop pass object. So if an unswitching with cost 100 happens in one function, that in effect reduces the threshold from 100 to 0 for the loops even in another function. This persists for the lifetime of that loop pass object. This makes no difference for most small examples but it is important for large examples. This revision fixes that.

Change 3: The cost is currently calculated as std::min(NumInstructions, 5 * NumBlocks). So a loop with 2 blocks and a million instructions will have an unswitching cost of 10. I changed this to just NumInstructions, as it were before revision 147935, though I'm open to e.g. instead replacing std::min with std::max.

I've tried to make the change minimally invasive while staying with what I think was the original intent of the code.
Submitted on behalf of broune@.

llvm-svn: 240438

9 years ago[NVPTX] Added missing test case for llvm.nvvm.sqrt.f NVPTX intrinsic
Artem Belevich [Tue, 23 Jun 2015 18:22:17 +0000 (18:22 +0000)]
[NVPTX] Added missing test case for llvm.nvvm.sqrt.f NVPTX intrinsic

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

llvm-svn: 240437

9 years agoADT: Add a string APSInt constructor.
Alex Lorenz [Tue, 23 Jun 2015 18:22:10 +0000 (18:22 +0000)]
ADT: Add a string APSInt constructor.

This commit moves the APSInt initialization code that's used by
the LLLexer class into a new APSInt constructor that constructs
APSInts from strings.

This change is useful for MIR Serialization, as it would allow
the MILexer class to use the same APSInt initialization as
LLexer when parsing immediate machine operands.

llvm-svn: 240436

9 years agoMark SBFrame::GetFunctionName and SBFrame::IsInlined as const.
Oleksiy Vyalov [Tue, 23 Jun 2015 18:21:55 +0000 (18:21 +0000)]
Mark SBFrame::GetFunctionName and SBFrame::IsInlined as const.

llvm-svn: 240435

9 years agoUse AddString/ReadString instead of doing it manually NFC
Ben Langmuir [Tue, 23 Jun 2015 18:20:23 +0000 (18:20 +0000)]
Use AddString/ReadString instead of doing it manually NFC

llvm-svn: 240434

9 years ago[Modules] Consider -fmodule-feature in module hash and when loading
Ben Langmuir [Tue, 23 Jun 2015 18:20:18 +0000 (18:20 +0000)]
[Modules] Consider -fmodule-feature in module hash and when loading

Any extra features from -fmodule-feature are part of the module hash and
need to get validated on load.  Also print them with -module-file-info.

llvm-svn: 240433

9 years agoDriver: Pass -I options to cc1as for .include search paths.
Jim Grosbach [Tue, 23 Jun 2015 18:20:13 +0000 (18:20 +0000)]
Driver: Pass -I options to cc1as for .include search paths.

llvm-svn: 240432

9 years agoPass -m to the linker in this test.
Rafael Espindola [Tue, 23 Jun 2015 18:04:54 +0000 (18:04 +0000)]
Pass -m to the linker in this test.

Fixes the test on a ppc host.

llvm-svn: 240431

9 years agoAdding a title to appease the sphinx build bot.
Aaron Ballman [Tue, 23 Jun 2015 17:31:30 +0000 (17:31 +0000)]
Adding a title to appease the sphinx build bot.

llvm-svn: 240430

9 years agoFix build breakage after llvm r240426
Pavel Labath [Tue, 23 Jun 2015 17:15:14 +0000 (17:15 +0000)]
Fix build breakage after llvm r240426

Test Plan: It builds, tests pass.

Reviewers: tstellarAMD, rafael

Subscribers: lldb-commits

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

llvm-svn: 240429

9 years agoAttributeReference.rst is automatically generated by a server-side process currently...
Aaron Ballman [Tue, 23 Jun 2015 17:14:51 +0000 (17:14 +0000)]
AttributeReference.rst is automatically generated by a server-side process currently. To cut down on accidental commits to this file that are not properly reflected in AttrDocs.td (such as r215806 - r215808), this file now contains nothing but a comment explaining the current state of affairs.

llvm-svn: 240428

9 years agoAsmParser: Extend the API to make the global value and metadata node slot mappings...
Alex Lorenz [Tue, 23 Jun 2015 17:10:10 +0000 (17:10 +0000)]
AsmParser: Extend the API to make the global value and metadata node slot mappings publicly accessible.

This commit creates a new structure called 'SlotMapping' in the AsmParser library.
This structure can be passed into the public parsing APIs from the AsmParser library
in order to extract the data structures that map from slot numbers to unnamed global
values and metadata nodes.

This change is useful for MIR Serialization, as the MIR Parser has to lookup the
unnamed global values and metadata nodes by their slot numbers.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 240427

9 years agoELF: Fix defintion of STT_LOOS and STT_HIOS.
Tom Stellard [Tue, 23 Jun 2015 16:41:57 +0000 (16:41 +0000)]
ELF: Fix defintion of STT_LOOS and STT_HIOS.

Reviewers: chandlerc, Bigcheese, rafael

Subscribers: llvm-commits

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

llvm-svn: 240426

9 years agoMIR Serialization: Serialize physical register machine operands.
Alex Lorenz [Tue, 23 Jun 2015 16:35:26 +0000 (16:35 +0000)]
MIR Serialization: Serialize physical register machine operands.

This commit introduces functionality that's used to serialize machine operands.
Only the physical register operands are serialized by this commit.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 240425

9 years ago[ARM] ARMLoadStoreOpt::UpdateBaseRegUses should stop on def
John Brawn [Tue, 23 Jun 2015 16:02:11 +0000 (16:02 +0000)]
[ARM] ARMLoadStoreOpt::UpdateBaseRegUses should stop on def

When UpdateBaseRegUses sees an instruction that defines the base
register it must stop, as the base register value it is updating is no
longer live. Ideally we would already have seen the register be killed
(which is already checked for), but the kill flags may be inaccurate
and we have to account for this.

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

llvm-svn: 240424

9 years agoobjdump: Don't print a (always 0) size for MachO symbols.
Rafael Espindola [Tue, 23 Jun 2015 15:45:38 +0000 (15:45 +0000)]
objdump: Don't print a (always 0) size for MachO symbols.

Only common symbol on MachO and COFF have a size.

For COFF we already had a custom format.

For MachO, there is no native objdump and we were printing it as ELF. Now
we only print the sizes for symbols that actually have them.

llvm-svn: 240422

9 years agoSystemZ: Avoid left shifting negative values (it's UB)
Justin Bogner [Tue, 23 Jun 2015 15:38:24 +0000 (15:38 +0000)]
SystemZ: Avoid left shifting negative values (it's UB)

Found by ubsan.

llvm-svn: 240420

9 years ago[Option] Plug a leak when move-assigning an InputArgList.
Benjamin Kramer [Tue, 23 Jun 2015 15:28:10 +0000 (15:28 +0000)]
[Option] Plug a leak when move-assigning an InputArgList.

The class has a non-trivial dtor so we have to clean up before we move
in new members. Remove misleading comment as a default move assignment
operator will never be synthesized for this class.

llvm-svn: 240417

9 years agoMake helper functions static. NFC.
Benjamin Kramer [Tue, 23 Jun 2015 14:51:40 +0000 (14:51 +0000)]
Make helper functions static. NFC.

llvm-svn: 240416

9 years ago[BranchFolding] Document why replacing HashMachineInstr with hash_code doesn't work
Benjamin Kramer [Tue, 23 Jun 2015 14:47:36 +0000 (14:47 +0000)]
[BranchFolding] Document why replacing HashMachineInstr with hash_code doesn't work

llvm-svn: 240415

9 years ago[MachineBasicBlock] Add getFirstNonDebugInstr to complement getLastNonDebugInstr
Benjamin Kramer [Tue, 23 Jun 2015 14:47:29 +0000 (14:47 +0000)]
[MachineBasicBlock] Add getFirstNonDebugInstr to complement getLastNonDebugInstr

Use it in CodeGen where applicable. No functionality change intended.

llvm-svn: 240414

9 years ago[MachineBasicBlock] Use the const_cast(this) trick to reduce duplication
Benjamin Kramer [Tue, 23 Jun 2015 14:47:18 +0000 (14:47 +0000)]
[MachineBasicBlock] Use the const_cast(this) trick to reduce duplication

NFC.

llvm-svn: 240413

9 years agoWhen building libc++, we use '"' as a delimiter instead of '<' when including libc...
Marshall Clow [Tue, 23 Jun 2015 14:45:02 +0000 (14:45 +0000)]
When building libc++, we use '"' as a delimiter instead of '<' when including libc++ header files. This is so that the dylib gets built with our headers; rather than the system-installed ones. We do this in most places already, just fixing a couple of inconsistent uses.

llvm-svn: 240412

9 years agoBe sure to set the DataLayout before checking the cache.
Rafael Espindola [Tue, 23 Jun 2015 14:42:34 +0000 (14:42 +0000)]
Be sure to set the DataLayout before checking the cache.

This makes sure the same mangling is used.

Should fix the OS X bots.

llvm-svn: 240411

9 years ago[mips] [IAS] Add partial support for the ULHU pseudo-instruction.
Toma Tabacu [Tue, 23 Jun 2015 14:39:42 +0000 (14:39 +0000)]
[mips] [IAS] Add partial support for the ULHU pseudo-instruction.

Summary:
This only adds support for ULHU of an immediate address with/without a source register.
It does not include support for ULHU of the address of a symbol.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 240410

9 years ago[OPENMP] Initial support for 'depend' clause (4.0).
Alexey Bataev [Tue, 23 Jun 2015 14:25:19 +0000 (14:25 +0000)]
[OPENMP] Initial support for 'depend' clause (4.0).

Parsing and sema analysis (without support for array sections in arguments) for 'depend' clause (used in 'task' directive, OpenMP 4.0).

llvm-svn: 240409

9 years agoRemove unused arguments and move ManglerPrefixTy to the implementation.
Rafael Espindola [Tue, 23 Jun 2015 14:11:09 +0000 (14:11 +0000)]
Remove unused arguments and move ManglerPrefixTy to the implementation.

llvm-svn: 240408

9 years ago[mips] [IAS] Add support for generating DADDu to createAddu(). NFC.
Toma Tabacu [Tue, 23 Jun 2015 14:00:54 +0000 (14:00 +0000)]
[mips] [IAS] Add support for generating DADDu to createAddu(). NFC.

Summary: This isn't used right now, but it will be in some upcoming changes.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 240407

9 years agoUpdate for LLVM api change.
Rafael Espindola [Tue, 23 Jun 2015 13:59:36 +0000 (13:59 +0000)]
Update for LLVM api change.

llvm-svn: 240406

9 years agoSimplify the Mangler interface now that DataLayout is mandatory.
Rafael Espindola [Tue, 23 Jun 2015 13:59:29 +0000 (13:59 +0000)]
Simplify the Mangler interface now that DataLayout is mandatory.

We only need to pass in a DataLayout when mangling a raw string, not when
constructing the mangler.

llvm-svn: 240405

9 years ago[mips64] Emit correct addend for some PC-relative relocations
Petar Jovanovic [Tue, 23 Jun 2015 13:54:42 +0000 (13:54 +0000)]
[mips64] Emit correct addend for some PC-relative relocations

So far, LLVM has not emitted correct addend for N64 and N32 ABI. This patch
fixes that. It also removes fixup from MCJIT for R_MIPS_PC16 relocation.

Patch by Vladimir Radosavljevic.

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

llvm-svn: 240404

9 years ago[Hexagon] Use MF reference from parent class in HexagonPacketizerList
Krzysztof Parzyszek [Tue, 23 Jun 2015 13:50:23 +0000 (13:50 +0000)]
[Hexagon] Use MF reference from parent class in HexagonPacketizerList

llvm-svn: 240403

9 years agoMoving r215806, r215807, and r215808 into AttrDocs.td. These changes were originally...
Aaron Ballman [Tue, 23 Jun 2015 13:41:03 +0000 (13:41 +0000)]
Moving r215806, r215807, and r215808 into AttrDocs.td. These changes were originally applied to the RST file that is automatically generated by the server, and so the changes were never properly reflected online once the server overwrote AttributeReference.rst.

llvm-svn: 240402

9 years agoFixing a build bot break from r240400.
Aaron Ballman [Tue, 23 Jun 2015 13:29:33 +0000 (13:29 +0000)]
Fixing a build bot break from r240400.

llvm-svn: 240401

9 years agoClarify pointer ownership semantics by hoisting the std::unique_ptr creation to the...
Aaron Ballman [Tue, 23 Jun 2015 13:15:32 +0000 (13:15 +0000)]
Clarify pointer ownership semantics by hoisting the std::unique_ptr creation to the caller instead of hiding it in emitReport. NFC.

llvm-svn: 240400

9 years ago[clang-tidy] Fix false positives in misc-macro-parentheses checker
Daniel Marjamaki [Tue, 23 Jun 2015 12:45:14 +0000 (12:45 +0000)]
[clang-tidy] Fix false positives in misc-macro-parentheses checker

llvm-svn: 240399

9 years ago[mips] [IAS] Move some function definitions to MipsTargetStreamer.cpp. NFC.
Toma Tabacu [Tue, 23 Jun 2015 12:34:19 +0000 (12:34 +0000)]
[mips] [IAS] Move some function definitions to MipsTargetStreamer.cpp. NFC.

Summary: For the sake of consistency and to make some upcoming changes a little less noisy.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 240398

9 years agoAdd handling of async notify packets
Ewan Crawford [Tue, 23 Jun 2015 12:32:06 +0000 (12:32 +0000)]
Add handling of async notify packets

This patch adds a listener to the AynscThread in ProcessGDBRemote, specifically for dealing with any async notification packets.

From the broadcast our listener receives we can process the notify packet from the event data. A handler function then sets the thread stop info from this packet, and updates lldb by setting the process private state to stopped. Allowing the async thread to go back to sleep and getting the main thread to handle the implications of a state change.

When sending a vCont in nonstop mode we also get a different reply from all-stop mode, an OK response as opposed to a stop reply. So a condition is added to handle this and set the process state without the stop-reply data.

Reviewers: clayborg

Subscribers: lldb-commits, labath, ted, aidan.dodds, deepak2427

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

llvm-svn: 240397

9 years agoDon't repeat names in comments.
Rafael Espindola [Tue, 23 Jun 2015 12:29:52 +0000 (12:29 +0000)]
Don't repeat names in comments.

llvm-svn: 240396

9 years agoUse MCSymbols for FastISel.
Rafael Espindola [Tue, 23 Jun 2015 12:21:54 +0000 (12:21 +0000)]
Use MCSymbols for FastISel.

The summary is that it moves the mangling earlier and replaces a few
calls to .addExternalSymbol with addSym.

I originally wanted to replace all the uses of addExternalSymbol with
addSym, but noticed it was a lot of work and doesn't need to be done
all at once.

llvm-svn: 240395

9 years agoRevert r240302 ("Bring r240130 back.").
Daniel Jasper [Tue, 23 Jun 2015 11:31:32 +0000 (11:31 +0000)]
Revert r240302 ("Bring r240130 back.").

This causes errors like:

  ld: error: blah.o: requires dynamic R_X86_64_PC32 reloc against '' which
  may overflow at runtime; recompile with -fPIC
  blah.cc:function f(): error: undefined reference to ''
  blah.o:g(): error: undefined reference to ''

I have not yet come up with an appropriate reproduction.

llvm-svn: 240394

9 years agoRevert r240271 (Fixed/added namespace ending comments using clang-tidy. NFC)
Alexander Kornienko [Tue, 23 Jun 2015 10:48:35 +0000 (10:48 +0000)]
Revert r240271 (Fixed/added namespace ending comments using clang-tidy. NFC)

llvm-svn: 240393

9 years ago[mips] llvm-readobj can parse .MIPS.abiflags. No need to check the bytes.
Daniel Sanders [Tue, 23 Jun 2015 10:11:36 +0000 (10:11 +0000)]
[mips] llvm-readobj can parse .MIPS.abiflags. No need to check the bytes.

Summary:

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: llvm-commits

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

llvm-svn: 240392

9 years agoFix a warning. [-Wsign-compare]
NAKAMURA Takumi [Tue, 23 Jun 2015 10:01:20 +0000 (10:01 +0000)]
Fix a warning. [-Wsign-compare]

FIXME: Should "Level" be unsigned?
llvm-svn: 240391

9 years agoRevert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Alexander Kornienko [Tue, 23 Jun 2015 09:49:53 +0000 (09:49 +0000)]
Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)

Apparently, the style needs to be agreed upon first.

llvm-svn: 240390

9 years agoSilence VC warning C4715: '`anonymous namespace'::getNativeVectorSizeForA VXABI' :
Yaron Keren [Tue, 23 Jun 2015 09:45:42 +0000 (09:45 +0000)]
Silence VC warning C4715: '`anonymous namespace'::getNativeVectorSizeForA VXABI' :
not all control paths return a value.

llvm-svn: 240389

9 years agoWrite output file to temp directory. The tests shouldn't assume that
Daniel Jasper [Tue, 23 Jun 2015 09:26:37 +0000 (09:26 +0000)]
Write output file to temp directory. The tests shouldn't assume that
they can write to the current working directory.

llvm-svn: 240388

9 years agoTweak clang/test/Modules/modules-with-same-name.m to run with GnuWin32's find.exe...
NAKAMURA Takumi [Tue, 23 Jun 2015 08:37:21 +0000 (08:37 +0000)]
Tweak clang/test/Modules/modules-with-same-name.m to run with GnuWin32's find.exe on newer version of Windows.

It seems "*.pcm" would be expanded with current directory by NTOS 6.x's msvcrt. GnuWin32 utils are affected.
To avoid the issue, put an expression that msvcrt's glob won't match, like "*.pc[m]".

llvm-svn: 240387

9 years agoAVX-512: Added all forms of VPABS instruction
Elena Demikhovsky [Tue, 23 Jun 2015 08:19:46 +0000 (08:19 +0000)]
AVX-512: Added all forms of VPABS instruction
Added all intrinsics, tests for encoding, tests for intrinsics.

llvm-svn: 240386

9 years agoMCExpr: Avoid UB by evaluating this shift as unsigned
Justin Bogner [Tue, 23 Jun 2015 07:32:55 +0000 (07:32 +0000)]
MCExpr: Avoid UB by evaluating this shift as unsigned

We hit undefined behaviour in some MCExpr tests when the LHS of a left
shift is -1. Twos-complement semantics are completely reasonable here,
so we should just do the shift in unsigned.

llvm-svn: 240385

9 years ago[MS ABI] Rework member pointer conversion
David Majnemer [Tue, 23 Jun 2015 07:31:11 +0000 (07:31 +0000)]
[MS ABI] Rework member pointer conversion

Member pointers in the MS ABI are made complicated due to the following:
- Virtual methods in the most derived class (MDC) might live in a
  vftable in a virtual base.
- There are four different representations of member pointer: single
  inheritance, multiple inheritance, virtual inheritance and the "most
  general" representation.
- Bases might have a *more* general representation than classes which
  derived from them, a most surprising result.

We believed that we could treat all member pointers as-if they were a
degenerate case of the multiple inheritance model.  This fell apart once
we realized that implementing standard member pointers using this ABI
requires referencing members with a non-zero vbindex.

On a bright note, all but the virtual inheritance model operate rather
similarly.  The virtual inheritance member pointer representation
awkwardly requires a virtual base adjustment in order to refer to
entities in the MDC.

However, the first virtual base might be quite far from the start of the
virtual base.  This means that we must add a negative non-virtual
displacement.

However, things get even more complicated.  The most general
representation interprets vbindex zero differently from the virtual
inheritance model: it doesn't reference the vbtable at all.

It turns out that this complexity can increase for quite some time:
consider a derived to base conversion from the most general model to the
multiple inheritance model...

To manage this complexity we introduce a concept of "normalized" member
pointer which allows us to treat all three models as the most general
model.  Then we try to figure out how to map this generalized member
pointer onto the destination member pointer model.  I've done my best to
furnish the code with comments explaining why each adjustment is
performed.

This fixes PR23878.

llvm-svn: 240384

9 years ago[MS ABI] Refactor member pointer generation
David Majnemer [Tue, 23 Jun 2015 07:31:07 +0000 (07:31 +0000)]
[MS ABI] Refactor member pointer generation

The MS ABI has very complicated member pointers.  Don't attempt to
synthesize the final member pointer ab ovo usque ad mala in one go.

Instead, start with a member pointer which points to the declaration in
question as-if it's decl context was the target class.  Then, utilize
our conversion logical to convert it to the target type.

This allows us to simplify how we think about member pointers because we
don't need to consider non-zero nv adjustments before we even generate
the member pointer.  Furthermore, it gives our adjustment logic more
exposure by utilizing it in a common path.

llvm-svn: 240383

9 years ago[CodeGen] Rename EmitMemberPointer to EmitMemberFunctionPointer
David Majnemer [Tue, 23 Jun 2015 07:31:01 +0000 (07:31 +0000)]
[CodeGen] Rename EmitMemberPointer to EmitMemberFunctionPointer

llvm-svn: 240382

9 years ago[mips] Fix some UB by shifting before sign-extending
Justin Bogner [Tue, 23 Jun 2015 07:28:57 +0000 (07:28 +0000)]
[mips] Fix some UB by shifting before sign-extending

Avoid shifting a negative value by sign-extending after the shift.

Fixes a couple of tests that were failing under ubsan.

llvm-svn: 240381

9 years agotest: Move target dependent test in their own folder for c API test
Justin Bogner [Tue, 23 Jun 2015 06:46:54 +0000 (06:46 +0000)]
test: Move target dependent test in their own folder for c API test

Dissasembly tests depends on target. The problem is that it disable
all tests if all targets are not compiled. This moves things around in
order to get target specific code in a target specific folder.

Patch by Amaury Sechet. Thanks!

llvm-svn: 240380

9 years ago[Sanitizers] Pass the correct arch to the symbolizer for x86_64h
Frederic Riss [Tue, 23 Jun 2015 05:35:19 +0000 (05:35 +0000)]
[Sanitizers] Pass the correct arch to the symbolizer for x86_64h

I have no idea how to directly test that as it depends on a particular
(micro-)architecure of the host processor.
Combined with llvm's r240339 this should fix issues people might have
be seeing intermitently on Darwin haswell machines (the symbolizer
would use the wrong slice of the binary, thus potentially resolving
to the wrong symbol).

llvm-svn: 240379

9 years agoFix PR13851: Preserve metadata for the unswitched branch
Weiming Zhao [Tue, 23 Jun 2015 05:31:09 +0000 (05:31 +0000)]
Fix PR13851: Preserve metadata for the unswitched branch

This patch copies the metadata of the unswitched branch to the newly
crreated branch in loop unswitch pass.

llvm-svn: 240378