Do not destroy external linkage when deleting function body

The function deleteBody() converts the linkage to external and thus destroys
original linkage type value. Lack of correct linkage type causes wrong
relocations to be emitted later.
Calling dropAllReferences() instead of deleteBody() will fix the issue.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218302 91177308-0d34-0410-b5e6-96231b3b80d8
Rebuild the inputs for the codeview-linetables.test with VS2013
Also provide reproducible instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218303 91177308-0d34-0410-b5e6-96231b3b80d8
ExecutionEngineTests: Call llvm_shutdown() on exit for ManagedStatic introduced in r218151.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218304 91177308-0d34-0410-b5e6-96231b3b80d8
Loop instead of individual def's for each GPR.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218305 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a small typo in the test comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218306 91177308-0d34-0410-b5e6-96231b3b80d8
valgrind/x86_64-pc-linux-gnu.supp: We don't care if sed leaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218307 91177308-0d34-0410-b5e6-96231b3b80d8
Rework r218304, "ExecutionEngineTests: Call llvm_shutdown() on exit for ManagedStatic introduced in r218151."

r218304 caused crash on msvc builder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218308 91177308-0d34-0410-b5e6-96231b3b80d8
Fix segfault in AArch64 backend with -g and -mbig-endian

Fix a null pointer dereference when trying to swap the endianness of
fixups in the .eh_frame section in the AArch64 backend.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218311 91177308-0d34-0410-b5e6-96231b3b80d8
Use SDValue bool operator to reduce code. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218314 91177308-0d34-0410-b5e6-96231b3b80d8
[MCJIT] Delete the JTIMemoryManager and associated APIs.

This patch removes the old JIT memory manager (which does not provide any
useful functionality now that the old JIT is gone), and migrates the few
remaining clients over to SectionMemoryManager.

http://llvm.org/PR20848



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218316 91177308-0d34-0410-b5e6-96231b3b80d8
[MCJIT] Remove #include of JITMemoryManager that accidentally survived r218316.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218317 91177308-0d34-0410-b5e6-96231b3b80d8
[MCJIT] Remove a few more references to JITMemoryManager that survived r218316.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218318 91177308-0d34-0410-b5e6-96231b3b80d8
[docs] Fixed a typo in Atomics.rst


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218319 91177308-0d34-0410-b5e6-96231b3b80d8
[MCJIT] Nuke MachineRelocation and MachineCodeEmitter. Now that the old JIT is
gone they're no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218320 91177308-0d34-0410-b5e6-96231b3b80d8
[x86] Teach the new shuffle lowering's blend functionality to use AVX2's
VPBLENDD where appropriate even on 128-bit vectors.

According to Agner's tables, this instruction is significantly higher
throughput (can execute on any port) on Haswell chips so we should
aggressively try to form it when available.

Sadly, this loses our delightful shuffle comments. I'll add those back
for VPBLENDD next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218322 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218324 91177308-0d34-0410-b5e6-96231b3b80d8
Just add a fixme about a possibly faster implementation of some atomic loads on some ARM processors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218326 91177308-0d34-0410-b5e6-96231b3b80d8
[MCJIT] Remove PPCRelocations.h - it's no longer used.

This was overlooked in r218320, which removed the relocation headers for other
targets. Thanks to Ulrich Weigand for catching it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218327 91177308-0d34-0410-b5e6-96231b3b80d8
[MCJIT] Fix some more RuntimeDyld debugging output format specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218328 91177308-0d34-0410-b5e6-96231b3b80d8
Add AtomicExpandPass::bracketInstWithFences, and use it whenever getInsertFencesForAtomic would trigger in SelectionDAGBuilder

Summary:
The goal is to eventually remove all the code related to getInsertFencesForAtomic
in SelectionDAGBuilder as it is wrong (designed for ARM, not really portable, works
mostly by accident because the backends are overly conservative), and repeats the
same logic that goes in emitLeading/TrailingFence.

In this patch, I make AtomicExpandPass insert the fences as it knows better
where to put them. Because this requires getting the fences and not just
passing an IRBuilder around, I had to change the return type of
emitLeading/TrailingFence.
This code only triggers on ARM for now. Because it is earlier in the pipeline
than SelectionDAGBuilder, it triggers and lowers atomic accesses to atomic so
SelectionDAGBuilder does not add barriers anymore on ARM.

If this patch is accepted I plan to implement emitLeading/TrailingFence for all
backends that setInsertFencesForAtomic(true), which will allow both making them
less conservative and simplifying SelectionDAGBuilder once they are all using
this interface.

This should not cause any functionnal change so the existing tests are used
and not modified.

Test Plan: make check-all, benefits from existing tests of atomics on ARM

Reviewers: jfb, t.p.northover

Subscribers: aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218329 91177308-0d34-0410-b5e6-96231b3b80d8