[PATCH] D50199: [MinGW] Predefine UNICODE if -municode is specified during compilation

2018-08-06 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC339048: [MinGW] Predefine UNICODE if -municode is specified during compilation (authored by mstorsjo, committed by ). Repository: rC Clang https://reviews.llvm.org/D50199 Files: lib/Driver/ToolChain

[PATCH] D50380: [Headers] Expand _Unwind_Exception for SEH on MinGW/x86_64

2018-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. mstorsjo added reviewers: rnk, compnerd, hans. Herald added a subscriber: chrib. This matches how GCC defines this struct. Repository: rC Clang https://reviews.llvm.org/D50380 Files: lib/Headers/unwind.h Index: lib/Headers/unwind.h

[PATCH] D50380: [Headers] Expand _Unwind_Exception for SEH on MinGW/x86_64

2018-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL339170: [Headers] Expand _Unwind_Exception for SEH on MinGW/x86_64 (authored by mstorsjo, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D5038

[PATCH] D50380: [Headers] Expand _Unwind_Exception for SEH on MinGW/x86_64

2018-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. @hans Can you merge this for 7.0? This is necessary for https://reviews.llvm.org/D49638 (merged well before the branch) to work properly without causing heap corruption. Repository: rL LLVM https://reviews.llvm.org/D50380

[PATCH] D50412: [libunwind] Fix pointer-to-integer cast warnings on LLP64.

2018-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo accepted this revision. mstorsjo added a comment. This revision is now accepted and ready to land. LGTM Repository: rUNW libunwind https://reviews.llvm.org/D50412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

[PATCH] D50414: [libunwind][include] Add SEH declarations to .

2018-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Should we maybe add the same declaration of `_GCC_specific_handler` to clang's unwind.h? That would allow removing the forward declaration in libcxxabi from https://reviews.llvm.org/D49638. Do you plan on implementing these SEH specific bits in libunwind, or are you j

[PATCH] D50413: [libunwind][include] Add some missing definitions to .

2018-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: include/unwind.h:46 +typedef uintptr_t _Unwind_Ptr; +#endif + What other reference is this list of typedefs for `_Unwind_Ptr` based on? I don't see any of these cases in clang's unwind.h at least. Co

[PATCH] D50412: [libunwind] Fix pointer-to-integer cast warnings on LLP64.

2018-08-07 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a subscriber: hans. mstorsjo added a comment. @hans This looks 7.0-worthy to me. Repository: rL LLVM https://reviews.llvm.org/D50412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

[PATCH] D50144: Add Windows support for the GNUstep Objective-C ABI V2.

2018-08-08 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: lib/CodeGen/CGBlocks.cpp:1276 +InitVar->setSection(".CRT$XCLa"); +CGM.addUsedGlobal(InitVar); + } rjmccall wrote: > DHowett-MSFT wrote: > > rjmccall wrote: > > > Is the priority system not good enough? > > My r

[PATCH] D50414: [libunwind][include] Add SEH declarations to .

2018-08-08 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo accepted this revision. mstorsjo added a comment. This revision is now accepted and ready to land. In https://reviews.llvm.org/D50414#1192267, @cdavis5x wrote: > In https://reviews.llvm.org/D50414#1191834, @mstorsjo wrote: > > > Do you plan on implementing these SEH specific bits in libu

[PATCH] D50413: [libunwind][include] Add some missing definitions to .

2018-08-10 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. @cdavis5x I presume the fact that this one turned out tricky is blocking submitting the SEH unwinding patch. Would it be worth to rework that patch to just use the basic types just like libunwind does today, e.g. having `_Unwind_GetRegionStart` return plain `uintptr_t

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-10 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. > I've tested this implementation on x86-64 to ensure that it works. All > libc++abi tests pass, as do all libc++ exception-related tests. I tested it now as well, and seems to work for my simple testcase. > ARM still remains to be implemented (@compnerd?). LLVM doesn

[PATCH] D50663: [libunwind] [cmake] Add MINGW_LIBRARIES to the linker flags

2018-08-13 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. mstorsjo added reviewers: rnk, compnerd, phosek, smeenai. Herald added subscribers: chrib, mgorny. This is essential when building with -nodefaultlibs. In some CMake versions (noticed in 3.5.1), the same libraries are picked up from CMAKE_REQUIRED_LIBRARIES in som

[PATCH] D50663: [libunwind] [cmake] Add MINGW_LIBRARIES to the linker flags

2018-08-13 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL339642: [cmake] Add MINGW_LIBRARIES to the linker flags (authored by mstorsjo, committed by ). Herald added subscribers: llvm-commits, christof. Changed prior to commit: https://reviews.llvm.org/D50663?

[PATCH] D50691: [CMake] Fix the LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY option

2018-08-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. mstorsjo added reviewers: phosek, rnk, compnerd, smeenai. Herald added subscribers: ldionne, mgorny. This option should be available if LIBCXX_ENABLE_SHARED is enabled, not LIBCXX_ENABLE_STATIC, since the option is about linking shard libraries. This fixes a typo

[PATCH] D50691: [CMake] Fix the LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY option

2018-08-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. @hans I think this should be merged to 7.0, if reviewers agree with the change. Repository: rCXX libc++ https://reviews.llvm.org/D50691 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D50564#1199285, @rnk wrote: > In https://reviews.llvm.org/D50564#1198996, @cdavis5x wrote: > > > Could somebody verify that the `DISPATCHER_CONTEXT` struct is defined in > > `` for the Win8 and Win10 SDKs? I can't install them right now. > >

[PATCH] D50691: [CMake] Fix the LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY option

2018-08-14 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL339697: [CMake] Fix the LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY option (authored by mstorsjo, committed by ). Herald added subscribers: llvm-commits, christof. Changed prior to commit: https://rev

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-20 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D50564#1206370, @cdavis5x wrote: > In https://reviews.llvm.org/D50564#1206302, @kristina wrote: > > > I'm all for this change except the core issue is that you're using > > libunwind as a shim around the actual unwinding API provided by Windo

[PATCH] D51026: [CodeGen] Implicitly set stackrealign on the main function, if custom stack alignment is used

2018-08-21 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. mstorsjo added reviewers: craig.topper, erichkeane, rnk. If using a custom stack alignment, one is expected to make sure that all callers provide such alignment, or realign the stack in all entry points (and callbacks). Despite this, the compiler can assume that

[PATCH] D51026: [CodeGen] Implicitly set stackrealign on the main function, if custom stack alignment is used

2018-08-21 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: lib/CodeGen/CodeGenFunction.cpp:989 +CGM.getCodeGenOpts().StackAlignment) + Fn->addFnAttr("stackrealign"); + erichkeane wrote: > Is there not an attribute name for this already in LLVM? I guess I'm > othe

[PATCH] D51026: [CodeGen] Implicitly set stackrealign on the main function, if custom stack alignment is used

2018-08-21 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL340334: [CodeGen] Implicitly set stackrealign on the main function, if custom stack… (authored by mstorsjo, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://revi

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-23 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/Unwind-seh.cpp:163 +#ifdef __x86_64__ +unw_get_reg(&cursor, UNW_X86_64_RAX, &retval); +unw_get_reg(&cursor, UNW_X86_64_RDX, &exc->private_[3]); Without understanding the code flow completely - is there a ris

[PATCH] D46287: [Driver] Don't add -dwarf-column-info when using -gcodeview on non-msvc targets

2018-05-08 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL331807: [Driver] Don't add -dwarf-column-info when using -gcodeview on non-msvc targets (authored by mstorsjo, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://r

[PATCH] D46520: [Driver] Use -fuse-line-directives by default in MSVC mode

2018-05-08 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D46520#1092233, @rnk wrote: > Please don't do this, this is actually really problematic, since `#line` > directives lose information about what's a system header. That means the > result of -E usually won't compile, since Windows headers are

[PATCH] D46520: [Driver] Use -fuse-line-directives by default in MSVC mode

2018-05-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo closed this revision. mstorsjo added a comment. Reverted in SVN r331858. Repository: rL LLVM https://reviews.llvm.org/D46520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[PATCH] D47476: Support __iso_volatile_load8 etc on aarch64-win32.

2018-05-29 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo accepted this revision. mstorsjo added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rC Clang https://reviews.llvm.org/D47476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.ll

[PATCH] D37530: [MinGW] Don't link -lmsvcrt if a different msvcrt version is to be linked

2017-09-25 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314138: [MinGW] Don't link -lmsvcrt if a different msvcrt version is to be linked (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D37530?vs=114429&id=116587#toc Repository:

[PATCH] D38247: [libunwind] Correct data types in the _Unwind_FunctionContext struct

2017-09-25 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. This makes it match the definition used within llvm and in libgcc, we previously got the wrong layout on 64 bit. https://reviews.llvm.org/D38247 Files: src/Unwind-sjlj.c Index: src/Unwind-sjlj.c ===

[PATCH] D38249: [libunwind] Skip building unused parts when targeting SJLJ

2017-09-25 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. Herald added subscribers: kristof.beyls, aemerson. When SJLJ exceptions are used, those functions aren't used. This fixes build failures on ARM with SJLJ enabled, such as armv7/iOS. https://reviews.llvm.org/D38249 Files: src/UnwindLevel1.c src/UnwindRegister

[PATCH] D38250: [libunwind] Implement the Get/SetTopOfFunctionStack functions via a __thread TLS variable

2017-09-25 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. When targeting apple platforms, these functions are implemented in Unwind_AppleExtras.cpp, but there's previously no implementation for other platforms. Does `__thread` have any specific runtime requirements on e.g. windows? https://reviews.llvm.org/D38250 Files

[PATCH] D38249: [libunwind] Skip building unused parts when targeting SJLJ

2017-09-26 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo closed this revision. mstorsjo marked an inline comment as done. mstorsjo added a comment. Committed in SVN r314197. https://reviews.llvm.org/D38249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailm

[PATCH] D38247: [libunwind] Correct data types in the _Unwind_FunctionContext struct

2017-09-26 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo closed this revision. mstorsjo added a comment. Committed in SVN r314196. https://reviews.llvm.org/D38247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D38250: [libunwind] Implement the Get/SetTopOfFunctionStack functions via a __thread TLS variable

2017-09-26 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D38250#880871, @compnerd wrote: > I have a complete implementation for this which is known to work on Windows > at least. Patches for libunwind, or standalone? In any case, please do share if you think it's relevant. > The only thing that

[PATCH] D38290: Add a ld64.lld alias for the MACHO LLD target

2017-09-26 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: tools/clang/lib/Driver/ToolChain.cpp:394 +llvm::SmallString<8> LinkerName; +if(Triple.isOSDarwin()) + LinkerName.append("ld64."); Space between `if` and `(` Repository: rL LLVM https://reviews.llvm.org

[PATCH] D38380: [libunwind] Add CMake support for building for MinGW

2017-09-28 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. Herald added a subscriber: mgorny. This is the cmake specific parts of https://reviews.llvm.org/D33601 (by Martell Malone) split out into a separate patch, to ease getting this part reviewed indendent of the rest of that patch. https://reviews.llvm.org/D38380 F

[PATCH] D38381: [libunwind] Skip building x86 parts of UnwindRegisters*.S when targeting SjLj

2017-09-28 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. Herald added subscribers: kristof.beyls, aemerson. This extends SVN r314197 (https://reviews.llvm.org/D38249) from the arm parts to the whole file (the x86 parts as well). https://reviews.llvm.org/D38381 Files: src/UnwindRegistersRestore.S src/UnwindRegister

[PATCH] D38250: [libunwind] Implement the Get/SetTopOfFunctionStack functions via a __thread TLS variable

2017-09-28 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/Unwind-sjlj.c:468 +#ifndef __APPLE__ +__thread struct _Unwind_FunctionContext *stack = NULL; compnerd wrote: > I would prefer: > > #if !defined(__APPLE__) Sure, I can change that. Comment a

[PATCH] D38250: [libunwind] Implement the Get/SetTopOfFunctionStack functions via a __thread TLS variable

2017-09-28 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo updated this revision to Diff 117089. mstorsjo edited the summary of this revision. mstorsjo added a comment. Made the tls variable static, changed ifndef into !defined(). https://reviews.llvm.org/D38250 Files: src/Unwind-sjlj.c Index: src/Unwind-sjlj.c

[PATCH] D38380: [libunwind] Add CMake support for building for MinGW

2017-09-28 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: cmake/config-ix.cmake:38 +else () + set(MINGW_RUNTIME gcc_s gcc) +endif() compnerd wrote: > This seems really weird. `gcc_s` and `gcc` are the same library, the former > is the shared version of the latte

[PATCH] D38381: [libunwind] Skip building x86 parts of UnwindRegisters*.S when targeting SjLj

2017-09-28 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314492: Skip building x86 parts of UnwindRegisters*.S when targeting SjLj (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D38381?vs=117047&id=117092#toc Repository: rL LLVM

[PATCH] D38250: [libunwind] Implement the Get/SetTopOfFunctionStack functions via a __thread TLS variable

2017-10-01 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/Unwind-sjlj.c:481 +#endif // !defined(__APPLE__) + #endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS) compnerd wrote: > mstorsjo wrote: > > compnerd wrote: > > > Can't both of these also be static? > > No, since they're

[PATCH] D38250: [libunwind] Implement the Get/SetTopOfFunctionStack functions via a __thread TLS variable

2017-10-01 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo abandoned this revision. mstorsjo added a comment. Works fine with the version from r314632 (with a minor fixup in r314635). https://reviews.llvm.org/D38250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-b

[PATCH] D38380: [libunwind] Add CMake support for building for MinGW

2017-10-02 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314716: Add CMake support for building for MinGW (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D38380?vs=117046&id=117417#toc Repository: rL LLVM https://reviews.llvm.org

[PATCH] D38576: |libunwind] [docs] Mention that SjLj works on any OS on the archs where supported by the compiler

2017-10-04 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. https://reviews.llvm.org/D38576 Files: docs/index.rst Index: docs/index.rst === --- docs/index.rst +++ docs/index.rst @@ -50,6 +50,7 @@ LinuxARM Clang, GCC EHABI Bare M

[PATCH] D38576: |libunwind] [docs] Mention that SjLj works on any OS on the archs where supported by the compiler

2017-10-06 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315090: [docs] Mention that SjLj works on any OS on the archs where supported by the… (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D38576?vs=117778&id=118054#toc Repository

[PATCH] D38680: [libunwind] Fix handling of DW_CFA_GNU_args_size

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. This effectively reverts SVN r204290 and r204292 (back when this code was part of libcxxabi). According to SVN r204290, the primary architecture using the DW_CFA_GNU_args_size opcode is VAX. However, clang also produces it on X86 when it has done X86CallFrameOp

[PATCH] D38679: [libunwind] Support dwarf unwinding on i386 windows

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. This builds on some parts from https://reviews.llvm.org/D33601 - some of them were commented on before. This patch contains comments and explanations about those non-obvious parts. https://reviews.llvm.org/D38679 Files: docs/index.rst src/AddressSpace.hpp

[PATCH] D38679: [libunwind] Support dwarf unwinding on i386 windows

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/AddressSpace.hpp:388-389 + found_obj = true; + } else if (!strncmp((const char *)pish->Name, ".eh_frame", + IMAGE_SIZEOF_SHORT_NAME)) { +info.dwarf_section = begin; rnk

[PATCH] D38679: [libunwind] Support dwarf unwinding on i386 windows

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/AddressSpace.hpp:521 unw_word_t *offset) { -#ifndef _LIBUNWIND_IS_BAREMETAL +#if !defined(_LIBUNWIND_IS_BAREMETAL) && !defined(_WIN32) Dl_info dyldInfo; jroelofs w

[PATCH] D38679: [libunwind] Support dwarf unwinding on i386 windows

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/AddressSpace.hpp:521 unw_word_t *offset) { -#ifndef _LIBUNWIND_IS_BAREMETAL +#if !defined(_LIBUNWIND_IS_BAREMETAL) && !defined(_WIN32) Dl_info dyldInfo; mstorsjo w

[PATCH] D38679: [libunwind] Support dwarf unwinding on i386 windows

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo updated this revision to Diff 118263. mstorsjo added a comment. Added a fixme comment about the truncated section name, flipped the ifdef in the assembly source. Didn't implement findFunctionName. https://reviews.llvm.org/D38679 Files: docs/index.rst src/AddressSpace.hpp src/Unw

[PATCH] D38679: [libunwind] Support dwarf unwinding on i386 windows

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: docs/index.rst:53 NetBSD x86_64 Clang, GCC DWARF CFI +Windows i386 ClangDWARF CFI Any i386, x86_64, ARMClangSjLj FWIW, for this to actually work

[PATCH] D38704: [libunwind] Emulate pthread rwlocks via SRW locks for windows

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. Herald added a subscriber: mehdi_amini. This makes sure that the FDE cache is thread safe. This requires building with `_WIN32_WINNT >= 0x0600`. The alternative would be to skip the FDE cache altogether if building without threads. https://reviews.llvm.org/D387

[PATCH] D38704: [libunwind] Emulate pthread rwlocks via SRW locks for windows

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D38704#892479, @zturner wrote: > I'm a little nervous about re-inventing a poor man's version of a reader > writer lock. Can we not just copy LLVM's? I guess I could have a look to see how much extra either kitchen sink it would bring. Si

[PATCH] D38680: [libunwind] Fix handling of DW_CFA_GNU_args_size

2017-10-09 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D38680#892487, @compnerd wrote: > I think that the problem is that we are using the generic register name, but > we need to use the target specific register name. On x86, EIP/ESP are > swapped. You mean EBP/ESP? I think the code here does

[PATCH] D38679: [libunwind] Support dwarf unwinding on i386 windows

2017-10-10 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Are there any further comments on this, or can someone of those who commented on it before approve it? https://reviews.llvm.org/D38679 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/m

[PATCH] D36111: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb

2017-10-11 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. @mgrang, did you ever get to completing this? I've got a need for this now (only `__dmb` so far), and if you don't have time, I can try to finish it. https://reviews.llvm.org/D36111 ___ cfe-commits mailing list cfe-commits

[PATCH] D38679: [libunwind] Support dwarf unwinding on i386 windows

2017-10-11 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D38679#894668, @jroelofs wrote: > LGTM Thanks, will push this one without the docs update since it's still buggy in practice on windows until https://reviews.llvm.org/D38680 gets resolved. https://reviews.llvm.org/D38679 __

[PATCH] D36111: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb

2017-10-11 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D36111#895084, @mgrang wrote: > Sorry, I never got to complete this as I moved to other priorities. I do not > think I have cycles to do this now. Please feel free to take over this patch > :) Ok - will do! Thanks for letting me know! ht

[PATCH] D38679: [libunwind] Support dwarf unwinding on i386 windows

2017-10-11 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315498: Support DWARF unwinding on i386 windows (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D38679?vs=118263&id=118673#toc Repository: rL LLVM https://reviews.llvm.org/

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-11 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. Herald added a subscriber: aprantl. Clang doesn't currently support building for windows/x86_64 with dwarf by setting command line parameters, but if manually modified to use dwarf, we can make libunwind work in this configuration as well. Even if support for thi

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-11 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. As further explanation/justification - libcxxabi and libunwind don't support SEH exceptions yet. https://reviews.llvm.org/D38819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D38821: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb

2017-10-11 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. Herald added subscribers: kristof.beyls, javed.absar, aemerson. This is an update to https://reviews.llvm.org/D36111 by @mgrang, taking over finishing of this patch. Compared to his version, this makes the intrinsics conditional to ALL_MS_LANGUAGES. https://revi

[PATCH] D38680: [libunwind] Fix handling of DW_CFA_GNU_args_size

2017-10-11 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/libunwind.cpp:188 + co->getInfo(&info); + pint_t orgArgSize = (pint_t)info.gp; + uint64_t orgFuncStart = info.start_ip; rnk wrote: > I think it makes sense to have this here: the contract is that if t

[PATCH] D38821: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb

2017-10-11 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D38821#895527, @compnerd wrote: > Don't you need a change to the intrinsics to actually map the builtin? Apparently, this change is all that's needed since the tests pass. I can of course try to look closer and see what actually makes it wo

[PATCH] D38821: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb

2017-10-12 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D38821#895527, @compnerd wrote: > Don't you need a change to the intrinsics to actually map the builtin? This seems to be automatically mapped via this piece of code in CGBuiltin.cpp: // See if we have a target specific intrinsic. const

[PATCH] D38821: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb

2017-10-12 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315567: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D38821?vs=118689&id=118747#toc Repository: rL LLVM https://reviews

[PATCH] D36111: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb

2017-10-12 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. This one can be abandoned now. https://reviews.llvm.org/D36111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D38900: libunwind: document tested FreeBSD configs and sort OS list

2017-10-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo accepted this revision. mstorsjo added a comment. This revision is now accepted and ready to land. Seems ok to me, with whatever other architectures it's verified on as well. https://reviews.llvm.org/D38900 ___ cfe-commits mailing list cfe-

[PATCH] D38704: [libunwind] Emulate pthread rwlocks via SRW locks for windows

2017-10-14 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D38704#892479, @zturner wrote: > I'm a little nervous about re-inventing a poor man's version of a reader > writer lock. Can we not just copy LLVM's? I had a closer look at this, and noticed the following: - The LLVM RWMutex class on wind

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-15 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: include/unwind.h:125 uintptr_t private_2; // holds sp that phase1 found for phase2 to use -#ifndef __LP64__ +#if !defined(__LP64__) && !defined(_WIN64) // The implementation of _Unwind_Exception uses an attribute mode on the -

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-15 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo updated this revision to Diff 119068. mstorsjo added a comment. Use `__SIZEOF_POINTER__` instead of checking `__LP64__` together with `_WIN64`. Changed `_WIN32` into `_WIN64` within the assembly sources for consistency/clarity. Removed one type definition ifdef by just using `(u)intptr

[PATCH] D38704: [libunwind] Emulate pthread rwlocks via SRW locks for windows

2017-10-15 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D38704#897935, @majnemer wrote: > I don't think we should depend on LLVM for the locking stuff. This sort of > infrastructure is in the same bucket as the demangler which we haven't really > solved. > > I *do* find it weird to do it this way

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-15 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: docs/index.rst:55 NetBSD x86_64 Clang, GCC DWARF CFI -Windows i386 ClangDWARF CFI +Windows i386, x86_64 ClangDWARF CFI =

[PATCH] D38704: [libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows

2017-10-15 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo updated this revision to Diff 119094. mstorsjo retitled this revision from "[libunwind] Emulate pthread rwlocks via SRW locks for windows" to "[libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows". mstorsjo edited the summary of this revision. mstorsjo

[PATCH] D38680: [libunwind] Fix handling of DW_CFA_GNU_args_size

2017-10-19 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D38680#901892, @dtzWill wrote: > Wow, I've finally debugged some unwind failures to this on x86_64 Linux ... > > 1. Call-frame optimization introduces it > 2. This fixes the cases I was investigating!! That's good to hear! FWIW, I've talked

[PATCH] D38704: [libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows

2017-10-20 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Ping @zturner and others https://reviews.llvm.org/D38704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-20 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Ping https://reviews.llvm.org/D38819 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D39156: [libunwind] Make HIDDEN_DIRECTIVE a function-like macro. NFCI.

2017-10-20 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. This avoids a hack for making it a no-op for windows. Also explicitly check for `_WIN32` instead of asduming it. https://reviews.llvm.org/D39156 Files: src/assembly.h Index: src/assembly.h === -

[PATCH] D39127: Fix template parameter default args missed if redecled

2017-10-21 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: lib/Sema/SemaTemplate.cpp:4808 + // Make sure we get the template parameter list from the most + // recentdeclaration, since that is the only one that has is guaranteed to + // have all the default template argument information.

[PATCH] D39127: Fix template parameter default args missed if redecled

2017-10-22 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: lib/Sema/SemaTemplate.cpp:4811 + TemplateParameterList *Params = + cast(Template->getMostRecentDecl()) + ->getTemplateParameters(); erichkeane wrote: > mstorsjo wrote: > > How does this work if there's an

[PATCH] D39156: [libunwind] Make HIDDEN_DIRECTIVE a function-like macro. NFCI.

2017-10-22 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316300: Make HIDDEN_DIRECTIVE a function-like macro. NFCI. (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D39156?vs=119740&id=119792#toc Repository: rL LLVM https://review

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-22 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/UnwindRegistersRestore.S:98 + # skip fs + # skip gs + movq 56(%rcx), %rsp # cut back rsp to new location compnerd wrote: > Doesn't Win64 ABI require some of the MMX registers be saved/restored too? Right, yes,

[PATCH] D39127: Fix template parameter default args missed if redecled

2017-10-23 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: lib/Sema/SemaTemplate.cpp:4811 + TemplateParameterList *Params = + cast(Template->getMostRecentDecl()) + ->getTemplateParameters(); erichkeane wrote: > mstorsjo wrote: > > erichkeane wrote: > > > mstorsjo

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-23 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/UnwindRegistersRestore.S:98 + # skip fs + # skip gs + movq 56(%rcx), %rsp # cut back rsp to new location mstorsjo wrote: > compnerd wrote: > > Doesn't Win64 ABI require some of the MMX registers be saved/restor

[PATCH] D38704: [libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows

2017-10-23 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316364: Abstract rwlocks into a class, provide a SRW lock implementation for windows (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D38704?vs=119094&id=119914#toc Repository:

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-23 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/UnwindRegistersRestore.S:98 + # skip fs + # skip gs + movq 56(%rcx), %rsp # cut back rsp to new location rnk wrote: > mstorsjo wrote: > > mstorsjo wrote: > > > compnerd wrote: > > > > Doesn't Win64 ABI require

[PATCH] D39206: [libunwind] Add missing checks for register number

2017-10-23 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. Herald added a subscriber: JDevlieghere. Most other cases that touch `savedRegisters[reg]` have got this check, but these three seemed to lack it. https://reviews.llvm.org/D39206 Files: src/DwarfParser.hpp Index: src/DwarfParser.hpp =

[PATCH] D39206: [libunwind] Add missing checks for register number

2017-10-24 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316415: Add missing checks for register number (authored by mstorsjo). Changed prior to commit: https://reviews.llvm.org/D39206?vs=119940&id=120001#toc Repository: rL LLVM https://reviews.llvm.org/D

[PATCH] D39206: [libunwind] Add missing checks for register number

2017-10-24 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D39206#904723, @compnerd wrote: > I'd say out of range rather than too big. Ok, pushing with the message changed to out of range, and actually printing the value. Repository: rL LLVM https://reviews.llvm.org/D39206 _

[PATCH] D36111: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb

2017-10-24 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo abandoned this revision. mstorsjo added a comment. This was updated, finished and merged in https://reviews.llvm.org/D38821. https://reviews.llvm.org/D36111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-b

[PATCH] D39251: [libunwind] Fix building for ARM with dwarf exception handling

2017-10-24 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. Herald added subscribers: kristof.beyls, aprantl, aemerson. The previous definition of _LIBUNWIND_HIGHEST_DWARF_REGISTER seems to be a copy of the ARM64 value (introduced in SVN r276128); since the code actually hasn't compiled properly for arm in dwarf mode befor

[PATCH] D39251: [libunwind] Fix building for ARM with dwarf exception handling

2017-10-24 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In https://reviews.llvm.org/D39251#906110, @compnerd wrote: > Whats the motivation for adding DWARF based unwinding on ARM? What > environment is using this? AFAIK NetBSD does. And my actual target is for MinGW/ARM; it seemed to be less effort to make libunwind wor

[PATCH] D39280: [libunwind] Use uint64_t for unw_word_t in ARM EHABI

2017-10-25 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. Herald added subscribers: kristof.beyls, aprantl, aemerson. This reduces the differences between the EHABI and DWARF cases. This allows getting rid of some casts in _LIBUNWIND_TRACE_API log lines, making them match what's in UnwindLevel1.c for DWARF. The only non

[PATCH] D39251: [libunwind] Fix building for ARM with dwarf exception handling

2017-10-25 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/UnwindLevel1.c:79 _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): pc=0x%" PRIx64 ", start_ip=0x%" PRIx64 ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "", mstorsjo wrote

[PATCH] D39281: [libunwind] Express Registers_*::lastDwarfReg using _LIBUNWIND_HIGHEST_DWARF_REGISTER

2017-10-25 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. This avoids having to keep the same information duplicated in multiple places. https://reviews.llvm.org/D39281 Files: src/Registers.hpp Index: src/Registers.hpp === --- src/Registers.hpp +++ src/

[PATCH] D39251: [libunwind] Fix building for ARM with dwarf exception handling

2017-10-25 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments. Comment at: src/Registers.hpp:1342 } + static int lastDwarfRegNum() { return 287; } mstorsjo wrote: > compnerd wrote: > > Can we not use `_LIBUNWIND_HIGHEST_DWARF_REGISTER` here? > I guess we could - we could do that consist

[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

2017-10-25 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo updated this revision to Diff 120215. mstorsjo edited the summary of this revision. mstorsjo added a comment. Updated to take care of saving/restoring XMM registers as well. https://reviews.llvm.org/D38819 Files: docs/index.rst include/__libunwind_config.h include/libunwind.h i

[PATCH] D50564: Add support for SEH unwinding on Windows.

2018-08-23 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Not much more comments from me. The implementation seems reasonable, and works for one simple test I did (with an earlier revision of the patch at least), and further refinement can happen in-tree I guess. I'd like to have someone else (@rnk @compnerd?) give it a more

  1   2   3   4   5   6   7   8   9   10   >