Commit Graph

437 Commits

Author SHA1 Message Date
Dimitry Andric
9a4b31181f Upgrade our copies of clang and llvm to 3.7.1 release. This is a
bugfix-only release, with no new features.

Please note that from 3.5.0 onwards, clang and llvm require C++11
support to build; see UPDATING for more information.
2015-12-25 21:39:45 +00:00
Andrew Turner
b1eb23b26b Don't adjust the program counter to an invalid address after reaching a
breakpoint. The value doesn't need to be adjusted as it is already
correctly returned from the kernel.

This allows lldb to set breakpoints, and stop on them, however more work
is needed, for example single stepping fails to stop.

Discussed with:	emaste
2015-12-22 17:18:40 +00:00
Ed Maste
ef3c018198 lldb(1): Document core file option -c / -core 2015-12-16 03:59:54 +00:00
Dimitry Andric
df5b54dee1 Add clang patch corresponding to r291701. 2015-12-04 17:23:19 +00:00
Dimitry Andric
bde2a921d4 In assembler mode, clang defaulted to DWARF3, if only -g was specified.
Change this to DWARF2, in the simplest way possible.  (Upstream, this
was fixed in clang trunk r250173, but this was done along with a lot of
shuffling around of debug option handling, so it cannot be applied
as-is.)

Noticed by:	des
MFC after:	3 days
2015-12-03 15:41:10 +00:00
Ed Maste
1638c73018 lldb: Add arm64 FreeBSD ProcessMonitor register context
This is an adaptation of upstream LLDB commit r251088.

Sponsored by:	The FreeBSD Foundation
2015-10-23 17:30:41 +00:00
Dimitry Andric
f80158072d Add clang patch corresponding to r289523. 2015-10-18 17:14:45 +00:00
Dimitry Andric
67291bbdf6 Pull in r248379 from upstream clang trunk (by Jörg Sonnenberger):
Refactor library decision for -fopenmp support from Darwin into a
  function for sharing with other platforms.

Pull in r248424 from upstream clang trunk (by Jörg Sonnenberger):

  Push OpenMP linker flags after linker input on Darwin. Don't add any
  libraries if -nostdlib is specified. Test.

Pull in r248426 from upstream clang trunk (by Jörg Sonnenberger):

  Support linking against OpenMP runtime on NetBSD.

Pull in r250657 from upstream clang trunk (by Dimitry Andric):

  Support linking against OpenMP runtime on FreeBSD.
2015-10-18 17:13:41 +00:00
Dimitry Andric
4409569894 Add llvm patch corresponding to r289221. 2015-10-13 16:25:02 +00:00
Dimitry Andric
645bd50341 Pull in r250085 from upstream llvm trunk (by Andrea Di Biagio):
[x86] Fix wrong lowering of vsetcc nodes (PR25080).

  Function LowerVSETCC (in X86ISelLowering.cpp) worked under the wrong
  assumption that for non-AVX512 targets, the source type and destination type
  of a type-legalized setcc node were always the same type.

  This assumption was unfortunately incorrect; the type legalizer is not always
  able to promote the return type of a setcc to the same type as the first
  operand of a setcc.

  In the case of a vsetcc node, the legalizer firstly checks if the first input
  operand has a legal type. If so, then it promotes the return type of the vsetcc
  to that same type. Otherwise, the return type is promoted to the 'next legal
  type', which, for vectors of MVT::i1 is always a 128-bit integer vector type.

  Example (-mattr=+avx):

    %0 = trunc <8 x i32> %a to <8 x i23>
    %1 = icmp eq <8 x i23> %0, zeroinitializer

  The initial selection dag for the code above is:

  v8i1 = setcc t5, t7, seteq:ch
    t5: v8i23 = truncate t2
      t2: v8i32,ch = CopyFromReg t0, Register:v8i32 %vreg1
      t7: v8i32 = build_vector of all zeroes.

  The type legalizer would firstly check if 't5' has a legal type. If so, then it
  would reuse that same type to promote the return type of the setcc node.
  Unfortunately 't5' is of illegal type v8i23, and therefore it cannot be used to
  promote the return type of the setcc node. Consequently, the setcc return type
  is promoted to v8i16. Later on, 't5' is promoted to v8i32 thus leading to the
  following dag node:
    v8i16 = setcc t32, t25, seteq:ch

    where t32 and t25 are now values of type v8i32.

  Before this patch, function LowerVSETCC would have wrongly expanded the setcc
  to a single X86ISD::PCMPEQ. Surprisingly, ISel was still able to match an
  instruction. In our case, ISel would have matched a VPCMPEQWrr:
    t37: v8i16 = X86ISD::VPCMPEQWrr t36, t25

  However, t36 and t25 are both VR256, while the result type is instead of class
  VR128. This inconsistency ended up causing the insertion of COPY instructions
  like this:
    %vreg7<def> = COPY %vreg3; VR128:%vreg7 VR256:%vreg3

  Which is an invalid full copy (not a sub register copy).
  Eventually, the backend would have hit an UNREACHABLE "Cannot emit physreg copy
  instruction" in the attempt to expand the malformed pseudo COPY instructions.

  This patch fixes the problem adding the missing logic in LowerVSETCC to handle
  the corner case of a setcc with 128-bit return type and 256-bit operand type.

  This problem was originally reported by Dimitry as PR25080. It has been latent
  for a very long time. I have added the minimal reproducible from that bugzilla
  as test setcc-lowering.ll.

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

This should fix the "Cannot emit physreg copy instruction" errors when
compiling contrib/wpa/src/common/ieee802_11_common.c, and CPUTYPE is set
to a CPU supporting AVX (e.g. sandybridge, ivybridge).
2015-10-13 16:24:22 +00:00
Dimitry Andric
1286cb8390 Add llvm patch corresponding to r289072. 2015-10-09 21:00:04 +00:00
Dimitry Andric
d361766d4b Temporarily revert upstream llvm trunk r240144 (by Michael Zolotukhin):
[SLP] Vectorize for all-constant entries.

This should fix libc++'s iostream initialization SIGBUSing on amd64,
whenever the global cout symbol is not aligned to 16 bytes.

Some further explanation: libc++'s iostream.cpp contains the definitions
of std::cout, std::cerr and so on.  These global objects are effectively
declared with an alignment of 8 bytes.  When an executable is linked
against libc++.so, it can sometimes get a copy of the global object,
which is then at the same alignment.

However, with clang 3.7.0, the initialization of these global objects
will incorrectly use SSE instructions (e.g. movdqa), whenever the
optimization level is high enough, and SSE is enabled, such as on amd64.
When any of these objects is not aligned to 16 bytes, this will result
in a SIGBUS during iostream initialization.  In contrast, clang 3.6.x
and earlier took the 8 byte alignment into consideration, and avoided
SSE for those particular operations.

After bisecting of upstream changes, I found that the above revision
caused the change of this behavior, so I am reverting it now as a
workaround, while a discussion and test case is being prepared for
upstream.
2015-10-09 18:21:45 +00:00
Dimitry Andric
ba96f361ba Add llvm patch corresponding to r288195. 2015-09-25 18:21:48 +00:00
Dimitry Andric
98e67009c0 Merge ^/head r288126 through r288196. 2015-09-24 21:48:04 +00:00
Dimitry Andric
a502cd2f72 Pull in r248439 from upstream llvm trunk (by Sanjay Patel):
set div/rem default values to 'expensive' in TargetTransformInfo's
  cost model

  ...because that's what the cost model was intended to do.

  As discussed in D12882, this fix has a temporary unintended
  consequence for SimplifyCFG: it causes us to not speculate an fdiv.
  However, two wrongs make PR24818 right, and two wrongs make PR24343
  act right even though it's really still wrong.

  I intend to correct SimplifyCFG and add to CodeGenPrepare to account
  for this cost model change and preserve the righteousness for the bug
  report cases.

  https://llvm.org/bugs/show_bug.cgi?id=24818
  https://llvm.org/bugs/show_bug.cgi?id=24343

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

This fixes the too-eager fdiv hoisting in pow(), which could lead to
unexpected floating point exceptions.
2015-09-24 21:20:00 +00:00
Ed Maste
8c034f6af7 Bring LLVM libunwind snapshot into contrib/llvm/projects 2015-09-23 19:30:46 +00:00
Dimitry Andric
977b468e25 Add clang patch corresponding to r288127. 2015-09-22 20:42:14 +00:00
Dimitry Andric
f3d77c91e9 Pull in r244063 from upstream clang trunk (by James Y Knight):
Add missing atomic libcall support.

  Support for emitting libcalls for __atomic_fetch_nand and
  __atomic_{add,sub,and,or,xor,nand}_fetch was missing; add it, and some
  test cases.

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

This fixes "cannot compile this atomic library call yet" errors when
compiling code which calls the above builtins, on arm < v6.
2015-09-22 20:39:59 +00:00
Dimitry Andric
883df6251d Revert merge of clang trunk r244063, which I did not intend to commit
yet.  Reminder to self: never merge to an unclean tree.
2015-09-22 10:00:32 +00:00
Dimitry Andric
26e065d02e Merge ^/head r288035 through r288099. 2015-09-22 09:50:11 +00:00
Dimitry Andric
c394288fa5 The R600 target got renamed to AMDGPU, but I missed deleting the old
directory during the vendor import.  Delete it now.
2015-09-21 22:34:16 +00:00
Dimitry Andric
2dd978e891 Drop a patch which is already included in 3.7.0. 2015-09-21 22:29:43 +00:00
Dimitry Andric
b6c25e0ef3 Update llvm, clang and lldb to 3.7.0 release. 2015-09-06 19:58:48 +00:00
Dimitry Andric
b91a7dfcc6 Update lldb to upstream trunk r242221. 2015-09-06 15:21:47 +00:00
Dimitry Andric
1757ba14bf Merge ^/head r287490 through r287501. 2015-09-06 12:02:28 +00:00
Dimitry Andric
7ff2ee1244 Update lldb's FREEBSD-Xlist to match reality. 2015-09-06 11:48:50 +00:00
Dimitry Andric
b10d76f080 Import r243925 from the upstream clang release_37 branch:
Reverting r239883 and r240720:
------------------------------------------------------------------------
r239883 | echristo | 2015-06-17 00:09:32 -0700 (Wed, 17 Jun 2015) | 16 lines

Update the intel intrinsic headers to use the target attribute support.

This involved removing the conditional inclusion and replacing them
with target attributes matching the original conditional inclusion
and checks. The testcase update removes the macro checks for each
file and replaces them with usage of the __target__ attribute, e.g.:

int __attribute__((__target__(("sse3")))) foo(int a) {
  _mm_mwait(0, 0);
  return 4;
}

This usage does require the enclosing function have the requisite
__target__ attribute for inlining and code generation - also for
any macro intrinsic uses in the enclosing function. There's no change
for existing uses of the intrinsic headers.
------------------------------------------------------------------------

------------------------------------------------------------------------
r240720 | silvas | 2015-06-25 16:22:11 -0700 (Thu, 25 Jun 2015) | 6 lines

Remove `requires` for x86 CPU features.

Ever since the target attributes change, we don't need to guard these
headers with `requires`. Actually it's a bit worse, because if we do
then they are included textually under the covers, causing declarations
to appear in submodules they aren't supposed to be in.
------------------------------------------------------------------------

This reverts the changes to the intrinsics headers in trunk, which could
result in some ports' configure scripts misdetecting SSE (and higher)
support.
2015-08-18 19:03:59 +00:00
Dimitry Andric
875ed54817 Update llvm/clang to r242221. 2015-08-12 18:31:11 +00:00
Dimitry Andric
1347814ced Merge ^/head r285924 through r286421. 2015-08-07 20:18:55 +00:00
Ed Maste
93d8f98ac7 Remove claim that the OS is Darwin from lldb(1)
Reported by:	bapt
2015-07-28 13:09:16 +00:00
Dimitry Andric
3dac3a9bad Update llvm/clang to r241361. 2015-07-05 22:34:42 +00:00
Dimitry Andric
4cd9b24e47 Merge ^/head r284737 through r285152. 2015-07-04 21:50:39 +00:00
Dimitry Andric
b41932d54e Add llvm patch corresponding to r285149. 2015-07-04 20:09:24 +00:00
Dimitry Andric
5f4899dbfe Pull in r241142 from upstream llvm trunk (by David Majnemer):
[SCCP] Turn loads of null into undef instead of zero initialized values

  Surprisingly, this is a correctness issue: the mmx type exists for
  calling convention purposes, LLVM doesn't have a zero representation for
  them.

  This partially fixes PR23999.

Pull in r241143 from upstream llvm trunk (by David Majnemer):

  [LoopUnroll] Use undef for phis with no value live

  We would create a phi node with a zero initialized operand instead of
  undef in the case where no value was originally available.  This was
  problematic for x86_mmx which has no null value.

These fix a "Cannot create a null constant of that type!" error when
compiling the graphics/sdl2_gfx port with MMX enabled.

Reported by:	amdmi3
2015-07-04 20:07:37 +00:00
Ed Maste
1c3bbb013d Update LLDB snapshot to upstream r241361
Notable upstream commits (upstream revision in parens):

- Add a JSON producer to LLDB (228636)
- Don't crash on bad DWARF expression (228729)
- Add support of DWARFv3 DW_OP_form_tls_address (231342)
- Assembly profiler for MIPS64 (232619)
- Handle FreeBSD/arm64 core files (233273)
- Read/Write register for MIPS64 (233685)
- Rework LLDB system initialization (233758)
- SysV ABI for aarch64 (236098)
- MIPS software single stepping (236696)
- FreeBSD/arm live debugging support (237303)
- Assembly profiler for mips32 (237420)
- Parse function name from DWARF DW_AT_abstract_origin (238307)
- Improve LLDB prompt handling (238313)
- Add real time signals support to FreeBSDSignals (238316)
- Fix race in IOHandlerProcessSTDIO (238423)
- MIPS64 Branch instruction emulation for SW single stepping (238820)
- Improve OSType initialization in elf object file's arch_spec (239148)
- Emulation of MIPS64 floating-point branch instructions (239996)
- ABI Plugin for MIPS32 (239997)
- ABI Plugin for MIPS64 (240123)
- MIPS32 branch emulation and single stepping (240373)
- Improve instruction emulation based stack unwinding on ARM (240533)
- Add branch emulation to aarch64 instruction emulator (240769)
2015-07-04 01:02:43 +00:00
Dimitry Andric
8f0fd8f6b8 Update llvm/clang to r240225. 2015-06-23 18:44:19 +00:00
Dimitry Andric
97bc6c731e Update Makefiles and other build glue for llvm/clang 3.7.0, as of trunk
r239412.
2015-06-10 19:12:52 +00:00
Dimitry Andric
021049273c Drop llvm/clang patches which are no longer necessary. 2015-05-30 15:36:23 +00:00
Dimitry Andric
b736063065 Update FREEBSD-Xlist files for llvm and clang. 2015-05-27 20:58:54 +00:00
Dimitry Andric
33956c4300 Merge clang trunk r238337 from ^/vendor/clang/dist, resolve conflicts,
and preserve our customizations, where necessary.
2015-05-27 20:44:45 +00:00
Dimitry Andric
ff0cc061ec Merge llvm trunk r238337 from ^/vendor/llvm/dist, resolve conflicts, and
preserve our customizations, where necessary.
2015-05-27 20:26:41 +00:00
Dimitry Andric
ef6fa9e26d Upgrade our copy of clang and llvm to 3.6.1 release.
This release contains the following cherry-picked revisions from
upstream trunk:

  226124 226151 226164 226165 226166 226407 226408 226409 226652
  226905 226983 227084 227087 227089 227208 227209 227210 227211
  227212 227213 227214 227269 227430 227482 227503 227519 227574
  227822 227986 227987 227988 227989 227990 228037 228038 228039
  228040 228188 228189 228190 228273 228372 228373 228374 228403
  228765 228848 228918 229223 229225 229226 229227 229228 229230
  229234 229235 229236 229238 229239 229413 229507 229680 229750
  229751 229752 229911 230146 230147 230235 230253 230255 230469
  230500 230564 230603 230657 230742 230748 230956 231219 231237
  231245 231259 231280 231451 231563 231601 231658 231659 231662
  231984 231986 232046 232085 232142 232176 232179 232189 232382
  232386 232389 232425 232438 232443 232675 232786 232797 232943
  232957 233075 233080 233351 233353 233409 233410 233508 233584
  233819 233904 234629 234636 234891 234975 234977 235524 235641
  235662 235931 236099 236306 236307

Please note that from 3.5.0 onwards, clang and llvm require C++11
support to build; see UPDATING for more information.
2015-05-25 13:43:03 +00:00
Dimitry Andric
867073d7fb Add llvm patch corresponding to r281775. 2015-04-20 17:37:37 +00:00
Dimitry Andric
98095a5dd2 Pull in r229911 from upstream llvm trunk (by Benjamin Kramer):
MC: Allow multiple comma-separated expressions on the .uleb128 directive.

  For compatiblity with GNU as. Binutils documents this as
  '.uleb128 expressions'. Subtle, isn't it?

Reported by:	sbruno
PR:		199554
MFC after:	3 days
2015-04-20 17:36:35 +00:00
Dimitry Andric
ebfc641e4e Update FREEBSD-Xlist for llvm. 2015-04-03 19:49:39 +00:00
Dimitry Andric
fe2efc8c43 Add the llvm-cov and llvm-profdata tools, when WITH_CLANG_EXTRAS is
defined.  These help with processing coverage and profile data.
2015-04-03 19:43:39 +00:00
Dimitry Andric
1f26983742 Add clang patch corresponding to r281046. 2015-04-03 18:42:38 +00:00
Dimitry Andric
de460a4881 Pull in r227115 from upstream clang trunk (by Ben Langmuir):
Fix assert instantiating string init of static variable

  ... when the variable's type is a typedef of a ConstantArrayType. Just
  look through the typedef (and any other sugar).  We only use the
  constant array type here to get the element count.

This fixes an assertion failure when building the games/redeclipse port.

Reported by:	amdmi3
2015-04-03 18:38:37 +00:00
Dimitry Andric
830e9b84d8 Add llvm patch corresponding to r280865. 2015-03-30 20:23:06 +00:00
Ed Maste
e93a7dab19 llvm: Backport upstream r229195 to fix arm64 TLS relocations
As is described at http://llvm.org/bugs/show_bug.cgi?id=22408, the GNU
  linkers ld.bfd and ld.gold currently only support a subset of the
  whole range of AArch64 ELF TLS relocations. Furthermore, they assume
  that some of the code sequences to access thread-local variables are
  produced in a very specific sequence.  When the sequence is not as the
  linker expects, it can silently mis-relaxe/mis-optimize the
  instructions.
  Even if that wouldn't be the case, it's good to produce the exact
  sequence, as that ensures that linkers can perform optimizing
  relaxations.

  This patch:

  * implements support for 16MiB TLS area size instead of 4GiB TLS area
    size. Ideally clang would grow an -mtls-size option to allow support
    for both, but that's not part of this patch.
  * by default doesn't produce local dynamic access patterns, as even
    modern ld.bfd and ld.gold linkers do not support the associated
    relocations. An option (-aarch64-elf-ldtls-generation) is added to
    enable generation of local dynamic code sequence, but is off by
    default.
  * makes sure that the exact expected code sequence for local dynamic
    and general dynamic accesses is produced, by making use of a new
    pseudo instruction. The patch also removes two
    (AArch64ISD::TLSDESC_BLR, AArch64ISD::TLSDESC_CALL) pre-existing
    AArch64-specific pseudo SDNode instructions that are superseded by
    the new one (TLSDESC_CALLSEQ).

Submitted by:	Kristof Beyls
Differential Revision:	https://reviews.freebsd.org/D2175
2015-03-30 20:01:41 +00:00
Ed Maste
e3327e3942 Import lldb r233478: Fix build failure on Freebsd with gcc 4.9.
llvm.org/pr23051

Submitted by:	rodrigc
2015-03-28 18:29:13 +00:00
Ed Maste
acf33b5c74 lldb: Move debug register output into __amd64__
This debug register diagnostic is really only applicable to amd64 at
present.

Sponsored by:	The FreeBSD Foundation
2015-03-27 19:42:38 +00:00
Dimitry Andric
24db767d81 Add llvm patch corresponding to r280400. 2015-03-23 21:15:07 +00:00
Dimitry Andric
c738625756 Pull in r230348 from upstream llvm trunk (by Tim Northover):
ARM: treat [N x i32] and [N x i64] as AAPCS composite types

  The logic is almost there already, with our special homogeneous
  aggregate handling. Tweaking it like this allows front-ends to emit
  AAPCS compliant code without ever having to count registers or add
  discarded padding arguments.

  Only arrays of i32 and i64 are needed to model AAPCS rules, but I
  decided to apply the logic to all integer arrays for more consistency.

This fixes a possible "Unexpected member type for HA" error when
compiling lib/msun/bsdsrc/b_tgamma.c for armv6.

Reported by:	Jakub Palider <jpa@semihalf.com>
2015-03-23 21:13:29 +00:00
Dimitry Andric
be01698709 Add FREEBSD-Xlist files for llvm, clang and lldb.
These are generated, and not "optimized" in any way, since I am not
entirely sure of the syntax or format of this type of file.  Feel free
to suggest ways of shortening these lists.

The general idea is the same for all three files, though:
* Get rid of upstream build infrastructure (CMakeLists, Makefiles, etc)
* Delete tests, tools and utilities we don't want or use (including
  samples)
* Remove various bits of upstream metadata files that we don't want or
  use (.arcconfig, .gitignore, etc)
2015-03-22 17:56:49 +00:00
Dimitry Andric
08122893fe Update README for the 3.6.0 release. 2015-03-09 21:31:37 +00:00
Dimitry Andric
cef93a3d52 Merge llvm 3.6.0 final from ^/vendor/llvm/dist, merge clang 3.6.0 final
from ^/vendor/clang/dist, and resolve conflicts.
2015-02-25 18:50:24 +00:00
Dimitry Andric
79a79bd7c1 Belatedly add llvm patch corresponding to r278367. 2015-02-22 16:28:24 +00:00
Dimitry Andric
9b2a0d91b8 Merge ^/head r279023 through r279162. 2015-02-22 16:04:37 +00:00
Dimitry Andric
680ef382a2 Add llvm patch corresponding to r279161. 2015-02-22 15:56:16 +00:00
Dimitry Andric
a6d980a99e Pull in r230058 from upstream llvm trunk (by Benjamin Kramer):
LoopRotate: When reconstructing loop simplify form don't split edges
  from indirectbrs.

  Yet another chapter in the endless story. While this looks like we
  leave the loop in a non-canonical state this replicates the logic in
  LoopSimplify so it doesn't diverge from the canonical form in any way.

  http://llvm.org/PR21968

This fixes a "Cannot split critical edge from IndirectBrInst" assertion
failure when building the devel/radare2 port.

PR:		195480, 196987
MFC after:	3 days
2015-02-22 15:51:49 +00:00
Dimitry Andric
b09980d164 Merge llvm 3.6.0rc4 from ^/vendor/llvm/dist, merge clang 3.6.0rc4 from
^/vendor/clang/dist, resolve conflicts, and update patches.
2015-02-19 22:20:19 +00:00
Dimitry Andric
714e3c812d Merge ^/head r278756 through r278915. 2015-02-17 19:53:41 +00:00
Ed Maste
b153f37ffc lldb: workaround to permit cross-arch core file debugging
FreeBSD core files have no section table and thus LLDB's OS and vendor
detection logic does not work. If we encounter such an ELF file, update
an unknown OS to match the host.

This is not really the correct way to handle this, but more extensive
rework of ObjectFileELF will be needed and this change restores cross-
arch core debugging until that can be completed.
2015-02-17 18:33:17 +00:00
Dimitry Andric
44f7b0dcc5 Merge llvm 3.6.0rc3 from ^/vendor/llvm/dist, merge clang 3.6.0rc3 from
^/vendor/clang/dist, resolve conflicts, and update patches README.
2015-02-14 14:13:00 +00:00
Ed Maste
17832a58a4 Use FreeBSD ProcessMonitor.h on FreeBSD
There's an unfortunate layering issue between LLDB's Process/POSIX and
Process/{FreeBSD,Linux}, exposed by a refactoring in upstream revision
218568.  Work around it by adding explicit #if defined(__FreeBSD__)
guards to include the correct header.
2015-02-08 16:18:46 +00:00
Ed Maste
7e79b605cb Remove undesired LLDB_DISABLE_PYTHON
It was added accidentally during the merge and it causes build warnings
as it is set from the command line.
2015-02-08 16:00:35 +00:00
Ed Maste
60903fda75 Revert LLDB compatibility changes for Clang 3.5 API
This reverts FreeBSD SVN r275134 and r275127, restoring the following
upstream revisions:

     SVN       git
    214335  59a1f270
    214340  42f16b1e
    214501  26d6f063
    215969  a083c0db
    216603  ee9cd340
    216810  f534f503

Sponsored by:	DARPA, AFRL
2015-02-08 14:28:43 +00:00
Dimitry Andric
ad8292ff21 Pull in r227089 from upstream llvm trunk (by Vasileios Kalintiris):
[mips] Enable arithmetic and binary operations for the i128 data type.

  Summary:
  This patch adds support for some operations that were missing from
  128-bit integer types (add/sub/mul/sdiv/udiv... etc.). With these
  changes we can support the __int128_t and __uint128_t data types
  from C/C++.

  Depends on D7125

  Reviewers: dsanders

  Subscribers: llvm-commits

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

This fixes "error in backend" messages, when compiling parts of
compiler-rt using 128-bit integer types for mips64.

Reported by:	sbruno
PR:		197259
2015-02-07 23:25:56 +00:00
Dimitry Andric
57fd0bcf03 Back out r278349 and r278350 for now, since this apparently blows up the
kernel build in sys/dev/hptmv/hptproc.c for some people.

Reported by:	sbruno, Matthew Fuller <fullermd@over-yonder.net>
2015-02-07 16:57:32 +00:00
Dimitry Andric
6a0d02c731 Add llvm patch corresponding to r278349. 2015-02-07 12:52:34 +00:00
Dimitry Andric
12752a4a78 Pull in r224884 from upstream llvm trunk (by Keno Fischer):
[FastIsel][X86] Fix invalid register replacement for bool args

  Summary:
  Consider the following IR:

   %3 = load i8* undef
   %4 = trunc i8 %3 to i1
   %5 = call %jl_value_t.0* @foo(..., i1 %4, ...)
   ret %jl_value_t.0* %5

  Bools (that are the result of direct truncs) are lowered as whatever
  the argument to the trunc was and a "and 1", causing the part of the
  MBB responsible for this argument to look something like this:

   %vreg8<def,tied1> = AND8ri %vreg7<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg8,%vreg7

  Later, when the load is lowered, it will insert

   %vreg15<def> = MOV8rm %vreg14, 1, %noreg, 0, %noreg; mem:LD1[undef] GR8:%vreg15 GR64:%vreg14

  but remember to (at the end of isel) replace vreg7 by vreg15. Now for
  the bug. In fast isel lowering, we mistakenly mark vreg8 as the result
  of the load instead of the trunc. This adds a fixup to have
  vreg8 replaced by whatever the result of the load is as well, so
  we end up with

   %vreg15<def,tied1> = AND8ri %vreg15<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg15

  which is an SSA violation and causes problems later down the road.

  This fixes PR21557.

  Test Plan: Test test case from PR21557 is added to the test suite.

  Reviewers: ributzka

  Reviewed By: ributzka

  Subscribers: llvm-commits

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

This fixes a possible assertion failure when compiling toolbox.cxx from
LibreOffice 4.3.5.

Reported by:	kwm
2015-02-07 12:50:33 +00:00
Ed Maste
7aa51b7949 Update LLDB snapshot to upstream r225923 (git 2b588ecd)
Sponsored by:	DARPA, AFRL
2015-02-06 22:25:21 +00:00
Dimitry Andric
19bd6fc76e Add the llvm patch corresponding to r278112. 2015-02-02 20:36:16 +00:00
Dimitry Andric
0f0f2bfa77 Pull in r227752 from upstream llvm trunk (by Michael Kuperstein):
[X86] Convert esp-relative movs of function arguments to pushes, step 2

  This moves the transformation introduced in r223757 into a separate MI pass.
  This allows it to cover many more cases (not only cases where there must be a
  reserved call frame), and perform rudimentary call folding. It still doesn't
  have a heuristic, so it is enabled only for optsize/minsize, with stack
  alignment <= 8, where it ought to be a fairly clear win.

  (Re-commit of r227728)

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

This helps to get sys/boot/i386/boot2 below the required size again,
when optimizing with -Oz.
2015-02-02 20:34:40 +00:00
Dimitry Andric
73ee00cef5 Merge ^/head r278005 through r278109. 2015-02-02 20:18:47 +00:00
Dimitry Andric
b73700f547 Belatedly add the clang patch corresponding to r277423. 2015-02-02 20:05:52 +00:00
Dimitry Andric
2e5092d911 Belatedly bump the clang repository URL for 3.6.0 RC2. 2015-02-01 01:53:59 +00:00
Dimitry Andric
3de688eb16 Merge llvm 3.6.0rc2 from ^/vendor/llvm/dist, merge clang 3.6.0rc2 from
^/vendor/clang/dist, resolve conflicts, and cleanup patches.
2015-01-31 21:57:38 +00:00
Dimitry Andric
8179004eba Merge ^/head r277719 through 277776. 2015-01-26 21:41:54 +00:00
Dimitry Andric
09e84db383 Add llvm and clang patches corresponding to r277774 and r277775. 2015-01-26 21:24:04 +00:00
Dimitry Andric
fce16cf29f Pull in r227062 from upstream clang trunk (by Renato Golin):
Allows Clang to use LLVM's fixes-x18 option

  This patch allows clang to have llvm reserve the x18
  platform register on AArch64. FreeBSD will use this in the kernel for
  per-cpu data but has no need to reserve this register in userland so
  will need this flag to reserve it.

  This uses llvm r226664 to allow this register to be reserved.

  Patch by Andrew Turner.

Requested by:	andrew
2015-01-26 21:19:24 +00:00
Dimitry Andric
5ada58c747 Pull in r226664 from upstream llvm trunk (by Tim Northover):
AArch64: add backend option to reserve x18 (platform register)

  AAPCS64 says that it's up to the platform to specify whether x18 is
  reserved, and a first step on that way is to add a flag controlling
  it.

  From: Andrew Turner <andrew@fubar.geek.nz>

Requested by:	andrew
2015-01-26 21:17:14 +00:00
Dimitry Andric
477129542c Merge ^/head r277327 through r277718. 2015-01-25 23:43:12 +00:00
Dimitry Andric
39d628a0c7 Merge llvm 3.6.0rc1 from ^/vendor/llvm/dist, merge clang 3.6.0rc1 from
^/vendor/clang/dist, resolve conflicts, and cleanup patches.
2015-01-25 23:36:55 +00:00
Sean Bruno
20ef3b88cd Allow clang to be built for mips/mips64 backend types by adding our mips
triple ids

This only allows testing and does not change the defaults for mips/mips64.
They still build/use gcc by default.

Differential Revision:	https://reviews.freebsd.org/D1190
Reviewed by:	dim
2015-01-20 17:00:28 +00:00
Dimitry Andric
9cac79b378 Upgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix
only release, no new features have been added.

Please note that this version requires C++11 support to build; see
UPDATING for more information.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.5.1/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.5.1/tools/clang/docs/ReleaseNotes.html>

MFC after:	1 month
X-MFC-With:	276479
2015-01-18 14:14:47 +00:00
Dimitry Andric
61b3223976 Add llvm patch corresponding to r276786. 2015-01-07 19:38:52 +00:00
Dimitry Andric
6849e1fd53 Pull in r222292 from upstream llvm trunk (by Weiming Zhao):
[Aarch64] Customer lowering of CTPOP to SIMD should check for NEON
  availability

This ensures llvm's AArch64 backend does not emit floating point
instructions if they are disabled.
2015-01-07 19:37:26 +00:00
Dimitry Andric
c956f15874 Add clang and llvm patches corresponding to r276516 and r276537. 2015-01-02 14:58:41 +00:00
Dimitry Andric
e5eac9539c Pull in r222587 from upstream llvm trunk (by Jörg Sonnenberger):
Fix transformation of add with pc argument to adr for non-immediate
  arguments.

This fixes an "Unimplemented" error when assembling certain ARM add
instructions with pc-relative arguments.

Reported by:	sbruno
PR:		196412, 196423
2015-01-02 14:55:02 +00:00
Dimitry Andric
f9d068d10d Pull in r213790 from upstream clang trunk (by Richard Smith):
PR20228: don't retain a pointer to a vector element after the
  container has been resized.

This fixes a possible crash when compiling certain parts of libc++'s
type_traits header.
2015-01-01 22:44:02 +00:00
Dimitry Andric
55b7c2bcf9 Add llvm patches corresponding to r276300, r276301 and r276324. 2014-12-28 02:33:13 +00:00
Dimitry Andric
c1ddc1e628 Pull in r224890 from upstream llvm trunk (by David Majnemer):
PowerPC: CTR shouldn't fire if a TLS call is in the loop

  Determining the address of a TLS variable results in a function call in
  certain TLS models.  This means that a simple ICmpInst might actually
  result in invalidating the CTR register.

  In such cases, do not attempt to rely on the CTR register for loop
  optimization purposes.

  This fixes PR22034.

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

This fixes a "Invalid PPC CTR loop" error when compiling parts of libc
for PowerPC-32.
2014-12-28 02:30:03 +00:00
Dimitry Andric
630590abbc Pull in r221703 from upstream llvm trunk (by Bill Schmidt):
[PowerPC] Replace foul hackery with real calls to __tls_get_addr

  My original support for the general dynamic and local dynamic TLS
  models contained some fairly obtuse hacks to generate calls to
  __tls_get_addr when lowering a TargetGlobalAddress.  Rather than
  generating real calls, special GET_TLS_ADDR nodes were used to wrap
  the calls and only reveal them at assembly time.  I attempted to
  provide correct parameter and return values by chaining CopyToReg and
  CopyFromReg nodes onto the GET_TLS_ADDR nodes, but this was also not
  fully correct.  Problems were seen with two back-to-back stores to TLS
  variables, where the call sequences ended up overlapping with unhappy
  results.  Additionally, since these weren't real calls, the proper
  register side effects of a call were not recorded, so clobbered values
  were kept live across the calls.

  The proper thing to do is to lower these into calls in the first
  place.  This is relatively straightforward; see the changes to
  PPCTargetLowering::LowerGlobalTLSAddress() in PPCISelLowering.cpp.
  The changes here are standard call lowering, except that we need to
  track the fact that these calls will require a relocation.  This is
  done by adding a machine operand flag of MO_TLSLD or MO_TLSGD to the
  TargetGlobalAddress operand that appears earlier in the sequence.

  The calls to LowerCallTo() eventually find their way to
  LowerCall_64SVR4() or LowerCall_32SVR4(), which call FinishCall(),
  which calls PrepareCall().  In PrepareCall(), we detect the calls to
  __tls_get_addr and immediately snag the TargetGlobalTLSAddress with
  the annotated relocation information.  This becomes an extra operand
  on the call following the callee, which is expected for nodes of type
  tlscall.  We change the call opcode to CALL_TLS for this case.  Back
  in FinishCall(), we change it again to CALL_NOP_TLS for 64-bit only,
  since we require a TOC-restore nop following the call for the 64-bit
  ABIs.

  During selection, patterns in PPCInstrInfo.td and PPCInstr64Bit.td
  convert the CALL_TLS nodes into BL_TLS nodes, and convert the
  CALL_NOP_TLS nodes into BL8_NOP_TLS nodes.  This replaces the code
  removed from PPCAsmPrinter.cpp, as the BL_TLS or BL8_NOP_TLS
  nodes can now be emitted normally using their patterns and the
  associated printTLSCall print method.

  Finally, as a result of these changes, all references to get-tls-addr
  in its various guises are no longer used, so they have been removed.

  There are existing TLS tests to verify the changes haven't messed
  anything up).  I've added one new test that verifies that the problem
  with the original code has been fixed.

This fixes a fatal "Bad machine code" error when compiling parts of
libgomp for 32-bit PowerPC.
2014-12-27 14:50:53 +00:00
Dimitry Andric
1ee9c19fb9 Pull in r213890 from upstream llvm trunk (by Jörg Sonnenberger):
Use the same .eh_frame encoding for 32bit PPC as on i386.

This fixes DT_TEXTREL errors when linking C++ objects using exceptions
on PowerPC.
2014-12-27 14:38:15 +00:00
Dimitry Andric
7b4faa6c04 Add llvm patches corresponding to r276211 and r276223. 2014-12-26 00:10:08 +00:00
Dimitry Andric
c47b215d21 Pull in r224415 from upstream llvm trunk (by Justin Hibbits):
Add parsing of 'foo@local".

  Summary:
  Currently, it supports generating, but not parsing, this expression.
  Test added as well.

  Test Plan: New test added, no regressions due to this.

  Reviewers: hfinkel

  Reviewed By: hfinkel

  Subscribers: llvm-commits

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

Pull in r224494 from upstream llvm trunk (by Justin Hibbits):

  Add a corresponding '@LOCAL' parse to match r224415.

  Pointed out by Jim Grosbach.
2014-12-25 23:57:31 +00:00
Dimitry Andric
c26ad6e55e Amend r276211 for the new PowerPC relocation types that were added
there.  (Upstream is now using a generated file for this, so there is no
direct upstream commit associated with this change.)
2014-12-25 23:54:57 +00:00
Dimitry Andric
404df5bbd5 Pull in r214284 from upstream llvm trunk (by Hal Finkel):
[PowerPC] Add JMP_SLOT relocation definitions

  This will be required by upcoming patches for LLDB support.

  Patch by Justin Hibbits!

Pull in r221510 from upstream llvm trunk (by Justin Hibbits):

  Add Position-independent Code model Module API.

  Summary:
  This makes PIC levels a Module flag attribute, which can be queried by the
  backend.  The flag is named `PIC Level`, and can have a value of:

    0 - Backend-default
    1 - Small-model (-fpic)
    2 - Large-model (-fPIC)

  These match the `-pic-level' command line argument for clang, and the value of the
  preprocessor macro `__PIC__'.

  Test Plan:
  New flags tests specific for the 'PIC Level' module flag.
  Tests to be added as part of a future commit for PowerPC, which will use this new API.

  Reviewers: rafael, echristo

  Reviewed By: rafael, echristo

  Subscribers: rafael, llvm-commits

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

Pull in r221791 from upstream llvm trunk (by Justin Hibbits):

  Add support for small-model PIC for PowerPC.

  Summary:
  Large-model was added first.  With the addition of support for multiple PIC
  models in LLVM, now add small-model PIC for 32-bit PowerPC, SysV4 ABI.  This
  generates more optimal code, for shared libraries with less than about 16380
  data objects.

  Test Plan: Test cases added or updated

  Reviewers: joerg, hfinkel

  Reviewed By: hfinkel

  Subscribers: jholewinski, mcrosier, emaste, llvm-commits

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

Together, these changes implement small-model PIC support for PowerPC.

Thanks to Justin Hibbits and Roman Divacky for their assistance in
getting this working.
2014-12-25 18:22:22 +00:00
Dimitry Andric
42ac84b368 Remove doubled patch, which snuck in with the last merge from head. 2014-12-25 16:58:48 +00:00
Dimitry Andric
e65720e1ac Merge ^/head r275759 through r275911. 2014-12-18 18:44:22 +00:00
Dimitry Andric
580210532a Add clang patch corrsponding to r275773. 2014-12-14 18:21:03 +00:00
Dimitry Andric
01a314e59a Pull in r221170 from upstream clang trunk (by Roman Divacky):
Implement vaarg lowering for ppc32. Lowering of scalars and
  aggregates is supported. Complex numbers are not.

This adds va_args support for PowerPC (32 bit) to clang.
2014-12-14 18:20:03 +00:00
Dimitry Andric
f843434e37 Update clang patch for r275759 to use correct test cases. 2014-12-14 18:16:49 +00:00
Dimitry Andric
be038cc81f Add clang patch corresponding to r275759. 2014-12-14 13:40:42 +00:00
Dimitry Andric
b567315ffc Pull in r221170 from upstream clang trunk (by Roman Divacky):
Implement vaarg lowering for ppc32. Lowering of scalars and
  aggregates is supported. Complex numbers are not.

This adds va_args support for PowerPC (32 bit) to clang.

Reviewed by:	jhibbits
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D1308
2014-12-14 13:38:10 +00:00
Dimitry Andric
b7f7b09969 Update patch-r274286-llvm-r201784-asm-dollar.diff, so
test/MC/AsmParser/macros.s is properly deleted when patching.
2014-12-14 13:32:14 +00:00
Dimitry Andric
60d2871897 Update llvm patch for r275635 so all the tests will pass. 2014-12-13 20:17:54 +00:00
Dimitry Andric
e5141ad104 Update llvm patches for r274286 and r275633 so all the tests will pass. 2014-12-13 18:54:46 +00:00
Dimitry Andric
bdc6b44506 Add llvm patch corresponding to r275654, and clean up a few other patches. 2014-12-09 20:46:17 +00:00
Dimitry Andric
3f0ad6cf3c Pull in r223147, r223255 and r223390 from upstream llvm trunk (by Roman
Divacky):

  Introduce CPUStringIsValid() into MCSubtargetInfo and use it for ARM
  .cpu parsing.

  Previously .cpu directive in ARM assembler didnt switch to the new
  CPU and therefore acted as a nop. This implemented real action for
  .cpu and eg. allows to assembler FreeBSD kernel with -integrated-as.

  Change the name to be in style.

  Add a FIXME as requested by Renato Golin.
2014-12-09 20:41:51 +00:00
Dimitry Andric
ee287c9033 Add llvm patch corresponding to r275635. 2014-12-09 20:05:05 +00:00
Dimitry Andric
2ee6121f79 Add llvm patch corresponding to r275633. 2014-12-09 20:04:26 +00:00
Dimitry Andric
292d912acf Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin):
PR21302. Vectorize only bottom-tested loops.

  rdar://problem/18886083

This fixes a bug in the llvm vectorizer, which could sometimes cause
vectorized loops to perform an additional iteration, leading to possible
buffer overruns.  Symptoms of this, which are usually segfaults, were
first noticed when building gcc ports, here:

https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html
https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html

Note: because this is applied on top of llvm/clang 3.5.0, this fix is
slightly different from the one just checked into head in r275633.
2014-12-09 07:48:25 +00:00
Dimitry Andric
cd9521158d Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin):
PR21302. Vectorize only bottom-tested loops.

  rdar://problem/18886083

This fixes a bug in the llvm vectorizer, which could sometimes cause
vectorized loops to perform an additional iteration, leading to possible
buffer overruns.  Symptoms of this, which are usually segfaults, were
first noticed when building gcc ports, here:

https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html
https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html

Since this fix is very important for ports, bump __FreeBSD_version to
make it easier for port maintainers to test whether the fix has been
applied.

Upstream PR:	http://llvm.org/PR21302
MFC after:	3 days
2014-12-09 07:34:28 +00:00
Dimitry Andric
d814fbe9d2 Add patch file for r275362. 2014-12-01 13:07:49 +00:00
Dimitry Andric
258fa8bc6c For now, enable the clrex instruction for armv6, until upstream
implements this properly.

Submitted by:	andrew
2014-12-01 12:59:21 +00:00
Dimitry Andric
5901d9eeec Add patch file for r275280. 2014-11-30 00:09:26 +00:00
Dimitry Andric
ee2ab7175c Pull in r215811 from upstream llvm trunk (by Nico Weber):
arm asm: Let .fpu enable instructions, PR20447.

  I'm not very happy with duplicating the fpu->feature mapping in ARMAsmParser.cpp
  and in clang's driver. See the bug for a patch that doesn't do that, and the
  review thread [1] for why this duplication exists.

  1: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140811/231052.html

This makes the .fpu directive work properly, so we can successfully
assemble several .S files using the directive, under lib/libc/arm.
2014-11-30 00:08:14 +00:00
Dimitry Andric
51cbfda29f Add patch file for r275265. 2014-11-29 20:24:18 +00:00
Dimitry Andric
50e3cdf0d7 Remove bogus revision numbers from diff header lines in the existing
llvm/clang patches.
2014-11-29 20:23:18 +00:00
Dimitry Andric
e1715afea7 Pull in r214802 from upstream llvm trunk (by Renato Golin):
Allow CP10/CP11 operations on ARMv5/v6

  Those registers are VFP/NEON and vector instructions should be used instead,
  but old cores rely on those co-processors to enable VFP unwinding. This change
  was prompted by the libc++abi's unwinding routine and is also present in many
  legacy low-level bare-metal code that we ought to compile/assemble.

  Fixing bug PR20025 and allowing PR20529 to proceed with a fix in libc++abi.

This enables assembling certain ARM instructions used in libgcc.
2014-11-29 20:18:08 +00:00
Dimitry Andric
e19eaefe3a Add patch file for r275160. 2014-11-27 00:39:01 +00:00
Dimitry Andric
6a37c166fb Pull in r222856 from upstream llvm trunk (by David Majnemer):
Revert "Added inst combine transforms for single bit tests from Chris's note"

  This reverts commit r210006, it miscompiled libapr which is used in who
  knows how many projects.

  A test has been added to ensure that we don't regress again.

This fixes a miscompilation in libapr, which caused problems in svnlite.
2014-11-27 00:33:31 +00:00
Dimitry Andric
4e734b2430 Add patch files for r275152, r275153 and r275154. 2014-11-26 23:57:12 +00:00
Dimitry Andric
cdf306c8b1 Pull in r221900 from upstream clang trunk (by Ed Maste):
Hook up FreeBSD AArch64 support

  Patch from Andrew Turner.
2014-11-26 23:54:23 +00:00
Dimitry Andric
b57715cff8 Pull in r216571 from upstream llvm trunk (by Zachary Turner):
Fix some semantic usability issues with DynamicLibrary.

  This patch allows invalid DynamicLibrary instances to be
  constructed, and fixes the const-correctness of the isValid()
  method.

  No functional change.

This is needed for supporting the upgrade to a newer LLDB snapshot.
2014-11-26 23:53:35 +00:00
Dimitry Andric
b5479adaec Pull in r215352 from upstream llvm trunk (by Tim Northover):
AArch64: add support for dynamic-loader relocations

  LLD needs them, and it's good to be able to print them properly when
  our object dumpers encounter them.

  Patch by Daniel Stewart.

This is needed for supporting the upgrade to a newer LLDB snapshot.
2014-11-26 23:52:59 +00:00
Ed Maste
10b16cca63 Remove additional platform-specific LLDB code 2014-11-26 18:03:25 +00:00
Ed Maste
dcb99b2156 Revert LLDB changes for Clang/LLVM 3.5 API compatibility
This reverts the following upstream revisions:

      SVN      git
    214335  59a1f270
    214340  42f16b1e
2014-11-26 18:02:22 +00:00
Ed Maste
2691e63cfa Remove LLDB platform support not currently of interest to us 2014-11-26 17:32:20 +00:00
Ed Maste
5dd0c6d9b9 Update paths for FreeBSD build infrastructure
This same change was applied upstream in a later verison.
2014-11-26 17:29:01 +00:00
Ed Maste
7f04dba99f There is no Python in the FreeBSD base system 2014-11-26 17:24:12 +00:00
Ed Maste
a01d545e93 Avoid need for AppleObjCRuntime on FreeBSD
Since it is unlikely to provide much value to us, just #if 0 it away

Sponsored by:	DARPA, AFRL
2014-11-26 17:22:37 +00:00
Ed Maste
85dd3ec148 Revert LLDB changes for Clang/LLVM 3.5 API compatibility
This reverts the following upstream revisions:

     SVN       git
    214501  26d6f063
    215969  a083c0db
    216603  ee9cd340
    216810  f534f503

Sponsored by:	DARPA, AFRL
2014-11-26 17:09:58 +00:00
Ed Maste
0127ef0f2c Update LLDB snapshot to upstream r216948 (git 50f7fe44)
This is approximately "LLDB 3.5" although with a little bit of skew,
and will go along with the Clang 3.5 import.

Sponsored by:	DARPA, AFRL
2014-11-26 16:48:12 +00:00
Ed Maste
fc8fb3476a Revert Clang 3.4 API compatibility changes
Re-apply previously reverted changes to restore LLDB to parity with
the last update as of upstream revision 202189. This is the first step
an LLDB update to correspond with the Clang 3.5 import and re-applies
the following upstream revisions:

      SVN      git
    199408  3ad0a1a1
    199689  05be72c3
    200085  9ad47a93

Sponsored by:	DARPA, AFRL
2014-11-26 16:23:32 +00:00
Dimitry Andric
db41cedf01 Cleanup upstream build infrastructure files that we don't use. 2014-11-24 20:57:20 +00:00
Dimitry Andric
2778984cca Cleanup patch set, and update README.TXT. Add three new patches. 2014-11-24 18:43:37 +00:00
Dimitry Andric
59d1ed5b20 Merge clang 3.5.0 release from ^/vendor/clang/dist, resolve conflicts,
and preserve our customizations, where necessary.
2014-11-24 18:11:16 +00:00
Dimitry Andric
91bc56ed82 Merge llvm 3.5.0 release from ^/vendor/llvm/dist, resolve conflicts, and
preserve our customizations, where necessary.
2014-11-24 17:02:24 +00:00
Baptiste Daroussin
b8f344397c Fix an error (case on a .Nm) preventing mandoc from rendering the manpage
Fix mandoc warnings: extrat space at end of lines
2014-11-23 22:01:43 +00:00
Dimitry Andric
daf03b8dad The fix imported into llvm in r274442 contains some C++11 constructs,
which gcc in base cannot handle.  Replace these with C++98 equivalents.

While here, add the patch for the adapted fix.

Reported by:	bz, kib
Pointy hat to:	dim
MFC after:	1 week
X-MFC-With:	r274442
2014-11-13 21:16:01 +00:00
Dimitry Andric
6a3e479401 Pull in r221709 from upstream llvm trunk (by Frédéric Riss):
Totally forget deallocated SDNodes in SDDbgInfo.

  What would happen before that commit is that the SDDbgValues associated with
  a deallocated SDNode would be marked Invalidated, but SDDbgInfo would keep
  a map entry keyed by the SDNode pointer pointing to this list of invalidated
  SDDbgNodes. As the memory gets reused, the list might get wrongly associated
  with another new SDNode. As the SDDbgValues are cloned when they are transfered,
  this can lead to an exponential number of SDDbgValues being produced during
  DAGCombine like in http://llvm.org/bugs/show_bug.cgi?id=20893

  Note that the previous behavior wasn't really buggy as the invalidation made
  sure that the SDDbgValues won't be used. This commit can be considered a
  memory optimization and as such is really hard to validate in a unit-test.

This should fix abnormally large memory usage and resulting OOM crashes
when compiling certain ports with debug information.

Reported by:	Dmitry Marakasov <amdmi3@amdmi3.ru>
Upstream PRs:	http://llvm.org/PR19031 http://llvm.org/PR20893
MFC after:	1 week
2014-11-12 20:01:10 +00:00
Dimitry Andric
9e9c431823 Add llvm patch corresponding to r274286. 2014-11-08 16:37:59 +00:00
Dimitry Andric
13235011d5 Pull in r201784 from upstream llvm trunk (by Benjamin Kramer):
AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets.

  There is code in the wild that relies on $0 not being expanded.

This fixes some cases of using $ signs in literals being incorrectly
assembled.

Reported by:	Richard Henderson
Upstream PR:	http://llvm.org/PR21500
MFC after:	3 days
2014-11-08 13:19:48 +00:00
Dimitry Andric
819c857f10 Add a few missing llvm/clang patches, update the other ones to be able
to apply with the same patch options onto a fresh upstream llvm/clang
3.4.1 checkout, and use approximately the same header tempate for them.

MFC after:	3 days
2014-09-21 15:37:39 +00:00
Dimitry Andric
e42bbd58d9 Pull in r217410 from upstream llvm trunk (by Bob Wilson):
Set trunc store action to Expand for all X86 targets.

  When compiling without SSE2, isTruncStoreLegal(F64, F32) would return
  Legal, whereas with SSE2 it would return Expand. And since the Target
  doesn't seem to actually handle a truncstore for double -> float, it
  would just output a store of a full double in the space for a float
  hence overwriting other bits on the stack.

  Patch by Luqman Aden!

This should fix clang -O0 on i386 assigning garbage to floats, in
certain scenarios.

PR:		187437
Submitted by:	cebd@gmail.com
Obtained from:	http://llvm.org/viewvc/llvm-project?rev=217410&view=rev
MFC after:	3 days
2014-09-14 18:50:38 +00:00
Ed Maste
3b1afa79c3 Add clang patch corresponding to r271432 2014-09-11 18:20:49 +00:00