[llvm-branch-commits] Reland "[compiler-rt] Allow running tests without installing first" (PR #88075)

2024-04-09 Thread Martin Storsjö via llvm-branch-commits

mstorsjo wrote:

> @mstorsjo It would be great if you could test this on windows.

Thanks, this does seem to run fine in my configuration!

https://github.com/llvm/llvm-project/pull/88075
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] release/18.x: [libcxx] [modules] Fix relative paths with absolute LIBCXX_INSTALL_MODULES_DIR (#85756) (PR #85907)

2024-03-20 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo closed 
https://github.com/llvm/llvm-project/pull/85907
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] release/18.x: [libcxx] [modules] Fix relative paths with absolute LIBCXX_INSTALL_MODULES_DIR (#85756) (PR #85907)

2024-03-20 Thread Martin Storsjö via llvm-branch-commits

mstorsjo wrote:

Closing this backport PR, the original commits had to be reverted (in 
407937036fa7640f61f225474b1ea6623a40dbdd).

https://github.com/llvm/llvm-project/pull/85907
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/18.x: [llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710) (PR #85746)

2024-03-19 Thread Martin Storsjö via llvm-branch-commits

mstorsjo wrote:

> A bit unfortunate to have these changes post-release, but I think we do need 
> to make them.

Yes, in particular as the earlier changes were backported. If the whole series 
would have been left out from 18.x, there wouldn't have been any hurry in 
backporting.

https://github.com/llvm/llvm-project/pull/85746
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [LLD] [docs] Add more release notes for COFF and MinGW (PR #81977)

2024-02-16 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo created 
https://github.com/llvm/llvm-project/pull/81977

Add review references to all items already mentioned.

Move some items to the right section (from the MinGW section to COFF, as the 
implementation is in the COFF linker side, and may be relevant for non-MinGW 
cases as well).

From 03da62f54b8f90dda00ca0632a962f9cdc73d571 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Mon, 12 Feb 2024 14:16:40 +0200
Subject: [PATCH] [LLD] [docs] Add more release notes for COFF and MinGW

Add review references to all items already mentioned.

Move some items to the right section (from the MinGW section to COFF,
as the implementation is in the COFF linker side, and may be relevant
for non-MinGW cases as well).
---
 lld/docs/ReleaseNotes.rst | 48 ---
 1 file changed, 45 insertions(+), 3 deletions(-)

diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index 82f9d93b8e86ab..56ba3463aeadc0 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -82,14 +82,46 @@ COFF Improvements
 
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
+  (`#68236 `_)
+
+* The ``-dependentloadflag`` option was implemented.
+  (`#71537 `_)
 
 * LLD now prefers library paths specified with ``-libpath:`` over the 
implicitly
   detected toolchain paths.
+  (`#78039 `_)
+
+* Added new options ``-lldemit:llvm`` and ``-lldemit:asm`` for getting
+  the output of LTO compilation as LLVM bitcode or assembly.
+  (`#66964 `_)
+  (`#67079 `_)
+
+* Added a new option ``-build-id`` for generating a ``.buildid`` section
+  when not generating a PDB. A new symbol ``__buildid`` is generated by
+  the linker, allowing code to reference the build ID of the binary.
+  (`#71433 `_)
+  (`#74652 `_)
+
+* A new, LLD specific option, ``-lld-allow-duplicate-weak``, was added
+  for allowing duplicate weak symbols.
+  (`#68077 `_)
+
+* More correctly handle LTO of files that define ``__imp_`` prefixed dllimport
+  redirections.
+  (`#70777 `_)
+  (`#71376 `_)
+  (`#72989 `_)
+
+* Linking undefined references to weak symbols with LTO now works.
+  (`#70430 `_)
 
 * Use the ``SOURCE_DATE_EPOCH`` environment variable for the PE header and
   debug directory timestamps, if neither the ``/Brepro`` nor ``/timestamp:``
   options have been specified. This makes the linker output reproducible by
   setting this environment variable.
+  (`#81326 `_)
+
+* Lots of incremental work towards supporting linking ARM64EC binaries.
 
 MinGW Improvements
 --
@@ -97,19 +129,29 @@ MinGW Improvements
 * Added support for many LTO and ThinLTO options (most LTO options supported
   by the ELF driver, that are implemented by the COFF backend as well,
   should be supported now).
+  (`D158412 `_)
+  (`D158887 `_)
+  (`#77387 `_)
+  (`#81475 `_)
 
 * LLD no longer tries to autodetect and use library paths from MSVC/WinSDK
   installations when run in MinGW mode; that mode of operation shouldn't
   ever be needed in MinGW mode, and could be a source of unexpected
   behaviours.
+  (`D144084 `_)
 
 * The ``--icf=safe`` option now works as expected; it was previously a no-op.
-
-* More correctly handle LTO of files that define ``__imp_`` prefixed dllimport
-  redirections.
+  (`#70037 `_)
 
 * The strip flags ``-S`` and ``-s`` now can be used to strip out DWARF debug
   info and symbol tables while emitting a PDB debug info file.
+  (`#75181 `_)
+
+* The option ``--dll`` is handled as an alias for the ``--shared`` option.
+  (`#68575 `_)
+
+* The option ``--sort-common`` is ignored now.
+  (`#66336 `_)
 
 MachO Improvements
 --

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [LLD] [docs] Add more release notes for COFF and MinGW (PR #81977)

2024-02-16 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo milestoned 
https://github.com/llvm/llvm-project/pull/81977
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP] [cmake] Don't use -fno-semantic-interposition on Windows (#81113) (PR #81332)

2024-02-16 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo approved this pull request.

Marking as approved (approved by @jhuber6), so it shows up right in PR listings.

https://github.com/llvm/llvm-project/pull/81332
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP] [cmake] Don't use -fno-semantic-interposition on Windows (#81113) (PR #81332)

2024-02-15 Thread Martin Storsjö via llvm-branch-commits

mstorsjo wrote:

Ping @jhuber6, can you ack this backport?

https://github.com/llvm/llvm-project/pull/81332
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [LLD] [docs] Add a release note for the SOURCE_DATE_EPOCH support (PR #81388)

2024-02-14 Thread Martin Storsjö via llvm-branch-commits

mstorsjo wrote:

@tstellar Can this be merged? It has been approved. I'd like to add more 
release notes here, which would go on top of this.

https://github.com/llvm/llvm-project/pull/81388
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [LLD] [docs] Add a release note for the SOURCE_DATE_EPOCH support (PR #81388)

2024-02-10 Thread Martin Storsjö via llvm-branch-commits

mstorsjo wrote:

This goes along with/after #81384 (which is approved but not yet merged).

https://github.com/llvm/llvm-project/pull/81388
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [LLD] [docs] Add a release note for the SOURCE_DATE_EPOCH support (PR #81388)

2024-02-10 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo created 
https://github.com/llvm/llvm-project/pull/81388

None

From 4a6f8dbf3993e6a8687c0711f073bc79823727a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Sun, 11 Feb 2024 00:49:26 +0200
Subject: [PATCH] [LLD] [docs] Add a release note for the SOURCE_DATE_EPOCH
 support

---
 lld/docs/ReleaseNotes.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index fa0e7f2bc0b3ea..82f9d93b8e86ab 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -86,6 +86,11 @@ COFF Improvements
 * LLD now prefers library paths specified with ``-libpath:`` over the 
implicitly
   detected toolchain paths.
 
+* Use the ``SOURCE_DATE_EPOCH`` environment variable for the PE header and
+  debug directory timestamps, if neither the ``/Brepro`` nor ``/timestamp:``
+  options have been specified. This makes the linker output reproducible by
+  setting this environment variable.
+
 MinGW Improvements
 --
 

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [LLD] [docs] Add a release note for the SOURCE_DATE_EPOCH support (PR #81388)

2024-02-10 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo milestoned 
https://github.com/llvm/llvm-project/pull/81388
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] PR for llvm/llvm-project#80808 (PR #80811)

2024-02-06 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/80811
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [lld] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo updated 
https://github.com/llvm/llvm-project/pull/80011

From a09a391d4985d4adc1a5f500ba69b2f8f55aa47f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Tue, 30 Jan 2024 14:18:22 +0200
Subject: [PATCH 1/2] [docs] Add release notes for Windows specific changes in
 18.x

---
 clang/docs/ReleaseNotes.rst |  2 ++
 lld/docs/ReleaseNotes.rst   | 16 
 llvm/docs/ReleaseNotes.rst  | 14 ++
 3 files changed, 32 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..c0833a4ee7a31 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1195,6 +1195,8 @@ Windows Support
   linking may succeed but the resulting executables may expose issues at
   runtime.
 
+- Clang now passes relevant LTO options to the linker (LLD) in MinGW mode.
+
 LoongArch Support
 ^
 - Added builtins support for all LSX (128-bits SIMD) and LASX (256-bits SIMD)
diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index 01669543cd50c..c896d2bd537a2 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.
+
+* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations
+  when run in MinGW mode.
+
+* The ``--icf=safe`` option now works as expected; it was previously a no-op.
+
+* More correctly handle LTO of files that define ``__imp_`` prefixed dllimport
+  redirections.
+
+* The strip flags ``-S`` and ``-s`` now can be used to strip out DWARF debug
+  info and symbol tables while emitting a PDB debug info file.
+
 MachO Improvements
 --
 
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 7b6a3f10d6377..c46c4a3f767f7 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -319,6 +319,18 @@ Changes to the LLVM tools
 * llvm-objcopy now supports ``--gap-fill`` and ``--pad-to`` options, for
   ELF input and binary output files only.
 
+* llvm-rc and llvm-windres now accept file path references in ``.rc`` files
+  concatenated from multiple string literals.
+
+* The llvm-windres option ``--preprocessor`` now resolve its argument
+  in the PATH environment variable as expected, and options passed with
+  ``--preprocessor-arg`` are placed before the input file as they should.
+
+* The llvm-windres option ``--preprocessor`` has been updated with the
+  breaking behaviour change from GNU windres from binutils 2.36, where
+  the whole argument is considered as one path, not considered as a
+  sequence of tool name and parameters.
+
 Changes to LLDB
 -
 
@@ -359,6 +371,8 @@ Changes to LLDB
   fields are present, however this is not always possible or entirely
   accurate. If in doubt, refer to the numerical value.
 
+* On Windows, LLDB can now read the thread names.
+
 Changes to Sanitizers
 -
 * HWASan now defaults to detecting use-after-scope bugs.

From 366716fe1814fbe37407913f8d5b0e0438773afb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Tue, 30 Jan 2024 19:13:33 +0200
Subject: [PATCH 2/2] Apply review suggestions

---
 lld/docs/ReleaseNotes.rst  | 12 
 llvm/docs/ReleaseNotes.rst |  5 +++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index c896d2bd537a2..3ff811d6d749f 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -41,16 +41,20 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
-* Prefer library paths specified with ``-libpath:`` over the implicitly
+* LLD now prefers library paths specified with ``-libpath:`` over the 
implicitly
   detected toolchain paths.
 
 MinGW Improvements
 --
 
-* Added support for many LTO and ThinLTO options.
+* Added support for many LTO and ThinLTO options (most LTO options supported
+  by the ELF driver, that are implemented by the COFF backend as well,
+  should be supported now).
 
-* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations
-  when run in MinGW mode.
+* LLD no longer tries to autodetect and use library paths from MSVC/WinSDK
+  installations when run in MinGW mode; that mode of operation shouldn't
+  ever be needed in MinGW mode, and could be a source of unexpected
+  behaviours.
 
 * The ``--icf=safe`` option now works as expected; it was previously a no-op.
 
diff --git a/llvm/docs/ReleaseNotes.rst 

[llvm-branch-commits] [clang] [llvm] [lld] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits


@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.
+
+* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations

mstorsjo wrote:

In mingw mode, one shouldn't use MSVC/WinSDK (headers/)libraries - there's 
really no use case for that.

The root cause is that in mingw mode, one always link by calling the compiler 
driver (just like for regular unix targets), which passes all the necessary 
search paths to the linker. In MSVC style environments, one usually invokes the 
linker directly (`link.exe` or `lld-link`), and it picks up a bunch of implicit 
search paths (from the environment variable `LIB`, and LLD can also look for 
MSVC installs in default paths and/or based on registry or other things, IIRC). 
When operating in mingw mode, those implicit default paths are only a potential 
source of unexpected behaviours and surprises, so there's no opt-in.

What about:
> LLD no longer tries to autodetect and use library paths from MSVC/WinSDK 
> installations when run in MinGW mode; that mode of operation shouldn't ever 
> be needed in MinGW mode, and could be a source of unexpected behaviours.


https://github.com/llvm/llvm-project/pull/80011
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [llvm] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits


@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.

mstorsjo wrote:

It's a bunch, a bit over 20 options, if counting all the aliases - added in 
5c92c9f34a7dba804479acef62c576d1a170ef1f, 
0b51e648307cf6c21c463d3e73e51c03aaa8c9e2 and 
a08506e374f5938e30a9c13b61a697e8c0e12aa3.

The vague "many" in this case is mostly meant to be "every LTO option that the 
ELF driver supports, that also is supported in the COFF linker at the moment".

https://github.com/llvm/llvm-project/pull/80011
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] [llvm] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits


@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly

mstorsjo wrote:

Thanks, will change so it says "LLD now prefers ...".

https://github.com/llvm/llvm-project/pull/80011
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits


@@ -359,6 +371,8 @@ Changes to LLDB
   fields are present, however this is not always possible or entirely
   accurate. If in doubt, refer to the numerical value.
 
+* On Windows, LLDB can now read the thread names.

mstorsjo wrote:

@oltolm Is this accurate for 95e5839e06fdffd278499257c6e7679bba3d6868?

https://github.com/llvm/llvm-project/pull/80011
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo edited 
https://github.com/llvm/llvm-project/pull/80011
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo milestoned 
https://github.com/llvm/llvm-project/pull/80011
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo created 
https://github.com/llvm/llvm-project/pull/80011

None

From a09a391d4985d4adc1a5f500ba69b2f8f55aa47f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Tue, 30 Jan 2024 14:18:22 +0200
Subject: [PATCH] [docs] Add release notes for Windows specific changes in 18.x

---
 clang/docs/ReleaseNotes.rst |  2 ++
 lld/docs/ReleaseNotes.rst   | 16 
 llvm/docs/ReleaseNotes.rst  | 14 ++
 3 files changed, 32 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..c0833a4ee7a31 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1195,6 +1195,8 @@ Windows Support
   linking may succeed but the resulting executables may expose issues at
   runtime.
 
+- Clang now passes relevant LTO options to the linker (LLD) in MinGW mode.
+
 LoongArch Support
 ^
 - Added builtins support for all LSX (128-bits SIMD) and LASX (256-bits SIMD)
diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index 01669543cd50c..c896d2bd537a2 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.
+
+* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations
+  when run in MinGW mode.
+
+* The ``--icf=safe`` option now works as expected; it was previously a no-op.
+
+* More correctly handle LTO of files that define ``__imp_`` prefixed dllimport
+  redirections.
+
+* The strip flags ``-S`` and ``-s`` now can be used to strip out DWARF debug
+  info and symbol tables while emitting a PDB debug info file.
+
 MachO Improvements
 --
 
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 7b6a3f10d6377..c46c4a3f767f7 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -319,6 +319,18 @@ Changes to the LLVM tools
 * llvm-objcopy now supports ``--gap-fill`` and ``--pad-to`` options, for
   ELF input and binary output files only.
 
+* llvm-rc and llvm-windres now accept file path references in ``.rc`` files
+  concatenated from multiple string literals.
+
+* The llvm-windres option ``--preprocessor`` now resolve its argument
+  in the PATH environment variable as expected, and options passed with
+  ``--preprocessor-arg`` are placed before the input file as they should.
+
+* The llvm-windres option ``--preprocessor`` has been updated with the
+  breaking behaviour change from GNU windres from binutils 2.36, where
+  the whole argument is considered as one path, not considered as a
+  sequence of tool name and parameters.
+
 Changes to LLDB
 -
 
@@ -359,6 +371,8 @@ Changes to LLDB
   fields are present, however this is not always possible or entirely
   accurate. If in doubt, refer to the numerical value.
 
+* On Windows, LLDB can now read the thread names.
+
 Changes to Sanitizers
 -
 * HWASan now defaults to detecting use-after-scope bugs.

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] 7af201c - [libcxx] [doc] Remove a leftover tentative release note

2022-08-15 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2022-08-15T14:27:47+03:00
New Revision: 7af201cba581930f990f70cb99bb91e7a046b307

URL: 
https://github.com/llvm/llvm-project/commit/7af201cba581930f990f70cb99bb91e7a046b307
DIFF: 
https://github.com/llvm/llvm-project/commit/7af201cba581930f990f70cb99bb91e7a046b307.diff

LOG: [libcxx] [doc] Remove a leftover tentative release note

This release note was added tentatively in
https://reviews.llvm.org/D120982 / ebde6fc23bc0ee9d022fcd26b52bc82dfb7c8468.
The issue was resolved differently in
https://reviews.llvm.org/D125715 / bedf657d0f4c54ffe9ef4303382657a74296b544,
but that commit forgot to remove the tentative release note.

Added: 


Modified: 
libcxx/docs/ReleaseNotes.rst

Removed: 




diff  --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index 6acde0db864bf..9fd114a05585d 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -239,11 +239,6 @@ Build System Changes
   use the ``CMAKE_CXX_COMPILER_TARGET``, ``CMAKE_SYSROOT`` and 
``CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN``
   variables provided by CMake.
 
-- When building for Windows, vendors who want to avoid dll-exporting symbols 
from the static libc++abi
-  library should set ``LIBCXXABI_HERMETIC_STATIC_LIBRARY=ON`` when configuring 
CMake. The current
-  behavior, which tries to guess the correct dll-export semantics based on 
whether we're building
-  the libc++ shared library, will be removed in LLVM 16.
-
 - Previously, the C++ ABI library headers would be installed inside 
``/include/c++/v1``
   alongside the libc++ headers as part of building libc++. This is not the 
case anymore -- the
   ABI library is expected to install its headers where it wants them as part 
of its own build.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] e692f99 - [lldb] [doc] Add release notes for a few noteworthy changes for Windows in 15.x

2022-08-03 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2022-08-03T12:08:32+03:00
New Revision: e692f99b2af8f099938d64efa719a1e3a3cf7bd3

URL: 
https://github.com/llvm/llvm-project/commit/e692f99b2af8f099938d64efa719a1e3a3cf7bd3
DIFF: 
https://github.com/llvm/llvm-project/commit/e692f99b2af8f099938d64efa719a1e3a3cf7bd3.diff

LOG: [lldb] [doc] Add release notes for a few noteworthy changes for Windows in 
15.x

Added: 


Modified: 
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 3b374e2c613dd..cf41439d8dd74 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -308,6 +308,14 @@ Changes to LLDB
 
 * LLDB now supports reading memory tags from AArch64 Linux core files.
 
+* LLDB now supports the gnu debuglink section for reading debug information
+  from a separate file on Windows
+
+* LLDB now allows selecting the C++ ABI to use on Windows (between Itanium,
+  used for MingW, and MSVC) via the ``plugin.object-file.pe-coff.abi`` setting.
+  In Windows builds of LLDB, this defaults to the style used for LLVM's default
+  target.
+
 Changes to Sanitizers
 -
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] aa94b5d - [LLD] [doc] Add release notes for MinGW changes for 15.x

2022-08-03 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2022-08-03T12:07:48+03:00
New Revision: aa94b5d4e73d4c2437fe50cc5522899cce4e5b8a

URL: 
https://github.com/llvm/llvm-project/commit/aa94b5d4e73d4c2437fe50cc5522899cce4e5b8a
DIFF: 
https://github.com/llvm/llvm-project/commit/aa94b5d4e73d4c2437fe50cc5522899cce4e5b8a.diff

LOG: [LLD] [doc] Add release notes for MinGW changes for 15.x

Added: 


Modified: 
lld/docs/ReleaseNotes.rst

Removed: 




diff  --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index 6cc4cb465ad71..a2afdc4d2bf32 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -60,7 +60,8 @@ COFF Improvements
 MinGW Improvements
 --
 
-* ...
+* The ``--disable-reloc-section`` option is now supported.
+  (`D127478 `_)
 
 MachO Improvements
 --



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 2ead82c - [clang] [MinGW] Default to DWARF 4

2022-02-10 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2022-02-10T11:24:46+02:00
New Revision: 2ead82c6f972c8372f761b40fcfd7f533b632db5

URL: 
https://github.com/llvm/llvm-project/commit/2ead82c6f972c8372f761b40fcfd7f533b632db5
DIFF: 
https://github.com/llvm/llvm-project/commit/2ead82c6f972c8372f761b40fcfd7f533b632db5.diff

LOG: [clang] [MinGW] Default to DWARF 4

Neither LLDB nor GDB seem to work with DWARF 5 debug information on
Windows right now.

This applies the same change as in
9c6272861032f511a23784ce0c5cc8f6ac2f625b (Default to DWARFv4 on Windows)
to the MinGW driver too.

Differential Revision: https://reviews.llvm.org/D119326

(cherry picked from commit 6cf64b2d2858dc93c3ec93438bdaca2807847e9b)

Added: 


Modified: 
clang/lib/Driver/ToolChains/MinGW.h
clang/test/CodeGen/dwarf-version.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/MinGW.h 
b/clang/lib/Driver/ToolChains/MinGW.h
index c3de19b977246..c9553b4f46520 100644
--- a/clang/lib/Driver/ToolChains/MinGW.h
+++ b/clang/lib/Driver/ToolChains/MinGW.h
@@ -90,6 +90,8 @@ class LLVM_LIBRARY_VISIBILITY MinGW : public ToolChain {
 
   void printVerboseInfo(raw_ostream ) const override;
 
+  unsigned GetDefaultDwarfVersion() const override { return 4; }
+
 protected:
   Tool *getTool(Action::ActionClass AC) const override;
   Tool *buildLinker() const override;

diff  --git a/clang/test/CodeGen/dwarf-version.c 
b/clang/test/CodeGen/dwarf-version.c
index 47025e241d13c..0a6fa4768026d 100644
--- a/clang/test/CodeGen/dwarf-version.c
+++ b/clang/test/CodeGen/dwarf-version.c
@@ -32,6 +32,11 @@
 // Explicitly request both.
 // RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm 
-o - %s \
 // RUN: | FileCheck %s --check-prefixes=VER4,CODEVIEW
+
+// Check what version of dwarf is used for MinGW targets.
+// RUN: %clang -target i686-pc-windows-gnu -g -S -emit-llvm -o - %s | \
+// RUN:   FileCheck %s --check-prefixes=VER4
+
 // RUN: %clang -target powerpc-ibm-aix-xcoff -g -S -emit-llvm -o - %s | \
 // RUN:   FileCheck %s --check-prefix=VER3
 // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-2 -S -emit-llvm -o - %s | 
\



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] ac8818e - [docs] Mention another fixed bug in the release notes

2022-02-09 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2022-02-09T18:57:42+02:00
New Revision: ac8818e38f6ea6d84e54ff1ea2c0436ecb43bc69

URL: 
https://github.com/llvm/llvm-project/commit/ac8818e38f6ea6d84e54ff1ea2c0436ecb43bc69
DIFF: 
https://github.com/llvm/llvm-project/commit/ac8818e38f6ea6d84e54ff1ea2c0436ecb43bc69.diff

LOG: [docs] Mention another fixed bug in the release notes

Added: 


Modified: 
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 447ef45e6ae88..f513b620066a1 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -147,6 +147,10 @@ Changes to the Windows Target
   constructors), making sure that GNU ld exports all of them correctly as
   functions, not data, when linking a DLL.
 
+* Handling of temporary files on more uncommon file systems (network
+  mounts, ramdisks) on Windows is fixed now (which previously either
+  errored out or left stray files behind).
+
 Changes to the OCaml bindings
 -
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] 8344ab9 - [docs] Add release notes for things that I've been involved in

2022-02-09 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2022-02-09T13:45:19+02:00
New Revision: 8344ab9c4f19b10d62806b0b7fdc48891595c2fb

URL: 
https://github.com/llvm/llvm-project/commit/8344ab9c4f19b10d62806b0b7fdc48891595c2fb
DIFF: 
https://github.com/llvm/llvm-project/commit/8344ab9c4f19b10d62806b0b7fdc48891595c2fb.diff

LOG: [docs] Add release notes for things that I've been involved in

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
lld/docs/ReleaseNotes.rst
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index caa2349f9d860..c8596fcfdc989 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -81,6 +81,10 @@ New Compiler Flags
 - The ``-mno-bti-at-return-twice`` flag will make sure a BTI instruction won't
   be added after a setjmp or possible other return-twice construct (ARM backend
   only).
+- The ``--start-no-unused-arguments`` and ``--end-no-unused-arguments`` flags
+  allow silencing warnings about unused arguments for only a subset of
+  the command line arguments, keeping potential warnings for other arguments
+  outside of such a region.
 
 Deprecated Compiler Flags
 -
@@ -164,6 +168,16 @@ Windows Support
 
 - Support for on-demand initialization of TLS variables was added.
 
+- Improved code generation for ARM, by assuming less strict alignment
+  requirements for instructions (just like other OSes do).
+
+- Fixed using the ``-m32`` flag in x86_64 MinGW setups, by e.g. making ``-m32``
+  pick i686 instead of i386, if there is no i386 sysroot, but only one for
+  i686.
+
+- Fixed passing the ``--no-demangle`` option through to the linker for MinGW
+  targets.
+
 C Language Changes in Clang
 ---
 

diff  --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index 82683801fad94..f611da428a8fe 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -58,12 +58,17 @@ Breaking changes
 COFF Improvements
 -
 
-* ...
+* Correctly handle a signed immediate offset in ARM64 adr/adrp relocations.
+  (`D114347 `_)
+
+* Omit section and label symbols from the symbol table.
+  (`D113866 `_)
 
 MinGW Improvements
 --
 
-* ...
+* ``--heap`` is now handled.
+  (`D118405 `_)
 
 MachO Improvements
 --

diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 3745128fd948d..447ef45e6ae88 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -80,12 +80,17 @@ Changes to the AArch64 Backend
   the use of the -mtune frontend flag. This allows certain scheduling features
   and optimisations to be enabled independently of the architecture. If the
   "tune-cpu" attribute is absent it tunes according to the "target-cpu".
+* Fixed relocations against temporary symbols (e.g. in jump tables and
+  constant pools) in large COFF object files.
 
 Changes to the ARM Backend
 --
 
 * Added support for the Armv9-A, Armv9.1-A and Armv9.2-A architectures.
 * Added support for the Armv8.1-M PACBTI-M extension.
+* Changed the assembly comment string for MSVC targets to ``@`` (consistent
+  with the MinGW and ELF targets), freeing up ``;`` to be used as
+  statement separator.
 
 Changes to the MIPS Target
 --
@@ -124,6 +129,24 @@ Changes to the WebAssembly Target
 
 During this release ...
 
+Changes to the Windows Target
+-
+
+* Changed how the ``.pdata`` sections refer to the code they're describing,
+  to avoid conflicting unwind info if weak symbols are overridden.
+
+* Fixed code generation for calling support routines for converting 128 bit
+  integers from/to floats on x86_64.
+
+* The preferred path separator form (backslashes or forward slashes) can be
+  configured in Windows builds of LLVM now, with the
+  ``LLVM_WINDOWS_PREFER_FORWARD_SLASH`` CMake option. This defaults to
+  true in MinGW builds of LLVM.
+
+* Set proper COFF symbol types for function aliases (e.g. for Itanium C++
+  constructors), making sure that GNU ld exports all of them correctly as
+  functions, not data, when linking a DLL.
+
 Changes to the OCaml bindings
 -
 
@@ -134,6 +157,9 @@ Changes to the C API
 * ``LLVMSetInstDebugLocation`` has been deprecated in favor of the more general
   ``LLVMAddMetadataToInst``.
 
+* Fixed building LLVM-C.dll for i386 targets with MSVC, which had been broken
+  since the LLVM 8.0.0 release.
+
 Changes to the Go bindings
 --
 
@@ -159,6 +185,8 @@ Changes to the LLVM tools
   `-name-whitelist` is marked as deprecated and to be removed in future
   releases.
 
+* llvm-readobj: Improved printing of symbols in Windows unwind data.
+
 Changes to LLDB
 

[llvm-branch-commits] [clang] dcdb124 - Add release notes for things relating to MinGW in the release

2021-08-16 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-08-16T12:26:49+03:00
New Revision: dcdb12496c24a02874dc060efac68adf178284cc

URL: 
https://github.com/llvm/llvm-project/commit/dcdb12496c24a02874dc060efac68adf178284cc
DIFF: 
https://github.com/llvm/llvm-project/commit/dcdb12496c24a02874dc060efac68adf178284cc.diff

LOG: Add release notes for things relating to MinGW in the release

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
lld/docs/ReleaseNotes.rst
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index a6f43bcaa4bb..285e057d92dd 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -123,6 +123,9 @@ Attribute Changes in Clang
 Windows Support
 ---
 
+- Fixed reading ``long double`` arguments with ``va_arg`` on x86_64 MinGW
+  targets.
+
 C Language Changes in Clang
 ---
 

diff  --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index a52ee4348f78..bf1c36f38f14 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -42,12 +42,29 @@ Breaking changes
 COFF Improvements
 -
 
-* ...
+* Avoid thread exhaustion when running on 32 bit Windows.
+  (`D105506 `_)
+
+* Improve terminating the process on Windows while a thread pool might be
+  running. (`D102944 `_)
 
 MinGW Improvements
 --
 
-* ...
+* Support for linking directly against a DLL without using an import library
+  has been added. (`D104530 `_ and
+  `D104531 `_)
+
+* Fix linking with ``--export-all-symbols`` in combination with
+  ``-function-sections``. (`D101522 `_ and
+  `D101615 `_)
+
+* Fix automatic export of symbols from LTO objects.
+  (`D101569 `_)
+
+* Accept more spellings of some options.
+  (`D107237 `_ and
+  `D107253 `_)
 
 MachO Improvements
 --

diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index de442580a149..9e9a7722b5e0 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -80,10 +80,15 @@ Changes to the AArch64 Backend
 * Introduced assembly support for Armv9-A's Realm Management Extension (RME)
   and Scalable Matrix Extension (SME).
 
+* Produce proper cross-section relative relocations on COFF
+
+* Fixed the calling convention on Windows for variadic functions involving
+  floats in the fixed arguments
+
 Changes to the ARM Backend
 --
 
-During this release ...
+* Produce proper cross-section relative relocations on COFF
 
 Changes to the MIPS Target
 --
@@ -241,6 +246,15 @@ Changes to the LLVM tools
 * In lli the default JIT engine switched from MCJIT (``-jit-kind=mcjit``) to 
ORC (``-jit-kind=orc``).
   (`D98931 `_)
 
+* llvm-rc got support for invoking Clang to preprocess its input.
+  (`D100755 `_)
+
+* llvm-rc got a GNU windres compatible frontend, llvm-windres.
+  (`D100756 `_)
+
+* llvm-ml has improved compatibility with MS ml.exe, managing to assemble
+  more asm files.
+
 Changes to LLDB
 -
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] a6c3900 - [LLD][MinGW] Accept joined format for --stack

2021-08-02 Thread Martin Storsjö via llvm-branch-commits

Author: Mateusz Mikuła
Date: 2021-08-02T21:26:03+03:00
New Revision: a6c39006e59ce92469b3a9369ebafd7c07ef54a0

URL: 
https://github.com/llvm/llvm-project/commit/a6c39006e59ce92469b3a9369ebafd7c07ef54a0
DIFF: 
https://github.com/llvm/llvm-project/commit/a6c39006e59ce92469b3a9369ebafd7c07ef54a0.diff

LOG: [LLD][MinGW] Accept joined format for --stack

Postgresql uses `--stack=` in its Makefile.

Downstream issue: https://github.com/msys2/MINGW-packages/pull/9167

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D107237

(cherry picked from commit 05b025edf4aecf19634e01b0974126e53a927a50)

Added: 


Modified: 
lld/MinGW/Options.td
lld/test/MinGW/driver.test

Removed: 




diff  --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index e1a505240cb82..7b250614e434b 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -85,7 +85,7 @@ defm output_def: Eq<"output-def", "Output def file">;
 defm section_alignment: Eq<"section-alignment", "Set section alignment">;
 def shared: F<"shared">, HelpText<"Build a shared object">;
 defm subs: Eq<"subsystem", "Specify subsystem">;
-def stack: S<"stack">;
+defm stack: Eq<"stack", "Set size of the initial stack">;
 def strip_all: F<"strip-all">,
 HelpText<"Omit all symbol information from the output binary">;
 def strip_debug: F<"strip-debug">,

diff  --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test
index ab5ca4c5c791c..29ea69bd7ba94 100644
--- a/lld/test/MinGW/driver.test
+++ b/lld/test/MinGW/driver.test
@@ -88,6 +88,7 @@ SUBSYSTEM_WINDOWS: -subsystem:windows,7.8
 
 RUN: ld.lld -### foo.o -m i386pep -stack 4194304,8192 2>&1 | FileCheck 
-check-prefix=STACK %s
 RUN: ld.lld -### foo.o -m i386pep --stack 4194304,8192 2>&1 | FileCheck 
-check-prefix=STACK %s
+RUN: ld.lld -### foo.o -m i386pep --stack=4194304,8192 2>&1 | FileCheck 
-check-prefix=STACK %s
 STACK: -stack:4194304,8192
 
 RUN: ld.lld -### foo.o -m i386pep -verbose 2>&1 | FileCheck 
-check-prefix=VERBOSE %s



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 332ac2f - [clang-repl] Fix building with win32 dylibs

2021-08-02 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-08-02T21:25:29+03:00
New Revision: 332ac2f8794610c3afdb11099a32ec36382cb500

URL: 
https://github.com/llvm/llvm-project/commit/332ac2f8794610c3afdb11099a32ec36382cb500
DIFF: 
https://github.com/llvm/llvm-project/commit/332ac2f8794610c3afdb11099a32ec36382cb500.diff

LOG: [clang-repl] Fix building with win32 dylibs

Use `clang_target_link_libraries` to avoid duplicate libraries when
the same symbol is provided both by a static library and a larger
dylib, fixing linking with win32 dylibs. This fixes errors like
these:

ld.lld: error: duplicate symbol: 
llvm::createStringError(std::__1::error_code, char const*)
>>> defined at libLLVMSupport.a(Error.cpp.obj)
>>> defined at libLLVM-14git.dll

This matches how other clang tools declare their dependencies.

Differential Revision: https://reviews.llvm.org/D107231

(cherry picked from commit 25a288b009f7d30b5392ea36c29570cbdcf238c3)

Added: 


Modified: 
clang/tools/clang-repl/CMakeLists.txt

Removed: 




diff  --git a/clang/tools/clang-repl/CMakeLists.txt 
b/clang/tools/clang-repl/CMakeLists.txt
index a9dcd1f6a66bb..ae0e4f39be70f 100644
--- a/clang/tools/clang-repl/CMakeLists.txt
+++ b/clang/tools/clang-repl/CMakeLists.txt
@@ -10,7 +10,7 @@ add_clang_executable(clang-repl
   ClangRepl.cpp
   )
 
-target_link_libraries(clang-repl PUBLIC
+clang_target_link_libraries(clang-repl PUBLIC
   clangBasic
   clangInterpreter
   clangTooling



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] eae7f3e - [lit] Pass the USERPROFILE variable through on Windows

2021-04-23 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-04-23T09:23:17+03:00
New Revision: eae7f3e3d45077a509a37bb2f2ff36b8196a855e

URL: 
https://github.com/llvm/llvm-project/commit/eae7f3e3d45077a509a37bb2f2ff36b8196a855e
DIFF: 
https://github.com/llvm/llvm-project/commit/eae7f3e3d45077a509a37bb2f2ff36b8196a855e.diff

LOG: [lit] Pass the USERPROFILE variable through on Windows

When running in a Windows Container, the Git for Windows Unix tools
(C:\Program Files\Git\usr\bin) just hang if this variable isn't
passed through.

Currently, running the LLVM/clang tests in a Windows Container fails
if that directory is added to the path, but succeeds after this change.
(After this change, the previously used GnuWin tools can be left out
entirely, too, as lit automatically picks up the Git for Windows tools
if necessary.)

Differential Revision: https://reviews.llvm.org/D98858

(cherry picked from commit 9de63b2e051cb3e79645cc20b83b4d33d132cba0)

Added: 


Modified: 
llvm/utils/lit/lit/TestingConfig.py

Removed: 




diff  --git a/llvm/utils/lit/lit/TestingConfig.py 
b/llvm/utils/lit/lit/TestingConfig.py
index 38d05066a2b0..e6c1b937c27a 100644
--- a/llvm/utils/lit/lit/TestingConfig.py
+++ b/llvm/utils/lit/lit/TestingConfig.py
@@ -33,6 +33,7 @@ def fromdefaults(litConfig):
 pass_vars.append('INCLUDE')
 pass_vars.append('LIB')
 pass_vars.append('PATHEXT')
+pass_vars.append('USERPROFILE')
 environment['PYTHONBUFFERED'] = '1'
 
 for var in pass_vars:



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] 072c90a - [LLD] Fix probing a MSYS based 'tar' in a Windows Container

2021-04-23 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-04-23T09:23:17+03:00
New Revision: 072c90a863aac1334a4950b3da262a025516dea0

URL: 
https://github.com/llvm/llvm-project/commit/072c90a863aac1334a4950b3da262a025516dea0
DIFF: 
https://github.com/llvm/llvm-project/commit/072c90a863aac1334a4950b3da262a025516dea0.diff

LOG: [LLD] Fix probing a MSYS based 'tar' in a Windows Container

Don't run the 'tar' tool in a cleared environment with only the
LANG variable set, just set LANG on top of the existing environment.

If the 'tar' tool is an MSYS based tool, running it in a Windows
Container hangs if all environment variables are cleared - in
particular, the USERPROFILE variable needs to be kept intact.

This is the same issue fixed as was fixed in other places in
9de63b2e051cb3e79645cc20b83b4d33d132cba0, but contrary to running
the actual tests, running with an as-cleared-as-possible environment
here is less important.

Differential Revision: https://reviews.llvm.org/D99304

(cherry picked from commit a88556733a4dced22416bd3f45255128b9eb4f49)

Added: 


Modified: 
lld/test/lit.cfg.py

Removed: 




diff  --git a/lld/test/lit.cfg.py b/lld/test/lit.cfg.py
index 8e31fd3977f9a..670f41f0b6313 100644
--- a/lld/test/lit.cfg.py
+++ b/lld/test/lit.cfg.py
@@ -101,11 +101,13 @@
 
 tar_executable = lit.util.which('tar', config.environment['PATH'])
 if tar_executable:
+env = os.environ
+env['LANG'] = 'C'
 tar_version = subprocess.Popen(
 [tar_executable, '--version'],
 stdout=subprocess.PIPE,
 stderr=subprocess.PIPE,
-env={'LANG': 'C'})
+env=env)
 sout, _ = tar_version.communicate()
 if 'GNU tar' in sout.decode():
 config.available_features.add('gnutar')



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] f290f3b - doc: Add a release note for the changed comment char for aarch64-msvc targets

2021-02-16 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-02-16T15:00:54+02:00
New Revision: f290f3bfc5c900bd46992c9419c53a76f08a58cc

URL: 
https://github.com/llvm/llvm-project/commit/f290f3bfc5c900bd46992c9419c53a76f08a58cc
DIFF: 
https://github.com/llvm/llvm-project/commit/f290f3bfc5c900bd46992c9419c53a76f08a58cc.diff

LOG: doc: Add a release note for the changed comment char for aarch64-msvc 
targets

This was backported in a6ea391b832573830b011f26013ebaa946032250.

Added: 


Modified: 
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index f2eb53778406a..c1bda3339a9ef 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -111,6 +111,10 @@ During this release ...
   ``:lo12:`` relocation specifiers, to allow the assembly output
   to actually be assembled.
 
+* Changed the assembly comment string for MSVC targets to ``//`` (consistent
+  with the MinGW and ELF targets), freeing up ``;`` to be used as
+  statement separator.
+
 Changes to the ARM Backend
 --
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] 1cb6551 - [lldb-vscode] correctly use Windows macros

2021-02-08 Thread Martin Storsjö via llvm-branch-commits

Author: Walter Erquinigo
Date: 2021-02-08T22:56:48+02:00
New Revision: 1cb6551edb94eea1fc087b346b1e8d13775dc692

URL: 
https://github.com/llvm/llvm-project/commit/1cb6551edb94eea1fc087b346b1e8d13775dc692
DIFF: 
https://github.com/llvm/llvm-project/commit/1cb6551edb94eea1fc087b346b1e8d13775dc692.diff

LOG: [lldb-vscode] correctly use Windows macros

@mstorsjo found a mistake that I made when trying to fix some Windows
compilation errors encountered by @stella.stamenova.

I was incorrectly using the LLVM_ON_UNIX macro. In any case, proper use
of

  #if defined(_WIN32)

should be the actual fix.

Differential Revision: https://reviews.llvm.org/D96060

(cherry picked from commit 36496cc2992d6fa26e6024971efcfc7d15f69888)

Added: 


Modified: 
lldb/tools/lldb-vscode/FifoFiles.cpp
lldb/tools/lldb-vscode/IOStream.cpp
lldb/tools/lldb-vscode/IOStream.h
lldb/tools/lldb-vscode/RunInTerminal.cpp
lldb/tools/lldb-vscode/VSCode.cpp
lldb/tools/lldb-vscode/lldb-vscode.cpp

Removed: 




diff  --git a/lldb/tools/lldb-vscode/FifoFiles.cpp 
b/lldb/tools/lldb-vscode/FifoFiles.cpp
index 0a36c87d4a94..4b14fb16f96c 100644
--- a/lldb/tools/lldb-vscode/FifoFiles.cpp
+++ b/lldb/tools/lldb-vscode/FifoFiles.cpp
@@ -8,7 +8,7 @@
 
 #include "FifoFiles.h"
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
 #include 
 #include 
 #include 
@@ -30,13 +30,13 @@ namespace lldb_vscode {
 FifoFile::FifoFile(StringRef path) : m_path(path) {}
 
 FifoFile::~FifoFile() {
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
   unlink(m_path.c_str());
 #endif
 };
 
 Expected> CreateFifoFile(StringRef path) {
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   return createStringError(inconvertibleErrorCode(), "Unimplemented");
 #else
   if (int err = mkfifo(path.data(), 0600))

diff  --git a/lldb/tools/lldb-vscode/IOStream.cpp 
b/lldb/tools/lldb-vscode/IOStream.cpp
index fdbfb554aedb..cd22d906c14c 100644
--- a/lldb/tools/lldb-vscode/IOStream.cpp
+++ b/lldb/tools/lldb-vscode/IOStream.cpp
@@ -8,7 +8,7 @@
 
 #include "IOStream.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32) 
 #include 
 #else
 #include 
@@ -33,7 +33,7 @@ StreamDescriptor::~StreamDescriptor() {
 return;
 
   if (m_is_socket)
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 ::closesocket(m_socket);
 #else
 ::close(m_socket);
@@ -108,7 +108,7 @@ bool InputStream::read_full(std::ofstream *log, size_t 
length,
 }
 if (bytes_read < 0) {
   int reason = 0;
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   if (descriptor.m_is_socket)
 reason = WSAGetLastError();
   else

diff  --git a/lldb/tools/lldb-vscode/IOStream.h 
b/lldb/tools/lldb-vscode/IOStream.h
index 1ec7ac3ed0f9..0eb9b6fefb0d 100644
--- a/lldb/tools/lldb-vscode/IOStream.h
+++ b/lldb/tools/lldb-vscode/IOStream.h
@@ -11,7 +11,7 @@
 
 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because

diff  --git a/lldb/tools/lldb-vscode/RunInTerminal.cpp 
b/lldb/tools/lldb-vscode/RunInTerminal.cpp
index 29edf5ca381d..2126563d9e96 100644
--- a/lldb/tools/lldb-vscode/RunInTerminal.cpp
+++ b/lldb/tools/lldb-vscode/RunInTerminal.cpp
@@ -8,7 +8,7 @@
 
 #include "RunInTerminal.h"
 
-#if LLVM_ON_UNIX
+#if !defined(_WIN32)
 #include 
 #include 
 #include 

diff  --git a/lldb/tools/lldb-vscode/VSCode.cpp 
b/lldb/tools/lldb-vscode/VSCode.cpp
index 4d0e281c1b8d..e9fdc17f4147 100644
--- a/lldb/tools/lldb-vscode/VSCode.cpp
+++ b/lldb/tools/lldb-vscode/VSCode.cpp
@@ -14,7 +14,7 @@
 #include "VSCode.h"
 #include "llvm/Support/FormatVariadic.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 #define NOMINMAX
 #include 
 #include 
@@ -41,7 +41,7 @@ VSCode::VSCode()
   stop_at_entry(false), is_attach(false),
   reverse_request_seq(0), waiting_for_run_in_terminal(false) {
   const char *log_file_path = getenv("LLDBVSCODE_LOG");
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
   // Windows opens stdout and stdin in text mode which converts \n to 13,10
   // while the value is just 10 on Darwin/Linux. Setting the file mode to 
binary
   // fixes this.

diff  --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp 
b/lldb/tools/lldb-vscode/lldb-vscode.cpp
index b7f39cbb1cb5..9469690cd7db 100644
--- a/lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -16,7 +16,7 @@
 #include 
 #include 
 #include 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because
@@ -55,7 +55,7 @@
 #include "JSONUtils.h"
 #include "LLDBUtils.h"
 
-#if !LLVM_ON_UNIX
+#if defined(_WIN32)
 #ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
 

[llvm-branch-commits] [lldb] 27aff2a - Fix lldb-vscode builds on Windows targeting POSIX

2021-02-08 Thread Martin Storsjö via llvm-branch-commits

Author: Walter Erquinigo
Date: 2021-02-08T22:56:48+02:00
New Revision: 27aff2aa2ade9d78d0081445eadacd5b5006143e

URL: 
https://github.com/llvm/llvm-project/commit/27aff2aa2ade9d78d0081445eadacd5b5006143e
DIFF: 
https://github.com/llvm/llvm-project/commit/27aff2aa2ade9d78d0081445eadacd5b5006143e.diff

LOG: Fix lldb-vscode builds on Windows targeting POSIX

@stella.stamenova found out that lldb-vscode's Win32 macros were failing
when building on windows targetings POSIX platforms.

I'm changing these macros for LLVM_ON_UNIX, which should be more
accurate.

(cherry picked from commit 0bca9a7ce2eeaa9f1d732ffbc17769560a2b236e)

Added: 


Modified: 
lldb/tools/lldb-vscode/IOStream.cpp
lldb/tools/lldb-vscode/IOStream.h
lldb/tools/lldb-vscode/RunInTerminal.cpp
lldb/tools/lldb-vscode/VSCode.cpp
lldb/tools/lldb-vscode/VSCode.h
lldb/tools/lldb-vscode/lldb-vscode.cpp

Removed: 




diff  --git a/lldb/tools/lldb-vscode/IOStream.cpp 
b/lldb/tools/lldb-vscode/IOStream.cpp
index 4b11b90b4c2e..fdbfb554aedb 100644
--- a/lldb/tools/lldb-vscode/IOStream.cpp
+++ b/lldb/tools/lldb-vscode/IOStream.cpp
@@ -8,7 +8,7 @@
 
 #include "IOStream.h"
 
-#if defined(_WIN32)
+#if !LLVM_ON_UNIX
 #include 
 #else
 #include 
@@ -33,7 +33,7 @@ StreamDescriptor::~StreamDescriptor() {
 return;
 
   if (m_is_socket)
-#if defined(_WIN32)
+#if !LLVM_ON_UNIX
 ::closesocket(m_socket);
 #else
 ::close(m_socket);
@@ -108,7 +108,7 @@ bool InputStream::read_full(std::ofstream *log, size_t 
length,
 }
 if (bytes_read < 0) {
   int reason = 0;
-#if defined(_WIN32)
+#if !LLVM_ON_UNIX
   if (descriptor.m_is_socket)
 reason = WSAGetLastError();
   else

diff  --git a/lldb/tools/lldb-vscode/IOStream.h 
b/lldb/tools/lldb-vscode/IOStream.h
index 603ae9adcc2a..1ec7ac3ed0f9 100644
--- a/lldb/tools/lldb-vscode/IOStream.h
+++ b/lldb/tools/lldb-vscode/IOStream.h
@@ -9,7 +9,9 @@
 #ifndef LLDB_TOOLS_LLDB_VSCODE_IOSTREAM_H
 #define LLDB_TOOLS_LLDB_VSCODE_IOSTREAM_H
 
-#if defined(_WIN32)
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
+
+#if !LLVM_ON_UNIX
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because

diff  --git a/lldb/tools/lldb-vscode/RunInTerminal.cpp 
b/lldb/tools/lldb-vscode/RunInTerminal.cpp
index 4db2806924ca..29edf5ca381d 100644
--- a/lldb/tools/lldb-vscode/RunInTerminal.cpp
+++ b/lldb/tools/lldb-vscode/RunInTerminal.cpp
@@ -6,7 +6,9 @@
 //
 
//===--===//
 
-#if !defined(WIN32)
+#include "RunInTerminal.h"
+
+#if LLVM_ON_UNIX
 #include 
 #include 
 #include 
@@ -21,8 +23,6 @@
 
 #include "lldb/lldb-defines.h"
 
-#include "RunInTerminal.h"
-
 using namespace llvm;
 
 namespace lldb_vscode {

diff  --git a/lldb/tools/lldb-vscode/VSCode.cpp 
b/lldb/tools/lldb-vscode/VSCode.cpp
index e9fdc17f4147..4d0e281c1b8d 100644
--- a/lldb/tools/lldb-vscode/VSCode.cpp
+++ b/lldb/tools/lldb-vscode/VSCode.cpp
@@ -14,7 +14,7 @@
 #include "VSCode.h"
 #include "llvm/Support/FormatVariadic.h"
 
-#if defined(_WIN32)
+#if !LLVM_ON_UNIX
 #define NOMINMAX
 #include 
 #include 
@@ -41,7 +41,7 @@ VSCode::VSCode()
   stop_at_entry(false), is_attach(false),
   reverse_request_seq(0), waiting_for_run_in_terminal(false) {
   const char *log_file_path = getenv("LLDBVSCODE_LOG");
-#if defined(_WIN32)
+#if !LLVM_ON_UNIX
   // Windows opens stdout and stdin in text mode which converts \n to 13,10
   // while the value is just 10 on Darwin/Linux. Setting the file mode to 
binary
   // fixes this.

diff  --git a/lldb/tools/lldb-vscode/VSCode.h b/lldb/tools/lldb-vscode/VSCode.h
index 8e7dfc078934..a2e1cac8ecf9 100644
--- a/lldb/tools/lldb-vscode/VSCode.h
+++ b/lldb/tools/lldb-vscode/VSCode.h
@@ -9,6 +9,8 @@
 #ifndef LLDB_TOOLS_LLDB_VSCODE_VSCODE_H
 #define LLDB_TOOLS_LLDB_VSCODE_VSCODE_H
 
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
+
 #include 
 #include 
 #include 

diff  --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp 
b/lldb/tools/lldb-vscode/lldb-vscode.cpp
index 69eb2e70aa6d..b7f39cbb1cb5 100644
--- a/lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+#include "VSCode.h"
+
 #include 
 #include 
 #include 
@@ -14,7 +16,7 @@
 #include 
 #include 
 #include 
-#if defined(_WIN32)
+#if !LLVM_ON_UNIX
 // We need to #define NOMINMAX in order to skip `min()` and `max()` macro
 // definitions that conflict with other system headers.
 // We also need to #undef GetObject (which is defined to GetObjectW) because
@@ -52,9 +54,8 @@
 
 #include "JSONUtils.h"
 #include "LLDBUtils.h"
-#include "VSCode.h"
 
-#if defined(_WIN32)
+#if !LLVM_ON_UNIX
 #ifndef PATH_MAX
 

[llvm-branch-commits] [lldb] d7d818c - Fix runInTerminal failures on Windows

2021-02-08 Thread Martin Storsjö via llvm-branch-commits

Author: Walter Erquinigo
Date: 2021-02-08T22:56:48+02:00
New Revision: d7d818c3615e4ff6bb283df0c1ddbb2b2cd50075

URL: 
https://github.com/llvm/llvm-project/commit/d7d818c3615e4ff6bb283df0c1ddbb2b2cd50075
DIFF: 
https://github.com/llvm/llvm-project/commit/d7d818c3615e4ff6bb283df0c1ddbb2b2cd50075.diff

LOG: Fix runInTerminal failures on Windows

stella.stemenova mentioned in https://reviews.llvm.org/D93951 failures on 
Windows for this test.

I'm fixing the macro definitions and disabling the tests for python
versions lower than 3.7. I'll figure out that actual issue with
python3.6 after the buildbots are fine again.

(cherry picked from commit ab5591e1d8f5abcfa9e75193d3e8a29087b61425)

Added: 


Modified: 
lldb/test/API/tools/lldb-vscode/runInTerminal/TestVSCode_runInTerminal.py
lldb/tools/lldb-vscode/FifoFiles.cpp
lldb/tools/lldb-vscode/FifoFiles.h
lldb/tools/lldb-vscode/lldb-vscode.cpp

Removed: 




diff  --git 
a/lldb/test/API/tools/lldb-vscode/runInTerminal/TestVSCode_runInTerminal.py 
b/lldb/test/API/tools/lldb-vscode/runInTerminal/TestVSCode_runInTerminal.py
index 055b5a5bed87..047cc317596f 100644
--- a/lldb/test/API/tools/lldb-vscode/runInTerminal/TestVSCode_runInTerminal.py
+++ b/lldb/test/API/tools/lldb-vscode/runInTerminal/TestVSCode_runInTerminal.py
@@ -33,20 +33,30 @@ def readErrorMessage(self, fifo_file):
 with open(fifo_file, "r") as file:
 return file.readline()
 
+def isTestSupported(self):
+# For some strange reason, this test fails on python3.6
+if not (sys.version_info.major == 3 and sys.version_info.minor >= 7):
+return False
+try:
+# We skip this test for debug builds because it takes too long 
parsing lldb's own
+# debug info. Release builds are fine.
+# Checking the size of the lldb-vscode binary seems to be a decent 
proxy for a quick
+# detection. It should be far less than 1 MB in Release builds.
+if os.path.getsize(os.environ["LLDBVSCODE_EXEC"]) < 100:
+return True
+except:
+return False
+
 @skipIfWindows
 @skipIfRemote
 @skipIf(archs=no_match(['x86_64']))
 def test_runInTerminal(self):
+if not self.isTestSupported():
+return
 '''
 Tests the "runInTerminal" reverse request. It makes sure that the 
IDE can
 launch the inferior with the correct environment variables and 
arguments.
 '''
-if "debug" in str(os.environ["LLDBVSCODE_EXEC"]).lower():
-# We skip this test for debug builds because it takes too long 
parsing lldb's own
-# debug info. Release builds are fine.
-# Checking this environment variable seems to be a decent proxy 
for a quick
-# detection
-return
 program = self.getBuildArtifact("a.out")
 source = 'main.c'
 self.build_and_launch(
@@ -77,6 +87,8 @@ def test_runInTerminal(self):
 @skipIfRemote
 @skipIf(archs=no_match(['x86_64']))
 def test_runInTerminalInvalidTarget(self):
+if not self.isTestSupported():
+return
 self.build_and_create_debug_adaptor()
 response = self.launch(
 "INVALIDPROGRAM", stopOnEntry=True, runInTerminal=True, 
args=["foobar"], env=["FOO=bar"], expectFailure=True)
@@ -88,6 +100,8 @@ def test_runInTerminalInvalidTarget(self):
 @skipIfRemote
 @skipIf(archs=no_match(['x86_64']))
 def test_missingArgInRunInTerminalLauncher(self):
+if not self.isTestSupported():
+return
 proc = subprocess.run([self.lldbVSCodeExec,  "--launch-target", 
"INVALIDPROGRAM"],
 capture_output=True, universal_newlines=True)
 self.assertTrue(proc.returncode != 0)
@@ -97,6 +111,8 @@ def test_missingArgInRunInTerminalLauncher(self):
 @skipIfRemote
 @skipIf(archs=no_match(['x86_64']))
 def test_FakeAttachedRunInTerminalLauncherWithInvalidProgram(self):
+if not self.isTestSupported():
+return
 comm_file = os.path.join(self.getBuildDir(), "comm-file")
 os.mkfifo(comm_file)
 
@@ -115,6 +131,8 @@ def 
test_FakeAttachedRunInTerminalLauncherWithInvalidProgram(self):
 @skipIfRemote
 @skipIf(archs=no_match(['x86_64']))
 def test_FakeAttachedRunInTerminalLauncherWithValidProgram(self):
+if not self.isTestSupported():
+return
 comm_file = os.path.join(self.getBuildDir(), "comm-file")
 os.mkfifo(comm_file)
 
@@ -132,6 +150,8 @@ def 
test_FakeAttachedRunInTerminalLauncherWithValidProgram(self):
 @skipIfRemote
 @skipIf(archs=no_match(['x86_64']))
 def test_FakeAttachedRunInTerminalLauncherAndCheckEnvironment(self):
+if not self.isTestSupported():
+return
 comm_file = os.path.join(self.getBuildDir(), "comm-file")

[llvm-branch-commits] [clang] b6d2402 - [docs] Add release notes for things I've done for the 12.x release branch.

2021-02-02 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-02-02T15:08:17+02:00
New Revision: b6d2402e319be00592908b2c9cb63fccdb481008

URL: 
https://github.com/llvm/llvm-project/commit/b6d2402e319be00592908b2c9cb63fccdb481008
DIFF: 
https://github.com/llvm/llvm-project/commit/b6d2402e319be00592908b2c9cb63fccdb481008.diff

LOG: [docs] Add release notes for things I've done for the 12.x release branch.

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
lld/docs/ReleaseNotes.rst
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 3001d6feb631..a34cd512ca59 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -150,6 +150,9 @@ Attribute Changes in Clang
 Windows Support
 ---
 
+- Implicitly add ``.exe`` suffix for MinGW targets, even when cross compiling.
+  (This matches a change from GCC 8.)
+
 C Language Changes in Clang
 ---
 

diff  --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index e0b17ca3e030..ea1403888eba 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -35,12 +35,28 @@ Breaking changes
 COFF Improvements
 -
 
-* ...
+* Error out clearly if creating a DLL with too many exported symbols.
+  (`D86701 `_)
 
 MinGW Improvements
 --
 
-* ...
+* Enabled dynamicbase by default. (`D86654 `_)
+
+* Tolerate mismatches between COMDAT section sizes with 
diff erent amount of
+  padding (produced by binutils) by inspecting the aux section definition.
+  (`D86659 `_)
+
+* Support setting the subsystem version via the subsystem argument.
+  (`D88804 `_)
+
+* Implemented the GNU -wrap option.
+  (`D89004 `_,
+  `D91689 `_)
+
+* Handle the ``--demangle`` and ``--no-demangle`` options.
+  (`D93950 `_)
+
 
 MachO Improvements
 --

diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index de8431fe3908..f2eb53778406 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -92,6 +92,25 @@ Changes to TableGen
   uses the "`...`" range punctuation (e.g., ``{0...9}``). The hyphen syntax
   is deprecated.
 
+Changes to the AArch64 Backend
+--
+
+During this release ...
+
+* Lots of improvements to generation of Windows unwind data; the unwind
+  data is optimized and written in packed form where possible, reducing
+  the size of unwind data (pdata and xdata sections) by around 60%
+  compared with LLVM 11. The generation of prologs/epilogs is tweaked
+  when targeting Windows, to increase the chances of being able to use
+  the packed unwind info format.
+
+* Support for creating Windows unwind data using ``.seh_*`` assembler
+  directives.
+
+* Produce proper assembly output for the Windows target, including
+  ``:lo12:`` relocation specifiers, to allow the assembly output
+  to actually be assembled.
+
 Changes to the ARM Backend
 --
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] dbaa6a1 - Revert "[AArch64] Attempt to sink mul operands"

2021-01-14 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-01-14T17:28:18+02:00
New Revision: dbaa6a1858a42f72b683f700d3bd7a9632f7a518

URL: 
https://github.com/llvm/llvm-project/commit/dbaa6a1858a42f72b683f700d3bd7a9632f7a518
DIFF: 
https://github.com/llvm/llvm-project/commit/dbaa6a1858a42f72b683f700d3bd7a9632f7a518.diff

LOG: Revert "[AArch64] Attempt to sink mul operands"

This reverts commit dda60035e9f0769c8907cdf6561489e0435c2275.

This commit caused failures to compile some sources, erroring out
with "error in backend: Cannot select: t85: v2i32 = AArch64ISD::DUP t15",
see https://reviews.llvm.org/D91271 for the full reproduction case.

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Removed: 
llvm/test/CodeGen/AArch64/aarch64-matrix-umull-smull.ll



diff  --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp 
b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 082fdf390786..b500cd534a1f 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -10956,43 +10956,6 @@ bool AArch64TargetLowering::shouldSinkOperands(
 
 return true;
   }
-  case Instruction::Mul: {
-bool IsProfitable = false;
-for (auto  : I->operands()) {
-  // Make sure we are not already sinking this operand
-  if (any_of(Ops, [&](Use *U) { return U->get() == Op; }))
-continue;
-
-  ShuffleVectorInst *Shuffle = dyn_cast(Op);
-  if (!Shuffle || !Shuffle->isZeroEltSplat())
-continue;
-
-  Value *ShuffleOperand = Shuffle->getOperand(0);
-  InsertElementInst *Insert = dyn_cast(ShuffleOperand);
-  if (!Insert)
-continue;
-
-  Instruction *OperandInstr = dyn_cast(Insert->getOperand(1));
-  if (!OperandInstr)
-continue;
-
-  ConstantInt *ElementConstant =
-  dyn_cast(Insert->getOperand(2));
-  // Check that the insertelement is inserting into element 0
-  if (!ElementConstant || ElementConstant->getZExtValue() != 0)
-continue;
-
-  unsigned Opcode = OperandInstr->getOpcode();
-  if (Opcode != Instruction::SExt && Opcode != Instruction::ZExt)
-continue;
-
-  Ops.push_back(>getOperandUse(0));
-  Ops.push_back();
-  IsProfitable = true;
-}
-
-return IsProfitable;
-  }
   default:
 return false;
   }

diff  --git a/llvm/test/CodeGen/AArch64/aarch64-matrix-umull-smull.ll 
b/llvm/test/CodeGen/AArch64/aarch64-matrix-umull-smull.ll
deleted file mode 100644
index 966cf7b46daa..
--- a/llvm/test/CodeGen/AArch64/aarch64-matrix-umull-smull.ll
+++ /dev/null
@@ -1,186 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=aarch64-none-linux-gnu < %s -o -| FileCheck %s
-
-define void @matrix_mul_unsigned(i32 %N, i32* nocapture %C, i16* nocapture 
readonly %A, i16 %val) {
-; CHECK-LABEL: matrix_mul_unsigned:
-; CHECK:   // %bb.0: // %vector.header
-; CHECK-NEXT:and w9, w3, #0x
-; CHECK-NEXT:// kill: def $w0 killed $w0 def $x0
-; CHECK-NEXT:and x8, x0, #0xfff8
-; CHECK-NEXT:dup v0.4h, w9
-; CHECK-NEXT:  .LBB0_1: // %vector.body
-; CHECK-NEXT:// =>This Inner Loop Header: Depth=1
-; CHECK-NEXT:add x9, x2, w0, uxtw #1
-; CHECK-NEXT:ldp d1, d2, [x9]
-; CHECK-NEXT:add x9, x1, w0, uxtw #2
-; CHECK-NEXT:subs x8, x8, #8 // =8
-; CHECK-NEXT:add w0, w0, #8 // =8
-; CHECK-NEXT:umull v1.4s, v0.4h, v1.4h
-; CHECK-NEXT:umull v2.4s, v0.4h, v2.4h
-; CHECK-NEXT:stp q1, q2, [x9]
-; CHECK-NEXT:b.ne .LBB0_1
-; CHECK-NEXT:  // %bb.2: // %for.end12
-; CHECK-NEXT:ret
-vector.header:
-  %conv4 = zext i16 %val to i32
-  %wide.trip.count = zext i32 %N to i64
-  %0 = add nsw i64 %wide.trip.count, -1
-  %min.iters.check = icmp ult i32 %N, 8
-  %1 = trunc i64 %0 to i32
-  %2 = icmp ugt i64 %0, 4294967295
-  %n.vec = and i64 %wide.trip.count, 4294967288
-  %broadcast.splatinsert = insertelement <4 x i32> undef, i32 %conv4, i32 0
-  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> 
undef, <4 x i32> zeroinitializer
-  %broadcast.splatinsert31 = insertelement <4 x i32> undef, i32 %conv4, i32 0
-  %broadcast.splat32 = shufflevector <4 x i32> %broadcast.splatinsert31, <4 x 
i32> undef, <4 x i32> zeroinitializer
-  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
-  br label %vector.body
-
-vector.body:  ; preds = %vector.header, 
%vector.body
-  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.header ]
-  %3 = trunc i64 %index to i32
-  %4 = add i32 %N, %3
-  %5 = zext i32 %4 to i64
-  %6 = getelementptr inbounds i16, i16* %A, i64 %5
-  %7 = bitcast i16* %6 to <4 x i16>*
-  %wide.load = load <4 x i16>, <4 x i16>* %7, align 2
-  %8 = getelementptr inbounds i16, i16* %6, i64 4
-  %9 = bitcast i16* %8 to <4 x i16>*
-  %wide.load30 = load <4 x i16>, <4 x i16>* %9, align 2
-  %10 = zext <4 x 

[llvm-branch-commits] [libcxx] 02f1d28 - [libcxx] Avoid overflows in the windows __libcpp_steady_clock_now()

2021-01-12 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-01-12T23:56:03+02:00
New Revision: 02f1d28ed6b8f33445dae3beed8b6cc8dada4312

URL: 
https://github.com/llvm/llvm-project/commit/02f1d28ed6b8f33445dae3beed8b6cc8dada4312
DIFF: 
https://github.com/llvm/llvm-project/commit/02f1d28ed6b8f33445dae3beed8b6cc8dada4312.diff

LOG: [libcxx] Avoid overflows in the windows __libcpp_steady_clock_now()

As freq.QuadValue can be in the range of 1000 to 1920,
the multiplication before division makes the calculation overflow
and wrap to negative values every 16-30 minutes.

Instead count the whole seconds separately before adding the
scaled fractional seconds.

Add a testcase for steady_clock to check that the values returned for
now() compare as bigger than the zero time origin; this
corresponds to a testcase in Qt [1] [2] (that failed spuriously
due to this).

[1] https://bugreports.qt.io/browse/QTBUG-89539
[2] 
https://code.qt.io/cgit/qt/qtbase.git/tree/tests/auto/corelib/kernel/qdeadlinetimer/tst_qdeadlinetimer.cpp?id=f8de5e54022b8b7471131b7ad55c83b69b2684c0#n569

Differential Revision: https://reviews.llvm.org/D93456

Added: 


Modified: 
libcxx/src/chrono.cpp
libcxx/test/std/utilities/time/time.clock/time.clock.steady/now.pass.cpp

Removed: 




diff  --git a/libcxx/src/chrono.cpp b/libcxx/src/chrono.cpp
index 1419cf2f74a8..5291d4fa8dc6 100644
--- a/libcxx/src/chrono.cpp
+++ b/libcxx/src/chrono.cpp
@@ -153,7 +153,10 @@ static steady_clock::time_point 
__libcpp_steady_clock_now() {
 
   LARGE_INTEGER counter;
   (void) QueryPerformanceCounter();
-  return steady_clock::time_point(steady_clock::duration(counter.QuadPart * 
nano::den / freq.QuadPart));
+  auto seconds = counter.QuadPart / freq.QuadPart;
+  auto fractions = counter.QuadPart % freq.QuadPart;
+  auto dur = seconds * nano::den + fractions * nano::den / freq.QuadPart;
+  return steady_clock::time_point(steady_clock::duration(dur));
 }
 
 #elif defined(CLOCK_MONOTONIC)

diff  --git 
a/libcxx/test/std/utilities/time/time.clock/time.clock.steady/now.pass.cpp 
b/libcxx/test/std/utilities/time/time.clock/time.clock.steady/now.pass.cpp
index 4b8104dd1a6f..14dc9a9832dc 100644
--- a/libcxx/test/std/utilities/time/time.clock/time.clock.steady/now.pass.cpp
+++ b/libcxx/test/std/utilities/time/time.clock/time.clock.steady/now.pass.cpp
@@ -25,6 +25,8 @@ int main(int, char**)
 C::time_point t1 = C::now();
 C::time_point t2 = C::now();
 assert(t2 >= t1);
+// make sure t2 didn't wrap around
+assert(t2 > std::chrono::time_point());
 
   return 0;
 }



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] d1fa7af - [AArch64] [Windows] Properly add :lo12: reloc specifiers when generating assembly

2021-01-12 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-01-12T23:56:03+02:00
New Revision: d1fa7afc7aefd822698fe86431d8184b1e8b6683

URL: 
https://github.com/llvm/llvm-project/commit/d1fa7afc7aefd822698fe86431d8184b1e8b6683
DIFF: 
https://github.com/llvm/llvm-project/commit/d1fa7afc7aefd822698fe86431d8184b1e8b6683.diff

LOG: [AArch64] [Windows] Properly add :lo12: reloc specifiers when generating 
assembly

This makes sure that assembly output actually can be assembled.

Set the correct MCExpr relocations specifier VK_PAGEOFF - and also
set VK_PAGE consistently even though it's not visible in the assembly
output.

Differential Revision: https://reviews.llvm.org/D94365

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
llvm/test/CodeGen/AArch64/cfguard-checks.ll
llvm/test/CodeGen/AArch64/dllimport.ll
llvm/test/CodeGen/AArch64/mingw-refptr.ll
llvm/test/CodeGen/AArch64/stack-protector-target.ll
llvm/test/CodeGen/AArch64/win-tls.ll
llvm/test/CodeGen/AArch64/win_cst_pool.ll
llvm/test/CodeGen/AArch64/windows-extern-weak.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp 
b/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
index afd5ae6bcbf2..10e191ff44cf 100644
--- a/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
+++ b/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
@@ -203,6 +203,12 @@ MCOperand AArch64MCInstLower::lowerSymbolOperandCOFF(const 
MachineOperand ,
 RefFlags |= AArch64MCExpr::VK_SABS;
   } else {
 RefFlags |= AArch64MCExpr::VK_ABS;
+
+if ((MO.getTargetFlags() & AArch64II::MO_FRAGMENT) == AArch64II::MO_PAGE)
+  RefFlags |= AArch64MCExpr::VK_PAGE;
+else if ((MO.getTargetFlags() & AArch64II::MO_FRAGMENT) ==
+ AArch64II::MO_PAGEOFF)
+  RefFlags |= AArch64MCExpr::VK_PAGEOFF | AArch64MCExpr::VK_NC;
   }
 
   if ((MO.getTargetFlags() & AArch64II::MO_FRAGMENT) == AArch64II::MO_G3)

diff  --git a/llvm/test/CodeGen/AArch64/cfguard-checks.ll 
b/llvm/test/CodeGen/AArch64/cfguard-checks.ll
index cb31decd57ba..66ec4b6ed074 100644
--- a/llvm/test/CodeGen/AArch64/cfguard-checks.ll
+++ b/llvm/test/CodeGen/AArch64/cfguard-checks.ll
@@ -18,7 +18,7 @@ entry:
 
   ; CHECK-LABEL: func_guard_nocf
   ; CHECK:   adrp x8, target_func
-   ; CHECK:   add x8, x8, target_func
+   ; CHECK:   add x8, x8, :lo12:target_func
   ; CHECK-NOT:   __guard_check_icall_fptr
; CHECK:   blr x8
 }
@@ -37,9 +37,9 @@ entry:
   ; The call to __guard_check_icall_fptr should come immediately before the 
call to the target function.
   ; CHECK-LABEL: func_optnone_cf
; CHECK:adrp x8, target_func
-   ; CHECK:add x8, x8, target_func
+   ; CHECK:add x8, x8, :lo12:target_func
; CHECK:adrp x9, __guard_check_icall_fptr
-   ; CHECK:add x9, x9, __guard_check_icall_fptr
+   ; CHECK:add x9, x9, :lo12:__guard_check_icall_fptr
; CHECK:ldr x9, [x9]
; CHECK:mov x15, x8
; CHECK:blr x9
@@ -60,9 +60,9 @@ entry:
   ; The call to __guard_check_icall_fptr should come immediately before the 
call to the target function.
   ; CHECK-LABEL: func_cf
   ; CHECK:adrp x8, __guard_check_icall_fptr
-   ; CHECK:ldr x9, [x8, __guard_check_icall_fptr]
+   ; CHECK:ldr x9, [x8, :lo12:__guard_check_icall_fptr]
; CHECK:adrp x8, target_func
-   ; CHECK:add x8, x8, target_func
+   ; CHECK:add x8, x8, :lo12:target_func
; CHECK:mov x15, x8
; CHECK:blr x9
; CHECK-NEXT:   blr x8
@@ -89,9 +89,9 @@ lpad: ; preds = 
%entry
   ; The call to __guard_check_icall_fptr should come immediately before the 
call to the target function.
   ; CHECK-LABEL: func_cf_invoke
   ; CHECK:adrp x8, __guard_check_icall_fptr
-   ; CHECK:ldr x9, [x8, __guard_check_icall_fptr]
+   ; CHECK:ldr x9, [x8, :lo12:__guard_check_icall_fptr]
; CHECK:adrp x8, target_func
-   ; CHECK:add x8, x8, target_func
+   ; CHECK:add x8, x8, :lo12:target_func
; CHECK:mov x15, x8
; CHECK:blr x9
   ; CHECK-NEXT:   .Ltmp0:

diff  --git a/llvm/test/CodeGen/AArch64/dllimport.ll 
b/llvm/test/CodeGen/AArch64/dllimport.ll
index d72e987aec2d..ed90c805c53b 100644
--- a/llvm/test/CodeGen/AArch64/dllimport.ll
+++ b/llvm/test/CodeGen/AArch64/dllimport.ll
@@ -14,7 +14,7 @@ define i32 @get_var() {
 
 ; CHECK-LABEL: get_var
 ; CHECK: adrp x8, __imp_var
-; CHECK: ldr x8, [x8, __imp_var]
+; CHECK: ldr x8, [x8, :lo12:__imp_var]
 ; CHECK: ldr w0, [x8]
 ; CHECK: ret
 
@@ -25,10 +25,10 @@ define i32 @get_ext() {
 
 ; CHECK-LABEL: get_ext
 ; CHECK: adrp x8, ext
-; DAG-ISEL: ldr w0, [x8, ext]
-; FAST-ISEL: add x8, x8, ext
+; DAG-ISEL: ldr w0, [x8, :lo12:ext]
+; 

[llvm-branch-commits] [compiler-rt] ffac900 - [compiler-rt] [sanitizer] Silence -Wframe-larger-than= for a few windows functions with large stack buffers

2021-01-08 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-01-08T22:54:03+02:00
New Revision: ffac9001d987096537b94ed7a1e4e4a4665d571f

URL: 
https://github.com/llvm/llvm-project/commit/ffac9001d987096537b94ed7a1e4e4a4665d571f
DIFF: 
https://github.com/llvm/llvm-project/commit/ffac9001d987096537b94ed7a1e4e4a4665d571f.diff

LOG: [compiler-rt] [sanitizer] Silence -Wframe-larger-than= for a few windows 
functions with large stack buffers

Also update a documentation url while touching code nearby, as
requested in review.

Differential Revision: https://reviews.llvm.org/D91853

Added: 


Modified: 
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp
compiler-rt/lib/sanitizer_common/sanitizer_win.cpp

Removed: 




diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp 
b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
index 48fa2d1033ae..7db7d3b0eb9d 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp
@@ -133,10 +133,14 @@ void InitializeDbgHelpIfNeeded() {
   }
 }
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wframe-larger-than="
+#endif
 bool WinSymbolizerTool::SymbolizePC(uptr addr, SymbolizedStack *frame) {
   InitializeDbgHelpIfNeeded();
 
-  // See http://msdn.microsoft.com/en-us/library/ms680578(VS.85).aspx
+  // See 
https://docs.microsoft.com/en-us/windows/win32/debug/retrieving-symbol-information-by-address
   char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(CHAR)];
   PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
   symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
@@ -162,6 +166,9 @@ bool WinSymbolizerTool::SymbolizePC(uptr addr, 
SymbolizedStack *frame) {
   // Otherwise, try llvm-symbolizer.
   return got_fileline;
 }
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
 
 const char *WinSymbolizerTool::Demangle(const char *name) {
   CHECK(is_dbghelp_initialized);

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp 
b/compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp
index e2edf428004e..7e01c81d0422 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp
@@ -43,6 +43,10 @@ void BufferedStackTrace::UnwindSlow(uptr pc, u32 max_depth) {
   trace_buffer[0] = pc;
 }
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wframe-larger-than="
+#endif
 void BufferedStackTrace::UnwindSlow(uptr pc, void *context, u32 max_depth) {
   CHECK(context);
   CHECK_GE(max_depth, 2);
@@ -74,6 +78,9 @@ void BufferedStackTrace::UnwindSlow(uptr pc, void *context, 
u32 max_depth) {
 trace_buffer[size++] = (uptr)stack_frame.AddrPC.Offset;
   }
 }
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
 #endif  // #if !SANITIZER_GO
 
 #endif  // SANITIZER_WINDOWS

diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp 
b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
index 281854aff261..63c90785f270 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
@@ -611,6 +611,10 @@ static uptr GetPreferredBase(const char *modname) {
   return (uptr)pe_header->ImageBase;
 }
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wframe-larger-than="
+#endif
 void ListOfModules::init() {
   clearOrInit();
   HANDLE cur_process = GetCurrentProcess();
@@ -672,6 +676,9 @@ void ListOfModules::init() {
   }
   UnmapOrDie(hmodules, modules_buffer_size);
 }
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
 
 void ListOfModules::fallbackInit() { clear(); }
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 7a91dad - [llvm-readobj] [ARMWinEH] Clearly print an invalid case of packed unwind info as such

2021-01-08 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-01-08T10:04:44+02:00
New Revision: 7a91dad9e5fa17ed31484ea7f264363b9b821861

URL: 
https://github.com/llvm/llvm-project/commit/7a91dad9e5fa17ed31484ea7f264363b9b821861
DIFF: 
https://github.com/llvm/llvm-project/commit/7a91dad9e5fa17ed31484ea7f264363b9b821861.diff

LOG: [llvm-readobj] [ARMWinEH] Clearly print an invalid case of packed unwind 
info as such

As the actual windows unwinder doesn't support this case, don't
pretend that it is supported when dumping the generated unwind info
either, even if it would be possible to interpret it as something
sensible.

This should reduce the risk of us emitting such a case in code
(although it's unlikely as long as the unwind info is generated
through the SEH opcodes, as the opcodes can't describe this case).

Differential Revision: https://reviews.llvm.org/D91529

Added: 


Modified: 
llvm/test/tools/llvm-readobj/COFF/arm64-packed-unwind.s
llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp

Removed: 




diff  --git a/llvm/test/tools/llvm-readobj/COFF/arm64-packed-unwind.s 
b/llvm/test/tools/llvm-readobj/COFF/arm64-packed-unwind.s
index f8c4d5e3074f..155c292e1649 100644
--- a/llvm/test/tools/llvm-readobj/COFF/arm64-packed-unwind.s
+++ b/llvm/test/tools/llvm-readobj/COFF/arm64-packed-unwind.s
@@ -139,7 +139,7 @@
 // CHECK-NEXT: FrameSize: 32
 // CHECK-NEXT: Prologue [
 // CHECK-NEXT:   sub sp, sp, #16
-// CHECK-NEXT:   stp x19, lr, [sp, #-16]!
+// CHECK-NEXT:   INVALID!
 // CHECK-NEXT:   end
 // CHECK-NEXT: ]
 // CHECK-NEXT:   }

diff  --git a/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp 
b/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
index 46a949b99045..5995a09514c8 100644
--- a/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
+++ b/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
@@ -1223,10 +1223,12 @@ bool Decoder::dumpPackedARM64Entry(const 
object::COFFObjectFile ,
 if (I == (RF.RegI() + 1) / 2 - 1 && RF.RegI() % 2 == 1) {
   // The last register, an odd register without a pair
   if (RF.CR() == 1) {
-if (I == 0) // If this is the only register pair
-  SW.startLine() << format("stp x%d, lr, [sp, #-%d]!\n", 19 + 2 * I,
-   SavSZ);
-else
+if (I == 0) { // If this is the only register pair
+  // CR=1 combined with RegI=1 doesn't map to a documented case;
+  // it doesn't map to any regular unwind info opcode, and the
+  // actual unwinder doesn't support it.
+  SW.startLine() << "INVALID!\n";
+} else
   SW.startLine() << format("stp x%d, lr, [sp, #%d]\n", 19 + 2 * I,
16 * I);
   } else {



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] 248e345 - [LLD] [MinGW] Pass the --demangle and --no-demangle options to the COFF linker

2021-01-07 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-01-07T10:02:19+02:00
New Revision: 248e3450fb8a1ab7146c0cbe8f0ea7204782f542

URL: 
https://github.com/llvm/llvm-project/commit/248e3450fb8a1ab7146c0cbe8f0ea7204782f542
DIFF: 
https://github.com/llvm/llvm-project/commit/248e3450fb8a1ab7146c0cbe8f0ea7204782f542.diff

LOG: [LLD] [MinGW] Pass the --demangle and --no-demangle options to the COFF 
linker

Differential Revision: https://reviews.llvm.org/D93950

Added: 


Modified: 
lld/MinGW/Driver.cpp
lld/MinGW/Options.td
lld/test/MinGW/driver.test

Removed: 




diff  --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index fae5cb77ec5d..f8eb4e76b7f9 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -320,6 +320,11 @@ bool mingw::link(ArrayRef argsArr, bool 
canExitEarly,
   else
 add("-opt:noref");
 
+  if (args.hasFlag(OPT_demangle, OPT_no_demangle, true))
+add("-demangle");
+  else
+add("-demangle:no");
+
   if (args.hasFlag(OPT_enable_auto_import, OPT_disable_auto_import, true))
 add("-auto-import");
   else

diff  --git a/lld/MinGW/Options.td b/lld/MinGW/Options.td
index 7bc5936d58d6..95b61952fc5e 100644
--- a/lld/MinGW/Options.td
+++ b/lld/MinGW/Options.td
@@ -28,6 +28,9 @@ defm allow_multiple_definition: B<"allow-multiple-definition",
 "Do not allow multiple definitions (default)">;
 def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries">;
 def Bstatic: F<"Bstatic">, HelpText<"Do not link against shared libraries">;
+defm demangle: B<"demangle",
+"Demangle symbol names (default)",
+"Do not demangle symbol names">;
 def disable_auto_import: F<"disable-auto-import">,
 HelpText<"Don't automatically import data symbols from other DLLs without 
dllimport">;
 def disable_runtime_pseudo_reloc: F<"disable-runtime-pseudo-reloc">,

diff  --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test
index 015c26963923..33503d45189e 100644
--- a/lld/test/MinGW/driver.test
+++ b/lld/test/MinGW/driver.test
@@ -285,3 +285,12 @@ NO_ALLOW_MULTIPLE_DEFINITION-NOT: -force:multiple
 RUN: ld.lld -### -m i386pep foo.o -wrap foo1 --wrap foo2 | FileCheck 
-check-prefix WRAP %s
 RUN: ld.lld -### -m i386pep foo.o -wrap=foo1 --wrap=foo2 | FileCheck 
-check-prefix WRAP %s
 WRAP: -wrap:foo1 -wrap:foo2
+
+RUN: ld.lld -### -m i386pep foo.o | FileCheck -check-prefix DEMANGLE %s
+RUN: ld.lld -### -m i386pep foo.o -demangle | FileCheck -check-prefix DEMANGLE 
%s
+RUN: ld.lld -### -m i386pep foo.o --demangle | FileCheck -check-prefix 
DEMANGLE %s
+DEMANGLE: -demangle{{ }}
+
+RUN: ld.lld -### -m i386pep foo.o -no-demangle | FileCheck -check-prefix 
NO-DEMANGLE %s
+RUN: ld.lld -### -m i386pep foo.o --no-demangle | FileCheck -check-prefix 
NO-DEMANGLE %s
+NO-DEMANGLE: -demangle:no



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] 979c38c - [compiler-rt] [windows] Add UNUSED attributes on variables/functions only used for 64 bit targets

2021-01-04 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2021-01-05T08:59:08+02:00
New Revision: 979c38cc74f4e96c5e1bee1f966a81038fff1ed6

URL: 
https://github.com/llvm/llvm-project/commit/979c38cc74f4e96c5e1bee1f966a81038fff1ed6
DIFF: 
https://github.com/llvm/llvm-project/commit/979c38cc74f4e96c5e1bee1f966a81038fff1ed6.diff

LOG: [compiler-rt] [windows] Add UNUSED attributes on variables/functions only 
used for 64 bit targets

This fixes warnings when building for 32 bit targets.

Differential Revision: https://reviews.llvm.org/D91852

Added: 


Modified: 
compiler-rt/lib/interception/interception_win.cpp

Removed: 




diff  --git a/compiler-rt/lib/interception/interception_win.cpp 
b/compiler-rt/lib/interception/interception_win.cpp
index 1a1c327e6124..98bc756ae53a 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -136,7 +136,7 @@ namespace __interception {
 static const int kAddressLength = FIRST_32_SECOND_64(4, 8);
 static const int kJumpInstructionLength = 5;
 static const int kShortJumpInstructionLength = 2;
-static const int kIndirectJumpInstructionLength = 6;
+UNUSED static const int kIndirectJumpInstructionLength = 6;
 static const int kBranchLength =
 FIRST_32_SECOND_64(kJumpInstructionLength, kIndirectJumpInstructionLength);
 static const int kDirectBranchLength = kBranchLength + kAddressLength;
@@ -165,7 +165,7 @@ static uptr GetMmapGranularity() {
   return si.dwAllocationGranularity;
 }
 
-static uptr RoundUpTo(uptr size, uptr boundary) {
+UNUSED static uptr RoundUpTo(uptr size, uptr boundary) {
   return (size + boundary - 1) & ~(boundary - 1);
 }
 
@@ -309,7 +309,7 @@ struct TrampolineMemoryRegion {
   uptr max_size;
 };
 
-static const uptr kTrampolineScanLimitRange = 1 << 31;  // 2 gig
+UNUSED static const uptr kTrampolineScanLimitRange = 1 << 31;  // 2 gig
 static const int kMaxTrampolineRegion = 1024;
 static TrampolineMemoryRegion TrampolineRegions[kMaxTrampolineRegion];
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] 1561807 - [libcxx] Fix the preexisting directory_iterator code for windows

2020-12-18 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-18T11:24:53+02:00
New Revision: 156180727d6c347eda3ba749730707acb8a48093

URL: 
https://github.com/llvm/llvm-project/commit/156180727d6c347eda3ba749730707acb8a48093
DIFF: 
https://github.com/llvm/llvm-project/commit/156180727d6c347eda3ba749730707acb8a48093.diff

LOG: [libcxx] Fix the preexisting directory_iterator code for windows

The directory_iterator.cpp file did contain an incomplete,
non-working implementation for windows.

Change it to use the wchar version of the APIs.

Don't set the windows specific errors from GetLastError() as code
in the generic category; remap the errors to the std::errc values.

Error out cleanly on empty paths.

Invoke FindFirstFile on /* to actually list the
entries of the directory.

If the first entry retured by FindFirstFile is to be skipped (e.g.
being "." or ".."), call advance() (which calls FindNextFile and loops)
which doesn't return until a valid entry is found (or the end is
reached).

Differential Revision: https://reviews.llvm.org/D91140

Added: 


Modified: 
libcxx/src/filesystem/directory_iterator.cpp
libcxx/src/filesystem/filesystem_common.h
libcxx/src/filesystem/operations.cpp

Removed: 




diff  --git a/libcxx/src/filesystem/directory_iterator.cpp 
b/libcxx/src/filesystem/directory_iterator.cpp
index e8941b3494b3..2721dea5c98f 100644
--- a/libcxx/src/filesystem/directory_iterator.cpp
+++ b/libcxx/src/filesystem/directory_iterator.cpp
@@ -10,6 +10,7 @@
 #include "__config"
 #if defined(_LIBCPP_WIN32API)
 #define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
 #include 
 #else
 #include 
@@ -72,16 +73,20 @@ static pair posix_readdir(DIR* 
dir_stream,
   }
 }
 #else
+// defined(_LIBCPP_WIN32API)
 
-static file_type get_file_type(const WIN32_FIND_DATA& data) {
-  //auto attrs = data.dwFileAttributes;
-  // FIXME(EricWF)
-  return file_type::unknown;
+static file_type get_file_type(const WIN32_FIND_DATAW& data) {
+  if (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT &&
+  data.dwReserved0 == IO_REPARSE_TAG_SYMLINK)
+return file_type::symlink;
+  if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+return file_type::directory;
+  return file_type::regular;
 }
-static uintmax_t get_file_size(const WIN32_FIND_DATA& data) {
-  return (data.nFileSizeHigh * (MAXDWORD + 1)) + data.nFileSizeLow;
+static uintmax_t get_file_size(const WIN32_FIND_DATAW& data) {
+  return (static_cast(data.nFileSizeHigh) << 32) + data.nFileSizeLow;
 }
-static file_time_type get_write_time(const WIN32_FIND_DATA& data) {
+static file_time_type get_write_time(const WIN32_FIND_DATAW& data) {
   ULARGE_INTEGER tmp;
   const FILETIME& time = data.ftLastWriteTime;
   tmp.u.LowPart = time.dwLowDateTime;
@@ -110,15 +115,21 @@ class __dir_stream {
 
   __dir_stream(const path& root, directory_options opts, error_code& ec)
   : __stream_(INVALID_HANDLE_VALUE), __root_(root) {
-__stream_ = ::FindFirstFile(root.c_str(), &__data_);
+if (root.native().empty()) {
+  ec = make_error_code(errc::no_such_file_or_directory);
+  return;
+}
+__stream_ = ::FindFirstFileW((root / "*").c_str(), &__data_);
 if (__stream_ == INVALID_HANDLE_VALUE) {
-  ec = error_code(::GetLastError(), generic_category());
+  ec = detail::make_windows_error(GetLastError());
   const bool ignore_permission_denied =
   bool(opts & directory_options::skip_permission_denied);
   if (ignore_permission_denied && ec.value() == ERROR_ACCESS_DENIED)
 ec.clear();
   return;
 }
+if (!assign())
+  advance(ec);
   }
 
   ~__dir_stream() noexcept {
@@ -130,35 +141,39 @@ class __dir_stream {
   bool good() const noexcept { return __stream_ != INVALID_HANDLE_VALUE; }
 
   bool advance(error_code& ec) {
-while (::FindNextFile(__stream_, &__data_)) {
-  if (!strcmp(__data_.cFileName, ".") || strcmp(__data_.cFileName, ".."))
-continue;
-  // FIXME: Cache more of this
-  //directory_entry::__cached_data cdata;
-  //cdata.__type_ = get_file_type(__data_);
-  //cdata.__size_ = get_file_size(__data_);
-  //cdata.__write_time_ = get_write_time(__data_);
-  __entry_.__assign_iter_entry(
-  __root_ / __data_.cFileName,
-  
directory_entry::__create_iter_result(detail::get_file_type(__data)));
-  return true;
+while (::FindNextFileW(__stream_, &__data_)) {
+  if (assign())
+return true;
 }
-ec = error_code(::GetLastError(), generic_category());
 close();
 return false;
   }
 
+  bool assign() {
+if (!wcscmp(__data_.cFileName, L".") || !wcscmp(__data_.cFileName, L".."))
+  return false;
+// FIXME: Cache more of this
+//directory_entry::__cached_data cdata;
+//cdata.__type_ = get_file_type(__data_);
+//cdata.__size_ = get_file_size(__data_);
+//cdata.__write_time_ = get_write_time(__data_);
+

[llvm-branch-commits] [libcxx] de698ae - [libcxx] Convert paths to/from the right narrow code page for narrow strings on windows

2020-12-18 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-18T11:24:52+02:00
New Revision: de698ae73444b5160dd6b8d768b30d6764be004e

URL: 
https://github.com/llvm/llvm-project/commit/de698ae73444b5160dd6b8d768b30d6764be004e
DIFF: 
https://github.com/llvm/llvm-project/commit/de698ae73444b5160dd6b8d768b30d6764be004e.diff

LOG: [libcxx] Convert paths to/from the right narrow code page for narrow 
strings on windows

On windows, the narrow, char based paths normally don't use utf8, but
can use many different native code pages, and this is what system
functions that operate on files, taking such paths/file names, interpret
them as.

Differential Revision: https://reviews.llvm.org/D91137

Added: 


Modified: 
libcxx/include/filesystem
libcxx/src/filesystem/filesystem_common.h
libcxx/src/filesystem/operations.cpp

Removed: 




diff  --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index adc863f052db..e39790c50955 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -690,6 +690,13 @@ typedef string __path_string;
 typedef char __path_value;
 #endif
 
+#if defined(_LIBCPP_WIN32API)
+_LIBCPP_FUNC_VIS
+size_t __wide_to_char(const wstring&, char*, size_t);
+_LIBCPP_FUNC_VIS
+size_t __char_to_wide(const string&, wchar_t*, size_t);
+#endif
+
 template 
 struct _PathCVT;
 
@@ -793,6 +800,48 @@ struct _PathCVT<__path_value> {
 };
 
 #if defined(_LIBCPP_WIN32API)
+template <>
+struct _PathCVT {
+
+  static void
+  __append_string(__path_string& __dest, const basic_string &__str) {
+  size_t __size = __char_to_wide(__str, nullptr, 0);
+  size_t __pos = __dest.size();
+  __dest.resize(__pos + __size);
+  __char_to_wide(__str, const_cast<__path_value*>(__dest.data()) + __pos, 
__size);
+  }
+
+  template 
+  static typename 
enable_if<__is_exactly_cpp17_input_iterator<_Iter>::value>::type
+  __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
+basic_string __tmp(__b, __e);
+__append_string(__dest, __tmp);
+  }
+
+  template 
+  static typename enable_if<__is_cpp17_forward_iterator<_Iter>::value>::type
+  __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
+basic_string __tmp(__b, __e);
+__append_string(__dest, __tmp);
+  }
+
+  template 
+  static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
+const char __sentinel = char{};
+basic_string __tmp;
+for (; *__b != __sentinel; ++__b)
+  __tmp.push_back(*__b);
+__append_string(__dest, __tmp);
+  }
+
+  template 
+  static void __append_source(__path_string& __dest, _Source const& __s) {
+using _Traits = __is_pathable<_Source>;
+__append_range(__dest, _Traits::__range_begin(__s),
+   _Traits::__range_end(__s));
+  }
+};
+
 template 
 struct _PathExport {
   typedef __narrow_to_utf8 _Narrower;
@@ -806,6 +855,17 @@ struct _PathExport {
   }
 };
 
+template <>
+struct _PathExport {
+  template 
+  static void __append(_Str& __dest, const __path_string& __src) {
+size_t __size = __wide_to_char(__src, nullptr, 0);
+size_t __pos = __dest.size();
+__dest.resize(__size);
+__wide_to_char(__src, const_cast(__dest.data()) + __pos, __size);
+  }
+};
+
 template <>
 struct _PathExport {
   template 
@@ -1110,7 +1170,11 @@ public:
 return string();
   }
   _LIBCPP_INLINE_VISIBILITY __u8_string u8string() const {
-return string<__u8_string::value_type>();
+using _CVT = __narrow_to_utf8;
+__u8_string __s;
+__s.reserve(__pn_.size());
+_CVT()(back_inserter(__s), __pn_.data(), __pn_.data() + __pn_.size());
+return __s;
   }
 
   _LIBCPP_INLINE_VISIBILITY _VSTD::u16string u16string() const {
@@ -1373,9 +1437,42 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
   is_same::__char_type, char>::value,
   "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
   " or 'char8_t'");
+#if defined(_LIBCPP_WIN32API)
+  string __tmp(__f, __l);
+  using _CVT = __widen_from_utf8;
+  _VSTD::wstring __w;
+  __w.reserve(__tmp.size());
+  _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + __tmp.size());
+  return path(__w);
+#else
   return path(__f, __l);
+#endif /* !_LIBCPP_WIN32API */
 }
 
+#if defined(_LIBCPP_WIN32API)
+template 
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
+typename enable_if<__is_pathable<_InputIt>::value, path>::type
+u8path(_InputIt __f, _NullSentinel) {
+  static_assert(
+#ifndef _LIBCPP_NO_HAS_CHAR8_T
+  is_same::__char_type, char8_t>::value ||
+#endif
+  is_same::__char_type, char>::value,
+  "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
+  " or 'char8_t'");
+  string __tmp;
+  const char __sentinel = char{};
+  for (; *__f != __sentinel; ++__f)
+__tmp.push_back(*__f);
+  using _CVT = __widen_from_utf8;
+  _VSTD::wstring __w;
+  __w.reserve(__tmp.size());
+  _CVT()(back_inserter(__w), __tmp.data(), __tmp.data() + 

[llvm-branch-commits] [libcxx] 48c6500 - [libcxx] Reorder the two u8path functions, to make the following diff more readable. NFC.

2020-12-18 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-18T11:24:52+02:00
New Revision: 48c6500b5bfa60dfe6ca5f407fcdbf5ddff0c289

URL: 
https://github.com/llvm/llvm-project/commit/48c6500b5bfa60dfe6ca5f407fcdbf5ddff0c289
DIFF: 
https://github.com/llvm/llvm-project/commit/48c6500b5bfa60dfe6ca5f407fcdbf5ddff0c289.diff

LOG: [libcxx] Reorder the two u8path functions, to make the following diff more 
readable. NFC.

Differential Revision: https://reviews.llvm.org/D91136

Added: 


Modified: 
libcxx/include/filesystem

Removed: 




diff  --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index 7aeabeb2d1ec..adc863f052db 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -1362,20 +1362,6 @@ inline _LIBCPP_INLINE_VISIBILITY void swap(path& __lhs, 
path& __rhs) noexcept {
 _LIBCPP_FUNC_VIS
 size_t hash_value(const path& __p) noexcept;
 
-template 
-_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
-typename enable_if<__is_pathable<_Source>::value, path>::type
-u8path(const _Source& __s) {
-  static_assert(
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
-  is_same::__char_type, char8_t>::value ||
-#endif
-  is_same::__char_type, char>::value,
-  "u8path(Source const&) requires Source have a character type of type "
-  "'char' or 'char8_t'");
-  return path(__s);
-}
-
 template 
 _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
 typename enable_if<__is_pathable<_InputIt>::value, path>::type
@@ -1390,6 +1376,20 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
   return path(__f, __l);
 }
 
+template 
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
+typename enable_if<__is_pathable<_Source>::value, path>::type
+u8path(const _Source& __s) {
+  static_assert(
+#ifndef _LIBCPP_NO_HAS_CHAR8_T
+  is_same::__char_type, char8_t>::value ||
+#endif
+  is_same::__char_type, char>::value,
+  "u8path(Source const&) requires Source have a character type of type "
+  "'char' or 'char8_t'");
+  return path(__s);
+}
+
 class _LIBCPP_TYPE_VIS path::iterator {
 public:
   enum _ParserState : unsigned char {



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] e83e0ca - [libcxx] Make filesystem::path::value_type wchar_t on windows

2020-12-18 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-18T11:24:52+02:00
New Revision: e83e0cac041bc071301f8399bb5c32b2529fc83f

URL: 
https://github.com/llvm/llvm-project/commit/e83e0cac041bc071301f8399bb5c32b2529fc83f
DIFF: 
https://github.com/llvm/llvm-project/commit/e83e0cac041bc071301f8399bb5c32b2529fc83f.diff

LOG: [libcxx] Make filesystem::path::value_type wchar_t on windows

Also set the preferred separator to backslash.

libc++ doesn't compile successfully for windows prior to this change,
and this change on its own isn't enough to make it compile successfully
either, but is the first stepping stone towards making it work correctly.

Most of operations.cpp will need to be touched, both for calling
functions that take wchar paths, but also for using other windows
specific functions instead of the posix functions used so far; that is
handled in later commits.

Changing parts of operations.cpp to generalize the string type handling
in code that doesn't touch system functions.

Differential Revision: https://reviews.llvm.org/D91135

Added: 


Modified: 
libcxx/include/filesystem
libcxx/src/filesystem/filesystem_common.h
libcxx/src/filesystem/operations.cpp

Removed: 




diff  --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index 764ec6573a50..7aeabeb2d1ec 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -568,9 +568,19 @@ struct __can_convert_char {
 template 
 typename enable_if<__can_convert_char<_ECharT>::value, bool>::type
 __is_separator(_ECharT __e) {
+#if defined(_LIBCPP_WIN32API)
+  return __e == _ECharT('/') || __e == _ECharT('\\');
+#else
   return __e == _ECharT('/');
+#endif
 }
 
+#ifndef _LIBCPP_NO_HAS_CHAR8_T
+typedef u8string __u8_string;
+#else
+typedef string __u8_string;
+#endif
+
 struct _NullSentinel {};
 
 template 
@@ -672,6 +682,14 @@ struct __is_pathable<_Tp, false, true, false> : 
__is_pathable_char_array<_Tp> {
 template 
 struct __is_pathable<_Tp, false, false, true> : __is_pathable_iter<_Tp> {};
 
+#if defined(_LIBCPP_WIN32API)
+typedef wstring __path_string;
+typedef wchar_t __path_value;
+#else
+typedef string __path_string;
+typedef char __path_value;
+#endif
+
 template 
 struct _PathCVT;
 
@@ -682,24 +700,40 @@ struct _PathCVT {
 "Char type not convertible");
 
   typedef __narrow_to_utf8 _Narrower;
+#if defined(_LIBCPP_WIN32API)
+  typedef __widen_from_utf8 _Widener;
+#endif
 
-  static void __append_range(string& __dest, _ECharT const* __b,
+  static void __append_range(__path_string& __dest, _ECharT const* __b,
  _ECharT const* __e) {
+#if defined(_LIBCPP_WIN32API)
+string __utf8;
+_Narrower()(back_inserter(__utf8), __b, __e);
+_Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + 
__utf8.size());
+#else
 _Narrower()(back_inserter(__dest), __b, __e);
+#endif
   }
 
   template 
-  static void __append_range(string& __dest, _Iter __b, _Iter __e) {
+  static void __append_range(__path_string& __dest, _Iter __b, _Iter __e) {
 static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
 if (__b == __e)
   return;
 basic_string<_ECharT> __tmp(__b, __e);
+#if defined(_LIBCPP_WIN32API)
+string __utf8;
+_Narrower()(back_inserter(__utf8), __tmp.data(),
+__tmp.data() + __tmp.length());
+_Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + 
__utf8.size());
+#else
 _Narrower()(back_inserter(__dest), __tmp.data(),
 __tmp.data() + __tmp.length());
+#endif
   }
 
   template 
-  static void __append_range(string& __dest, _Iter __b, _NullSentinel) {
+  static void __append_range(__path_string& __dest, _Iter __b, _NullSentinel) {
 static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
 const _ECharT __sentinel = _ECharT{};
 if (*__b == __sentinel)
@@ -707,12 +741,19 @@ struct _PathCVT {
 basic_string<_ECharT> __tmp;
 for (; *__b != __sentinel; ++__b)
   __tmp.push_back(*__b);
+#if defined(_LIBCPP_WIN32API)
+string __utf8;
+_Narrower()(back_inserter(__utf8), __tmp.data(),
+__tmp.data() + __tmp.length());
+_Widener()(back_inserter(__dest), __utf8.data(), __utf8.data() + 
__utf8.size());
+#else
 _Narrower()(back_inserter(__dest), __tmp.data(),
 __tmp.data() + __tmp.length());
+#endif
   }
 
   template 
-  static void __append_source(string& __dest, _Source const& __s) {
+  static void __append_source(__path_string& __dest, _Source const& __s) {
 using _Traits = __is_pathable<_Source>;
 __append_range(__dest, _Traits::__range_begin(__s),
_Traits::__range_end(__s));
@@ -721,36 +762,79 @@ struct _PathCVT {
 #endif // !_LIBCPP_HAS_NO_LOCALIZATION
 
 template <>
-struct _PathCVT {
+struct _PathCVT<__path_value> {
 
   template 
   static typename 

[llvm-branch-commits] [libcxx] 08a00c6 - [libcxx] Remove ifdefs in the message to static_assert. NFC.

2020-12-17 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-17T13:37:52+02:00
New Revision: 08a00c6f43c187f8fb3b08dd98e269fb1fcff836

URL: 
https://github.com/llvm/llvm-project/commit/08a00c6f43c187f8fb3b08dd98e269fb1fcff836
DIFF: 
https://github.com/llvm/llvm-project/commit/08a00c6f43c187f8fb3b08dd98e269fb1fcff836.diff

LOG: [libcxx] Remove ifdefs in the message to static_assert. NFC.

Differential Revision: https://reviews.llvm.org/D93283

Added: 


Modified: 
libcxx/include/filesystem

Removed: 




diff  --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index 1a44d9f360e3..764ec6573a50 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -1236,11 +1236,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
 #endif
   is_same::__char_type, char>::value,
   "u8path(Source const&) requires Source have a character type of type "
-  "'char'"
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
-  " or 'char8_t'"
-#endif
-  );
+  "'char' or 'char8_t'");
   return path(__s);
 }
 
@@ -1254,10 +1250,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
 #endif
   is_same::__char_type, char>::value,
   "u8path(Iter, Iter) requires Iter have a value_type of type 'char'"
-#ifndef _LIBCPP_NO_HAS_CHAR8_T
-  " or 'char8_t'"
-#endif
-  );
+  " or 'char8_t'");
   return path(__f, __l);
 }
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 879c15e - [llvm-rc] Handle driveless absolute windows paths when loading external files

2020-12-10 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-10T14:11:06+02:00
New Revision: 879c15e890b4d25d28ea904e92497f091f796019

URL: 
https://github.com/llvm/llvm-project/commit/879c15e890b4d25d28ea904e92497f091f796019
DIFF: 
https://github.com/llvm/llvm-project/commit/879c15e890b4d25d28ea904e92497f091f796019.diff

LOG: [llvm-rc] Handle driveless absolute windows paths when loading external 
files

When llvm-rc loads an external file, it looks for it relative to
a number of include directories and the current working directory.
If the path is considered absolute, llvm-rc tries to open the
filename as such, and doesn't try to open it relative to other
paths.

On Windows, a path name like "\dir\file" isn't considered absolute
as it lacks the drive name, but by appending it on top of the search
dirs, it's not found.

LLVM's sys::path::append just appends such a path (same with a properly
absolute posix path) after the paths it's supposed to be relative to.

This fix doesn't handle the case if the resource script and the
external file are on a different drive than the current working
directory; to fix that, we'd have to make LLVM's sys::path::append
handle appending fully absolute and partially absolute paths (ones
lacking a drive prefix but containing a root directory), or switch
to C++17's std::filesystem.

Differential Revision: https://reviews.llvm.org/D92558

Added: 


Modified: 
llvm/test/tools/llvm-rc/absolute.test
llvm/tools/llvm-rc/ResourceFileWriter.cpp

Removed: 




diff  --git a/llvm/test/tools/llvm-rc/absolute.test 
b/llvm/test/tools/llvm-rc/absolute.test
index 95aff3e42440..fd8b2d68d41e 100644
--- a/llvm/test/tools/llvm-rc/absolute.test
+++ b/llvm/test/tools/llvm-rc/absolute.test
@@ -1,3 +1,7 @@
 ; RUN: touch %t.manifest
 ; RUN: echo "1 24 \"%t.manifest\"" > %t.rc
 ; RUN: llvm-rc -- %t.rc
+;; On Windows, try stripping out the drive name from the absolute path,
+;; and make sure the path still is found.
+; RUN: cat %t.rc | sed 's/"[a-zA-Z]:/"/' > %t2.rc
+; RUN: llvm-rc -- %t2.rc

diff  --git a/llvm/tools/llvm-rc/ResourceFileWriter.cpp 
b/llvm/tools/llvm-rc/ResourceFileWriter.cpp
index c80605aed446..553bb754aea0 100644
--- a/llvm/tools/llvm-rc/ResourceFileWriter.cpp
+++ b/llvm/tools/llvm-rc/ResourceFileWriter.cpp
@@ -1514,8 +1514,16 @@ ResourceFileWriter::loadFile(StringRef File) const {
   SmallString<128> Cwd;
   std::unique_ptr Result;
 
-  // 0. The file path is absolute and the file exists.
-  if (sys::path::is_absolute(File))
+  // 0. The file path is absolute or has a root directory, so we shouldn't
+  // try to append it on top of other base directories. (An absolute path
+  // must have a root directory, but e.g. the path "\dir\file" on windows
+  // isn't considered absolute, but it does have a root directory. As long as
+  // sys::path::append doesn't handle appending an absolute path or a path
+  // starting with a root directory on top of a base, we must handle this
+  // case separately at the top. C++17's path::append handles that case
+  // properly though, so if using that to append paths below, this early
+  // exception case could be removed.)
+  if (sys::path::has_root_directory(File))
 return errorOrToExpected(MemoryBuffer::getFile(File, -1, false));
 
   // 1. The current working directory.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 78a5706 - [CodeGen] Restore accessing __stack_chk_guard via a .refptr stub on mingw after 2518433f861fcb87

2020-12-07 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-07T09:35:12+02:00
New Revision: 78a57069b53a08d5aef98a8472fcfa73dbbc8771

URL: 
https://github.com/llvm/llvm-project/commit/78a57069b53a08d5aef98a8472fcfa73dbbc8771
DIFF: 
https://github.com/llvm/llvm-project/commit/78a57069b53a08d5aef98a8472fcfa73dbbc8771.diff

LOG: [CodeGen] Restore accessing __stack_chk_guard via a .refptr stub on mingw 
after 2518433f861fcb87

Add tests for this particular detail for x86 and arm (similar tests
already existed for x86_64 and aarch64).

The libssp implementation may be located in a separate DLL, and in
those cases, the references need to be in a .refptr stub, to avoid
needing to touch up code in the text section at runtime (which is
supported but inefficient for x86, and unsupported for arm).

Differential Revision: https://reviews.llvm.org/D92738

Added: 
llvm/test/CodeGen/ARM/win32-ssp.ll

Modified: 
llvm/lib/CodeGen/TargetLoweringBase.cpp
llvm/test/CodeGen/X86/win32-ssp.ll

Removed: 




diff  --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp 
b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 61a2de711af8..7dfd76ce5de0 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -1973,7 +1973,8 @@ void TargetLoweringBase::insertSSPDeclarations(Module ) 
const {
 auto *GV = new GlobalVariable(M, Type::getInt8PtrTy(M.getContext()), false,
   GlobalVariable::ExternalLinkage, nullptr,
   "__stack_chk_guard");
-if (getTargetMachine().getRelocationModel() == Reloc::Static)
+if (TM.getRelocationModel() == Reloc::Static &&
+!TM.getTargetTriple().isWindowsGNUEnvironment())
   GV->setDSOLocal(true);
   }
 }

diff  --git a/llvm/test/CodeGen/ARM/win32-ssp.ll 
b/llvm/test/CodeGen/ARM/win32-ssp.ll
new file mode 100644
index ..292ef9f65df1
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/win32-ssp.ll
@@ -0,0 +1,23 @@
+; RUN: llc -mtriple=thumbv7-w64-mingw32 < %s -o - | FileCheck 
--check-prefix=MINGW %s
+
+declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
+declare dso_local void @other(i8*)
+declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
+
+define dso_local void @func() sspstrong {
+entry:
+; MINGW-LABEL: func:
+; MINGW: movw [[REG:r[0-9]+]], :lower16:.refptr.__stack_chk_guard
+; MINGW: movt [[REG]], :upper16:.refptr.__stack_chk_guard
+; MINGW: ldr [[REG2:r[0-9]+]], {{\[}}[[REG]]]
+; MINGW: ldr {{r[0-9]+}}, {{\[}}[[REG2]]]
+; MINGW: bl other
+; MINGW: ldr {{r[0-9]+}}, {{\[}}[[REG2]]]
+; MINGW: bl __stack_chk_fail
+
+  %c = alloca i8, align 1
+  call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %c)
+  call void @other(i8* nonnull %c)
+  call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %c)
+  ret void
+}

diff  --git a/llvm/test/CodeGen/X86/win32-ssp.ll 
b/llvm/test/CodeGen/X86/win32-ssp.ll
index b3e6333000ad..0626bd98a3e3 100644
--- a/llvm/test/CodeGen/X86/win32-ssp.ll
+++ b/llvm/test/CodeGen/X86/win32-ssp.ll
@@ -1,6 +1,7 @@
 ; RUN: llc -mtriple=x86_64-w64-mingw32< %s -o - | FileCheck 
--check-prefix=MINGW %s
 ; RUN: llc -mtriple=x86_64-pc-windows-itanium < %s -o - | FileCheck 
--check-prefix=MSVC  %s
 ; RUN: llc -mtriple=x86_64-pc-windows-msvc< %s -o - | FileCheck 
--check-prefix=MSVC  %s
+; RUN: llc -mtriple=i686-w64-mingw32  < %s -o - | FileCheck 
--check-prefix=MINGW %s
 
 declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
 declare dso_local void @other(i8*)
@@ -9,12 +10,11 @@ declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
 define dso_local void @func() sspstrong {
 entry:
 ; MINGW-LABEL: func:
-; MINGW: mov{{l|q}}  .refptr.__stack_chk_guard(%rip), [[REG:%[a-z]+]]
+; MINGW: mov{{l|q}}  .refptr.[[PREFIX:_?]]__stack_chk_guard{{(\(%rip\))?}}, 
[[REG:%[a-z]+]]
 ; MINGW: mov{{l|q}}  ([[REG]])
-; MINGW: callq other
+; MINGW: call{{l|q}} [[PREFIX]]other
 ; MINGW: mov{{l|q}}  ([[REG]])
-; MINGW: callq __stack_chk_fail
-; MINGW: .seh_endproc
+; MINGW: call{{l|q}} [[PREFIX]]__stack_chk_fail
 
 ; MSVC-LABEL: func:
 ; MSVC: mov{{l|q}} __security_cookie



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] 0b71bf7 - [libcxx] [test] Add a test for conversions between wchar_t, utf8, char16_t, char32_t and windows native narrow code pages

2020-12-04 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-04T11:37:05+02:00
New Revision: 0b71bf793924301d53cf01eeb0a27e96fea17791

URL: 
https://github.com/llvm/llvm-project/commit/0b71bf793924301d53cf01eeb0a27e96fea17791
DIFF: 
https://github.com/llvm/llvm-project/commit/0b71bf793924301d53cf01eeb0a27e96fea17791.diff

LOG: [libcxx] [test] Add a test for conversions between wchar_t, utf8, 
char16_t, char32_t and windows native narrow code pages

Differential Revision: https://reviews.llvm.org/D91133

Added: 

libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp

Modified: 


Removed: 




diff  --git 
a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
 
b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
new file mode 100644
index ..f36b6e2dc87e
--- /dev/null
+++ 
b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
@@ -0,0 +1,418 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// UNSUPPORTED: c++03
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
+
+// 
+
+// class path
+
+// Test constructors, accessors and modifiers that convert from/to various
+// character encodings. Constructors and modifiers (append, concat,
+// operator/=, operator+=) accept inputs with various character encodings,
+// and accessors (*string(), string<>(), u8string()) export the string with
+// various encodings.
+//
+// Some encodings are standardized; char16_t, char32_t and the u8string
+// accessor and u8path constructor (and normal functions taking char8_t in
+// C++20) convert from/to UTF-16, UTF-32 and UTF-8. wchar_t can be either
+// UTF-16 or UTF-32 depending on the size of the wchar_t type, or can be
+// left unimplemented.
+//
+// Plain char is implicitly UTF-8 on posix systems. On Windows, plain char
+// is supposed to be in the same encoding as the platform's native file
+// system APIs consumes in the functions that take narrow strings as path
+// names.
+
+
+#include "filesystem_include.h"
+#include 
+#include 
+
+#include "test_macros.h"
+#include "filesystem_test_helper.h"
+
+// libstdc++ doesn't define conversions from/to wchar_t outside of windows.
+#if defined(__GLIBCXX__) && !defined(_WIN32)
+#  define HAS_NO_WCHAR
+#endif
+
+// Test conversion with strings that fit within the latin1 charset, that fit
+// within one code point in UTF-16, and that can be expressible in certain
+// one-byte code pages.
+static void test_latin_unicode()
+{
+  const char16_t u16str[] = { 0xe5, 0xe4, 0xf6, 0x00 };
+  const char32_t u32str[] = { 0xe5, 0xe4, 0xf6, 0x00 };
+  const char str[] = { char(0xc3), char(0xa5), char(0xc3), char(0xa4), 
char(0xc3), char(0xb6), 0x00 }; // UTF8, in a regular char string
+#if TEST_STD_VER > 17 && defined(__cpp_lib_char8_t)
+  const char8_t u8str[] = { 0xc3, 0xa5, 0xc3, 0xa4, 0xc3, 0xb6, 0x00 };
+#else
+  const char u8str[] = { char(0xc3), char(0xa5), char(0xc3), char(0xa4), 
char(0xc3), char(0xb6), 0x00 };
+#endif
+#ifndef HAS_NO_WCHAR
+  const wchar_t wstr[] = { 0xe5, 0xe4, 0xf6, 0x00 };
+#endif
+
+  // Test well-defined conversion between UTF-8, UTF-16 and UTF-32
+  {
+const fs::path p(u16str);
+assert(p.u8string() == u8str);
+assert(p.u16string() == u16str);
+assert(p.u32string() == u32str);
+assert(p.string() == u16str);
+assert(p.string() == u32str);
+  }
+  {
+const fs::path p(u32str);
+assert(p.u8string() == u8str);
+assert(p.u16string() == u16str);
+assert(p.u32string() == u32str);
+assert(p.string() == u16str);
+assert(p.string() == u32str);
+  }
+  {
+const fs::path p = fs::u8path(str);
+assert(p.u8string() == u8str);
+assert(p.u16string() == u16str);
+assert(p.u32string() == u32str);
+assert(p.string() == u16str);
+assert(p.string() == u32str);
+  }
+#if TEST_STD_VER > 17 && defined(__cpp_lib_char8_t)
+  {
+// In C++20, the path constructor can unambiguously handle UTF-8 input,
+// even if the plain char constructor would treat it as something else.
+const fs::path p(u8str);
+assert(p.u8string() == u8str);
+assert(p.u16string() == u16str);
+assert(p.u32string() == u32str);
+assert(p.string() == u8str);
+assert(p.string() == u16str);
+assert(p.string() == u32str);
+  }
+  // Check reading various inputs with string()
+  {
+const fs::path p(u16str);
+assert(p.string() == u8str);
+  }
+  {
+const fs::path p(u32str);
+assert(p.string() == u8str);
+  }
+  {
+const fs::path p = fs::u8path(str);

[llvm-branch-commits] [libcxx] 6be11e3 - [libcxx] Implement c++2a char8_t input/output of std::filesystem::path

2020-12-04 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-04T11:37:05+02:00
New Revision: 6be11e35d5397ae1c117eb840a969585fdd7d08d

URL: 
https://github.com/llvm/llvm-project/commit/6be11e35d5397ae1c117eb840a969585fdd7d08d
DIFF: 
https://github.com/llvm/llvm-project/commit/6be11e35d5397ae1c117eb840a969585fdd7d08d.diff

LOG: [libcxx] Implement c++2a char8_t input/output of std::filesystem::path

This implements the std::filesystem parts of P0482 (which is already
marked as in progress), and applies the actions that are suggested
in P1423.

Differential Revision: https://reviews.llvm.org/D90222

Added: 


Modified: 
libcxx/docs/Cxx2aStatusPaperStatus.csv
libcxx/docs/ReleaseNotes.rst
libcxx/include/__config
libcxx/include/filesystem

libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp

libcxx/test/std/input.output/filesystems/class.path/path.member/path.generic.obs/named_overloads.pass.cpp

libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/named_overloads.pass.cpp

libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp
libcxx/test/support/filesystem_test_helper.h

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatusPaperStatus.csv 
b/libcxx/docs/Cxx2aStatusPaperStatus.csv
index 88d5641403f5..ac2c093cea3d 100644
--- a/libcxx/docs/Cxx2aStatusPaperStatus.csv
+++ b/libcxx/docs/Cxx2aStatusPaperStatus.csv
@@ -115,7 +115,7 @@
 "`P1208 `__","LWG","Adopt source_location for 
C++20","Cologne","",""
 "`P1355 `__","LWG","Exposing a narrow contract for 
ceil2","Cologne","|Complete|","9.0"
 "`P1361 `__","LWG","Integration of chrono with text 
formatting","Cologne","",""
-"`P1423 `__","LWG","char8_t backward compatibility 
remediation","Cologne","",""
+"`P1423 `__","LWG","char8_t backward compatibility 
remediation","Cologne","|In Progress|",""
 "`P1424 `__","LWG","'constexpr' feature macro 
concerns","Cologne","Superseded by `P1902 `__",""
 "`P1466 `__","LWG","Miscellaneous minor fixes for 
chrono","Cologne","",""
 "`P1474 `__","LWG","Helpful pointers for 
ContiguousIterator","Cologne","",""

diff  --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index 719115fded67..8ce9b2961119 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -56,3 +56,9 @@ API Changes
   - ``ceil2`` has been renamed to ``bit_ceil``
   - ``floor2`` has been renamed to ``bit_floor``
   - ``log2p1`` has been renamed to ``bit_width``
+
+- In C++20 mode, ``std::filesystem::path::u8string()`` and
+  ``generic_u8string()`` now return ``std::u8string`` according to P0428,
+  while they return ``std::string`` in C++17. This can cause source
+  incompatibility, which is discussed and acknowledged in P1423, but that
+  paper doesn't suggest any remediation for this incompatibility.

diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 1a206680ecdc..3f56a022177d 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -989,6 +989,12 @@ typedef unsigned int   char32_t;
 #  define _LIBCPP_DEPRECATED_IN_CXX20
 #endif
 
+#if !defined(_LIBCPP_NO_HAS_CHAR8_T)
+#  define _LIBCPP_DEPRECATED_WITH_CHAR8_T _LIBCPP_DEPRECATED
+#else
+#  define _LIBCPP_DEPRECATED_WITH_CHAR8_T
+#endif
+
 // Macros to enter and leave a state where deprecation warnings are suppressed.
 #if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) && \
 (defined(_LIBCPP_COMPILER_CLANG) || defined(_LIBCPP_COMPILER_GCC))

diff  --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index b4a64768500d..d24751b716e3 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -547,6 +547,13 @@ struct __can_convert_char {
   static const bool value = true;
   using __char_type = wchar_t;
 };
+#ifndef _LIBCPP_NO_HAS_CHAR8_T
+template <>
+struct __can_convert_char {
+  static const bool value = true;
+  using __char_type = char8_t;
+};
+#endif
 template <>
 struct __can_convert_char {
   static const bool value = true;
@@ -995,7 +1002,11 @@ public:
   _LIBCPP_INLINE_VISIBILITY operator string_type() const { return __pn_; }
 
   _LIBCPP_INLINE_VISIBILITY _VSTD::string string() const { return __pn_; }
+#ifndef _LIBCPP_NO_HAS_CHAR8_T
+  _LIBCPP_INLINE_VISIBILITY _VSTD::u8string u8string() const { return 
_VSTD::u8string(__pn_.begin(), __pn_.end()); }
+#else
   _LIBCPP_INLINE_VISIBILITY _VSTD::string u8string() const { return __pn_; }
+#endif
 
 #if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
   template ,
@@ -1023,7 +1034,11 @@ public:
 
   // generic format observers
   _VSTD::string generic_string() const { return __pn_; }
+#ifndef _LIBCPP_NO_HAS_CHAR8_T
+  _VSTD::u8string generic_u8string() const 

[llvm-branch-commits] [clang] c17fdca - [clang] [Headers] Use the corresponding _aligned_free or __mingw_aligned_free in _mm_free

2020-12-04 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-04T11:34:12+02:00
New Revision: c17fdca1883ddee94c6b7e055428d4445ab13e42

URL: 
https://github.com/llvm/llvm-project/commit/c17fdca1883ddee94c6b7e055428d4445ab13e42
DIFF: 
https://github.com/llvm/llvm-project/commit/c17fdca1883ddee94c6b7e055428d4445ab13e42.diff

LOG: [clang] [Headers] Use the corresponding _aligned_free or 
__mingw_aligned_free in _mm_free

Differential Revision: https://reviews.llvm.org/D92570

Added: 


Modified: 
clang/lib/Headers/mm_malloc.h

Removed: 




diff  --git a/clang/lib/Headers/mm_malloc.h b/clang/lib/Headers/mm_malloc.h
index 0ea32517aea8..933dbaacade5 100644
--- a/clang/lib/Headers/mm_malloc.h
+++ b/clang/lib/Headers/mm_malloc.h
@@ -54,7 +54,13 @@ _mm_malloc(size_t __size, size_t __align)
 static __inline__ void __attribute__((__always_inline__, __nodebug__))
 _mm_free(void *__p)
 {
+#if defined(__MINGW32__)
+  __mingw_aligned_free(__p);
+#elif defined(_WIN32)
+  _aligned_free(__p);
+#else
   free(__p);
+#endif
 }
 #endif
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] d3fef7a - [compiler-rt] Fix building the aarch64 out-of-line atomics assembly for non-ELF platforms

2020-12-03 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-03T15:31:06+02:00
New Revision: d3fef7a7c25eba804f5e75b0bb352ed0aaa7c057

URL: 
https://github.com/llvm/llvm-project/commit/d3fef7a7c25eba804f5e75b0bb352ed0aaa7c057
DIFF: 
https://github.com/llvm/llvm-project/commit/d3fef7a7c25eba804f5e75b0bb352ed0aaa7c057.diff

LOG: [compiler-rt] Fix building the aarch64 out-of-line atomics assembly for 
non-ELF platforms

Move the two different definitions of FUNC_ALIGN out of the ELF
specific block. Add the missing CFI_END in
END_COMPILERRT_OUTLINE_FUNCTION, to go with the corresponding CFI_START
in DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED.

Differential Revision: https://reviews.llvm.org/D92549

Added: 


Modified: 
compiler-rt/lib/builtins/assembly.h

Removed: 




diff  --git a/compiler-rt/lib/builtins/assembly.h 
b/compiler-rt/lib/builtins/assembly.h
index 3b7f592fa95c..66625a926cd0 100644
--- a/compiler-rt/lib/builtins/assembly.h
+++ b/compiler-rt/lib/builtins/assembly.h
@@ -37,12 +37,8 @@
 #define FILE_LEVEL_DIRECTIVE
 #if defined(__arm__) || defined(__aarch64__)
 #define SYMBOL_IS_FUNC(name) .type name,%function
-#define FUNC_ALIGN 
\
-  .text SEPARATOR  
\
-  .balign 16 SEPARATOR
 #else
 #define SYMBOL_IS_FUNC(name) .type name,@function
-#define FUNC_ALIGN
 #endif
 #define CONST_SECTION .section .rodata
 
@@ -69,6 +65,14 @@
 
 #endif
 
+#if defined(__arm__) || defined(__aarch64__)
+#define FUNC_ALIGN 
\
+  .text SEPARATOR  
\
+  .balign 16 SEPARATOR
+#else
+#define FUNC_ALIGN
+#endif
+
 // BTI and PAC gnu property note
 #define NT_GNU_PROPERTY_TYPE_0 5
 #define GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc000
@@ -270,7 +274,8 @@
   .size SYMBOL_NAME(name), . - SYMBOL_NAME(name)
 #else
 #define END_COMPILERRT_FUNCTION(name)
-#define END_COMPILERRT_OUTLINE_FUNCTION(name)
+#define END_COMPILERRT_OUTLINE_FUNCTION(name)  
\
+  CFI_END
 #endif
 
 #endif // COMPILERRT_ASSEMBLY_H



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] 0d7bd72 - [libcxx] Apply msvcrt specific exception for lgamma() to mingw configurations, too

2020-12-02 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-02T09:55:16+02:00
New Revision: 0d7bd72f5ab48b2f4a903e21985ae004c12ce265

URL: 
https://github.com/llvm/llvm-project/commit/0d7bd72f5ab48b2f4a903e21985ae004c12ce265
DIFF: 
https://github.com/llvm/llvm-project/commit/0d7bd72f5ab48b2f4a903e21985ae004c12ce265.diff

LOG: [libcxx] Apply msvcrt specific exception for lgamma() to mingw 
configurations, too

This fixes linking code that uses some bits of the  header
on mingw targets.

Differential Revision: https://reviews.llvm.org/D92379

Added: 


Modified: 
libcxx/include/random

Removed: 




diff  --git a/libcxx/include/random b/libcxx/include/random
index 3cb2d30ed732..760a6eb2d46f 100644
--- a/libcxx/include/random
+++ b/libcxx/include/random
@@ -4035,12 +4035,12 @@ public:
 {return !(__x == __y);}
 };
 
-#ifndef _LIBCPP_MSVCRT
+#ifndef _LIBCPP_MSVCRT_LIKE
 extern "C" double lgamma_r(double, int *);
 #endif
 
 inline _LIBCPP_INLINE_VISIBILITY double __libcpp_lgamma(double __d) {
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_MSVCRT_LIKE)
   return lgamma(__d);
 #else
   int __sign;



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] 2e5aaf6 - [compiler-rt] [emutls] Handle unused parameters in a compiler agnostic way

2020-12-01 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-12-01T10:07:53+02:00
New Revision: 2e5aaf65a344ae804343bfed6326ef33f61586b0

URL: 
https://github.com/llvm/llvm-project/commit/2e5aaf65a344ae804343bfed6326ef33f61586b0
DIFF: 
https://github.com/llvm/llvm-project/commit/2e5aaf65a344ae804343bfed6326ef33f61586b0.diff

LOG: [compiler-rt] [emutls] Handle unused parameters in a compiler agnostic way

The MSVC specific pragmas disable this warning, but the pragmas themselves
(when not guarded by any _MSC_VER ifdef) cause warnings for other targets,
e.g. when targeting mingw.

Instead silence the MSVC warnings about unused parameters by casting
the parameters to void.

Differential Revision: https://reviews.llvm.org/D91851

Added: 


Modified: 
compiler-rt/lib/builtins/emutls.c

Removed: 




diff  --git a/compiler-rt/lib/builtins/emutls.c 
b/compiler-rt/lib/builtins/emutls.c
index e0aa19155f7d..98cabd917d6c 100644
--- a/compiler-rt/lib/builtins/emutls.c
+++ b/compiler-rt/lib/builtins/emutls.c
@@ -182,9 +182,10 @@ static void emutls_exit(void) {
   }
 }
 
-#pragma warning(push)
-#pragma warning(disable : 4100)
 static BOOL CALLBACK emutls_init(PINIT_ONCE p0, PVOID p1, PVOID *p2) {
+  (void)p0;
+  (void)p1;
+  (void)p2;
   emutls_mutex =
   (LPCRITICAL_SECTION)_aligned_malloc(sizeof(CRITICAL_SECTION), 16);
   if (!emutls_mutex) {
@@ -251,8 +252,6 @@ static __inline void __atomic_store_n(void *ptr, uintptr_t 
val, unsigned type) {
 
 #endif // __ATOMIC_RELEASE
 
-#pragma warning(pop)
-
 #endif // _WIN32
 
 static size_t emutls_num_object = 0; // number of allocated TLS objects



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] fa10383 - Revert "[BasicAA] Fix BatchAA results for phi-phi assumptions"

2020-11-27 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-11-27T21:50:59+02:00
New Revision: fa103836649c8c37cf4e49523d3448c1ae1a160f

URL: 
https://github.com/llvm/llvm-project/commit/fa103836649c8c37cf4e49523d3448c1ae1a160f
DIFF: 
https://github.com/llvm/llvm-project/commit/fa103836649c8c37cf4e49523d3448c1ae1a160f.diff

LOG: Revert "[BasicAA] Fix BatchAA results for phi-phi assumptions"

This reverts commit 8166ed1a7a26ee8ea8db9005cc8ee5d156adad9b,
as it caused some compilations to hang/loop indefinitely, see
https://reviews.llvm.org/D91936 for details.

Added: 


Modified: 
llvm/include/llvm/Analysis/BasicAliasAnalysis.h
llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/unittests/Analysis/AliasAnalysisTest.cpp

Removed: 




diff  --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h 
b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
index 6f5a31d6a4b5..3717fc9e2c36 100644
--- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
@@ -162,10 +162,6 @@ class BasicAAResult : public AAResultBase {
   /// Tracks instructions visited by pointsToConstantMemory.
   SmallPtrSet Visited;
 
-  /// Whether to disable persistent caching in AAQI. This is used to prevent
-  /// caching of results based on temporary assumptions.
-  bool DisableCache = false;
-
   static const Value *
   GetLinearExpression(const Value *V, APInt , APInt ,
   unsigned , unsigned ,
@@ -220,12 +216,6 @@ class BasicAAResult : public AAResultBase {
  LocationSize V2Size, const AAMDNodes ,
  AAQueryInfo , const Value *O1 = nullptr,
  const Value *O2 = nullptr);
-
-  AliasResult aliasCheckRecursive(const Value *V1, LocationSize V1Size,
-  const AAMDNodes , const Value *V2,
-  LocationSize V2Size, const AAMDNodes 
,
-  AAQueryInfo , const Value *O1,
-  const Value *O2);
 };
 
 /// Analysis pass providing a never-invalidated alias analysis result.

diff  --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp 
b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 0f13f98868cf..5e6afd908ba3 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -1489,10 +1489,8 @@ AliasResult BasicAAResult::aliasPHI(const PHINode *PN, 
LocationSize PNSize,
   // operand from outside the PHIs' cycle that is MayAlias/MustAlias or
   // there must be an operation on the PHIs within the PHIs' value cycle
   // that causes a MayAlias.
-  // Disable persistent caching, so intermediate results based on a
-  // possibly incorrect assumption do not get cached.
-  bool OrigDisableCache = DisableCache;
-  DisableCache = true;
+  // Pretend the phis do not alias.
+  AliasResult Alias = NoAlias;
   AliasResult OrigAliasResult;
   {
 // Limited lifetime iterator invalidated by the aliasCheck call below.
@@ -1503,7 +1501,6 @@ AliasResult BasicAAResult::aliasPHI(const PHINode *PN, 
LocationSize PNSize,
 CacheIt->second = NoAlias;
   }
 
-  AliasResult Alias = NoAlias;
   for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
 AliasResult ThisAlias =
 aliasCheck(PN->getIncomingValue(i), PNSize, PNAAInfo,
@@ -1517,7 +1514,6 @@ AliasResult BasicAAResult::aliasPHI(const PHINode *PN, 
LocationSize PNSize,
   // Reset if speculation failed.
   if (Alias != NoAlias)
 AAQI.updateResult(Locs, OrigAliasResult);
-  DisableCache = OrigDisableCache;
   return Alias;
 }
 
@@ -1757,73 +1753,59 @@ AliasResult BasicAAResult::aliasCheck(const Value *V1, 
LocationSize V1Size,
   if (!Pair.second)
 return Pair.first->second;
 
-  AliasResult Result = aliasCheckRecursive(V1, V1Size, V1AAInfo, V2, V2Size,
-   V2AAInfo, AAQI, O1, O2);
-
-  // If caching is disabled, remove the entry once the recursive checks are
-  // done. We only needed it to prevent infinite recursion.
-  if (DisableCache)
-AAQI.AliasCache.erase(AAQI.AliasCache.find(Locs));
-  else if (Result != MayAlias)
-AAQI.updateResult(Locs, Result);
-  return Result;
-}
-
-AliasResult BasicAAResult::aliasCheckRecursive(
-const Value *V1, LocationSize V1Size, const AAMDNodes ,
-const Value *V2, LocationSize V2Size, const AAMDNodes ,
-AAQueryInfo , const Value *O1, const Value *O2) {
   if (const GEPOperator *GV1 = dyn_cast(V1)) {
 AliasResult Result =
 aliasGEP(GV1, V1Size, V1AAInfo, V2, V2Size, V2AAInfo, O1, O2, AAQI);
 if (Result != MayAlias)
-  return Result;
+  return AAQI.updateResult(Locs, Result);
   } else if (const GEPOperator *GV2 = dyn_cast(V2)) {
 AliasResult Result =
 aliasGEP(GV2, V2Size, V2AAInfo, V1, V1Size, V1AAInfo, O2, 

[llvm-branch-commits] [openmp] 6b42966 - [OpenMP][OMPT] Fix building with OMPT disabled after 6d3b81664a4b79

2020-11-26 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-11-26T10:09:32+02:00
New Revision: 6b429668ded1aa7de4d586fc6dc8a469799b4d9c

URL: 
https://github.com/llvm/llvm-project/commit/6b429668ded1aa7de4d586fc6dc8a469799b4d9c
DIFF: 
https://github.com/llvm/llvm-project/commit/6b429668ded1aa7de4d586fc6dc8a469799b4d9c.diff

LOG: [OpenMP][OMPT] Fix building with OMPT disabled after 6d3b81664a4b79

Added: 


Modified: 
openmp/runtime/src/ompt-specific.h

Removed: 




diff  --git a/openmp/runtime/src/ompt-specific.h 
b/openmp/runtime/src/ompt-specific.h
index 49aa6451f603..18816e7337c1 100644
--- a/openmp/runtime/src/ompt-specific.h
+++ b/openmp/runtime/src/ompt-specific.h
@@ -109,6 +109,26 @@ inline void ompt_set_thread_state(kmp_info_t *thread, 
ompt_state_t state) {
 inline const char *ompt_get_runtime_version() {
   return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN];
 }
+
+class OmptReturnAddressGuard {
+private:
+  bool SetAddress{false};
+  int Gtid;
+
+public:
+  OmptReturnAddressGuard(int Gtid, void *ReturnAddress) : Gtid(Gtid) {
+if (ompt_enabled.enabled && Gtid >= 0 && __kmp_threads[Gtid] &&
+!__kmp_threads[Gtid]->th.ompt_thread_info.return_address) {
+  SetAddress = true;
+  __kmp_threads[Gtid]->th.ompt_thread_info.return_address = ReturnAddress;
+}
+  }
+  ~OmptReturnAddressGuard() {
+if (SetAddress)
+  __kmp_threads[Gtid]->th.ompt_thread_info.return_address = NULL;
+  }
+};
+
 #endif // OMPT_SUPPORT
 
 // macros providing the OMPT callbacks for reduction clause
@@ -135,23 +155,4 @@ inline const char *ompt_get_runtime_version() {
 #define OMPT_REDUCTION_END
 #endif // ! OMPT_SUPPORT && OMPT_OPTIONAL
 
-class OmptReturnAddressGuard {
-private:
-  bool SetAddress{false};
-  int Gtid;
-
-public:
-  OmptReturnAddressGuard(int Gtid, void *ReturnAddress) : Gtid(Gtid) {
-if (ompt_enabled.enabled && Gtid >= 0 && __kmp_threads[Gtid] &&
-!__kmp_threads[Gtid]->th.ompt_thread_info.return_address) {
-  SetAddress = true;
-  __kmp_threads[Gtid]->th.ompt_thread_info.return_address = ReturnAddress;
-}
-  }
-  ~OmptReturnAddressGuard() {
-if (SetAddress)
-  __kmp_threads[Gtid]->th.ompt_thread_info.return_address = NULL;
-  }
-};
-
 #endif



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] d2b71ea - [ORC] Cast to const void* to silence a GCC warning. NFC.

2020-11-25 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-11-25T12:10:53+02:00
New Revision: d2b71ea03d9c250453a90ad01ea1a4f8b0566b5d

URL: 
https://github.com/llvm/llvm-project/commit/d2b71ea03d9c250453a90ad01ea1a4f8b0566b5d
DIFF: 
https://github.com/llvm/llvm-project/commit/d2b71ea03d9c250453a90ad01ea1a4f8b0566b5d.diff

LOG: [ORC] Cast to const void* to silence a GCC warning. NFC.

Added: 


Modified: 
llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h

Removed: 




diff  --git 
a/llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h 
b/llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h
index b498661021ae..0bc209120ce7 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/OrcRPCTargetProcessControl.h
@@ -94,7 +94,7 @@ class OrcRPCTPCJITLinkMemoryManager : public 
jitlink::JITLinkMemoryManager {
  << " bytes to " << ((Prot & orcrpctpc::WPF_Read) ? 'R' : '-')
  << ((Prot & orcrpctpc::WPF_Write) ? 'W' : '-')
  << ((Prot & orcrpctpc::WPF_Exec) ? 'X' : '-')
- << " segment: local " << (void *)B.Buffer.data()
+ << " segment: local " << (const void *)B.Buffer.data()
  << " -> target " << formatv("{0:x16}", B.Address) << "\n";
 }
   });



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] df54f50 - [ORC] Remove a superfluous semicolon, silencing GCC warnings. NFC.

2020-11-25 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-11-25T12:10:53+02:00
New Revision: df54f50437db99bd489d0782422c3c55900e6347

URL: 
https://github.com/llvm/llvm-project/commit/df54f50437db99bd489d0782422c3c55900e6347
DIFF: 
https://github.com/llvm/llvm-project/commit/df54f50437db99bd489d0782422c3c55900e6347.diff

LOG: [ORC] Remove a superfluous semicolon, silencing GCC warnings. NFC.

Added: 


Modified: 
llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Removed: 




diff  --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp 
b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index 4e899cf2d156..1ba5259988f5 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -733,7 +733,7 @@ Error LLVMJITLinkRemoteTargetProcessControl::disconnect() {
   });
   ListenerThread.join();
   return joinErrors(std::move(Err), F.get());
-};
+}
 
 class PhonyExternalsGenerator : public DefinitionGenerator {
 public:



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 6f79204 - Reapply "[CodeGen] [WinException] Only produce handler data at the end of the function if needed"

2020-11-23 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-11-23T23:17:03+02:00
New Revision: 6f792041a5cb964b4099614952a54c4961bfb872

URL: 
https://github.com/llvm/llvm-project/commit/6f792041a5cb964b4099614952a54c4961bfb872
DIFF: 
https://github.com/llvm/llvm-project/commit/6f792041a5cb964b4099614952a54c4961bfb872.diff

LOG: Reapply "[CodeGen] [WinException] Only produce handler data at the end of 
the function if needed"

This reapplies 36c64af9d7f97414d48681b74352c9684077259b in updated
form.

Emit the xdata for each function at .seh_endproc. This keeps the
exact same output header order for most code generated by the LLVM
CodeGen layer. (Sections still change order for code built from
assembly where functions lack an explicit .seh_handlerdata
directive, and functions with chained unwind info.)

The practical effect should be that assembly output lacks
superfluous ".seh_handlerdata; .text" pairs at the end of functions
that don't handle exceptions, which allows such functions to use
the AArch64 packed unwind format again.

Differential Revision: https://reviews.llvm.org/D87448

Added: 


Modified: 
llvm/include/llvm/MC/MCStreamer.h
llvm/include/llvm/MC/MCWin64EH.h
llvm/include/llvm/MC/MCWinEH.h
llvm/lib/CodeGen/AsmPrinter/WinException.cpp
llvm/lib/MC/MCStreamer.cpp
llvm/lib/MC/MCWin64EH.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp
llvm/test/CodeGen/AArch64/win64-jumptable.ll
llvm/test/CodeGen/AArch64/wineh1.mir
llvm/test/CodeGen/X86/avx512-intel-ocl.ll
llvm/test/CodeGen/X86/avx512-regcall-Mask.ll
llvm/test/CodeGen/X86/avx512-regcall-NoMask.ll
llvm/test/CodeGen/X86/break-false-dep.ll
llvm/test/CodeGen/X86/conditional-tailcall-pgso.ll
llvm/test/CodeGen/X86/conditional-tailcall.ll
llvm/test/CodeGen/X86/gnu-seh-nolpads.ll
llvm/test/CodeGen/X86/mixed-ptr-sizes.ll
llvm/test/CodeGen/X86/musttail-varargs.ll
llvm/test/CodeGen/X86/no-sse-win64.ll
llvm/test/CodeGen/X86/win64-jumptable.ll
llvm/test/CodeGen/X86/win64_frame.ll

Removed: 




diff  --git a/llvm/include/llvm/MC/MCStreamer.h 
b/llvm/include/llvm/MC/MCStreamer.h
index 6a0ef5360cd4..9581a08fc5cf 100644
--- a/llvm/include/llvm/MC/MCStreamer.h
+++ b/llvm/include/llvm/MC/MCStreamer.h
@@ -206,6 +206,7 @@ class MCStreamer {
   std::vector> WinFrameInfos;
 
   WinEH::FrameInfo *CurrentWinFrameInfo;
+  size_t CurrentProcWinFrameInfoStartIndex;
 
   /// Tracks an index to represent the order a symbol was emitted in.
   /// Zero means we did not emit that symbol.
@@ -244,6 +245,8 @@ class MCStreamer {
 return CurrentWinFrameInfo;
   }
 
+  virtual void EmitWindowsUnwindTables(WinEH::FrameInfo *Frame);
+
   virtual void EmitWindowsUnwindTables();
 
   virtual void emitRawTextImpl(StringRef String);

diff  --git a/llvm/include/llvm/MC/MCWin64EH.h 
b/llvm/include/llvm/MC/MCWin64EH.h
index 60ec06e61b7c..065161d1759e 100644
--- a/llvm/include/llvm/MC/MCWin64EH.h
+++ b/llvm/include/llvm/MC/MCWin64EH.h
@@ -53,14 +53,15 @@ struct Instruction {
 class UnwindEmitter : public WinEH::UnwindEmitter {
 public:
   void Emit(MCStreamer ) const override;
-  void EmitUnwindInfo(MCStreamer , WinEH::FrameInfo *FI) const 
override;
+  void EmitUnwindInfo(MCStreamer , WinEH::FrameInfo *FI,
+  bool HandlerData) const override;
 };
 
 class ARM64UnwindEmitter : public WinEH::UnwindEmitter {
 public:
   void Emit(MCStreamer ) const override;
-  void EmitUnwindInfo(MCStreamer ,
-  WinEH::FrameInfo *FI) const override;
+  void EmitUnwindInfo(MCStreamer , WinEH::FrameInfo *FI,
+  bool HandlerData) const override;
 };
 
 }

diff  --git a/llvm/include/llvm/MC/MCWinEH.h b/llvm/include/llvm/MC/MCWinEH.h
index a46f56d708ce..5688255810d0 100644
--- a/llvm/include/llvm/MC/MCWinEH.h
+++ b/llvm/include/llvm/MC/MCWinEH.h
@@ -80,7 +80,8 @@ class UnwindEmitter {
 
   /// This emits the unwind info sections (.pdata and .xdata in PE/COFF).
   virtual void Emit(MCStreamer ) const = 0;
-  virtual void EmitUnwindInfo(MCStreamer , FrameInfo *FI) const = 0;
+  virtual void EmitUnwindInfo(MCStreamer , FrameInfo *FI,
+  bool HandlerData) const = 0;
 };
 }
 }

diff  --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp 
b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index 26b6a322da38..3a9c9df79783 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -258,11 +258,11 @@ void WinException::endFuncletImpl() {
 if (F.hasPersonalityFn())
   Per = classifyEHPersonality(F.getPersonalityFn()->stripPointerCasts());
 
-// Emit an UNWIND_INFO struct describing the prologue.
-Asm->OutStreamer->EmitWinEHHandlerData();
-
 if (Per == EHPersonality::MSVC_CXX && shouldEmitPersonality &&
 

[llvm-branch-commits] [compiler-rt] 33fb967 - [compiler-rt] [profile] Silence a warning about an unused function on mingw targets

2020-11-21 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-11-21T22:14:35+02:00
New Revision: 33fb9679ec6e288bc72f2aa19c8ef1576b4c66b9

URL: 
https://github.com/llvm/llvm-project/commit/33fb9679ec6e288bc72f2aa19c8ef1576b4c66b9
DIFF: 
https://github.com/llvm/llvm-project/commit/33fb9679ec6e288bc72f2aa19c8ef1576b4c66b9.diff

LOG: [compiler-rt] [profile] Silence a warning about an unused function on 
mingw targets

This function is only used within the ifdef below.

Differential Revision: https://reviews.llvm.org/D91850

Added: 


Modified: 
compiler-rt/lib/profile/InstrProfilingFile.c

Removed: 




diff  --git a/compiler-rt/lib/profile/InstrProfilingFile.c 
b/compiler-rt/lib/profile/InstrProfilingFile.c
index bd1ec44fc77e..42ffdae82622 100644
--- a/compiler-rt/lib/profile/InstrProfilingFile.c
+++ b/compiler-rt/lib/profile/InstrProfilingFile.c
@@ -420,14 +420,12 @@ static void truncateCurrentFile(void) {
   fclose(File);
 }
 
-#ifndef _MSC_VER
+#if !defined(__Fuchsia__) && !defined(_WIN32)
 static void assertIsZero(int *i) {
   if (*i)
 PROF_WARN("Expected flag to be 0, but got: %d\n", *i);
 }
-#endif
 
-#if !defined(__Fuchsia__) && !defined(_WIN32)
 /* Write a partial profile to \p Filename, which is required to be backed by
  * the open file object \p File. */
 static int writeProfileWithFileObject(const char *Filename, FILE *File) {



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] e6ec96f - [docs] Add release notes for the 11.x release

2020-08-17 Thread Martin Storsjö via llvm-branch-commits

Author: Martin Storsjö
Date: 2020-08-17T11:17:15+03:00
New Revision: e6ec96f4215a4f5302e4dd5d0ac287a1b0563586

URL: 
https://github.com/llvm/llvm-project/commit/e6ec96f4215a4f5302e4dd5d0ac287a1b0563586
DIFF: 
https://github.com/llvm/llvm-project/commit/e6ec96f4215a4f5302e4dd5d0ac287a1b0563586.diff

LOG: [docs] Add release notes for the 11.x release

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
lld/docs/ReleaseNotes.rst
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 3264846506c6..6f336088750f 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -191,6 +191,16 @@ Attribute Changes in Clang
 Windows Support
 ---
 
+- Don't warn about `ms_struct may not produce Microsoft-compatible layouts
+  for classes with base classes or virtual functions` if the option is
+  enabled globally, as opposed to enabled on a specific class/struct or
+  on a specific section in the source files. This avoids needing to
+  couple `-mms-bitfields` with `-Wno-incompatible-ms-struct` if building
+  C++ code.
+
+- Enable `-mms-bitfields` by default for MinGW targets, matching a similar
+  change in GCC 4.7.
+
 C Language Changes in Clang
 ---
 

diff  --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index fe3de8306cd8..f0482c2428c4 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -40,12 +40,17 @@ Breaking changes
 COFF Improvements
 -
 
-* ...
+* Fixed exporting symbols whose names contain a period (``.``), which was
+  a regression in lld 7.
 
 MinGW Improvements
 --
 
-* ...
+* Implemented new options for disabling auto import and runtime pseudo
+  relocations (``--disable-auto-import`` and
+  ``--disable-runtime-pseudo-reloc``), the ``--no-seh`` flag and options
+  for selecting file and section alignment (``--file-alignment`` and
+  ``--section-alignment``).
 
 MachO Improvements
 --

diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index ed1718a95054..c9ac61d29676 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -81,6 +81,15 @@ Changes to the LLVM IR
 Changes to building LLVM
 
 
+Changes to the AArch64 Backend
+--
+
+* Back up and restore x18 in functions with windows calling convention on
+  non-windows OSes.
+
+* Clearly error out on unsupported relocations when targeting COFF, instead
+  of silently accepting some (without being able to do what was requested).
+
 Changes to the ARM Backend
 --
 
@@ -157,6 +166,12 @@ Changes to the WebAssembly Target
 * `__attribute__((visibility("protected")))` now evokes a warning, as
   WebAssembly does not support "protected" visibility.
 
+Changes to the Windows Target
+-
+
+* Produce COFF weak external symbols for IR level weak symbols without a comdat
+  (e.g. for `__attribute__((weak))` in C)
+
 Changes to the OCaml bindings
 -
 
@@ -195,6 +210,12 @@ Changes to the LLVM tools
   symbols, i.e. mapping symbols on ARM and AArch64, by default. This matches
   the GNU nm behavior.
 
+* llvm-rc now tolerates -1 as menu item ID, supports the language id option
+  and allows string table values to be split into multiple string literals
+
+* llvm-lib supports adding import library objects in addition to regular
+  object files
+
 Changes to LLDB
 ===
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits