platform/upstream/llvm.git
9 years agoFixed TestInferiorCrashing failures
Chaoren Lin [Tue, 3 Feb 2015 01:51:05 +0000 (01:51 +0000)]
Fixed TestInferiorCrashing failures

LLGS debugging is outputting different thread stop reasons than
local linux debugging.  The stop reasons are reasonable so I've left
left them alone.  Might update them to match darwin in the future.

llvm-svn: 227920

9 years agoAdded support for writing registers larger than 64 bits
Chaoren Lin [Tue, 3 Feb 2015 01:51:03 +0000 (01:51 +0000)]
Added support for writing registers larger than 64 bits

llvm-svn: 227919

9 years agoLLGS local - signal stops inferior in debugger
Chaoren Lin [Tue, 3 Feb 2015 01:51:02 +0000 (01:51 +0000)]
LLGS local - signal stops inferior in debugger

NativeProcessLinux::MonitorSignal was automatically resuming threads
that stopped due to a signal.  This is inconsistent with the
behavior of lldb and gdb.  This change removes the automatic resume.

Fixes
TestSendSignal.py
TestSignalsAPI.py
if PLATFORM_LINUX_FORCE_LLGS_LOCAL is in the environment vars.

llvm-svn: 227918

9 years agoFix up NativeProcessLinux::Interrupt() to use thread state coordinator mechanism.
Chaoren Lin [Tue, 3 Feb 2015 01:51:00 +0000 (01:51 +0000)]
Fix up NativeProcessLinux::Interrupt() to use thread state coordinator mechanism.

llvm-svn: 227917

9 years agoAdded code to prevent "administrative stop" from overwriting a real stop reason.
Chaoren Lin [Tue, 3 Feb 2015 01:50:57 +0000 (01:50 +0000)]
Added code to prevent "administrative stop" from overwriting a real stop reason.

Note this code path should not happen - it implies a bug in another part of
the code.  For the thread to receive the stop signal as it is handled, the
and for it to already have a stop reason, it implies the kernel was able to
tell the thread that it stopped while it was stopped.  More likely this
seems to indicate a bug where an actual thread start was not getting correctly
logged.  If it does get hit, we'll want to understand the sequence to figure
out if it is truly legitimate or if it implies another bug.

llvm-svn: 227916

9 years agoFix step commands that mix running threads and stepping threads.
Chaoren Lin [Tue, 3 Feb 2015 01:50:56 +0000 (01:50 +0000)]
Fix step commands that mix running threads and stepping threads.

This fixes https://github.com/tfiala/lldb/issues/62.

llvm-svn: 227915

9 years agoDisabled local-llgs hijacking of state on startup; passed along signo to killed process.
Chaoren Lin [Tue, 3 Feb 2015 01:50:54 +0000 (01:50 +0000)]
Disabled local-llgs hijacking of state on startup; passed along signo to killed process.

It looks like Shawn's fix addresses what the initial hijacking was trying
to accomplish per conversations with Greg and Jim.  The hijacking was
causing several tests to hang (#61, #62, #63, #64, #67, possibly more).
These tests now just fail rather than hang with this modification.

llvm-svn: 227914

9 years agoFix some bugs in llgs thread state handling.
Chaoren Lin [Tue, 3 Feb 2015 01:50:51 +0000 (01:50 +0000)]
Fix some bugs in llgs thread state handling.

* When the thread state coordinator is told to skip sending a stop request
  for a running thread that is ignored (e.g. the thread that steps in a
  step operation is technically running and should not have a stop sent
  to it, since it will stop of its own accord per the kernel step operation),
  ensure the deferred signal notification logic still waits for the
  skipped thread.  (i.e. we want to defer the notification until the
  stepping thread is indeed stopped, we just don't want to send it a tgkill).

* Add ThreadStateCoordinator::RequestResumeAsNeeded().  This variant of the
  RequestResume() method does not call the error function when the thread
  is already running.  Instead, it just logs that the thread is already
  running and skips the resume operation.  This is useful for the case of
  vCont;c handling, where we tell all threads that they should be running.
  At the place we're calling, all we know is "we want this thread running if
  it isn't already," and that's exactly what this command does.

* Formatting change (minor) in NativeThreadLinux logging.

llvm-svn: 227913

9 years agollgs: more work on thread stepping.
Chaoren Lin [Tue, 3 Feb 2015 01:50:49 +0000 (01:50 +0000)]
llgs: more work on thread stepping.

See https://github.com/tfiala/lldb/issues/75.  Not fixed yet but
continuing to push this further.

Fixes:
* Resume() now skips doing deferred notifications if we're doing a
  vCont;{c,C}.  In this case, we're trying to start something up,
  not defer a stop notification.  The default thread action stop
  mode pickup was triggering a stop because it had at least one
  stop, which was wrong in the case of a continue.  (Bug introduced
  by previous change.)

* Added a variant to ThreadStateCoordinator to specify a set of
  thread ids to be skipped when triggering stop notifications to
  non-stopped threads on a deferred signal call.  For the case of
  a stepping thread, it is actually told to step (and is running)
  for a brief moment, but the thread state coordinator would think
  it needed to send the stepping thread a stop, which id doesn't
  need to do.  This facility allows me to get around that cleanly.

With this change, behavior is now reduced to something I think is
essentially a different bug:

* Doing a step into libc code from my code crashes llgs.
* Doing a next out of a function in my own code crashes llgs.

llvm-svn: 227912

9 years agollgs: fix up some handling of stepping.
Chaoren Lin [Tue, 3 Feb 2015 01:50:46 +0000 (01:50 +0000)]
llgs: fix up some handling of stepping.

Tracked down while working on https://github.com/tfiala/lldb/issues/75.
This is not a complete fix for that issue, but moves us farther along.

Fixes:
* When a thread step is requested via vCont:{s,S}, Resume() now marks
  the stepping thread as (1) currently stepping and (2) does trigger
  the deferred signal for the stepped thread.  This fixes a bug where
  we were actually triggering a deferred stop cycle here for the non-stepping
  thread since the single step thread was not part of the Resume()
  deferred signal mechanism.  The stepping thread is also marked in
  the thread state coordinator as running (via a resume callback).

* When we get the SIGTRAP signal for the step completion, we don't
  do a deferred signal call - that happened during the vCont:{s,S}
  processing in Resume() already.  Now we just need to mark that
  the stepping thread is now stopped.  If this is the last thread
  in the set that needs to stop, it will trigger the process/delegate
  stop call that will notify lldb.  Otherwise, that'll happen when
  the final thead we're waiting for stops.

Misc:
* Fixed up thread stop logging to use a leading 0 (0x%PRIx32) so
  we don't get log lines like 0x5 for 0x05 SIGTRAP.

llvm-svn: 227911

9 years agollgs: fixed a bug in deferred signal thread id; added coordinator enqueue logging.
Chaoren Lin [Tue, 3 Feb 2015 01:50:44 +0000 (01:50 +0000)]
llgs: fixed a bug in deferred signal thread id; added coordinator enqueue logging.

The deferred signal thread id was being set with the process id
unintentionally in NativeProcessLinux::CallAfterRunningThreadsStop().

llvm-svn: 227910

9 years agoGet initial thread state coordinator integration working.
Chaoren Lin [Tue, 3 Feb 2015 01:50:42 +0000 (01:50 +0000)]
Get initial thread state coordinator integration working.

* Fixed bug in run loop where run loop return enum was being treated
  erroneously like an int, causing the TSC event loop to terminate
  prematurely.

* Added an explicit scope in NativeProcessLinux::Resume() for the
  threads lock lifetime.  (This was likely unnecessary but is
  more explicit.)

* Fixed a bug in ThreadStateCoordinator where resume execution was
  not updating the internal state about the thread assumed to be
  running now.  I'll add a test and upstream this in a moment.

* Added a verbose logging mechanism to event processing within
  ThreadStateCoordinator.  It is currently enabled when the
  'log enable lldb thread' is true upon inferior launch/attach.

llvm-svn: 227909

9 years agoAdded remote-build.py and wired it into Xcode for Linux and MacOSX+Linux builds.
Chaoren Lin [Tue, 3 Feb 2015 01:50:39 +0000 (01:50 +0000)]
Added remote-build.py and wired it into Xcode for Linux and MacOSX+Linux builds.

llvm-svn: 227908

9 years agoRemove invalid const qualifier for r0, since it is written by svc.
Stephen Hines [Tue, 3 Feb 2015 01:35:39 +0000 (01:35 +0000)]
Remove invalid const qualifier for r0, since it is written by svc.

Summary: This causes an invalid lvalue error when building for Android.

Reviewers: danalbert

Reviewed By: danalbert

Subscribers: llvm-commits

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

llvm-svn: 227907

9 years agoAllow customizing the timeout of the inferior
Enrico Granata [Tue, 3 Feb 2015 01:06:35 +0000 (01:06 +0000)]
Allow customizing the timeout of the inferior

llvm-svn: 227906

9 years agoAnd, do not define arguments twice
Enrico Granata [Tue, 3 Feb 2015 01:00:44 +0000 (01:00 +0000)]
And, do not define arguments twice

llvm-svn: 227905

9 years agoAllow pexpect exact matches
Enrico Granata [Tue, 3 Feb 2015 00:59:28 +0000 (00:59 +0000)]
Allow pexpect exact matches

llvm-svn: 227904

9 years agoUse a non-fatal diag handler in the C API. FIxes PR22368.
Rafael Espindola [Tue, 3 Feb 2015 00:49:57 +0000 (00:49 +0000)]
Use a non-fatal diag handler in the C API. FIxes PR22368.

llvm-svn: 227903

9 years agoELF: Improve linker script unit tests.
Rui Ueyama [Tue, 3 Feb 2015 00:42:36 +0000 (00:42 +0000)]
ELF: Improve linker script unit tests.

This patch is to enable to write unit tests for linker script with
less boilerplate code.

llvm-svn: 227902

9 years agoInstrProf: Update for LLVM API change
Justin Bogner [Tue, 3 Feb 2015 00:20:24 +0000 (00:20 +0000)]
InstrProf: Update for LLVM API change

Update for the change in r227900.

llvm-svn: 227901

9 years agoInstrProf: Simplify RawCoverageMappingReader's API slightly
Justin Bogner [Tue, 3 Feb 2015 00:20:11 +0000 (00:20 +0000)]
InstrProf: Simplify RawCoverageMappingReader's API slightly

This is still kind of a weird API, but dropping the (partial) update
of the passed in CoverageMappingRecord makes it a little easier to
understand and use.

llvm-svn: 227900

9 years agoMake "process attach" command to support attaching to remote process in case if selec...
Oleksiy Vyalov [Tue, 3 Feb 2015 00:04:35 +0000 (00:04 +0000)]
Make "process attach" command to support attaching to remote process in case if selected platform allows this.

http://reviews.llvm.org/D7358

llvm-svn: 227899

9 years agoInstrProf: Simplify some logic by using ArrayRef::slice (NFC)
Justin Bogner [Tue, 3 Feb 2015 00:00:00 +0000 (00:00 +0000)]
InstrProf: Simplify some logic by using ArrayRef::slice (NFC)

llvm-svn: 227898

9 years agoRevert part of r227437 as it was unnecessary. Thanks to echristo for
Alex Rosenberg [Mon, 2 Feb 2015 23:58:54 +0000 (23:58 +0000)]
Revert part of r227437 as it was unnecessary. Thanks to echristo for
pointing this out.

llvm-svn: 227897

9 years agotest: Make encode-test-5.m's output not dependent on its filename
David Majnemer [Mon, 2 Feb 2015 23:38:27 +0000 (23:38 +0000)]
test: Make encode-test-5.m's output not dependent on its filename

Pipe the file into clang instead of passing the file path on the command
line.

llvm-svn: 227896

9 years agoRevert "Add some overloads so that floating point literals can be AST matched properly."
Daniel Jasper [Mon, 2 Feb 2015 23:35:39 +0000 (23:35 +0000)]
Revert "Add some overloads so that floating point literals can be AST matched properly."

Apparently the build bots get angry for some reason. Can't reproduce
that in a local cmake/ninja build. Will look closer. Rolling back for
now.

llvm-svn: 227895

9 years agoclang lit.cfg: Fix a bug pointed by Sean Silva
Filipe Cabecinhas [Mon, 2 Feb 2015 23:17:54 +0000 (23:17 +0000)]
clang lit.cfg: Fix a bug pointed by Sean Silva

llvm-svn: 227894

9 years ago[TSan] Fix remaining bashism in buildgo.sh script.
Alexey Samsonov [Mon, 2 Feb 2015 23:14:46 +0000 (23:14 +0000)]
[TSan] Fix remaining bashism in buildgo.sh script.

llvm-svn: 227893

9 years agoAdd some overloads so that floating point literals can be AST matched properly.
Daniel Jasper [Mon, 2 Feb 2015 23:04:00 +0000 (23:04 +0000)]
Add some overloads so that floating point literals can be AST matched properly.

I am not entirely sure whether the implemented sematics are ideal. In
particular, should floatLiteral(equals(0.5)) match "0.5f" and should
floatLiteral(equals(0.5f)) match "0.5". With the overloads in this
patch, the answer to both questions is yes, but I am happy to change
that.

llvm-svn: 227892

9 years agoMigrate to using the subtarget on the machine function and update
Eric Christopher [Mon, 2 Feb 2015 23:03:45 +0000 (23:03 +0000)]
Migrate to using the subtarget on the machine function and update
all uses.

llvm-svn: 227891

9 years agoUse the function template getSubtarget off of the machine function,
Eric Christopher [Mon, 2 Feb 2015 23:03:43 +0000 (23:03 +0000)]
Use the function template getSubtarget off of the machine function,
and use it in all locations.

llvm-svn: 227890

9 years agoSome cleanup in lldbpexpect
Enrico Granata [Mon, 2 Feb 2015 23:03:37 +0000 (23:03 +0000)]
Some cleanup in lldbpexpect

llvm-svn: 227889

9 years agoNice syntax typo in lldbpexpect
Enrico Granata [Mon, 2 Feb 2015 22:55:46 +0000 (22:55 +0000)]
Nice syntax typo in lldbpexpect

llvm-svn: 227887

9 years agoPR 17421: Implemented -save-temps={obj|cwd} option
Reid Kleckner [Mon, 2 Feb 2015 22:41:48 +0000 (22:41 +0000)]
PR 17421: Implemented -save-temps={obj|cwd} option

-save-temps=cwd is equivalent to -save-temps
-save-temps=obj saves temporary file in the same directory as output

This helps to avoid clobbering of temp files in case of parallel
compilation with -save-temps of the files that have the same name
but located in different directories.

Patch by Artem Belevich

Reviewed By: rnk

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

llvm-svn: 227886

9 years agoUse the cached subtarget on the MachineFunction.
Eric Christopher [Mon, 2 Feb 2015 22:40:56 +0000 (22:40 +0000)]
Use the cached subtarget on the MachineFunction.

llvm-svn: 227885

9 years agoRemove dead header.
Eric Christopher [Mon, 2 Feb 2015 22:40:54 +0000 (22:40 +0000)]
Remove dead header.

llvm-svn: 227884

9 years agoRemove dead code in the HexagonMCInst classes. This also fixes
Eric Christopher [Mon, 2 Feb 2015 22:40:53 +0000 (22:40 +0000)]
Remove dead code in the HexagonMCInst classes. This also fixes
a layering violation in the port and removes calls to getSubtargetImpl.

llvm-svn: 227883

9 years ago80-col fixup.
Eric Christopher [Mon, 2 Feb 2015 22:40:51 +0000 (22:40 +0000)]
80-col fixup.

llvm-svn: 227882

9 years agoInstrProf: Remove an unused header (NFC)
Justin Bogner [Mon, 2 Feb 2015 22:38:39 +0000 (22:38 +0000)]
InstrProf: Remove an unused header (NFC)

llvm-svn: 227881

9 years agoRemove dead code in the HexagonMCInst classes. This also fixes
Eric Christopher [Mon, 2 Feb 2015 22:28:48 +0000 (22:28 +0000)]
Remove dead code in the HexagonMCInst classes. This also fixes
a layering violation in the port and removes calls to getSubtargetImpl.

llvm-svn: 227880

9 years ago80-col fixup.
Eric Christopher [Mon, 2 Feb 2015 22:28:46 +0000 (22:28 +0000)]
80-col fixup.

llvm-svn: 227879

9 years agoRemove unused class variables and update all callers/uses from
Eric Christopher [Mon, 2 Feb 2015 22:28:44 +0000 (22:28 +0000)]
Remove unused class variables and update all callers/uses from
the HexagonSplitTFRCondSet pass. Use the subtarget off the machine
function at the same time.

llvm-svn: 227878

9 years ago[TSan] Update check_analyze.sh expectations to match trunk Clang output.
Alexey Samsonov [Mon, 2 Feb 2015 22:17:23 +0000 (22:17 +0000)]
[TSan] Update check_analyze.sh expectations to match trunk Clang output.

llvm-svn: 227877

9 years agoSEH: Diagnose use of C++ EH and SEH in the same function
Reid Kleckner [Mon, 2 Feb 2015 22:15:31 +0000 (22:15 +0000)]
SEH: Diagnose use of C++ EH and SEH in the same function

This check does not apply when Borland extensions are enabled, as they
have a checked in test case indicating that mixed usage of SEH and C++
is supported.

llvm-svn: 227876

9 years agoAdd an helper class to write pexpect-based test cases
Enrico Granata [Mon, 2 Feb 2015 22:12:39 +0000 (22:12 +0000)]
Add an helper class to write pexpect-based test cases
Over time, we should improve this class and port all pexpect based testing over to using this

llvm-svn: 227875

9 years agoMigrate the HexagonSplitConst32AndConst64 pass from TargetMachine
Eric Christopher [Mon, 2 Feb 2015 22:11:43 +0000 (22:11 +0000)]
Migrate the HexagonSplitConst32AndConst64 pass from TargetMachine
based getSubtarget to the one cached on the MachineFunction.
Remove unused class variables and update all callers/uses.

llvm-svn: 227874

9 years agoRemove #if'd code and update comment.
Eric Christopher [Mon, 2 Feb 2015 22:11:42 +0000 (22:11 +0000)]
Remove #if'd code and update comment.

llvm-svn: 227873

9 years agoMove HexagonMachineScheduler to use the subtarget off of the
Eric Christopher [Mon, 2 Feb 2015 22:11:40 +0000 (22:11 +0000)]
Move HexagonMachineScheduler to use the subtarget off of the
MachineFunction and update all uses accordingly including
VLIWResourceModel.

llvm-svn: 227872

9 years agoCache and use the subtarget that owns the target lowering.
Eric Christopher [Mon, 2 Feb 2015 22:11:36 +0000 (22:11 +0000)]
Cache and use the subtarget that owns the target lowering.

llvm-svn: 227871

9 years ago[TSan] Fix Go sanity check script.
Alexey Samsonov [Mon, 2 Feb 2015 22:07:39 +0000 (22:07 +0000)]
[TSan] Fix Go sanity check script.

llvm-svn: 227870

9 years ago[X86][MMX] Add tests for MMX extract element
Bruno Cardoso Lopes [Mon, 2 Feb 2015 22:00:48 +0000 (22:00 +0000)]
[X86][MMX] Add tests for MMX extract element

LLVM ToT produces poor MMX code compared to 3.5. However, part of the previous
functionality can be achieved by using -x86-experimental-vector-widening-legalization.
Add tests to be sure we don't regress again.

llvm-svn: 227869

9 years agoAdd cc1 option '-fmodule-feature' to add custom values for 'requires' decls
Ben Langmuir [Mon, 2 Feb 2015 21:56:15 +0000 (21:56 +0000)]
Add cc1 option '-fmodule-feature' to add custom values for 'requires' decls

This allows clang-based tools to specify custom features that can be
tested by the 'requires' declaration in a module map file.

llvm-svn: 227868

9 years ago[X86][MMX] Cleanup shuffle, bitcast and insert element tests
Bruno Cardoso Lopes [Mon, 2 Feb 2015 21:56:11 +0000 (21:56 +0000)]
[X86][MMX] Cleanup shuffle, bitcast and insert element tests

- Merge MMX arg passing test files
- Merge MMX bitcast, insert elt and shuffle tests

llvm-svn: 227867

9 years agoRename pow2 functions in __hash_table to reflect that they are hash specific
Eric Fiselier [Mon, 2 Feb 2015 21:31:48 +0000 (21:31 +0000)]
Rename pow2 functions in __hash_table to reflect that they are hash specific

llvm-svn: 227866

9 years agobpf: Use the getSubtarget call off of the MachineFunction rather than the TargetMachine
Alexei Starovoitov [Mon, 2 Feb 2015 21:24:27 +0000 (21:24 +0000)]
bpf: Use the getSubtarget call off of the MachineFunction rather than the TargetMachine

Summary:
Hi Eric,

this patch cleans up the layering violation that you're fixing across backends.
Anything else I need to fix on bpf backend side?

Thanks

Reviewers: echristo

Reviewed By: echristo

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

llvm-svn: 227865

9 years agoLock the Platform mutex in PlatformDarwin::GetDeveloperDirectory().
Greg Clayton [Mon, 2 Feb 2015 21:18:46 +0000 (21:18 +0000)]
Lock the Platform mutex in PlatformDarwin::GetDeveloperDirectory().

Partial fix for: <rdar://problem/19575304>

llvm-svn: 227863

9 years agoUpdate LFTS status page
Eric Fiselier [Mon, 2 Feb 2015 21:10:21 +0000 (21:10 +0000)]
Update LFTS status page

llvm-svn: 227862

9 years agoWhen generating llvm.used, we may need an addrspacecast instead of a bitcast.
Justin Holewinski [Mon, 2 Feb 2015 21:05:49 +0000 (21:05 +0000)]
When generating llvm.used, we may need an addrspacecast instead of a bitcast.

Summary:
This is especially important for targets that use multiple address spaces,
and commonly place global variables in address spaces other than zero.

Fixes PR22383

Test Plan: New test case added: llvm-used.cu

Reviewers: jingyue

Subscribers: llvm-commits

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

llvm-svn: 227861

9 years ago[libcxx] Add <experimental/chrono>
Eric Fiselier [Mon, 2 Feb 2015 21:05:47 +0000 (21:05 +0000)]
[libcxx] Add <experimental/chrono>

Summary:
This patch adds <experimental/chrono> which only contains a single variable template.

See: https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#time

Reviewers: jroelofs, danalbert, K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 227860

9 years agoMake one mutex for the lldb_private::Platform class that can be used to protect with...
Greg Clayton [Mon, 2 Feb 2015 20:45:17 +0000 (20:45 +0000)]
Make one mutex for the lldb_private::Platform class that can be used to protect with modifying member variables. This mutex is designed to be used for simple modifications, so the lock should be taken, modify the member variable and released. We need to make sure this isn't used with any code that cause code to rely or reenter on another thread.

Partial fix for: <rdar://problem/19575304>

llvm-svn: 227855

9 years agoResurrect the assertion removed by r227717
Jingyue Wu [Mon, 2 Feb 2015 20:41:11 +0000 (20:41 +0000)]
Resurrect the assertion removed by r227717

Summary: MSVC can compile "LoopID->getOperand(0) == LoopID" when LoopID is MDNode*.

Test Plan: no regression

Reviewers: mkuper

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 227853

9 years ago[TSan] Add Go runtime sanity check to CMake build.
Alexey Samsonov [Mon, 2 Feb 2015 20:37:28 +0000 (20:37 +0000)]
[TSan] Add Go runtime sanity check to CMake build.

llvm-svn: 227852

9 years ago[Sanitizer] Fix checking for weak function presence.
Alexey Samsonov [Mon, 2 Feb 2015 20:37:26 +0000 (20:37 +0000)]
[Sanitizer] Fix checking for weak function presence.

llvm-svn: 227851

9 years ago[TSan] Build runtime with -msse3 flag.
Alexey Samsonov [Mon, 2 Feb 2015 20:37:25 +0000 (20:37 +0000)]
[TSan] Build runtime with -msse3 flag.

llvm-svn: 227850

9 years agoFix the -Werror build, NFC
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 20:20:56 +0000 (20:20 +0000)]
Fix the -Werror build, NFC

llvm-svn: 227849

9 years agoIR: Allow GenericDebugNode construction from MDString
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 20:01:03 +0000 (20:01 +0000)]
IR: Allow GenericDebugNode construction from MDString

Allow `GenericDebugNode` construction directly from `MDString`, rather
than requiring `StringRef`s.  I've refactored the `StringRef`
constructors to use these.  There's no real functionality change here,
except for exposing the lower-level API.

The purpose of this is to simplify construction of string operands when
reading bitcode.  It's unnecessarily indirect to parse an `MDString` ID,
lookup the `MDString` in the bitcode reader list, get the `StringRef`
out of that, and then have `GenericDebugNode::getImpl()` use
`MDString::get()` to acquire the original `MDString`.  Instead, this
allows the bitcode reader to directly pass in the `MDString`.

llvm-svn: 227848

9 years agoIR: Extract DEFINE_MDNODE_GET(), NFC
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 19:55:21 +0000 (19:55 +0000)]
IR: Extract DEFINE_MDNODE_GET(), NFC

llvm-svn: 227847

9 years agoIR: Separate helpers for string operands, NFC
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 19:54:05 +0000 (19:54 +0000)]
IR: Separate helpers for string operands, NFC

llvm-svn: 227846

9 years ago[Orc] Make OrcMCJITReplacement::addObject calls transfer buffer ownership to the
Lang Hames [Mon, 2 Feb 2015 19:51:18 +0000 (19:51 +0000)]
[Orc] Make OrcMCJITReplacement::addObject calls transfer buffer ownership to the
ObjectLinkingLayer.

There are a two of overloads for addObject, one of which transfers ownership of
the underlying buffer to OrcMCJITReplacement. This commit makes the ownership
transfering version pass ownership down to the ObjectLinkingLayer in order to
prevent the issue described in r227778.

I think this commit will fix the sanitizer bot failures that necessitated the
removal of the load-object-a.ll regression test in r227785, so I'm reinstating
that test.

llvm-svn: 227845

9 years ago[NFC] Remove some unnecessary local objects
Johannes Doerfert [Mon, 2 Feb 2015 19:41:30 +0000 (19:41 +0000)]
[NFC] Remove some unnecessary local objects

llvm-svn: 227844

9 years agoFileCheck'ize CodeGenObjC test
David Majnemer [Mon, 2 Feb 2015 19:30:54 +0000 (19:30 +0000)]
FileCheck'ize CodeGenObjC test

This fixes PR22437.

llvm-svn: 227843

9 years agoThe prefix 'Ms-' should be 'MS-'
David Majnemer [Mon, 2 Feb 2015 19:30:52 +0000 (19:30 +0000)]
The prefix 'Ms-' should be 'MS-'

Clang is otherwise consistent that Microsoft be abbreviated as MS, not
Ms.

llvm-svn: 227842

9 years agoMove simple case earlier and use a continue.
Rafael Espindola [Mon, 2 Feb 2015 19:22:51 +0000 (19:22 +0000)]
Move simple case earlier and use a continue.

llvm-svn: 227841

9 years agoMigrate HexagonISelDAGToDAG to setting a subtarget pointer during
Eric Christopher [Mon, 2 Feb 2015 19:22:03 +0000 (19:22 +0000)]
Migrate HexagonISelDAGToDAG to setting a subtarget pointer during
runOnMachineFunction. Update all uses of the Subtarget accordingly.

llvm-svn: 227840

9 years agoUse the getSubtarget call off of the MachineFunction rather than
Eric Christopher [Mon, 2 Feb 2015 19:22:01 +0000 (19:22 +0000)]
Use the getSubtarget call off of the MachineFunction rather than
the TargetMachine.

llvm-svn: 227839

9 years agoMS ABI: Add more documentation and tests for novtable
David Majnemer [Mon, 2 Feb 2015 19:05:46 +0000 (19:05 +0000)]
MS ABI: Add more documentation and tests for novtable

llvm-svn: 227838

9 years agoRemove unused class variables and update calls to get the subtarget
Eric Christopher [Mon, 2 Feb 2015 19:05:28 +0000 (19:05 +0000)]
Remove unused class variables and update calls to get the subtarget
off of the machine function.

llvm-svn: 227837

9 years agoSink queries into asserts since the variable is unused otherwise.
Eric Christopher [Mon, 2 Feb 2015 18:58:24 +0000 (18:58 +0000)]
Sink queries into asserts since the variable is unused otherwise.

llvm-svn: 227836

9 years agoIR: Split out DebugInfoMetadata.h, NFC
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 18:53:21 +0000 (18:53 +0000)]
IR: Split out DebugInfoMetadata.h, NFC

Move debug-info-centred `Metadata` subclasses into their own
header/source file.  A couple of private template functions are needed
from both `Metadata.cpp` and `DebugInfoMetadata.cpp`, so I've moved them
to `lib/IR/MetadataImpl.h`.

llvm-svn: 227835

9 years agoUpdate CMake build for removed files.
Eric Christopher [Mon, 2 Feb 2015 18:52:49 +0000 (18:52 +0000)]
Update CMake build for removed files.

llvm-svn: 227834

9 years agoMake SBTarget::Launch() respect the stop_at_entry argument.
Zachary Turner [Mon, 2 Feb 2015 18:50:01 +0000 (18:50 +0000)]
Make SBTarget::Launch() respect the stop_at_entry argument.

Patch by Ilia K
Differential Revision: http://reviews.llvm.org/D7271

llvm-svn: 227833

9 years agoGet TargetRegisterInfo and TargetInstrInfo off of the MachineFunction
Eric Christopher [Mon, 2 Feb 2015 18:46:31 +0000 (18:46 +0000)]
Get TargetRegisterInfo and TargetInstrInfo off of the MachineFunction
and remove unnecessary class variables.

llvm-svn: 227832

9 years agoUse the function template getSubtarget to remove an explicit cast.
Eric Christopher [Mon, 2 Feb 2015 18:46:29 +0000 (18:46 +0000)]
Use the function template getSubtarget to remove an explicit cast.

llvm-svn: 227831

9 years agoGrab TargetInstrInfo off of the MachineFunction and remove
Eric Christopher [Mon, 2 Feb 2015 18:46:27 +0000 (18:46 +0000)]
Grab TargetInstrInfo off of the MachineFunction and remove
unnecessary class variables.

llvm-svn: 227830

9 years agoRemove unused files.
Eric Christopher [Mon, 2 Feb 2015 18:46:23 +0000 (18:46 +0000)]
Remove unused files.

llvm-svn: 227829

9 years agoSTLExtras: Provide less/equal functors with templated function call operators, plus...
David Blaikie [Mon, 2 Feb 2015 18:35:10 +0000 (18:35 +0000)]
STLExtras: Provide less/equal functors with templated function call operators, plus a deref'ing functor template utility

Similar to the C++14 void specializations of these templates, useful as
a stop-gap until LLVM switches to '14.

Example use-cases in tblgen because I saw some functors that looked like
they could be simplified/refactored.

Reviewers: dexonsmith

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

llvm-svn: 227828

9 years agoDebug Info: Relax assertion in isUnsignedDIType() to allow floats to be
Adrian Prantl [Mon, 2 Feb 2015 18:31:58 +0000 (18:31 +0000)]
Debug Info: Relax assertion in isUnsignedDIType() to allow floats to be
described by integer constants. This is a bit ugly, but if the source
language allows arbitrary type casting, the debug info must follow suit.

For example:
  void foo() {
    float a;
    *(int *)&a = 0;
  }
For the curious: SROA replaces the float alloca with an i32 alloca, which
is then optimized away and described via dbg.value(i32 0, ...).

llvm-svn: 227827

9 years agoFix some file headers, NFC
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 18:20:15 +0000 (18:20 +0000)]
Fix some file headers, NFC

llvm-svn: 227826

9 years agoSupport: Add missing header to BlockFrequencyTest.cpp, NFC
Duncan P. N. Exon Smith [Mon, 2 Feb 2015 18:18:07 +0000 (18:18 +0000)]
Support: Add missing header to BlockFrequencyTest.cpp, NFC

llvm-svn: 227825

9 years agoFix PR#22433. The algorithm is_partitioned was testing an item in the middle of the...
Marshall Clow [Mon, 2 Feb 2015 18:16:35 +0000 (18:16 +0000)]
Fix PR#22433. The algorithm is_partitioned was testing an item in the middle of the sequence twice.

llvm-svn: 227824

9 years agoR600/SI: 64-bit and larger memory access must be at least 4-byte aligned
Tom Stellard [Mon, 2 Feb 2015 18:02:28 +0000 (18:02 +0000)]
R600/SI: 64-bit and larger memory access must be at least 4-byte aligned

This is true for SI only. CI+ supports unaligned memory accesses,
but this requires driver support, so for now we disallow unaligned
accesses for all GCN targets.

llvm-svn: 227822

9 years agoR600/SI: Merge two test files
Tom Stellard [Mon, 2 Feb 2015 18:02:23 +0000 (18:02 +0000)]
R600/SI: Merge two test files

llvm-svn: 227821

9 years ago[AArch64] Prefer DUP/MOV ("CPY") to INS for vector_extract.
Ahmed Bougacha [Mon, 2 Feb 2015 17:55:57 +0000 (17:55 +0000)]
[AArch64] Prefer DUP/MOV ("CPY") to INS for vector_extract.

This avoids a partial false dependency on the previous content of
the upper lanes of the destination vector register.

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

llvm-svn: 227820

9 years agoSince TargetLowering is already subtarget dependent just pass
Eric Christopher [Mon, 2 Feb 2015 17:52:27 +0000 (17:52 +0000)]
Since TargetLowering is already subtarget dependent just pass
in the subtarget and stash it in the class so that lookups are
easier and safer.

llvm-svn: 227819

9 years agoUse the function template getSubtarget on the MachineFunction
Eric Christopher [Mon, 2 Feb 2015 17:52:25 +0000 (17:52 +0000)]
Use the function template getSubtarget on the MachineFunction
rather than a larger explicit cast.

llvm-svn: 227818

9 years agoRemove unused class variable.
Eric Christopher [Mon, 2 Feb 2015 17:52:23 +0000 (17:52 +0000)]
Remove unused class variable.

llvm-svn: 227817

9 years agoRemove unused class variable.
Eric Christopher [Mon, 2 Feb 2015 17:52:20 +0000 (17:52 +0000)]
Remove unused class variable.

llvm-svn: 227816

9 years agofix typo
Sanjay Patel [Mon, 2 Feb 2015 17:47:30 +0000 (17:47 +0000)]
fix typo

llvm-svn: 227815

9 years agoReuse a bunch of cached subtargets and remove getSubtarget calls
Eric Christopher [Mon, 2 Feb 2015 17:38:43 +0000 (17:38 +0000)]
Reuse a bunch of cached subtargets and remove getSubtarget calls
without a Function argument.

llvm-svn: 227814

9 years agoRemove unnecessary forward declaration.
Eric Christopher [Mon, 2 Feb 2015 17:38:40 +0000 (17:38 +0000)]
Remove unnecessary forward declaration.

llvm-svn: 227813