[PATCH] D38441: [compiler-rt] [cmake] Add a separate CMake var to control profile runtime

2017-10-01 Thread Michał Górny via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL314646: [cmake] Add a separate CMake var to control profile 
runtime (authored by mgorny).

Changed prior to commit:
  https://reviews.llvm.org/D38441?vs=117255=117299#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38441

Files:
  compiler-rt/trunk/CMakeLists.txt
  compiler-rt/trunk/lib/CMakeLists.txt
  compiler-rt/trunk/test/CMakeLists.txt


Index: compiler-rt/trunk/lib/CMakeLists.txt
===
--- compiler-rt/trunk/lib/CMakeLists.txt
+++ compiler-rt/trunk/lib/CMakeLists.txt
@@ -41,7 +41,7 @@
   endforeach()
 endif()
 
-if (COMPILER_RT_HAS_PROFILE)
+if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
   compiler_rt_build_runtime(profile)
 endif()
 
Index: compiler-rt/trunk/test/CMakeLists.txt
===
--- compiler-rt/trunk/test/CMakeLists.txt
+++ compiler-rt/trunk/test/CMakeLists.txt
@@ -10,7 +10,7 @@
 
 set(SANITIZER_COMMON_LIT_TEST_DEPS)
 
-if (COMPILER_RT_HAS_PROFILE)
+if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
   list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS profile)
 endif()
 
@@ -72,7 +72,7 @@
   endif()
 endforeach()
   endif()
-  if (COMPILER_RT_HAS_PROFILE)
+  if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
 compiler_rt_test_runtime(profile)
   endif()
   if(COMPILER_RT_BUILD_XRAY)
Index: compiler-rt/trunk/CMakeLists.txt
===
--- compiler-rt/trunk/CMakeLists.txt
+++ compiler-rt/trunk/CMakeLists.txt
@@ -38,6 +38,8 @@
 mark_as_advanced(COMPILER_RT_BUILD_XRAY)
 option(COMPILER_RT_BUILD_LIBFUZZER "Build libFuzzer" ON)
 mark_as_advanced(COMPILER_RT_BUILD_LIBFUZZER)
+option(COMPILER_RT_BUILD_PROFILE "Build profile runtime" ON)
+mark_as_advanced(COMPILER_RT_BUILD_PROFILE)
 option(COMPILER_RT_BUILD_XRAY_NO_PREINIT "Build xray with no preinit patching" 
OFF)
 mark_as_advanced(COMPILER_RT_BUILD_XRAY_NO_PREINIT)
 


Index: compiler-rt/trunk/lib/CMakeLists.txt
===
--- compiler-rt/trunk/lib/CMakeLists.txt
+++ compiler-rt/trunk/lib/CMakeLists.txt
@@ -41,7 +41,7 @@
   endforeach()
 endif()
 
-if (COMPILER_RT_HAS_PROFILE)
+if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
   compiler_rt_build_runtime(profile)
 endif()
 
Index: compiler-rt/trunk/test/CMakeLists.txt
===
--- compiler-rt/trunk/test/CMakeLists.txt
+++ compiler-rt/trunk/test/CMakeLists.txt
@@ -10,7 +10,7 @@
 
 set(SANITIZER_COMMON_LIT_TEST_DEPS)
 
-if (COMPILER_RT_HAS_PROFILE)
+if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
   list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS profile)
 endif()
 
@@ -72,7 +72,7 @@
   endif()
 endforeach()
   endif()
-  if (COMPILER_RT_HAS_PROFILE)
+  if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
 compiler_rt_test_runtime(profile)
   endif()
   if(COMPILER_RT_BUILD_XRAY)
Index: compiler-rt/trunk/CMakeLists.txt
===
--- compiler-rt/trunk/CMakeLists.txt
+++ compiler-rt/trunk/CMakeLists.txt
@@ -38,6 +38,8 @@
 mark_as_advanced(COMPILER_RT_BUILD_XRAY)
 option(COMPILER_RT_BUILD_LIBFUZZER "Build libFuzzer" ON)
 mark_as_advanced(COMPILER_RT_BUILD_LIBFUZZER)
+option(COMPILER_RT_BUILD_PROFILE "Build profile runtime" ON)
+mark_as_advanced(COMPILER_RT_BUILD_PROFILE)
 option(COMPILER_RT_BUILD_XRAY_NO_PREINIT "Build xray with no preinit patching" OFF)
 mark_as_advanced(COMPILER_RT_BUILD_XRAY_NO_PREINIT)
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2017-10-01 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment.

This patch virtually sets `ld64` the linker command name for macOS. I'd be a 
bit reluctant doing that, because `ld64` sounds like a too generic name to 
indicate "a linker for macOS". But that's probably okay because we don't have a 
better name.

Can you get an LGTM from someone who owns the clang driver?


Repository:
  rL LLVM

https://reviews.llvm.org/D38290



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


[PATCH] D38441: [compiler-rt] [cmake] Add a separate CMake var to control profile runtime

2017-10-01 Thread Vedant Kumar via Phabricator via cfe-commits
vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.

Thanks, lgtm.


Repository:
  rL LLVM

https://reviews.llvm.org/D38441



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


[libclc] r314633 - Do no circularly define NULL

2017-10-01 Thread Jeroen Ketema via cfe-commits
Author: jketema
Date: Sun Oct  1 13:10:14 2017
New Revision: 314633

URL: http://llvm.org/viewvc/llvm-project?rev=314633=rev
Log:
Do no circularly define NULL

Reviewed-by: Jan Vesely 

Modified:
libclc/trunk/generic/include/clc/clcmacros.h

Modified: libclc/trunk/generic/include/clc/clcmacros.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clcmacros.h?rev=314633=314632=314633=diff
==
--- libclc/trunk/generic/include/clc/clcmacros.h (original)
+++ libclc/trunk/generic/include/clc/clcmacros.h Sun Oct  1 13:10:14 2017
@@ -9,7 +9,7 @@
 #define CLC_VERSION_1_2 120
 #endif
 
-#define NULL ((void*)NULL)
+#define NULL ((void*)0)
 
 #define __kernel_exec(X, typen) __kernel \
 __attribute__((work_group_size_hint(X, 1, 1))) 
\


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


[libclc] r314634 - Let get_work_dim take exactly 0 arguments

2017-10-01 Thread Jeroen Ketema via cfe-commits
Author: jketema
Date: Sun Oct  1 13:11:46 2017
New Revision: 314634

URL: http://llvm.org/viewvc/llvm-project?rev=314634=rev
Log:
Let get_work_dim take exactly 0 arguments

Reviewed-by: Jan Vesely 

Modified:
libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl
libclc/trunk/generic/include/clc/workitem/get_work_dim.h
libclc/trunk/r600/lib/workitem/get_work_dim.cl

Modified: libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl?rev=314634=314633=314634=diff
==
--- libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl (original)
+++ libclc/trunk/amdgcn/lib/workitem/get_work_dim.cl Sun Oct  1 13:11:46 2017
@@ -1,6 +1,6 @@
 #include 
 
-_CLC_DEF uint get_work_dim()
+_CLC_DEF uint get_work_dim(void)
 {
__attribute__((address_space(2))) uint * ptr =
(__attribute__((address_space(2))) uint *)

Modified: libclc/trunk/generic/include/clc/workitem/get_work_dim.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/workitem/get_work_dim.h?rev=314634=314633=314634=diff
==
--- libclc/trunk/generic/include/clc/workitem/get_work_dim.h (original)
+++ libclc/trunk/generic/include/clc/workitem/get_work_dim.h Sun Oct  1 
13:11:46 2017
@@ -1 +1 @@
-_CLC_DECL uint get_work_dim();
+_CLC_DECL uint get_work_dim(void);

Modified: libclc/trunk/r600/lib/workitem/get_work_dim.cl
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/workitem/get_work_dim.cl?rev=314634=314633=314634=diff
==
--- libclc/trunk/r600/lib/workitem/get_work_dim.cl (original)
+++ libclc/trunk/r600/lib/workitem/get_work_dim.cl Sun Oct  1 13:11:46 2017
@@ -1,6 +1,6 @@
 #include 
 
-_CLC_DEF uint get_work_dim()
+_CLC_DEF uint get_work_dim(void)
 {
__attribute__((address_space(7))) uint * ptr =
(__attribute__((address_space(7))) uint *)


___
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-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-bin/mailman/listinfo/cfe-commits


[libunwind] r314635 - SjLj: Fix building after SVN r314632

2017-10-01 Thread Martin Storsjo via cfe-commits
Author: mstorsjo
Date: Sun Oct  1 13:22:40 2017
New Revision: 314635

URL: http://llvm.org/viewvc/llvm-project?rev=314635=rev
Log:
SjLj: Fix building after SVN r314632

The code moved from Unwind_AppleExtras.cpp to Unwind-sjlj.c needed
a few minor modifications to build as C instead of C++.

Modified:
libunwind/trunk/src/Unwind-sjlj.c

Modified: libunwind/trunk/src/Unwind-sjlj.c
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-sjlj.c?rev=314635=314634=314635=diff
==
--- libunwind/trunk/src/Unwind-sjlj.c (original)
+++ libunwind/trunk/src/Unwind-sjlj.c Sun Oct  1 13:22:40 2017
@@ -67,7 +67,7 @@ struct _Unwind_FunctionContext {
 #if defined(__APPLE__)
 #include 
 #else
-static _LIBUNWIND_THREAD_LOCAL _Unwind_FunctionContext *stack = nullptr;
+static _LIBUNWIND_THREAD_LOCAL struct _Unwind_FunctionContext *stack = NULL;
 #endif
 
 static struct _Unwind_FunctionContext *__Unwind_SjLj_GetTopOfFunctionStack() {


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


[PATCH] D37624: add support for -fno-instrument-functions and -finstrument-functions-exclude-{file, function}-list=<arg1, arg2, ...> to match gcc options.

2017-10-01 Thread kchoi via Phabricator via cfe-commits
choikwa added a comment.

> Can you get more information on what GCC actually implemented and why? It's 
> not clear to me that ignoring the namespaces is the most-useful way to do 
> this. I don't want to emulate GCC bugs, but maybe there's a good reason why 
> their implementation works this way.

This is what I found, https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00473.html
Diff shows it doesn't seem to specially treat single quotes.

+case OPT_finstrument_functions_include_function_list_:
+  add_comma_separated_to_vector
+   (>x_flag_instrument_functions_include_functions, arg);
+  break;


https://reviews.llvm.org/D37624



___
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-10-01 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment.

I believe that SVN r314632 should address the issue more thorougly.


https://reviews.llvm.org/D38250



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


[libunwind] r314632 - SjLj: make the SjLj implementation more portable

2017-10-01 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Oct  1 13:06:48 2017
New Revision: 314632

URL: http://llvm.org/viewvc/llvm-project?rev=314632=rev
Log:
SjLj: make the SjLj implementation more portable

This moves the definition of the internal helpers
`__Unwind_SjLj_GetTopOfFunctionStack` and
`__Unwind_SjLj_SetTopOfFunctionStack` into `Unwind-sjlj.c`.  These are
not extra functions specific to Apple, but rather are internal
implementation details of SjLj support in the LLVM libunwind
implementation.

This allows us to remove the internal header unwind_ext.h, as these
functions are not meant to be used as SPI either.  Because they are
static, they will be given implicit hidden visibility, but due to the
simplicity should get fully inlined into the actual use.

Use the C11 standard static TLS annotation (`_Thread_local`) if
possible, otherwise, use the Windows specific `__declspec(thread)` when
targeting Windows or the GNU `__thread` extension.  In theory, it should
be possible for this implementation to use a `pthread_setspecific` and
`pthread_getspecific` on platforms with pthreads or `SetFlsValue` and
`GetFlsValue` on Windows for non-static TLS.  However, static TLS tends
to be significantly faster, so we really should prefer that over the
dynamic TLS approach.  On Apple environments, when not building for the
loader (dyld), use the pre-allocated TLS slot in the loader rather than
the local static TLS variable.

Note that the un-threaded support of libunwind is still present as
before, however, it is unsafe to use in a threaded environment as the
cleanup stack may be mutated incorrectly due to lack of locking across
threads.  In the static TLS model, the lock is unneeded as each thread
of execution retains its own copy of the cleanup stack.

Take the opportunity to clean up the comment block, removing the iOS
specific note as the SjLj implementation can be used outside of the
context of iOS.  Convert the rest of the explanation to a doxygen style
comment block.

Removed:
libunwind/trunk/src/unwind_ext.h
Modified:
libunwind/trunk/src/CMakeLists.txt
libunwind/trunk/src/Unwind-sjlj.c
libunwind/trunk/src/Unwind_AppleExtras.cpp

Modified: libunwind/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/CMakeLists.txt?rev=314632=314631=314632=diff
==
--- libunwind/trunk/src/CMakeLists.txt (original)
+++ libunwind/trunk/src/CMakeLists.txt Sun Oct  1 13:06:48 2017
@@ -31,7 +31,6 @@ set(LIBUNWIND_HEADERS
 libunwind_ext.h
 Registers.hpp
 UnwindCursor.hpp
-unwind_ext.h
 ${CMAKE_CURRENT_SOURCE_DIR}/../include/libunwind.h
 ${CMAKE_CURRENT_SOURCE_DIR}/../include/unwind.h)
 

Modified: libunwind/trunk/src/Unwind-sjlj.c
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Unwind-sjlj.c?rev=314632=314631=314632=diff
==
--- libunwind/trunk/src/Unwind-sjlj.c (original)
+++ libunwind/trunk/src/Unwind-sjlj.c Sun Oct  1 13:06:48 2017
@@ -17,20 +17,14 @@
 #include 
 
 #include "config.h"
-#include "unwind_ext.h"
 
-//
-// 32-bit iOS uses setjump/longjump based C++ exceptions.
-// Other architectures use "zero cost" exceptions.
-//
-// With SJLJ based exceptions, any function that has a catch clause or needs to
-// do any clean up when an exception propagates through it, needs to call 
-// _Unwind_SjLj_Register() at the start of the function and 
-// _Unwind_SjLj_Unregister() at the end.  The register function is called with 
-// the address of a block of memory in the function's stack frame.  The runtime
-// keeps a linked list (stack) of these blocks - one per thread.  The calling 
-// function also sets the personality and lsda fields of the block.
-//
+/// With SJLJ based exceptions, any function that has a catch clause or needs 
to
+/// do any clean up when an exception propagates through it, needs to call
+/// \c _Unwind_SjLj_Register at the start of the function and
+/// \c _Unwind_SjLj_Unregister at the end.  The register function is called 
with
+/// the address of a block of memory in the function's stack frame.  The 
runtime
+/// keeps a linked list (stack) of these blocks - one per thread.  The calling
+/// function also sets the personality and lsda fields of the block.
 
 #if defined(_LIBUNWIND_BUILD_SJLJ_APIS)
 
@@ -53,6 +47,48 @@ struct _Unwind_FunctionContext {
   void   *jbuf[];
 };
 
+#if defined(_LIBUNWIND_HAS_NO_THREADS)
+# define _LIBUNWIND_THREAD_LOCAL
+#else
+# if __STDC_VERSION__ >= 201112L
+#  define _LIBUNWIND_THREAD_LOCAL _Thread_local
+# elif defined(_WIN32)
+#  define _LIBUNWIND_THREAD_LOCAL __declspec(thread)
+# elif defined(__GNUC__) || defined(__clang__)
+#  define _LIBUNWIND_THREAD_LOCAL __thread
+# else
+#  error Unable to create thread local storage
+# endif
+#endif
+
+
+#if !defined(FOR_DYLD)
+
+#if defined(__APPLE__)
+#include 
+#else
+static 

[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 declared earlier as non-static.
> Yeah, that is a bug :-).  `__Unwind_SjLj_GetTopOfFunctionStack` and 
> `__Unwind_SjLj_SetToOfFunctionStack` are implementation details of LLVM's 
> libunwind.  They are not part of the public interfaces, and are not used 
> outside of this TU, and should be marked as static as such.  I think that 
> changing the prototype declaration to indicate this is reasonable.  I suppose 
> that I can make that change separately.
Yes, except that in the apple case, those functions are provided by another TU 
(Unwind_AppleExtras.cpp). So in that case, those functions only should be 
static in the non-apple case.


https://reviews.llvm.org/D38250



___
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-10-01 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd requested changes to this revision.
compnerd added a comment.
This revision now requires changes to proceed.

Actually, Ill go ahead and make the more invasive change and that will provide 
this properly.


https://reviews.llvm.org/D38250



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


[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-01 Thread Raoul Wols via Phabricator via cfe-commits
rwols updated this revision to Diff 117290.
rwols added a comment.

- Fix fillSortText: used the old version, now using new version from upstream
- Fix initialize-params.test and initialize-params-invalid.test to account for 
signature help
- All tests pass now


https://reviews.llvm.org/D38048

Files:
  clangd/ClangdLSPServer.cpp
  clangd/ClangdLSPServer.h
  clangd/ClangdServer.cpp
  clangd/ClangdServer.h
  clangd/ClangdUnit.cpp
  clangd/ClangdUnit.h
  clangd/Protocol.cpp
  clangd/Protocol.h
  clangd/ProtocolHandlers.cpp
  clangd/ProtocolHandlers.h
  test/clangd/formatting.test
  test/clangd/initialize-params-invalid.test
  test/clangd/initialize-params.test
  test/clangd/signature-help.test

Index: test/clangd/signature-help.test
===
--- /dev/null
+++ test/clangd/signature-help.test
@@ -0,0 +1,42 @@
+# RUN: clangd -run-synchronously < %s | FileCheck %s
+# It is absolutely vital that this file has CRLF line endings.
+
+# Start a session.
+Content-Length: 125
+
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
+
+# Modify the document.
+Content-Length: 333
+
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///main.cpp","languageId":"cpp","version":1,"text":"void foo(int x, int y);\nvoid foo(int x, float y);\nvoid foo(float x, int y);\nvoid foo(float x, float y);\nvoid bar(int x, int y = 0);\nvoid bar(float x = 0, int y = 42);\nint main() { foo("}}}
+
+# Ask for signature help.
+Content-Length: 151
+
+{"jsonrpc":"2.0","id":1,"method":"textDocument/signatureHelp","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":8,"character":9}}}
+# CHECK: {"jsonrpc":"2.0","id":1,"result":{"activeSignature":0,"activeParameter":0,"signatures":[
+# CHECK-DAG: {"label":"foo(float x, float y) -> void","parameters":[{"label":"float x"},{"label":"float y"}]}
+# CHECK-DAG: {"label":"foo(float x, int y) -> void","parameters":[{"label":"float x"},{"label":"int y"}]}
+# CHECK-DAG: {"label":"foo(int x, float y) -> void","parameters":[{"label":"int x"},{"label":"float y"}]}
+# CHECK-DAG: {"label":"foo(int x, int y) -> void","parameters":[{"label":"int x"},{"label":"int y"}]}
+# CHECK: ]}
+
+# Modify the document
+Content-Length: 333
+
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///main.cpp","languageId":"cpp","version":2,"text":"void foo(int x, int y);\nvoid foo(int x, float y);\nvoid foo(float x, int y);\nvoid foo(float x, float y);\nvoid bar(int x, int y = 0);\nvoid bar(float x = 0, int y = 42);\nint main() { bar("}}}
+
+# Ask for signature help (this checks default argument handling).
+Content-Length: 151
+
+{"jsonrpc":"2.0","id":2,"method":"textDocument/signatureHelp","params":{"textDocument":{"uri":"file:///main.cpp"},"position":{"line":8,"character":9}}}
+# CHECK: {"jsonrpc":"2.0","id":2,"result":{"activeSignature":0,"activeParameter":0,"signatures":[
+# CHECK-DAG: {"label":"bar(int x, int y = 0) -> void","parameters":[{"label":"int x"},{"label":"int y = 0"}]}
+# CHECK-DAG: {"label":"bar(float x = 0, int y = 42) -> void","parameters":[{"label":"float x = 0"},{"label":"int y = 42"}]}
+# CHECK: ]}
+
+# Shutdown.
+Content-Length: 49
+
+{"jsonrpc":"2.0","id":10,"method":"shutdown"}
Index: test/clangd/initialize-params.test
===
--- test/clangd/initialize-params.test
+++ test/clangd/initialize-params.test
@@ -5,14 +5,15 @@
 Content-Length: 143
 
 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootUri":"file:///path/to/workspace","capabilities":{},"trace":"off"}}
-# CHECK: Content-Length: 466
+# CHECK: Content-Length: 535
 # CHECK: {"jsonrpc":"2.0","id":0,"result":{"capabilities":{
 # CHECK:   "textDocumentSync": 1,
 # CHECK:   "documentFormattingProvider": true,
 # CHECK:   "documentRangeFormattingProvider": true,
 # CHECK:   "documentOnTypeFormattingProvider": {"firstTriggerCharacter":"}","moreTriggerCharacter":[]},
 # CHECK:   "codeActionProvider": true,
 # CHECK:   "completionProvider": {"resolveProvider": false, "triggerCharacters": [".",">",":"]},
+# CHECK:   "signatureHelpProvider": {"triggerCharacters": ["(",","]},
 # CHECK:   "definitionProvider": true
 # CHECK: }}}
 #
Index: test/clangd/initialize-params-invalid.test
===
--- test/clangd/initialize-params-invalid.test
+++ test/clangd/initialize-params-invalid.test
@@ -5,14 +5,15 @@
 Content-Length: 142
 
 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":"","rootUri":"file:///path/to/workspace","capabilities":{},"trace":"off"}}
-# CHECK: Content-Length: 466
+# CHECK: Content-Length: 535
 # CHECK: {"jsonrpc":"2.0","id":0,"result":{"capabilities":{
 # CHECK:   "textDocumentSync": 1,
 # CHECK:   "documentFormattingProvider": true,
 # CHECK:   

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

2017-10-01 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd accepted this revision.
compnerd added inline comments.
This revision is now accepted and ready to land.



Comment at: src/Unwind-sjlj.c:481
+#endif // !defined(__APPLE__)
+
 #endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS)

mstorsjo wrote:
> compnerd wrote:
> > Can't both of these also be static?
> No, since they're declared earlier as non-static.
Yeah, that is a bug :-).  `__Unwind_SjLj_GetTopOfFunctionStack` and 
`__Unwind_SjLj_SetToOfFunctionStack` are implementation details of LLVM's 
libunwind.  They are not part of the public interfaces, and are not used 
outside of this TU, and should be marked as static as such.  I think that 
changing the prototype declaration to indicate this is reasonable.  I suppose 
that I can make that change separately.


https://reviews.llvm.org/D38250



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


[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-01 Thread Raoul Wols via Phabricator via cfe-commits
rwols added inline comments.



Comment at: clangd/ClangdUnit.cpp:442
 
   static void FillSortText(const CodeCompletionString ,
CompletionItem ) {

I seem to have inadvertently used the old fillSortText during the merge from 
upstream, let me fix that (this is why tests were failing probably).


https://reviews.llvm.org/D38048



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


[PATCH] D37624: add support for -fno-instrument-functions and -finstrument-functions-exclude-{file, function}-list=<arg1, arg2, ...> to match gcc options.

2017-10-01 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added a comment.

In https://reviews.llvm.org/D37624#885311, @choikwa wrote:

> In https://reviews.llvm.org/D37624#885308, @hfinkel wrote:
>
> > In https://reviews.llvm.org/D37624#885295, @choikwa wrote:
> >
> > > In https://reviews.llvm.org/D37624#885290, @hfinkel wrote:
> > >
> > > > In https://reviews.llvm.org/D37624#885288, @choikwa wrote:
> > > >
> > > > > - add comment to CPP test to explain usage
> > > >
> > > >
> > > > Thanks. Please also add some tests showing matching overloaded 
> > > > functions, functions with template parameters, etc.
> > > >
> > > > Do we need to strip whitespace before trying to match the demangled 
> > > > names?
> > >
> > >
> > > Some cursory testing with g++ shows that only the 'test5' of 
> > > 'test5(float, int, int*)' is matched. 'test5(' or 'test5 (' is not 
> > > matched. It seems weird that arguments are not matched.
> > >
> > > g++ man page shows
> > >
> > >   "The function name to be matched is its user-visible name, such as 
> > > "vector blah(const vector &)", not the internal mangled name"
> > >
> > > but it doesn't seem to be including parameters.
> >
> >
> > Interesting. Can you tell what GCC is doing w.r.t. namespace names, class 
> > names, etc. and template parameters?
> >
> > > Also uncovered a bug where sub argument list containing comma needs to be 
> > > surrounded by single quote, but clang seems to ignores single quote.
> > >  I'll try to dig around ArgList implementation to see if it can return 
> > > argument surrounded by single-quote as a whole.
>
>
> Given A::B::C(T a), only 'C' is meaningful in g++'s matcher. Adding 
> anything else escapes the match [  'B::C', 'C('  ].
>  It seems like g++ will also not match single quotes as a whole, ie. int 
> fooboo() is matched by 'foo,boo'.


Can you get more information on what GCC actually implemented and why? It's not 
clear to me that ignoring the namespaces is the most-useful way to do this. I 
don't want to emulate GCC bugs, but maybe there's a good reason why their 
implementation works this way.


https://reviews.llvm.org/D37624



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


r314623 - Test Commit.

2017-10-01 Thread Andrew Gozillon via cfe-commits
Author: agozillon
Date: Sun Oct  1 05:16:24 2017
New Revision: 314623

URL: http://llvm.org/viewvc/llvm-project?rev=314623=rev
Log:
Test Commit.


Modified:
cfe/trunk/lib/Sema/SemaType.cpp

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=314623=314622=314623=diff
==
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Sun Oct  1 05:16:24 2017
@@ -5606,7 +5606,6 @@ ParsedType Sema::ActOnObjCInstanceType(S
 /// space for the type.
 static void HandleAddressSpaceTypeAttribute(QualType ,
 const AttributeList , Sema 
){
-
   // If this type is already address space qualified, reject it.
   // ISO/IEC TR 18037 S5.3 (amending C99 6.7.3): "No type shall be qualified by
   // qualifiers for two or more different address spaces."


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


[PATCH] D37466: D37461: fixups for existing InlineAsm tests + adding new ones

2017-10-01 Thread coby via Phabricator via cfe-commits
coby added inline comments.



Comment at: test/CodeGen/ms-inline-asm.cpp:37-38
-  int lvar = 10;
-  __asm mov eax, offset Foo::ptr
-  __asm mov eax, offset Foo::Bar::ptr
-// CHECK-LABEL: define void @_Z2t2v()

rnk wrote:
> These don't seem tested anywhere now
I've tested them against msvc, and they are seem to be unsupported there as 
well, so I don't see any value in keeping this one around :\


Repository:
  rL LLVM

https://reviews.llvm.org/D37466



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


[PATCH] D38445: [x86][inlin-asm] allow recognition of MPX regs inside ms inline-asm blob

2017-10-01 Thread coby via Phabricator via cfe-commits
coby created this revision.
Herald added a subscriber: eraman.

Repository:
  rL LLVM

https://reviews.llvm.org/D38445

Files:
  lib/Basic/Targets/X86.cpp
  test/CodeGen/ms-inline-asm.c


Index: lib/Basic/Targets/X86.cpp
===
--- lib/Basic/Targets/X86.cpp
+++ lib/Basic/Targets/X86.cpp
@@ -60,6 +60,7 @@
 "k2","k3","k4","k5","k6",  "k7",
 "cr0",   "cr2",   "cr3",   "cr4",   "cr8",
 "dr0",   "dr1",   "dr2",   "dr3",   "dr6", "dr7",
+"bnd0",  "bnd1",  "bnd2",  "bnd3",
 };
 
 const TargetInfo::AddlRegName AddlRegNames[] = {
Index: test/CodeGen/ms-inline-asm.c
===
--- test/CodeGen/ms-inline-asm.c
+++ test/CodeGen/ms-inline-asm.c
@@ -661,6 +661,17 @@
   // CHECK: call void asm sideeffect inteldialect "add eax, [eax + $$-128]", 
"~{eax},~{flags},~{dirflag},~{fpsr},~{flags}"()
 }
 
+void t47() {
+  // CHECK-LABEL: define void @t47
+  __asm {
+bndmk bnd0, dword ptr [eax]
+bndmk bnd1, dword ptr [ebx]
+bndmk bnd2, dword ptr [ecx]
+bndmk bnd3, dword ptr [edx]
+  }
+  // CHECK: call void asm sideeffect inteldialect "bndmk bnd0, dword ptr 
[eax]\0A\09bndmk bnd1, dword ptr [ebx]\0A\09bndmk bnd2, dword ptr 
[ecx]\0A\09bndmk bnd3, dword ptr [edx]", 
"~{bnd0},~{bnd1},~{bnd2},~{bnd3},~{dirflag},~{fpsr},~{flags}"()
+}
+
 void dot_operator(){
   // CHECK-LABEL: define void @dot_operator
__asm { mov eax, 3[ebx]A.b}


Index: lib/Basic/Targets/X86.cpp
===
--- lib/Basic/Targets/X86.cpp
+++ lib/Basic/Targets/X86.cpp
@@ -60,6 +60,7 @@
 "k2","k3","k4","k5","k6",  "k7",
 "cr0",   "cr2",   "cr3",   "cr4",   "cr8",
 "dr0",   "dr1",   "dr2",   "dr3",   "dr6", "dr7",
+"bnd0",  "bnd1",  "bnd2",  "bnd3",
 };
 
 const TargetInfo::AddlRegName AddlRegNames[] = {
Index: test/CodeGen/ms-inline-asm.c
===
--- test/CodeGen/ms-inline-asm.c
+++ test/CodeGen/ms-inline-asm.c
@@ -661,6 +661,17 @@
   // CHECK: call void asm sideeffect inteldialect "add eax, [eax + $$-128]", "~{eax},~{flags},~{dirflag},~{fpsr},~{flags}"()
 }
 
+void t47() {
+  // CHECK-LABEL: define void @t47
+  __asm {
+bndmk bnd0, dword ptr [eax]
+bndmk bnd1, dword ptr [ebx]
+bndmk bnd2, dword ptr [ecx]
+bndmk bnd3, dword ptr [edx]
+  }
+  // CHECK: call void asm sideeffect inteldialect "bndmk bnd0, dword ptr [eax]\0A\09bndmk bnd1, dword ptr [ebx]\0A\09bndmk bnd2, dword ptr [ecx]\0A\09bndmk bnd3, dword ptr [edx]", "~{bnd0},~{bnd1},~{bnd2},~{bnd3},~{dirflag},~{fpsr},~{flags}"()
+}
+
 void dot_operator(){
   // CHECK-LABEL: define void @dot_operator
 	__asm { mov eax, 3[ebx]A.b}
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D38444: [compiler-rt] [cmake] Create dummy gtest target for stand-alone builds

2017-10-01 Thread Michał Górny via Phabricator via cfe-commits
mgorny created this revision.
Herald added a subscriber: dberris.

Create a dummy 'gtest' target to satisfy the test dependencies while
doing stand-alone builds. Historically those dependencies were
conditional to non-stand-alone builds but the refactoring
in https://reviews.llvm.org/rL310971 has made them unconditional, breaking 
stand-alone builds
as a result.

Given the added complexity of maintaining a large number of conditionals
scattered around the different CMakeLists.txt files and the likeliness
of people mistakenly adding more unconditional dependencies, adding
a dummy target seems an easier way forward.


Repository:
  rL LLVM

https://reviews.llvm.org/D38444

Files:
  cmake/Modules/AddCompilerRT.cmake


Index: cmake/Modules/AddCompilerRT.cmake
===
--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -291,6 +291,12 @@
   -I${COMPILER_RT_GTEST_PATH}
 )
 
+if(COMPILER_RT_STANDALONE_BUILD)
+  # Add a dummy target to satisfy dependencies on GTest when building
+  # stand-alone. GTest itself is provided via COMPILER_RT_GTEST_SOURCES.
+  add_custom_target(gtest)
+endif()
+
 append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 
COMPILER_RT_UNITTEST_CFLAGS)
 append_list_if(COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG 
-Wno-covered-switch-default COMPILER_RT_UNITTEST_CFLAGS)
 


Index: cmake/Modules/AddCompilerRT.cmake
===
--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -291,6 +291,12 @@
   -I${COMPILER_RT_GTEST_PATH}
 )
 
+if(COMPILER_RT_STANDALONE_BUILD)
+  # Add a dummy target to satisfy dependencies on GTest when building
+  # stand-alone. GTest itself is provided via COMPILER_RT_GTEST_SOURCES.
+  add_custom_target(gtest)
+endif()
+
 append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 COMPILER_RT_UNITTEST_CFLAGS)
 append_list_if(COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG -Wno-covered-switch-default COMPILER_RT_UNITTEST_CFLAGS)
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D37624: add support for -fno-instrument-functions and -finstrument-functions-exclude-{file, function}-list=<arg1, arg2, ...> to match gcc options.

2017-10-01 Thread kchoi via Phabricator via cfe-commits
choikwa added a comment.

In https://reviews.llvm.org/D37624#885308, @hfinkel wrote:

> In https://reviews.llvm.org/D37624#885295, @choikwa wrote:
>
> > In https://reviews.llvm.org/D37624#885290, @hfinkel wrote:
> >
> > > In https://reviews.llvm.org/D37624#885288, @choikwa wrote:
> > >
> > > > - add comment to CPP test to explain usage
> > >
> > >
> > > Thanks. Please also add some tests showing matching overloaded functions, 
> > > functions with template parameters, etc.
> > >
> > > Do we need to strip whitespace before trying to match the demangled names?
> >
> >
> > Some cursory testing with g++ shows that only the 'test5' of 'test5(float, 
> > int, int*)' is matched. 'test5(' or 'test5 (' is not matched. It seems 
> > weird that arguments are not matched.
> >
> > g++ man page shows
> >
> >   "The function name to be matched is its user-visible name, such as 
> > "vector blah(const vector &)", not the internal mangled name"
> >
> > but it doesn't seem to be including parameters.
>
>
> Interesting. Can you tell what GCC is doing w.r.t. namespace names, class 
> names, etc. and template parameters?
>
> > Also uncovered a bug where sub argument list containing comma needs to be 
> > surrounded by single quote, but clang seems to ignores single quote.
> >  I'll try to dig around ArgList implementation to see if it can return 
> > argument surrounded by single-quote as a whole.


Given A::B::C(T a), only 'C' is meaningful in g++'s matcher. Adding 
anything else escapes the match [  'B::C', 'C('  ].


https://reviews.llvm.org/D37624



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


[PATCH] D37624: add support for -fno-instrument-functions and -finstrument-functions-exclude-{file, function}-list=<arg1, arg2, ...> to match gcc options.

2017-10-01 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added a comment.

In https://reviews.llvm.org/D37624#885295, @choikwa wrote:

> In https://reviews.llvm.org/D37624#885290, @hfinkel wrote:
>
> > In https://reviews.llvm.org/D37624#885288, @choikwa wrote:
> >
> > > - add comment to CPP test to explain usage
> >
> >
> > Thanks. Please also add some tests showing matching overloaded functions, 
> > functions with template parameters, etc.
> >
> > Do we need to strip whitespace before trying to match the demangled names?
>
>
> Some cursory testing with g++ shows that only the 'test5' of 'test5(float, 
> int, int*)' is matched. 'test5(' or 'test5 (' is not matched. It seems weird 
> that arguments are not matched.
>
> g++ man page shows
>
>   "The function name to be matched is its user-visible name, such as 
> "vector blah(const vector &)", not the internal mangled name"
>
> but it doesn't seem to be including parameters.


Interesting. Can you tell what GCC is doing w.r.t. namespace names, class 
names, etc. and template parameters?

> Also uncovered a bug where sub argument list containing comma needs to be 
> surrounded by single quote, but clang seems to ignores single quote.
>  I'll try to dig around ArgList implementation to see if it can return 
> argument surrounded by single-quote as a whole.




https://reviews.llvm.org/D37624



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