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

2017-11-02 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added inline comments.



Comment at: src/Registers.hpp:1481
+  mutable uint32_t _iwmmx_control[4];
 #endif
 };

compnerd wrote:
> Why the change to mark these as mutable?
These are touched from within `getRegister`, but we need to make `getRegister` 
const since it's used on a const Registers object in the dwarf codepath.


https://reviews.llvm.org/D39251



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


[libunwind] r317192 - Fix building for ARM with dwarf exception handling

2017-11-02 Thread Martin Storsjo via cfe-commits
Author: mstorsjo
Date: Thu Nov  2 01:16:16 2017
New Revision: 317192

URL: http://llvm.org/viewvc/llvm-project?rev=317192&view=rev
Log:
Fix building for ARM with dwarf exception handling

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
before, this hasn't actually been used. Set it to the correct value
based on the UNW_ARM_* enum values.

The iwmmx control variables have to be made mutable, since they are
touched from within getRegister (which previously wasn't const), and
getRegister is used on a const Registers object in DwarfInstructions.hpp.

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

Modified:
libunwind/trunk/include/__libunwind_config.h
libunwind/trunk/include/libunwind.h
libunwind/trunk/src/Registers.hpp
libunwind/trunk/src/UnwindCursor.hpp
libunwind/trunk/src/libunwind.cpp

Modified: libunwind/trunk/include/__libunwind_config.h
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/include/__libunwind_config.h?rev=317192&r1=317191&r2=317192&view=diff
==
--- libunwind/trunk/include/__libunwind_config.h (original)
+++ libunwind/trunk/include/__libunwind_config.h Thu Nov  2 01:16:16 2017
@@ -19,7 +19,7 @@
 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_6432
 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC   112
 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64 95
-#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM   95
+#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM   287
 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K  31
 
 #if defined(_LIBUNWIND_IS_NATIVE_ONLY)
@@ -75,7 +75,7 @@
 # define _LIBUNWIND_TARGET_OR1K 1
 # define _LIBUNWIND_CONTEXT_SIZE 128
 # define _LIBUNWIND_CURSOR_SIZE 140
-# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 119
+# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
 #endif // _LIBUNWIND_IS_NATIVE_ONLY
 
 #endif // LIBUNWIND_CONFIG_H__

Modified: libunwind/trunk/include/libunwind.h
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/include/libunwind.h?rev=317192&r1=317191&r2=317192&view=diff
==
--- libunwind/trunk/include/libunwind.h (original)
+++ libunwind/trunk/include/libunwind.h Thu Nov  2 01:16:16 2017
@@ -73,7 +73,7 @@ typedef struct unw_addr_space *unw_addr_
 
 typedef int unw_regnum_t;
 typedef uintptr_t unw_word_t;
-#if defined(_LIBUNWIND_ARM_EHABI)
+#if defined(__arm__)
 typedef uint64_t unw_fpreg_t;
 #else
 typedef double unw_fpreg_t;

Modified: libunwind/trunk/src/Registers.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/Registers.hpp?rev=317192&r1=317191&r2=317192&view=diff
==
--- libunwind/trunk/src/Registers.hpp (original)
+++ libunwind/trunk/src/Registers.hpp Thu Nov  2 01:16:16 2017
@@ -1386,7 +1386,7 @@ public:
   Registers_arm(const void *registers);
 
   boolvalidRegister(int num) const;
-  uint32_tgetRegister(int num);
+  uint32_tgetRegister(int num) const;
   voidsetRegister(int num, uint32_t value);
   boolvalidFloatRegister(int num) const;
   unw_fpreg_t getFloatRegister(int num);
@@ -1399,6 +1399,7 @@ public:
 restoreSavedFloatRegisters();
 restoreCoreAndJumpTo();
   }
+  static int  lastDwarfRegNum() { return 
_LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM; }
 
   uint32_t  getSP() const { return _registers.__sp; }
   void  setSP(uint32_t value) { _registers.__sp = value; }
@@ -1472,11 +1473,11 @@ private:
   // Whether iWMMX data registers are saved.
   bool _saved_iwmmx;
   // Whether iWMMX control registers are saved.
-  bool _saved_iwmmx_control;
+  mutable bool _saved_iwmmx_control;
   // iWMMX registers
   unw_fpreg_t _iwmmx[16];
   // iWMMX control registers
-  uint32_t _iwmmx_control[4];
+  mutable uint32_t _iwmmx_control[4];
 #endif
 };
 
@@ -1533,7 +1534,7 @@ inline bool Registers_arm::validRegister
   return false;
 }
 
-inline uint32_t Registers_arm::getRegister(int regNum) {
+inline uint32_t Registers_arm::getRegister(int regNum) const {
   if (regNum == UNW_REG_SP || regNum == UNW_ARM_SP)
 return _registers.__sp;
 

Modified: libunwind/trunk/src/UnwindCursor.hpp
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/UnwindCursor.hpp?rev=317192&r1=317191&r2=317192&view=diff
==
--- libunwind/trunk/src/UnwindCursor.hpp (original)
+++ libunwind/trunk/src/UnwindCursor.hpp Thu Nov  2 01:16:16 2017
@@ -583,6 +583,12 @@ private:
   }
 #endif
 
+#if defined(_LIBUNWIND_TARGET_ARM)
+  compact_unwind_encoding_t dwarfEncoding(Registers_arm &) const {
+return 0;
+  }
+#endif
+
 #if defined (_LIBUNWIND_TARGET_OR1K)
   compact_unwind_encoding_t dwarfEncoding(Registers_or1k &) co

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

2017-11-02 Thread Martin Storsjö via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL317192: Fix building for ARM with dwarf exception handling 
(authored by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D39251?vs=120863&id=121242#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39251

Files:
  libunwind/trunk/include/__libunwind_config.h
  libunwind/trunk/include/libunwind.h
  libunwind/trunk/src/Registers.hpp
  libunwind/trunk/src/UnwindCursor.hpp
  libunwind/trunk/src/libunwind.cpp

Index: libunwind/trunk/src/Registers.hpp
===
--- libunwind/trunk/src/Registers.hpp
+++ libunwind/trunk/src/Registers.hpp
@@ -1386,7 +1386,7 @@
   Registers_arm(const void *registers);
 
   boolvalidRegister(int num) const;
-  uint32_tgetRegister(int num);
+  uint32_tgetRegister(int num) const;
   voidsetRegister(int num, uint32_t value);
   boolvalidFloatRegister(int num) const;
   unw_fpreg_t getFloatRegister(int num);
@@ -1399,6 +1399,7 @@
 restoreSavedFloatRegisters();
 restoreCoreAndJumpTo();
   }
+  static int  lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM; }
 
   uint32_t  getSP() const { return _registers.__sp; }
   void  setSP(uint32_t value) { _registers.__sp = value; }
@@ -1472,11 +1473,11 @@
   // Whether iWMMX data registers are saved.
   bool _saved_iwmmx;
   // Whether iWMMX control registers are saved.
-  bool _saved_iwmmx_control;
+  mutable bool _saved_iwmmx_control;
   // iWMMX registers
   unw_fpreg_t _iwmmx[16];
   // iWMMX control registers
-  uint32_t _iwmmx_control[4];
+  mutable uint32_t _iwmmx_control[4];
 #endif
 };
 
@@ -1533,7 +1534,7 @@
   return false;
 }
 
-inline uint32_t Registers_arm::getRegister(int regNum) {
+inline uint32_t Registers_arm::getRegister(int regNum) const {
   if (regNum == UNW_REG_SP || regNum == UNW_ARM_SP)
 return _registers.__sp;
 
Index: libunwind/trunk/src/UnwindCursor.hpp
===
--- libunwind/trunk/src/UnwindCursor.hpp
+++ libunwind/trunk/src/UnwindCursor.hpp
@@ -583,6 +583,12 @@
   }
 #endif
 
+#if defined(_LIBUNWIND_TARGET_ARM)
+  compact_unwind_encoding_t dwarfEncoding(Registers_arm &) const {
+return 0;
+  }
+#endif
+
 #if defined (_LIBUNWIND_TARGET_OR1K)
   compact_unwind_encoding_t dwarfEncoding(Registers_or1k &) const {
 return 0;
Index: libunwind/trunk/src/libunwind.cpp
===
--- libunwind/trunk/src/libunwind.cpp
+++ libunwind/trunk/src/libunwind.cpp
@@ -55,7 +55,7 @@
 # define REGISTER_KIND Registers_ppc
 #elif defined(__aarch64__)
 # define REGISTER_KIND Registers_arm64
-#elif defined(_LIBUNWIND_ARM_EHABI)
+#elif defined(__arm__)
 # define REGISTER_KIND Registers_arm
 #elif defined(__or1k__)
 # define REGISTER_KIND Registers_or1k
Index: libunwind/trunk/include/__libunwind_config.h
===
--- libunwind/trunk/include/__libunwind_config.h
+++ libunwind/trunk/include/__libunwind_config.h
@@ -19,7 +19,7 @@
 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_6432
 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC   112
 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64 95
-#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM   95
+#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM   287
 #define _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K  31
 
 #if defined(_LIBUNWIND_IS_NATIVE_ONLY)
@@ -75,7 +75,7 @@
 # define _LIBUNWIND_TARGET_OR1K 1
 # define _LIBUNWIND_CONTEXT_SIZE 128
 # define _LIBUNWIND_CURSOR_SIZE 140
-# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 119
+# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
 #endif // _LIBUNWIND_IS_NATIVE_ONLY
 
 #endif // LIBUNWIND_CONFIG_H__
Index: libunwind/trunk/include/libunwind.h
===
--- libunwind/trunk/include/libunwind.h
+++ libunwind/trunk/include/libunwind.h
@@ -73,7 +73,7 @@
 
 typedef int unw_regnum_t;
 typedef uintptr_t unw_word_t;
-#if defined(_LIBUNWIND_ARM_EHABI)
+#if defined(__arm__)
 typedef uint64_t unw_fpreg_t;
 #else
 typedef double unw_fpreg_t;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D39441: [refactor][extract] insert semicolons into extracted/inserted code when needed

2017-11-02 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment.

Code looks good with some nits.




Comment at: lib/Tooling/Refactoring/CMakeLists.txt:7
   AtomicChange.cpp
   Extract.cpp
+  SourceExtraction.cpp

Shall we move function extraction sources into a sub-directory? Like what you 
did for headers.



Comment at: lib/Tooling/Refactoring/SourceExtraction.h:25
+/// Determines which semicolons should be inserted during extraction.
+struct ExtractionSemicolonPolicy {
+  bool IsNeededInExtractedFunction;

I think this should be a `class` with accessors if the members are not expected 
to be changed by users.



Comment at: lib/Tooling/Refactoring/SourceExtraction.h:36
+
+private:
+  static ExtractionSemicolonPolicy neededInExtractedFunction() {

Either move these helpers into the cpp file or simply make them public.


Repository:
  rL LLVM

https://reviews.llvm.org/D39441



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


[PATCH] D39533: [MinGW] Define __ARM_DWARF_EH__ on MinGW/ARM

2017-11-02 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.

This should go together with https://reviews.llvm.org/D39532 in LLVM.


https://reviews.llvm.org/D39533

Files:
  lib/Basic/Targets/ARM.cpp
  test/Preprocessor/init.c


Index: test/Preprocessor/init.c
===
--- test/Preprocessor/init.c
+++ test/Preprocessor/init.c
@@ -2645,6 +2645,10 @@
 // Thumbebv7: #define __THUMB_INTERWORK__ 1
 // Thumbebv7: #define __thumb2__ 1
 
+// RUN: %clang -E -dM -ffreestanding -target thumbv7-pc-mingw32 %s -o - | 
FileCheck -match-full-lines -check-prefix THUMB-MINGW %s
+
+// THUMB-MINGW:#define __ARM_DWARF_EH__ 1
+
 //
 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-none-none < /dev/null | 
FileCheck -match-full-lines -check-prefix I386 %s
 //
Index: lib/Basic/Targets/ARM.cpp
===
--- lib/Basic/Targets/ARM.cpp
+++ lib/Basic/Targets/ARM.cpp
@@ -1002,6 +1002,7 @@
   DefineStd(Builder, "WIN32", Opts);
   DefineStd(Builder, "WINNT", Opts);
   Builder.defineMacro("_ARM_");
+  Builder.defineMacro("__ARM_DWARF_EH__");
   addMinGWDefines(Opts, Builder);
 }
 


Index: test/Preprocessor/init.c
===
--- test/Preprocessor/init.c
+++ test/Preprocessor/init.c
@@ -2645,6 +2645,10 @@
 // Thumbebv7: #define __THUMB_INTERWORK__ 1
 // Thumbebv7: #define __thumb2__ 1
 
+// RUN: %clang -E -dM -ffreestanding -target thumbv7-pc-mingw32 %s -o - | FileCheck -match-full-lines -check-prefix THUMB-MINGW %s
+
+// THUMB-MINGW:#define __ARM_DWARF_EH__ 1
+
 //
 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-none-none < /dev/null | FileCheck -match-full-lines -check-prefix I386 %s
 //
Index: lib/Basic/Targets/ARM.cpp
===
--- lib/Basic/Targets/ARM.cpp
+++ lib/Basic/Targets/ARM.cpp
@@ -1002,6 +1002,7 @@
   DefineStd(Builder, "WIN32", Opts);
   DefineStd(Builder, "WINNT", Opts);
   Builder.defineMacro("_ARM_");
+  Builder.defineMacro("__ARM_DWARF_EH__");
   addMinGWDefines(Opts, Builder);
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D39534: [libunwind] Add ifdefs around ELF specific parts of UnwindRegisters*.S for ARM

2017-11-02 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision.
Herald added subscribers: kristof.beyls, aprantl, aemerson.

This allows using dwarf exceptions on MinGW/ARM. This goes together with 
https://reviews.llvm.org/D39532 in LLVM and https://reviews.llvm.org/D39533 in 
clang.


https://reviews.llvm.org/D39534

Files:
  docs/index.rst
  src/UnwindRegistersRestore.S
  src/UnwindRegistersSave.S

Index: src/UnwindRegistersSave.S
===
--- src/UnwindRegistersSave.S
+++ src/UnwindRegistersSave.S
@@ -375,7 +375,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .fpu vfpv3-d16
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveVFPWithFSTMDEPy)
   vstmia r0, {d0-d15}
   JMP(lr)
@@ -387,7 +389,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .fpu vfpv3-d16
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveVFPWithFSTMXEPy)
   vstmia r0, {d0-d15} @ fstmiax is deprecated in ARMv7+ and now behaves like vstmia
   JMP(lr)
@@ -399,7 +403,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .fpu vfpv3
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm9saveVFPv3EPy)
   @ VFP and iwMMX instructions are only available when compiling with the flags
   @ that enable them. We do not want to do that in the library (because we do not
@@ -420,7 +426,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .arch armv5te
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm9saveiWMMXEPy)
   stcl p1, cr0, [r0], #8  @ wstrd wR0, [r0], #8
   stcl p1, cr1, [r0], #8  @ wstrd wR1, [r0], #8
@@ -447,7 +455,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .arch armv5te
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveiWMMXControlEPj)
   stc2 p1, cr8, [r0], #4  @ wstrw wCGR0, [r0], #4
   stc2 p1, cr9, [r0], #4  @ wstrw wCGR1, [r0], #4
Index: src/UnwindRegistersRestore.S
===
--- src/UnwindRegistersRestore.S
+++ src/UnwindRegistersRestore.S
@@ -391,7 +391,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .fpu vfpv3-d16
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm19restoreVFPWithFLDMDEPy)
   @ VFP and iwMMX instructions are only available when compiling with the flags
   @ that enable them. We do not want to do that in the library (because we do not
@@ -410,7 +412,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .fpu vfpv3-d16
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm19restoreVFPWithFLDMXEPy)
   vldmia r0, {d0-d15} @ fldmiax is deprecated in ARMv7+ and now behaves like vldmia
   JMP(lr)
@@ -422,7 +426,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .fpu vfpv3
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm12restoreVFPv3EPy)
   vldmia r0, {d16-d31}
   JMP(lr)
@@ -436,7 +442,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .arch armv5te
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm12restoreiWMMXEPy)
   ldcl p1, cr0, [r0], #8  @ wldrd wR0, [r0], #8
   ldcl p1, cr1, [r0], #8  @ wldrd wR1, [r0], #8
@@ -463,7 +471,9 @@
 @  values pointer is in r0
 @
   .p2align 2
+#if defined(__ELF__)
   .arch armv5te
+#endif
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj)
   ldc2 p1, cr8, [r0], #4  @ wldrw wCGR0, [r0], #4
   ldc2 p1, cr9, [r0], #4  @ wldrw wCGR1, [r0], #4
Index: docs/index.rst
===
--- docs/index.rst
+++ docs/index.rst
@@ -52,7 +52,7 @@
 Linuxi386, x86_64, ARM64  Clang, GCC   DWARF CFI
 Mac OS X i386, x86_64 Clang, GCC   DWARF CFI
 NetBSD   x86_64   Clang, GCC   DWARF CFI
-Windows  i386, x86_64 ClangDWARF CFI
+Windows  i386, x86_64, ARMClangDWARF CFI
    
 
 The following minimum compiler versions are strongly recommended.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D39086: Performance tracing facility for clangd.

2017-11-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 121247.
sammccall added a comment.

Provide RAII-like interface to trace functionality.

Note that we may want to provide a backend API here.


https://reviews.llvm.org/D39086

Files:
  clangd/CMakeLists.txt
  clangd/ClangdServer.cpp
  clangd/ClangdUnit.cpp
  clangd/JSONRPCDispatcher.cpp
  clangd/ProtocolHandlers.cpp
  clangd/Trace.cpp
  clangd/Trace.h
  clangd/tool/ClangdMain.cpp
  test/clangd/trace.test
  unittests/clangd/CMakeLists.txt
  unittests/clangd/TraceTests.cpp

Index: unittests/clangd/TraceTests.cpp
===
--- /dev/null
+++ unittests/clangd/TraceTests.cpp
@@ -0,0 +1,117 @@
+//===-- TraceTests.cpp - Tracing unit tests -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "Trace.h"
+
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/YAMLParser.h"
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+namespace clang {
+namespace clangd {
+namespace {
+using namespace llvm;
+
+MATCHER_P(StringNode, Val, "") {
+  if (arg->getType() != yaml::Node::NK_Scalar) {
+*result_listener << "is a " << arg->getVerbatimTag();
+return false;
+  }
+  SmallString<32> S;
+  return Val == static_cast(arg)->getValue(S);
+}
+
+// Checks that N is a Mapping (JS object) with the expected scalar properties.
+// The object must have all the Expected properties, but may have others.
+bool VerifyObject(yaml::Node &N, std::map Expected) {
+  auto* M = dyn_cast(&N);
+  if (!M) {
+ADD_FAILURE() << "Not an object";
+return false;
+  }
+  bool Match = true;
+  SmallString<32> Tmp;
+  for (auto Prop : *M) {
+auto* K = dyn_cast_or_null(Prop.getKey());
+if (!K) continue;
+std::string KS = K->getValue(Tmp).str();
+auto I = Expected.find(KS);
+if (I == Expected.end()) continue;  // Ignore properties with no assertion.
+
+auto* V = dyn_cast_or_null(Prop.getValue());
+if (!V) {
+  ADD_FAILURE() << KS << " is not a string";
+  Match = false;
+}
+std::string VS = V->getValue(Tmp).str();
+if (VS != I->second) {
+  ADD_FAILURE() << KS << " expected " << I->second << " but actual " << VS;
+  Match = false;
+}
+Expected.erase(I);
+  }
+  for (const auto& P : Expected) {
+ADD_FAILURE() << P.first << " missing, expected " << P.second;
+Match = false;
+  }
+  return Match;
+}
+
+TEST(TraceTest, SmokeTest) {
+  // Capture some events.
+  std::string JSON;
+  raw_string_ostream OS(JSON);
+  trace::start(OS);
+  {
+trace::Span S("A");
+trace::log("B");
+  }
+  trace::stop();
+
+  // Get the root JSON object using the YAML parser.
+  SourceMgr SM;
+  yaml::Stream Stream(JSON, SM);
+  auto Doc = Stream.begin();
+  ASSERT_NE(Doc, Stream.end());
+  auto* Root = dyn_cast_or_null(Doc->getRoot());
+  ASSERT_NE(Root, nullptr) << "Root should be an object";
+
+  // We expect in order:
+  //   displayTimeUnit: "ns"
+  //   traceEvents: [process name, thread name, start span, log, end span]
+  // (The order doesn't matter, but the YAML parser is awkward to use otherwise)
+  auto Prop = Root->begin();
+  ASSERT_NE(Prop, Root->end()) << "Expected displayTimeUnit property";
+  ASSERT_THAT(Prop->getKey(), StringNode("displayTimeUnit"));
+  EXPECT_THAT(Prop->getValue(), StringNode("ns"));
+  ASSERT_NE(++Prop, Root->end()) << "Expected traceEvents property";
+  EXPECT_THAT(Prop->getKey(), StringNode("traceEvents"));
+  auto* Events = dyn_cast_or_null(Prop->getValue());
+  ASSERT_NE(Events, nullptr) << "traceEvents should be an array";
+  auto Event = Events->begin();
+  ASSERT_NE(Event, Events->end()) << "Expected process name";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "M"}, {"name", "process_name"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected thread name";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "M"}, {"name", "thread_name"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected span start";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "B"}, {"name", "A"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected log message";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "i"}, {"name", "B"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected span end";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "E"}}));
+  ASSERT_EQ(++Event, Events->end());
+  ASSERT_EQ(++Prop, Root->end());
+}
+
+} // namespace
+} // namespace clangd
+} // namespace clang
Index: unittests/clangd/CMakeLists.txt
===
--- unittests/clangd/CMakeLists.txt
+++ unittests/clangd/CMakeLists.txt
@@ -10,6 +10,7 @@
 
 add_extra_unittest(ClangdTests
   ClangdTests.cpp
+  TraceTests.cpp
   )
 
 target_link_lib

[PATCH] D39086: Performance tracing facility for clangd.

2017-11-02 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision.
ioeric added a comment.

still lgtm




Comment at: clangd/Trace.h:38
+  // Starts a sessions capturing trace events and writing Trace Event JSON.
+  static std::unique_ptr createJSON(llvm::raw_ostream &OS);
+  ~Session();

`createJSON` is a bit confusing... maybe just `create` since json is just the 
underlying representation which users don't have to know about?


https://reviews.llvm.org/D39086



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


[PATCH] D39086: Performance tracing facility for clangd.

2017-11-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 121252.
sammccall marked an inline comment as done.
sammccall added a comment.

createJSON -> create


https://reviews.llvm.org/D39086

Files:
  clangd/CMakeLists.txt
  clangd/ClangdServer.cpp
  clangd/ClangdUnit.cpp
  clangd/JSONRPCDispatcher.cpp
  clangd/ProtocolHandlers.cpp
  clangd/Trace.cpp
  clangd/Trace.h
  clangd/tool/ClangdMain.cpp
  test/clangd/trace.test
  unittests/clangd/CMakeLists.txt
  unittests/clangd/TraceTests.cpp

Index: unittests/clangd/TraceTests.cpp
===
--- /dev/null
+++ unittests/clangd/TraceTests.cpp
@@ -0,0 +1,117 @@
+//===-- TraceTests.cpp - Tracing unit tests -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "Trace.h"
+
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/YAMLParser.h"
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+namespace clang {
+namespace clangd {
+namespace {
+using namespace llvm;
+
+MATCHER_P(StringNode, Val, "") {
+  if (arg->getType() != yaml::Node::NK_Scalar) {
+*result_listener << "is a " << arg->getVerbatimTag();
+return false;
+  }
+  SmallString<32> S;
+  return Val == static_cast(arg)->getValue(S);
+}
+
+// Checks that N is a Mapping (JS object) with the expected scalar properties.
+// The object must have all the Expected properties, but may have others.
+bool VerifyObject(yaml::Node &N, std::map Expected) {
+  auto* M = dyn_cast(&N);
+  if (!M) {
+ADD_FAILURE() << "Not an object";
+return false;
+  }
+  bool Match = true;
+  SmallString<32> Tmp;
+  for (auto Prop : *M) {
+auto* K = dyn_cast_or_null(Prop.getKey());
+if (!K) continue;
+std::string KS = K->getValue(Tmp).str();
+auto I = Expected.find(KS);
+if (I == Expected.end()) continue;  // Ignore properties with no assertion.
+
+auto* V = dyn_cast_or_null(Prop.getValue());
+if (!V) {
+  ADD_FAILURE() << KS << " is not a string";
+  Match = false;
+}
+std::string VS = V->getValue(Tmp).str();
+if (VS != I->second) {
+  ADD_FAILURE() << KS << " expected " << I->second << " but actual " << VS;
+  Match = false;
+}
+Expected.erase(I);
+  }
+  for (const auto& P : Expected) {
+ADD_FAILURE() << P.first << " missing, expected " << P.second;
+Match = false;
+  }
+  return Match;
+}
+
+TEST(TraceTest, SmokeTest) {
+  // Capture some events.
+  std::string JSON;
+  raw_string_ostream OS(JSON);
+  trace::start(OS);
+  {
+trace::Span S("A");
+trace::log("B");
+  }
+  trace::stop();
+
+  // Get the root JSON object using the YAML parser.
+  SourceMgr SM;
+  yaml::Stream Stream(JSON, SM);
+  auto Doc = Stream.begin();
+  ASSERT_NE(Doc, Stream.end());
+  auto* Root = dyn_cast_or_null(Doc->getRoot());
+  ASSERT_NE(Root, nullptr) << "Root should be an object";
+
+  // We expect in order:
+  //   displayTimeUnit: "ns"
+  //   traceEvents: [process name, thread name, start span, log, end span]
+  // (The order doesn't matter, but the YAML parser is awkward to use otherwise)
+  auto Prop = Root->begin();
+  ASSERT_NE(Prop, Root->end()) << "Expected displayTimeUnit property";
+  ASSERT_THAT(Prop->getKey(), StringNode("displayTimeUnit"));
+  EXPECT_THAT(Prop->getValue(), StringNode("ns"));
+  ASSERT_NE(++Prop, Root->end()) << "Expected traceEvents property";
+  EXPECT_THAT(Prop->getKey(), StringNode("traceEvents"));
+  auto* Events = dyn_cast_or_null(Prop->getValue());
+  ASSERT_NE(Events, nullptr) << "traceEvents should be an array";
+  auto Event = Events->begin();
+  ASSERT_NE(Event, Events->end()) << "Expected process name";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "M"}, {"name", "process_name"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected thread name";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "M"}, {"name", "thread_name"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected span start";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "B"}, {"name", "A"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected log message";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "i"}, {"name", "B"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected span end";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "E"}}));
+  ASSERT_EQ(++Event, Events->end());
+  ASSERT_EQ(++Prop, Root->end());
+}
+
+} // namespace
+} // namespace clangd
+} // namespace clang
Index: unittests/clangd/CMakeLists.txt
===
--- unittests/clangd/CMakeLists.txt
+++ unittests/clangd/CMakeLists.txt
@@ -10,6 +10,7 @@
 
 add_extra_unittest(ClangdTests
   ClangdTests.cpp
+  TraceTests.cpp
   )
 
 target_link_libraries(ClangdTests
Index: test/clangd/tra

[PATCH] D39086: Performance tracing facility for clangd.

2017-11-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments.



Comment at: clangd/Trace.h:38
+  // Starts a sessions capturing trace events and writing Trace Event JSON.
+  static std::unique_ptr createJSON(llvm::raw_ostream &OS);
+  ~Session();

ioeric wrote:
> `createJSON` is a bit confusing... maybe just `create` since json is just the 
> underlying representation which users don't have to know about?
I think later we might have an API for non-JSON sessions (crazy google internal 
tracing tools) but until then, `create` is a fine name.


https://reviews.llvm.org/D39086



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


[PATCH] D39086: Performance tracing facility for clangd.

2017-11-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 121253.
sammccall added a comment.

clang-format


https://reviews.llvm.org/D39086

Files:
  clangd/CMakeLists.txt
  clangd/ClangdServer.cpp
  clangd/ClangdUnit.cpp
  clangd/JSONRPCDispatcher.cpp
  clangd/ProtocolHandlers.cpp
  clangd/Trace.cpp
  clangd/Trace.h
  clangd/tool/ClangdMain.cpp
  test/clangd/trace.test
  unittests/clangd/CMakeLists.txt
  unittests/clangd/TraceTests.cpp

Index: unittests/clangd/TraceTests.cpp
===
--- /dev/null
+++ unittests/clangd/TraceTests.cpp
@@ -0,0 +1,119 @@
+//===-- TraceTests.cpp - Tracing unit tests -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "Trace.h"
+
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/YAMLParser.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+namespace clang {
+namespace clangd {
+namespace {
+using namespace llvm;
+
+MATCHER_P(StringNode, Val, "") {
+  if (arg->getType() != yaml::Node::NK_Scalar) {
+*result_listener << "is a " << arg->getVerbatimTag();
+return false;
+  }
+  SmallString<32> S;
+  return Val == static_cast(arg)->getValue(S);
+}
+
+// Checks that N is a Mapping (JS object) with the expected scalar properties.
+// The object must have all the Expected properties, but may have others.
+bool VerifyObject(yaml::Node &N, std::map Expected) {
+  auto *M = dyn_cast(&N);
+  if (!M) {
+ADD_FAILURE() << "Not an object";
+return false;
+  }
+  bool Match = true;
+  SmallString<32> Tmp;
+  for (auto Prop : *M) {
+auto *K = dyn_cast_or_null(Prop.getKey());
+if (!K)
+  continue;
+std::string KS = K->getValue(Tmp).str();
+auto I = Expected.find(KS);
+if (I == Expected.end())
+  continue; // Ignore properties with no assertion.
+
+auto *V = dyn_cast_or_null(Prop.getValue());
+if (!V) {
+  ADD_FAILURE() << KS << " is not a string";
+  Match = false;
+}
+std::string VS = V->getValue(Tmp).str();
+if (VS != I->second) {
+  ADD_FAILURE() << KS << " expected " << I->second << " but actual " << VS;
+  Match = false;
+}
+Expected.erase(I);
+  }
+  for (const auto &P : Expected) {
+ADD_FAILURE() << P.first << " missing, expected " << P.second;
+Match = false;
+  }
+  return Match;
+}
+
+TEST(TraceTest, SmokeTest) {
+  // Capture some events.
+  std::string JSON;
+  raw_string_ostream OS(JSON);
+  trace::start(OS);
+  {
+trace::Span S("A");
+trace::log("B");
+  }
+  trace::stop();
+
+  // Get the root JSON object using the YAML parser.
+  SourceMgr SM;
+  yaml::Stream Stream(JSON, SM);
+  auto Doc = Stream.begin();
+  ASSERT_NE(Doc, Stream.end());
+  auto *Root = dyn_cast_or_null(Doc->getRoot());
+  ASSERT_NE(Root, nullptr) << "Root should be an object";
+
+  // We expect in order:
+  //   displayTimeUnit: "ns"
+  //   traceEvents: [process name, thread name, start span, log, end span]
+  // (The order doesn't matter, but the YAML parser is awkward to use otherwise)
+  auto Prop = Root->begin();
+  ASSERT_NE(Prop, Root->end()) << "Expected displayTimeUnit property";
+  ASSERT_THAT(Prop->getKey(), StringNode("displayTimeUnit"));
+  EXPECT_THAT(Prop->getValue(), StringNode("ns"));
+  ASSERT_NE(++Prop, Root->end()) << "Expected traceEvents property";
+  EXPECT_THAT(Prop->getKey(), StringNode("traceEvents"));
+  auto *Events = dyn_cast_or_null(Prop->getValue());
+  ASSERT_NE(Events, nullptr) << "traceEvents should be an array";
+  auto Event = Events->begin();
+  ASSERT_NE(Event, Events->end()) << "Expected process name";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "M"}, {"name", "process_name"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected thread name";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "M"}, {"name", "thread_name"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected span start";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "B"}, {"name", "A"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected log message";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "i"}, {"name", "B"}}));
+  ASSERT_NE(++Event, Events->end()) << "Expected span end";
+  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "E"}}));
+  ASSERT_EQ(++Event, Events->end());
+  ASSERT_EQ(++Prop, Root->end());
+}
+
+} // namespace
+} // namespace clangd
+} // namespace clang
Index: unittests/clangd/CMakeLists.txt
===
--- unittests/clangd/CMakeLists.txt
+++ unittests/clangd/CMakeLists.txt
@@ -10,6 +10,7 @@
 
 add_extra_unittest(ClangdTests
   ClangdTests.cpp
+  TraceTests.cpp
   )
 
 target_link_libraries(ClangdTests
Index: test/clangd/trace.test
===

[PATCH] D39332: [clang-refactor] Introduce "local-qualified-rename" action.

2017-11-02 Thread Johann Klähn via Phabricator via cfe-commits
jklaehn added a comment.

I spotted two typos. :) Also, the commit message needs to be updated.




Comment at: lib/Tooling/Refactoring/RefactoringActions.cpp:61
+  StringRef getDescription() const override {
+return "The new qualified to chagne the symbol to";
+  }

There is a typo here → "qualified name to change"



Comment at: lib/Tooling/Refactoring/Rename/RenamingAction.cpp:105
+
+const RefactoringDescriptor &QualifiedRenameRuledescribe() {
+  static const RefactoringDescriptor Descriptor = {

missing `::`? → `::describe()`


https://reviews.llvm.org/D39332



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


[PATCH] D39537: Rename identifiers named `__output`

2017-11-02 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson created this revision.

In the CHERI clang compiler __output and __input are keywords and therefore
we can't compile libc++ with our compiler.


Repository:
  rL LLVM

https://reviews.llvm.org/D39537

Files:
  include/algorithm
  include/experimental/algorithm
  include/experimental/iterator
  include/regex
  test/support/nasty_macros.hpp

Index: test/support/nasty_macros.hpp
===
--- test/support/nasty_macros.hpp
+++ test/support/nasty_macros.hpp
@@ -52,4 +52,7 @@
 #define __out NASTY_MACRO
 #endif
 
+#define __output NASTY_MACRO
+#define __input NASTY_MACRO
+
 #endif // SUPPORT_NASTY_MACROS_HPP
Index: include/regex
===
--- include/regex
+++ include/regex
@@ -5277,15 +5277,15 @@
 // format:
 template 
 _OutputIter
-format(_OutputIter __output, const char_type* __fmt_first,
+format(_OutputIter __output_iter, const char_type* __fmt_first,
const char_type* __fmt_last,
regex_constants::match_flag_type __flags = regex_constants::format_default) const;
 template 
 _LIBCPP_INLINE_VISIBILITY
 _OutputIter
-format(_OutputIter __output, const basic_string& __fmt,
+format(_OutputIter __output_iter, const basic_string& __fmt,
regex_constants::match_flag_type __flags = regex_constants::format_default) const
-{return format(__output, __fmt.data(), __fmt.data() + __fmt.size(), __flags);}
+{return format(__output_iter, __fmt.data(), __fmt.data() + __fmt.size(), __flags);}
 template 
 _LIBCPP_INLINE_VISIBILITY
 basic_string
@@ -5397,36 +5397,36 @@
 template 
 template 
 _OutputIter
-match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output,
+match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_iter,
 const char_type* __fmt_first, const char_type* __fmt_last,
 regex_constants::match_flag_type __flags) const
 {
 if (__flags & regex_constants::format_sed)
 {
 for (; __fmt_first != __fmt_last; ++__fmt_first)
 {
 if (*__fmt_first == '&')
-__output = _VSTD::copy(__matches_[0].first, __matches_[0].second,
-   __output);
+__output_iter = _VSTD::copy(__matches_[0].first, __matches_[0].second,
+   __output_iter);
 else if (*__fmt_first == '\\' && __fmt_first + 1 != __fmt_last)
 {
 ++__fmt_first;
 if ('0' <= *__fmt_first && *__fmt_first <= '9')
 {
 size_t __i = *__fmt_first - '0';
-__output = _VSTD::copy((*this)[__i].first,
-(*this)[__i].second, __output);
+__output_iter = _VSTD::copy((*this)[__i].first,
+(*this)[__i].second, __output_iter);
 }
 else
 {
-*__output = *__fmt_first;
-++__output;
+*__output_iter = *__fmt_first;
+++__output_iter;
 }
 }
 else
 {
-*__output = *__fmt_first;
-++__output;
+*__output_iter = *__fmt_first;
+++__output_iter;
 }
 }
 }
@@ -5439,21 +5439,21 @@
 switch (__fmt_first[1])
 {
 case '$':
-*__output = *++__fmt_first;
-++__output;
+*__output_iter = *++__fmt_first;
+++__output_iter;
 break;
 case '&':
 ++__fmt_first;
-__output = _VSTD::copy(__matches_[0].first, __matches_[0].second,
-   __output);
+__output_iter = _VSTD::copy(__matches_[0].first, __matches_[0].second,
+   __output_iter);
 break;
 case '`':
 ++__fmt_first;
-__output = _VSTD::copy(__prefix_.first, __prefix_.second, __output);
+__output_iter = _VSTD::copy(__prefix_.first, __prefix_.second, __output_iter);
 break;
 case '\'':
 ++__fmt_first;
-__output = _VSTD::copy(__suffix_.first, __suffix_.second, __output);
+__output_iter = _VSTD::copy(__suffix_.first, __suffix_.second, __output_iter);
 break;
 default:
 if ('0' <= __fmt_first[1] && __fmt_first[1] <= '9')
@@ -5468,25 +5468,25 @@
 __throw_regex_error();
 

[clang-tools-extra] r317193 - Performance tracing facility for clangd.

2017-11-02 Thread Sam McCall via cfe-commits
Author: sammccall
Date: Thu Nov  2 02:21:51 2017
New Revision: 317193

URL: http://llvm.org/viewvc/llvm-project?rev=317193&view=rev
Log:
Performance tracing facility for clangd.

Summary:
This lets you visualize clangd's activity on different threads over time,
and understand critical paths of requests and object lifetimes.
The data produced can be visualized in Chrome (at chrome://tracing), or
in a standalone copy of catapult (http://github.com/catapult-project/catapult)

This patch consists of:
 - a command line flag "-trace" that causes clangd to emit JSON trace data
 - an API (in Trace.h) allowing clangd code to easily add events to the stream
 - several initial uses of this API to capture JSON-RPC requests, builds, logs

Example result: https://photos.app.goo.gl/12L9swaz5REGQ1rm1

Caveats:
 - JSON serialization is ad-hoc (isn't it everywhere?) so the API is
   limited to naming events rather than attaching arbitrary metadata.
   I'd like to fix this (I think we could use a JSON-object abstraction).
 - The recording is very naive: events are written immediately by
   locking a mutex. Contention on the mutex might disturb performance.
 - For now it just traces instants or spans on the current thread.
   There are other things that make sense to show (cross-thread flows,
   non-thread resources such as ASTs). But we have to start somewhere.

Reviewers: ioeric, ilya-biryukov

Subscribers: cfe-commits, mgorny

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

Added:
clang-tools-extra/trunk/clangd/Trace.cpp
clang-tools-extra/trunk/clangd/Trace.h
clang-tools-extra/trunk/test/clangd/trace.test
clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp
Modified:
clang-tools-extra/trunk/clangd/CMakeLists.txt
clang-tools-extra/trunk/clangd/ClangdServer.cpp
clang-tools-extra/trunk/clangd/ClangdUnit.cpp
clang-tools-extra/trunk/clangd/JSONRPCDispatcher.cpp
clang-tools-extra/trunk/clangd/ProtocolHandlers.cpp
clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
clang-tools-extra/trunk/unittests/clangd/CMakeLists.txt

Modified: clang-tools-extra/trunk/clangd/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/CMakeLists.txt?rev=317193&r1=317192&r2=317193&view=diff
==
--- clang-tools-extra/trunk/clangd/CMakeLists.txt (original)
+++ clang-tools-extra/trunk/clangd/CMakeLists.txt Thu Nov  2 02:21:51 2017
@@ -13,6 +13,7 @@ add_clang_library(clangDaemon
   Logger.cpp
   Protocol.cpp
   ProtocolHandlers.cpp
+  Trace.cpp
 
   LINK_LIBS
   clangAST

Modified: clang-tools-extra/trunk/clangd/ClangdServer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangdServer.cpp?rev=317193&r1=317192&r2=317193&view=diff
==
--- clang-tools-extra/trunk/clangd/ClangdServer.cpp (original)
+++ clang-tools-extra/trunk/clangd/ClangdServer.cpp Thu Nov  2 02:21:51 2017
@@ -15,6 +15,8 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/FormatProviders.h"
+#include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
 #include 
@@ -98,7 +100,8 @@ ClangdScheduler::ClangdScheduler(unsigne
 
   Workers.reserve(AsyncThreadsCount);
   for (unsigned I = 0; I < AsyncThreadsCount; ++I) {
-Workers.push_back(std::thread([this]() {
+Workers.push_back(std::thread([this, I]() {
+  llvm::set_thread_name(llvm::formatv("scheduler/{0}", I));
   while (true) {
 UniqueFunction Request;
 

Modified: clang-tools-extra/trunk/clangd/ClangdUnit.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangdUnit.cpp?rev=317193&r1=317192&r2=317193&view=diff
==
--- clang-tools-extra/trunk/clangd/ClangdUnit.cpp (original)
+++ clang-tools-extra/trunk/clangd/ClangdUnit.cpp Thu Nov  2 02:21:51 2017
@@ -10,6 +10,7 @@
 #include "ClangdUnit.h"
 
 #include "Logger.h"
+#include "Trace.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Frontend/CompilerInvocation.h"
 #include "clang/Frontend/FrontendActions.h"
@@ -1285,6 +1286,7 @@ CppFile::deferRebuild(StringRef NewConte
 return OldPreamble;
   }
 
+  trace::Span Tracer(llvm::Twine("Preamble: ") + That->FileName);
   std::vector PreambleDiags;
   StoreDiagsConsumer PreambleDiagnosticsConsumer(/*ref*/ PreambleDiags);
   IntrusiveRefCntPtr PreambleDiagsEngine =
@@ -1330,9 +1332,13 @@ CppFile::deferRebuild(StringRef NewConte
 }
 
 // Compute updated AST.
-llvm::Optional NewAST =
-ParsedAST::Build(std::move(CI), PreambleForAST, 
SerializedPreambleDecls,
- std::move(ContentsBuffer), PCHs, VFS, That->Logger);
+llvm::Optional NewAST;
+{
+  trace::

[PATCH] D39086: Performance tracing facility for clangd.

2017-11-02 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL317193: Performance tracing facility for clangd. (authored 
by sammccall).

Changed prior to commit:
  https://reviews.llvm.org/D39086?vs=121253&id=121257#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39086

Files:
  clang-tools-extra/trunk/clangd/CMakeLists.txt
  clang-tools-extra/trunk/clangd/ClangdServer.cpp
  clang-tools-extra/trunk/clangd/ClangdUnit.cpp
  clang-tools-extra/trunk/clangd/JSONRPCDispatcher.cpp
  clang-tools-extra/trunk/clangd/ProtocolHandlers.cpp
  clang-tools-extra/trunk/clangd/Trace.cpp
  clang-tools-extra/trunk/clangd/Trace.h
  clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp
  clang-tools-extra/trunk/test/clangd/trace.test
  clang-tools-extra/trunk/unittests/clangd/CMakeLists.txt
  clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp

Index: clang-tools-extra/trunk/test/clangd/trace.test
===
--- clang-tools-extra/trunk/test/clangd/trace.test
+++ clang-tools-extra/trunk/test/clangd/trace.test
@@ -0,0 +1,16 @@
+# RUN: clangd -run-synchronously -trace %t < %s && FileCheck %s < %t
+# It is absolutely vital that this file has CRLF line endings.
+#
+Content-Length: 125
+
+{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
+#
+Content-Length: 152
+
+{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///foo.c","languageId":"c","version":1,"text":"void main() {}"}}}
+# CHECK: "textDocument/didOpen"
+# CHECK: "Preamble: /foo.c"
+# CHECK: "Build: /foo.c"
+Content-Length: 44
+
+{"jsonrpc":"2.0","id":5,"method":"shutdown"}
Index: clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp
===
--- clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp
+++ clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp
@@ -0,0 +1,120 @@
+//===-- TraceTests.cpp - Tracing unit tests -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "Trace.h"
+
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/YAMLParser.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+namespace clang {
+namespace clangd {
+namespace {
+using namespace llvm;
+
+MATCHER_P(StringNode, Val, "") {
+  if (arg->getType() != yaml::Node::NK_Scalar) {
+*result_listener << "is a " << arg->getVerbatimTag();
+return false;
+  }
+  SmallString<32> S;
+  return Val == static_cast(arg)->getValue(S);
+}
+
+// Checks that N is a Mapping (JS object) with the expected scalar properties.
+// The object must have all the Expected properties, but may have others.
+bool VerifyObject(yaml::Node &N, std::map Expected) {
+  auto *M = dyn_cast(&N);
+  if (!M) {
+ADD_FAILURE() << "Not an object";
+return false;
+  }
+  bool Match = true;
+  SmallString<32> Tmp;
+  for (auto Prop : *M) {
+auto *K = dyn_cast_or_null(Prop.getKey());
+if (!K)
+  continue;
+std::string KS = K->getValue(Tmp).str();
+auto I = Expected.find(KS);
+if (I == Expected.end())
+  continue; // Ignore properties with no assertion.
+
+auto *V = dyn_cast_or_null(Prop.getValue());
+if (!V) {
+  ADD_FAILURE() << KS << " is not a string";
+  Match = false;
+}
+std::string VS = V->getValue(Tmp).str();
+if (VS != I->second) {
+  ADD_FAILURE() << KS << " expected " << I->second << " but actual " << VS;
+  Match = false;
+}
+Expected.erase(I);
+  }
+  for (const auto &P : Expected) {
+ADD_FAILURE() << P.first << " missing, expected " << P.second;
+Match = false;
+  }
+  return Match;
+}
+
+TEST(TraceTest, SmokeTest) {
+  // Capture some events.
+  std::string JSON;
+  {
+raw_string_ostream OS(JSON);
+auto Session = trace::Session::create(OS);
+{
+  trace::Span S("A");
+  trace::log("B");
+}
+  }
+
+  // Get the root JSON object using the YAML parser.
+  SourceMgr SM;
+  yaml::Stream Stream(JSON, SM);
+  auto Doc = Stream.begin();
+  ASSERT_NE(Doc, Stream.end());
+  auto *Root = dyn_cast_or_null(Doc->getRoot());
+  ASSERT_NE(Root, nullptr) << "Root should be an object";
+
+  // We expect in order:
+  //   displayTimeUnit: "ns"
+  //   traceEvents: [process name, thread name, start span, log, end span]
+  // (The order doesn't matter, but the YAML parser is awkward to use otherwise)
+  auto Prop = Root->begin();
+  ASSERT_NE(Prop, Root->end()) << "Expected displayTimeUnit property";
+  ASSERT_THAT(Prop->getKey(), StringNode("displayTimeUnit"));
+  EXPECT_THAT(Prop->getValue(), StringNode("ns"));
+  ASSERT_NE(++Pro

[clang-tools-extra] r317194 - Fix clangd test on platforms where get_thread_name does nothing.

2017-11-02 Thread Sam McCall via cfe-commits
Author: sammccall
Date: Thu Nov  2 02:48:55 2017
New Revision: 317194

URL: http://llvm.org/viewvc/llvm-project?rev=317194&view=rev
Log:
Fix clangd test on platforms where get_thread_name does nothing.

Modified:
clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp

Modified: clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp?rev=317194&r1=317193&r2=317194&view=diff
==
--- clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/TraceTests.cpp Thu Nov  2 02:48:55 
2017
@@ -12,6 +12,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/Threading.h"
 #include "llvm/Support/YAMLParser.h"
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
@@ -88,6 +89,11 @@ TEST(TraceTest, SmokeTest) {
   auto *Root = dyn_cast_or_null(Doc->getRoot());
   ASSERT_NE(Root, nullptr) << "Root should be an object";
 
+  // Check whether we expect thread name events on this platform.
+  SmallString<32> ThreadName;
+  llvm::get_thread_name(ThreadName);
+  bool ThreadsHaveNames = !ThreadName.empty();
+
   // We expect in order:
   //   displayTimeUnit: "ns"
   //   traceEvents: [process name, thread name, start span, log, end span]
@@ -103,8 +109,10 @@ TEST(TraceTest, SmokeTest) {
   auto Event = Events->begin();
   ASSERT_NE(Event, Events->end()) << "Expected process name";
   EXPECT_TRUE(VerifyObject(*Event, {{"ph", "M"}, {"name", "process_name"}}));
-  ASSERT_NE(++Event, Events->end()) << "Expected thread name";
-  EXPECT_TRUE(VerifyObject(*Event, {{"ph", "M"}, {"name", "thread_name"}}));
+  if (ThreadsHaveNames) {
+ASSERT_NE(++Event, Events->end()) << "Expected thread name";
+EXPECT_TRUE(VerifyObject(*Event, {{"ph", "M"}, {"name", "thread_name"}}));
+  }
   ASSERT_NE(++Event, Events->end()) << "Expected span start";
   EXPECT_TRUE(VerifyObject(*Event, {{"ph", "B"}, {"name", "A"}}));
   ASSERT_NE(++Event, Events->end()) << "Expected log message";


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


[PATCH] D35295: [docs] Add section 'Half-Precision Floating Point'

2017-11-02 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham added inline comments.



Comment at: docs/LanguageExtensions.rst:462
+``__fp16`` is a ARM C-Language Extension (ACLE) and ``_Float16`` is defined by
+the C standards committee, which should help portability between entire
+architectures. Also, ``_Float16`` arithmetic and operations will directly map

Sorry to nitpick a second time, but I think the phrase "entire architectures" 
is a bit strange here. I know it's the same phrase I actually *wrote* in my 
last review comment, but I was being a bit informal, and also explicitly 
contrasting with "versions of the Arm architecture" in the same sentence, to 
distinguish (say) "port between Arm and x86" from "port between ArmThis and 
ArmThat". Out of context it doesn't seem quite idiomatic or quite clear to me, 
so sorry to have accidentally suggested it!

How about something like this as alternative wording:

  ``__fp16`` is an ARM C-Language Extension (ACLE), whereas ``_Float16`` is 
defined by the C standards committee, so using ``_Float16`` will not prevent 
code from being ported to architectures other than Arm.


https://reviews.llvm.org/D35295



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


[PATCH] D35295: [docs] Add section 'Half-Precision Floating Point'

2017-11-02 Thread Sjoerd Meijer via Phabricator via cfe-commits
SjoerdMeijer updated this revision to Diff 121265.
SjoerdMeijer added a comment.

Many thanks for the reviews and suggestions! Comments addressed.


https://reviews.llvm.org/D35295

Files:
  docs/LanguageExtensions.rst


Index: docs/LanguageExtensions.rst
===
--- docs/LanguageExtensions.rst
+++ docs/LanguageExtensions.rst
@@ -436,6 +436,49 @@
 
 See also :ref:`langext-__builtin_shufflevector`, 
:ref:`langext-__builtin_convertvector`.
 
+Half-Precision Floating Point
+=
+
+Clang supports two half-precision (16-bit) floating point types: ``__fp16`` and
+``_Float16``. ``__fp16`` is defined in the ARM C Language Extensions (`ACLE
+`_)
+and ``_Float16`` in ISO/IEC TS 18661-3:2015.
+
+``__fp16`` is a storage and interchange format only. This means that values of
+``__fp16`` promote to (at least) float when used in arithmetic operations.
+There are two ``__fp16`` formats. Clang supports the IEEE 754-2008 format and
+not the ARM alternative format.
+
+ISO/IEC TS 18661-3:2015 defines C support for additional floating point types.
+``_FloatN`` is defined as a binary floating type, where the N suffix denotes
+the number of bits and is 16, 32, 64, or greater and equal to 128 and a
+multiple of 32. Clang supports ``_Float16``. The difference from ``__fp16`` is
+that arithmetic on ``_Float16`` is performed in half-precision, thus it is not
+a storage-only format. ``_Float16`` is available as a source language type in
+both C and C++ mode.
+
+It is recommended that portable code use the ``_Float16`` type because
+``__fp16`` is an ARM C-Language Extension (ACLE), whereas ``_Float16`` is
+defined by the C standards committee, so using ``_Float16`` will not prevent
+code from being ported to architectures other than Arm.  Also, ``_Float16``
+arithmetic and operations will directly map on half-precision instructions when
+they are available (e.g. Armv8.2-A), avoiding conversions to/from
+single-precision, and thus will result in more performant code. If
+half-precision instructions are unavailable, values will be promoted to
+single-precision, similar to the semantics of ``__fp16`` except that the
+results will be stored in single-precision.
+
+In an arithmetic operation where one operand is of ``__fp16`` type and the
+other is of ``_Float16`` type, the ``_Float16`` type is first converted to
+``__fp16`` type and then the operation is completed as if both operands were of
+``__fp16`` type.
+
+To define a ``_Float16`` literal, suffix ``f16`` can be appended to the 
compile-time
+constant declaration. There is no default argument promotion for ``_Float16``; 
this
+applies to the standard floating types only. As a consequence, for example, an
+explicit cast is required for printing a ``_Float16`` value (there is no string
+format specifier for ``_Float16``).
+
 Messages on ``deprecated`` and ``unavailable`` Attributes
 =
 


Index: docs/LanguageExtensions.rst
===
--- docs/LanguageExtensions.rst
+++ docs/LanguageExtensions.rst
@@ -436,6 +436,49 @@
 
 See also :ref:`langext-__builtin_shufflevector`, :ref:`langext-__builtin_convertvector`.
 
+Half-Precision Floating Point
+=
+
+Clang supports two half-precision (16-bit) floating point types: ``__fp16`` and
+``_Float16``. ``__fp16`` is defined in the ARM C Language Extensions (`ACLE
+`_)
+and ``_Float16`` in ISO/IEC TS 18661-3:2015.
+
+``__fp16`` is a storage and interchange format only. This means that values of
+``__fp16`` promote to (at least) float when used in arithmetic operations.
+There are two ``__fp16`` formats. Clang supports the IEEE 754-2008 format and
+not the ARM alternative format.
+
+ISO/IEC TS 18661-3:2015 defines C support for additional floating point types.
+``_FloatN`` is defined as a binary floating type, where the N suffix denotes
+the number of bits and is 16, 32, 64, or greater and equal to 128 and a
+multiple of 32. Clang supports ``_Float16``. The difference from ``__fp16`` is
+that arithmetic on ``_Float16`` is performed in half-precision, thus it is not
+a storage-only format. ``_Float16`` is available as a source language type in
+both C and C++ mode.
+
+It is recommended that portable code use the ``_Float16`` type because
+``__fp16`` is an ARM C-Language Extension (ACLE), whereas ``_Float16`` is
+defined by the C standards committee, so using ``_Float16`` will not prevent
+code from being ported to architectures other than Arm.  Also, ``_Float16``
+arithmetic and operations will directly map on half-precision instructions when
+they are available (e.g. Armv8.2-A), avoiding conversions to/from
+single-precision, and thus will result in more performant code

[PATCH] D39332: [clang-refactor] Introduce "local-qualified-rename" action.

2017-11-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 121266.
hokein marked 3 inline comments as done.
hokein added a comment.

- add USRRenameRule interface.
- fix typos.


https://reviews.llvm.org/D39332

Files:
  include/clang/Tooling/Refactoring/Rename/RenamingAction.h
  lib/Tooling/Refactoring/RefactoringActions.cpp
  lib/Tooling/Refactoring/Rename/RenamingAction.cpp
  test/Refactor/LocalRename/QualifiedRename.cpp
  tools/clang-refactor/ClangRefactor.cpp

Index: tools/clang-refactor/ClangRefactor.cpp
===
--- tools/clang-refactor/ClangRefactor.cpp
+++ tools/clang-refactor/ClangRefactor.cpp
@@ -283,10 +283,10 @@
 
   const RefactoringActionRules &getActionRules() const { return ActionRules; }
 
-  /// Parses the command-line arguments that are specific to this rule.
+  /// Parses the "-selection" command-line argument.
   ///
   /// \returns true on error, false otherwise.
-  bool parseArguments() {
+  bool parseSelectionArgument() {
 if (Selection) {
   ParsedSelection = SourceSelectionArgument::fromString(*Selection);
   if (!ParsedSelection)
@@ -464,20 +464,20 @@
 SmallVector MatchingRules;
 llvm::StringSet<> MissingOptions;
 
-bool HasSelection = false;
 for (const auto &Rule : Subcommand.getActionRules()) {
-  bool SelectionMatches = true;
-  if (Rule->hasSelectionRequirement()) {
-HasSelection = true;
-if (!Subcommand.getSelection()) {
-  MissingOptions.insert("selection");
-  SelectionMatches = false;
-}
-  }
   CommandLineRefactoringOptionVisitor Visitor(Subcommand.getOptions());
   Rule->visitRefactoringOptions(Visitor);
-  if (SelectionMatches && Visitor.getMissingRequiredOptions().empty()) {
-MatchingRules.push_back(Rule.get());
+  if (Visitor.getMissingRequiredOptions().empty()) {
+if (!Rule->hasSelectionRequirement()) {
+  MatchingRules.push_back(Rule.get());
+} else {
+  Subcommand.parseSelectionArgument();
+  if (Subcommand.getSelection()) {
+MatchingRules.push_back(Rule.get());
+  } else {
+MissingOptions.insert("selection");
+  }
+}
 continue;
   }
   for (const RefactoringOption *Opt : Visitor.getMissingRequiredOptions())
@@ -490,6 +490,14 @@
 llvm::errs() << "  missing '-" << Opt.getKey() << "' option\n";
   return true;
 }
+if (MatchingRules.size() > 1) {
+  llvm::errs() << "error: find multiple matched action rules for the given "
+  "arguments\n";
+  return true;
+}
+
+RefactoringActionRule* MatchingRule = MatchingRules[0];
+bool HasSelection = MatchingRule->hasSelectionRequirement();
 
 ClangRefactorConsumer Consumer;
 bool HasFailed = false;
@@ -499,16 +507,7 @@
 
   auto InvokeRule = [&](RefactoringResultConsumer &Consumer) {
 logInvocation(Subcommand, Context);
-for (RefactoringActionRule *Rule : MatchingRules) {
-  if (!Rule->hasSelectionRequirement())
-continue;
-  Rule->invoke(Consumer, Context);
-  return;
-}
-// FIXME (Alex L): If more than one initiation succeeded, then the
-// rules are ambiguous.
-llvm_unreachable(
-"The action must have at least one selection rule");
+MatchingRule->invoke(Consumer, Context);
   };
 
   std::unique_ptr CustomConsumer;
@@ -530,7 +529,8 @@
 ActiveConsumer.endTU();
 return;
   }
-  // FIXME (Alex L): Implement non-selection based invocation path.
+
+  InvokeRule(ActiveConsumer);
   ActiveConsumer.endTU();
 }))
   return true;
@@ -567,8 +567,6 @@
   }
   RefactoringActionSubcommand &ActionCommand = **It;
 
-  if (ActionCommand.parseArguments())
-return 1;
   if (Tool.invokeAction(ActionCommand, Options.getCompilations(),
 Options.getSourcePathList()))
 return 1;
Index: test/Refactor/LocalRename/QualifiedRename.cpp
===
--- /dev/null
+++ test/Refactor/LocalRename/QualifiedRename.cpp
@@ -0,0 +1,24 @@
+// RUN: clang-refactor local-rename -old-qualified-name="foo::A" -new-qualified-name="bar::B" %s -- -std=c++11 2>&1 | grep -v CHECK | FileCheck %s
+
+namespace foo {
+class A {};
+}
+// CHECK: namespace foo {
+// CHECK-NEXT: class B {};
+// CHECK-NEXT: }
+
+namespace bar {
+void f(foo::A* a) {
+  foo::A b;
+}
+// CHECK: void f(B* a) {
+// CHECK-NEXT:   B b;
+// CHECK-NEXT: }
+}
+
+void f(foo::A* a) {
+  foo::A b;
+}
+// CHECK: void f(bar::B* a) {
+// CHECK-NEXT:   bar::B b;
+// CHECK-NEXT: }
Index: lib/Tooling/Refactoring/Rename/RenamingAction.cpp
===
--- lib/Tooling/Refactoring/Rename/RenamingAction.cpp
+++ lib/Tooling/Refactoring/R

[PATCH] D35295: [docs] Add section 'Half-Precision Floating Point'

2017-11-02 Thread Simon Tatham via Phabricator via cfe-commits
simon_tatham accepted this revision.
simon_tatham added a comment.
This revision is now accepted and ready to land.

LGTM now, thanks! (But other reviewers may still want to comment.)


https://reviews.llvm.org/D35295



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


[PATCH] D39332: [clang-refactor] Introduce a new rename rule for qualified symbols

2017-11-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments.



Comment at: lib/Tooling/Refactoring/Rename/RenamingAction.cpp:101
+  std::string NewQualifiedName) {
+  return QualifiedRenameRule(std::move(OldQualifiedName),
+ std::move(NewQualifiedName));

arphaman wrote:
> It might be better to find the declaration (and report error if needed) 
> during in initiation, and then pass the `ND` to the class. Maybe then both 
> `RenameOccurrences` and `QualifiedRenameRule` could subclass from one base 
> class that actually does just this:
> 
> ``` 
> auto USRs = getUSRsForDeclaration(ND, Context.getASTContext());
>   assert(!USRs.empty());
>   return tooling::createRenameAtomicChanges(
>   USRs, NewQualifiedName, 
> Context.getASTContext().getTranslationUnitDecl());
> ```
Done. Introduced a common interface `USRRenameRule`.



Comment at: lib/Tooling/Refactoring/Rename/RenamingAction.cpp:105
+
+const RefactoringDescriptor &QualifiedRenameRuledescribe() {
+  static const RefactoringDescriptor Descriptor = {

jklaehn wrote:
> missing `::`? → `::describe()`
Good Catch!


https://reviews.llvm.org/D39332



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


[PATCH] D39518: [analyzer] do not crash on libcxx03 call_once implementation

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments.



Comment at: lib/Analysis/BodyFarm.cpp:415
 CallbackRecordDecl, CallArgs);
-  } else {
+  } else if (Callback->getType()->isRValueReferenceType()
+  || Callback->getType()->isLValueReferenceType()) {

Wouldn't it be equivalent for checking only 
`callback->getType()->isReferenceType()`?


https://reviews.llvm.org/D39518



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


[PATCH] D39505: [OpenMP] Show error if VLAs are not supported

2017-11-02 Thread Jonas Hahnfeld via Phabricator via cfe-commits
Hahnfeld added inline comments.



Comment at: include/clang/Basic/TargetInfo.h:944
+  /// \brief Whether target supports variable-length arrays.
+  bool isVLASupported() const { return VLASupported; }
+

rjmccall wrote:
> The way you've written this makes it sound like "does the target support 
> VLAs?", but the actual semantic checks treat it as "do OpenMP devices on this 
> target support VLAs?"  Maybe there should be a more specific way to query 
> things about OpenMP devices instead of setting a global flag for the target?
Actually, the NVPTX and SPIR targets never support VLAs. So I felt like it 
would be more correct to make this a global property of the target.

The difference is that the other programming models (OpenCL and CUDA) error out 
immediatelyand regardless of the target because this limitation is reflected in 
the standards that disallow VLAs (see SemaType.cpp). For OpenMP we might have 
target devices that support VLA so we shouldn't error out for those.


https://reviews.llvm.org/D39505



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


[PATCH] D39543: [analyzer] Document the issue hash debugging facility

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision.
Herald added subscribers: szepet, baloghadamsoftware, whisperity.

Add documentation to the recently added issue hash dumping function.


Repository:
  rL LLVM

https://reviews.llvm.org/D39543

Files:
  docs/analyzer/DebugChecks.rst


Index: docs/analyzer/DebugChecks.rst
===
--- docs/analyzer/DebugChecks.rst
+++ docs/analyzer/DebugChecks.rst
@@ -242,6 +242,19 @@
   clang_analyzer_printState(); // Read the stderr!
 }
 
+- ``void clang_analyzer_hashDump(int);``
+
+  The analyzer can generate a hash to identify repots. To debug what 
information
+  is used to calculate this hash it is possible to dump the hashed string to
+  the stderr of an arbitrary expression using the function above.
+
+  Example usage::
+
+void foo() {
+  int x = 1;
+  clang_analyzer_hashDump(x); // Hashed string of x on stderr.
+}
+
 Statistics
 ==
 


Index: docs/analyzer/DebugChecks.rst
===
--- docs/analyzer/DebugChecks.rst
+++ docs/analyzer/DebugChecks.rst
@@ -242,6 +242,19 @@
   clang_analyzer_printState(); // Read the stderr!
 }
 
+- ``void clang_analyzer_hashDump(int);``
+
+  The analyzer can generate a hash to identify repots. To debug what information
+  is used to calculate this hash it is possible to dump the hashed string to
+  the stderr of an arbitrary expression using the function above.
+
+  Example usage::
+
+void foo() {
+  int x = 1;
+  clang_analyzer_hashDump(x); // Hashed string of x on stderr.
+}
+
 Statistics
 ==
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D38844: [analyzer] Make issue hash related tests more concise

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment.

In https://reviews.llvm.org/D38844#911735, @NoQ wrote:

> Hey, i just recalled that we have documentation for `ExprInspection` 
> functions in `docs/analyzer/DebugChecks.rst`, you may want to add your 
> function there as well :)


Indeed, thanks for pointing this out! The patch is up for review: 
https://reviews.llvm.org/D39543


Repository:
  rL LLVM

https://reviews.llvm.org/D38844



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


[PATCH] D39543: [analyzer] Document the issue hash debugging facility

2017-11-02 Thread Johann Klähn via Phabricator via cfe-commits
jklaehn added inline comments.



Comment at: docs/analyzer/DebugChecks.rst:247
+
+  The analyzer can generate a hash to identify repots. To debug what 
information
+  is used to calculate this hash it is possible to dump the hashed string to

typo `reports`?


Repository:
  rL LLVM

https://reviews.llvm.org/D39543



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


r317200 - Fix typo in class annotation

2017-11-02 Thread Jan Korous via cfe-commits
Author: jkorous
Date: Thu Nov  2 05:15:51 2017
New Revision: 317200

URL: http://llvm.org/viewvc/llvm-project?rev=317200&view=rev
Log:
Fix typo in class annotation

Modified:
cfe/trunk/include/clang/AST/NestedNameSpecifier.h

Modified: cfe/trunk/include/clang/AST/NestedNameSpecifier.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/NestedNameSpecifier.h?rev=317200&r1=317199&r2=317200&view=diff
==
--- cfe/trunk/include/clang/AST/NestedNameSpecifier.h (original)
+++ cfe/trunk/include/clang/AST/NestedNameSpecifier.h Thu Nov  2 05:15:51 2017
@@ -35,7 +35,7 @@ class LangOptions;
 /// "\::std::vector::".
 ///
 /// C++ nested name specifiers are the prefixes to qualified
-/// namespaces. For example, "foo::" in "foo::x" is a nested name
+/// names. For example, "foo::" in "foo::x" is a nested name
 /// specifier. Nested name specifiers are made up of a sequence of
 /// specifiers, each of which can be a namespace, type, identifier
 /// (for dependent names), decltype specifier, or the global specifier ('::').


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


[PATCH] D39543: [analyzer] Document the issue hash debugging facility

2017-11-02 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment.

Yup, thanks!




Comment at: docs/analyzer/DebugChecks.rst:255
+  int x = 1;
+  clang_analyzer_hashDump(x); // Hashed string of x on stderr.
+}

Unlike `printState` and like all other functions, your function doesn't dump to 
plain stderr, but generates warnings instead. I didn't want `printState` to 
produce huge warnings because matching them with `expected-warning` would be 
more disgusting than `FileCheck`ing, but that's not your case. So i think you'd 
like to document it similarly to other functions, probably as `// 
expected-warning{{'sample output'}}`.


Repository:
  rL LLVM

https://reviews.llvm.org/D39543



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


r317205 - Fix clang-format CLion integration bug.

2017-11-02 Thread Eric Liu via cfe-commits
Author: ioeric
Date: Thu Nov  2 05:48:48 2017
New Revision: 317205

URL: http://llvm.org/viewvc/llvm-project?rev=317205&view=rev
Log:
Fix clang-format CLion integration bug.

CLion's Sax parser threw this error:

Failed to parse clang-format XML replacements. Input: 

[...]
[org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 66; Open quote is 
expected for attribute "line" associated with an  element type  "replacements".]

Patch by Justine Tunney (j...@google.com)!

Modified:
cfe/trunk/tools/clang-format/ClangFormat.cpp

Modified: cfe/trunk/tools/clang-format/ClangFormat.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/ClangFormat.cpp?rev=317205&r1=317204&r2=317205&view=diff
==
--- cfe/trunk/tools/clang-format/ClangFormat.cpp (original)
+++ cfe/trunk/tools/clang-format/ClangFormat.cpp Thu Nov  2 05:48:48 2017
@@ -289,7 +289,7 @@ static bool format(StringRef FileName) {
   "xml:space='preserve' incomplete_format='"
<< (Status.FormatComplete ? "false" : "true") << "'";
 if (!Status.FormatComplete)
-  outs() << " line=" << Status.Line;
+  outs() << " line='" << Status.Line << "'";
 outs() << ">\n";
 if (Cursor.getNumOccurrences() != 0)
   outs() << ""


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


[PATCH] D39543: [analyzer] Document the issue hash debugging facility

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun updated this revision to Diff 121290.
xazax.hun marked 2 inline comments as done.

https://reviews.llvm.org/D39543

Files:
  docs/analyzer/DebugChecks.rst


Index: docs/analyzer/DebugChecks.rst
===
--- docs/analyzer/DebugChecks.rst
+++ docs/analyzer/DebugChecks.rst
@@ -242,6 +242,19 @@
   clang_analyzer_printState(); // Read the stderr!
 }
 
+- ``void clang_analyzer_hashDump(int);``
+
+  The analyzer can generate a hash to identify reports. To debug what 
information
+  is used to calculate this hash it is possible to dump the hashed string as a
+  warning of an arbitrary expression using the function above.
+
+  Example usage::
+
+void foo() {
+  int x = 1;
+  clang_analyzer_hashDump(x); // expected-warning{{hashed string for x}}
+}
+
 Statistics
 ==
 


Index: docs/analyzer/DebugChecks.rst
===
--- docs/analyzer/DebugChecks.rst
+++ docs/analyzer/DebugChecks.rst
@@ -242,6 +242,19 @@
   clang_analyzer_printState(); // Read the stderr!
 }
 
+- ``void clang_analyzer_hashDump(int);``
+
+  The analyzer can generate a hash to identify reports. To debug what information
+  is used to calculate this hash it is possible to dump the hashed string as a
+  warning of an arbitrary expression using the function above.
+
+  Example usage::
+
+void foo() {
+  int x = 1;
+  clang_analyzer_hashDump(x); // expected-warning{{hashed string for x}}
+}
+
 Statistics
 ==
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D39543: [analyzer] Document the issue hash debugging facility

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments.



Comment at: docs/analyzer/DebugChecks.rst:255
+  int x = 1;
+  clang_analyzer_hashDump(x); // Hashed string of x on stderr.
+}

NoQ wrote:
> Unlike `printState` and like all other functions, your function doesn't dump 
> to plain stderr, but generates warnings instead. I didn't want `printState` 
> to produce huge warnings because matching them with `expected-warning` would 
> be more disgusting than `FileCheck`ing, but that's not your case. So i think 
> you'd like to document it similarly to other functions, probably as `// 
> expected-warning{{'sample output'}}`.
Yeah, sorry for the oversight. :) I wanted to get the documentation part done 
as soon as possible to work on other parts. But it looks like these kinds of 
tasks should have the same level of attention as others. 


https://reviews.llvm.org/D39543



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


[PATCH] D39239: [AST] Incorrectly qualified unscoped enumeration as template actual parameter.

2017-11-02 Thread Tamas Berghammer via Phabricator via cfe-commits
tberghammer added a comment.

In https://reviews.llvm.org/D39239#911696, @CarlosAlbertoEnciso wrote:

> Hi Tamas,
>
> Thanks very much for your message.
>
> In https://reviews.llvm.org/D39239#910797, @tberghammer wrote:
>
> > - Can you do a diff of the debug_info dump before and after your change? 
> > Understanding what have changed should give us a pretty good clue about the 
> > issue.
>
>
> For this specific case, the debug_info is the same before and after my 
> change, as the patch affects only unscoped enums.


If this patch doesn't effect the debug info generated for this specific case 
then my guess is that when LLDB builds the EnumDecl for the scoped enumeration 
it will incorrectly build one for an unscoped enum instead. Looking at the code 
at 
https://github.com/llvm-mirror/lldb/blob/master/source/Symbol/ClangASTContext.cpp#L2170
 we even have a TODO in the LLDB to fix handling for this case. Can you try out 
your patch with https://reviews.llvm.org/D39545 what supposed to fix the 
problem on the LLDB side (haven't tested it at all)?


https://reviews.llvm.org/D39239



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


r317207 - [OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as base

2017-11-02 Thread Jonas Hahnfeld via cfe-commits
Author: hahnfeld
Date: Thu Nov  2 06:30:42 2017
New Revision: 317207

URL: http://llvm.org/viewvc/llvm-project?rev=317207&view=rev
Log:
[OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as base

We can generate constant sized arrays whenever the array section has constant
length, even if the base expression itself is a VLA.

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

Modified:
cfe/trunk/lib/Sema/SemaOpenMP.cpp
cfe/trunk/test/OpenMP/for_reduction_codegen.cpp

Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=317207&r1=317206&r2=317207&view=diff
==
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Thu Nov  2 06:30:42 2017
@@ -9711,7 +9711,7 @@ static bool ActOnOMPReductionKindClause(
 }
 
 if ((OASE && !ConstantLengthOASE) ||
-(!ASE &&
+(!OASE && !ASE &&
  D->getType().getNonReferenceType()->isVariablyModifiedType())) {
   // For arrays/array sections only:
   // Create pseudo array type for private copy. The size for this array 
will

Modified: cfe/trunk/test/OpenMP/for_reduction_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_reduction_codegen.cpp?rev=317207&r1=317206&r2=317207&view=diff
==
--- cfe/trunk/test/OpenMP/for_reduction_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/for_reduction_codegen.cpp Thu Nov  2 06:30:42 2017
@@ -207,6 +207,11 @@ int main() {
 #pragma omp for reduction(+:arr) reduction(&:arrs)
   for (int i = 0; i < 10; ++i)
 ++arr[1][i];
+  // arr is a VLA, but the array section has constant length so we can 
generate a constant sized array!
+#pragma omp parallel
+#pragma omp for reduction(+:arr[1][0:2])
+  for (int i = 0; i < 10; ++i)
+++arr[1][i];
 #pragma omp parallel
 #pragma omp for reduction(& : var2[0 : 5][1 : 6])
   for (int i = 0; i < 10; ++i)
@@ -254,15 +259,16 @@ int main() {
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 6, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
float*, [[S_FLOAT_TY]]*, [[S_FLOAT_TY]]*, float*, [2 x i32]*, [4 x 
[[S_FLOAT_TY]]]*)* [[MAIN_MICROTASK:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 5, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
i64, i64, i32*, [2 x i32]*, [10 x [4 x [[S_FLOAT_TY*)* 
[[MAIN_MICROTASK1:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 4, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
i64, i64, i32*, [10 x [4 x [[S_FLOAT_TY*)* [[MAIN_MICROTASK2:@.+]] to void
-// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
[[S_FLOAT_TY]]***)* [[MAIN_MICROTASK3:@.+]] to void
+// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 3, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
i64, i64, i32*)* [[MAIN_MICROTASK3:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
[[S_FLOAT_TY]]***)* [[MAIN_MICROTASK4:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
[[S_FLOAT_TY]]***)* [[MAIN_MICROTASK5:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
[[S_FLOAT_TY]]***)* [[MAIN_MICROTASK6:@.+]] to void
-// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
[5 x [[S_FLOAT_TY]]]*)* [[MAIN_MICROTASK7:@.+]] to void
-// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void 
(i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, 
[4 

[PATCH] D39504: [OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as base

2017-11-02 Thread Jonas Hahnfeld via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL317207: [OpenMP] Extend "Avoid VLAs for reduction" 
optimization to VLAs as base (authored by Hahnfeld).

Changed prior to commit:
  https://reviews.llvm.org/D39504?vs=121169&id=121297#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39504

Files:
  cfe/trunk/lib/Sema/SemaOpenMP.cpp
  cfe/trunk/test/OpenMP/for_reduction_codegen.cpp

Index: cfe/trunk/lib/Sema/SemaOpenMP.cpp
===
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp
@@ -9711,7 +9711,7 @@
 }
 
 if ((OASE && !ConstantLengthOASE) ||
-(!ASE &&
+(!OASE && !ASE &&
  D->getType().getNonReferenceType()->isVariablyModifiedType())) {
   // For arrays/array sections only:
   // Create pseudo array type for private copy. The size for this array will
Index: cfe/trunk/test/OpenMP/for_reduction_codegen.cpp
===
--- cfe/trunk/test/OpenMP/for_reduction_codegen.cpp
+++ cfe/trunk/test/OpenMP/for_reduction_codegen.cpp
@@ -207,6 +207,11 @@
 #pragma omp for reduction(+:arr) reduction(&:arrs)
   for (int i = 0; i < 10; ++i)
 ++arr[1][i];
+  // arr is a VLA, but the array section has constant length so we can generate a constant sized array!
+#pragma omp parallel
+#pragma omp for reduction(+:arr[1][0:2])
+  for (int i = 0; i < 10; ++i)
+++arr[1][i];
 #pragma omp parallel
 #pragma omp for reduction(& : var2[0 : 5][1 : 6])
   for (int i = 0; i < 10; ++i)
@@ -254,15 +259,16 @@
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 6, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, float*, [[S_FLOAT_TY]]*, [[S_FLOAT_TY]]*, float*, [2 x i32]*, [4 x [[S_FLOAT_TY]]]*)* [[MAIN_MICROTASK:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 5, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, i64, i64, i32*, [2 x i32]*, [10 x [4 x [[S_FLOAT_TY*)* [[MAIN_MICROTASK1:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 4, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, i64, i64, i32*, [10 x [4 x [[S_FLOAT_TY*)* [[MAIN_MICROTASK2:@.+]] to void
-// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[S_FLOAT_TY]]***)* [[MAIN_MICROTASK3:@.+]] to void
+// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 3, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, i64, i64, i32*)* [[MAIN_MICROTASK3:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[S_FLOAT_TY]]***)* [[MAIN_MICROTASK4:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[S_FLOAT_TY]]***)* [[MAIN_MICROTASK5:@.+]] to void
 // CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[S_FLOAT_TY]]***)* [[MAIN_MICROTASK6:@.+]] to void
-// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [5 x [[S_FLOAT_TY]]]*)* [[MAIN_MICROTASK7:@.+]] to void
-// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [4 x [[S_FLOAT_TY]]]*)* [[MAIN_MICROTASK8:@.+]] to void
+// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bitcast (void (i{{[0-9]+}}*, i{{[0-9]+}}*, [[S_FLOAT_TY]]***)* [[MAIN_MICROTASK7:@.+]] to void
+// CHECK: call void (%{{.+}}*, i{{[0-9]+}}, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)*, ...) @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{[0-9]+}} 1, void (i{{[0-9]+}}*, i{{[0-9]+}}*, ...)* bit

Patch to fix Format's FixNamespaceComments for Objective-C++ files

2017-11-02 Thread Vasyl Smyrnov via cfe-commits
Hi,

I’ve noticed that clang-format does not respect the "FixNamespaceComments: 
true” option if an Objective-C++ file is formatted by feeding a .mm file to 
clang-format, however the option is respected with the same source code 
supplied via stdin.

The attached patch fixes the problem (based on revision 317195).

Thanks for your consideration.



patch.diff
Description: Binary data
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


(Take 2) Patch to fix Format's FixNamespaceComments for Objective-C++ files

2017-11-02 Thread Vasyl Smyrnov via cfe-commits
(Take 2, with the correct patch.diff - originally used "svn st" instead of “svn 
diff")

Hi,

I’ve noticed that clang-format does not respect the "FixNamespaceComments: 
true” option if an Objective-C++ file is formatted by feeding a .mm file to 
clang-format, however the option is respected with the same source code 
supplied via stdin.

The attached patch fixes the problem (based on revision 317195).

Thanks for your consideration.



patch.diff
Description: Binary data
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r317208 - [OPENMP] Fix PR35156: Get correct thread id with windows exceptions.

2017-11-02 Thread Alexey Bataev via cfe-commits
Author: abataev
Date: Thu Nov  2 07:25:34 2017
New Revision: 317208

URL: http://llvm.org/viewvc/llvm-project?rev=317208&view=rev
Log:
[OPENMP] Fix PR35156: Get correct thread id with windows exceptions.

If the thread id is requested in windows mode within funclets, we may
generate incorrect function call that could lead to broken codegen.

Added:
cfe/trunk/test/OpenMP/openmp_win_codegen.cpp
Modified:
cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
cfe/trunk/test/OpenMP/critical_codegen.cpp
cfe/trunk/test/OpenMP/for_codegen.cpp
cfe/trunk/test/OpenMP/for_simd_codegen.cpp
cfe/trunk/test/OpenMP/master_codegen.cpp
cfe/trunk/test/OpenMP/parallel_for_codegen.cpp
cfe/trunk/test/OpenMP/parallel_for_simd_codegen.cpp
cfe/trunk/test/OpenMP/parallel_sections_codegen.cpp
cfe/trunk/test/OpenMP/sections_codegen.cpp
cfe/trunk/test/OpenMP/single_codegen.cpp
cfe/trunk/test/OpenMP/taskgroup_codegen.cpp

Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=317208&r1=317207&r2=317208&view=diff
==
--- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Thu Nov  2 07:25:34 2017
@@ -1451,7 +1451,8 @@ llvm::Value *CGOpenMPRuntime::getThreadI
   return ThreadID;
   }
   // If exceptions are enabled, do not use parameter to avoid possible crash.
-  if (!CGF.getInvokeDest()) {
+  if (!CGF.getInvokeDest() ||
+  CGF.Builder.GetInsertBlock() == CGF.AllocaInsertPt->getParent()) {
 if (auto *OMPRegionInfo =
 dyn_cast_or_null(CGF.CapturedStmtInfo)) {
   if (OMPRegionInfo->getThreadIDVariable()) {
@@ -1475,12 +1476,13 @@ llvm::Value *CGOpenMPRuntime::getThreadI
   // function.
   CGBuilderTy::InsertPointGuard IPG(CGF.Builder);
   CGF.Builder.SetInsertPoint(CGF.AllocaInsertPt);
-  ThreadID =
-  
CGF.EmitRuntimeCall(createRuntimeFunction(OMPRTL__kmpc_global_thread_num),
-  emitUpdateLocation(CGF, Loc));
+  auto *Call = CGF.Builder.CreateCall(
+  createRuntimeFunction(OMPRTL__kmpc_global_thread_num),
+  emitUpdateLocation(CGF, Loc));
+  Call->setCallingConv(CGF.getRuntimeCC());
   auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct(CGF.CurFn);
-  Elem.second.ThreadID = ThreadID;
-  return ThreadID;
+  Elem.second.ThreadID = Call;
+  return Call;
 }
 
 void CGOpenMPRuntime::functionFinished(CodeGenFunction &CGF) {

Modified: cfe/trunk/test/OpenMP/critical_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/critical_codegen.cpp?rev=317208&r1=317207&r2=317208&view=diff
==
--- cfe/trunk/test/OpenMP/critical_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/critical_codegen.cpp Thu Nov  2 07:25:34 2017
@@ -78,7 +78,7 @@ void critical_ref(S &s) {
 void parallel_critical() {
 #pragma omp parallel
 #pragma omp critical
-  // TERM_DEBUG: __kmpc_global_thread_num
+  // TERM_DEBUG-NOT: __kmpc_global_thread_num
   // TERM_DEBUG: call void @__kmpc_critical({{.+}}), !dbg 
[[DBG_LOC_START:![0-9]+]]
   // TERM_DEBUG: invoke void {{.*}}foo{{.*}}()
   // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],

Modified: cfe/trunk/test/OpenMP/for_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_codegen.cpp?rev=317208&r1=317207&r2=317208&view=diff
==
--- cfe/trunk/test/OpenMP/for_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/for_codegen.cpp Thu Nov  2 07:25:34 2017
@@ -355,7 +355,7 @@ int foo() {return 0;};
 void parallel_for(float *a) {
 #pragma omp parallel
 #pragma omp for schedule(static, 5)
-  // TERM_DEBUG: __kmpc_global_thread_num
+  // TERM_DEBUG-NOT: __kmpc_global_thread_num
   // TERM_DEBUG: call void @__kmpc_for_static_init_4u({{.+}}), !dbg 
[[DBG_LOC_START:![0-9]+]]
   // TERM_DEBUG: invoke i32 {{.*}}foo{{.*}}()
   // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],

Modified: cfe/trunk/test/OpenMP/for_simd_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_simd_codegen.cpp?rev=317208&r1=317207&r2=317208&view=diff
==
--- cfe/trunk/test/OpenMP/for_simd_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/for_simd_codegen.cpp Thu Nov  2 07:25:34 2017
@@ -673,7 +673,7 @@ int bar() {return 0;};
 void parallel_simd(float *a) {
 #pragma omp parallel
 #pragma omp for simd
-  // TERM_DEBUG: __kmpc_global_thread_num
+  // TERM_DEBUG-NOT: __kmpc_global_thread_num
   // TERM_DEBUG: invoke i32 {{.*}}bar{{.*}}()
   // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],
   // TERM_DEBUG-NOT: __kmpc_global_thread_num

Modified: cfe/trunk/test/OpenMP/master_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/ma

[PATCH] D39551: [analyzer] Make __builtin_debugtrap() a sink

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun created this revision.
Herald added subscribers: szepet, baloghadamsoftware, whisperity.

For some reason, `__builtin_debugtrap` is not a sink for the analyzer. I also 
added some test cases to demonstrate that `__builtin_trap` and 
`__builtin_unreachable` are handled properly. The former is not marked as 
noreturn while the last two are. See Builtins.def for details. It was made 
non-noreturn deliberately, see https://reviews.llvm.org/rL166345
I have however no idea why.


https://reviews.llvm.org/D39551

Files:
  lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
  test/Analysis/builtin-functions.cpp


Index: test/Analysis/builtin-functions.cpp
===
--- test/Analysis/builtin-functions.cpp
+++ test/Analysis/builtin-functions.cpp
@@ -63,4 +63,18 @@
 clang_analyzer_warnIfReached(); // Assumtion contradicts constraints.
 // We give up the analysis on this path.
   }
+  switch (i) {
+  case 1:
+__builtin_unreachable();
+clang_analyzer_warnIfReached();
+break;
+  case 2:
+__builtin_trap();
+clang_analyzer_warnIfReached();
+break;
+  case 3:
+__builtin_debugtrap();
+clang_analyzer_warnIfReached();
+break;
+  }
 }
Index: lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
===
--- lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
+++ lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
@@ -41,6 +41,10 @@
   default:
 return false;
 
+  case Builtin::BI__builtin_debugtrap:
+C.generateSink(C.getState(), C.getPredecessor());
+return true;
+
   case Builtin::BI__builtin_assume: {
 assert (CE->arg_begin() != CE->arg_end());
 SVal ArgSVal = state->getSVal(CE->getArg(0), LCtx);


Index: test/Analysis/builtin-functions.cpp
===
--- test/Analysis/builtin-functions.cpp
+++ test/Analysis/builtin-functions.cpp
@@ -63,4 +63,18 @@
 clang_analyzer_warnIfReached(); // Assumtion contradicts constraints.
 // We give up the analysis on this path.
   }
+  switch (i) {
+  case 1:
+__builtin_unreachable();
+clang_analyzer_warnIfReached();
+break;
+  case 2:
+__builtin_trap();
+clang_analyzer_warnIfReached();
+break;
+  case 3:
+__builtin_debugtrap();
+clang_analyzer_warnIfReached();
+break;
+  }
 }
Index: lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
===
--- lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
+++ lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
@@ -41,6 +41,10 @@
   default:
 return false;
 
+  case Builtin::BI__builtin_debugtrap:
+C.generateSink(C.getState(), C.getPredecessor());
+return true;
+
   case Builtin::BI__builtin_assume: {
 assert (CE->arg_begin() != CE->arg_end());
 SVal ArgSVal = state->getSVal(CE->getArg(0), LCtx);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r317209 - Mark Endian as 'in progress'

2017-11-02 Thread Marshall Clow via cfe-commits
Author: marshall
Date: Thu Nov  2 07:53:08 2017
New Revision: 317209

URL: http://llvm.org/viewvc/llvm-project?rev=317209&view=rev
Log:
Mark Endian as 'in progress'

Modified:
libcxx/trunk/www/cxx2a_status.html

Modified: libcxx/trunk/www/cxx2a_status.html
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/cxx2a_status.html?rev=317209&r1=317208&r2=317209&view=diff
==
--- libcxx/trunk/www/cxx2a_status.html (original)
+++ libcxx/trunk/www/cxx2a_status.html Thu Nov  2 07:53:08 2017
@@ -54,7 +54,7 @@
 
-   https://wg21.link/P0463R1";>P0463R1LWGEndian just 
EndianToronto
+   https://wg21.link/P0463R1";>P0463R1LWGEndian just 
EndianTorontoIn progress
https://wg21.link/P0674R1";>P0674R1LWGExtending 
make_shared to Support ArraysToronto
 
 


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


[PATCH] D38362: Mark tests as unsupported in C++98 as well

2017-11-02 Thread Marshall Clow via Phabricator via cfe-commits
mclow.lists accepted this revision.
mclow.lists added a comment.
This revision is now accepted and ready to land.

LGTM


https://reviews.llvm.org/D38362



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


[PATCH] D39551: [analyzer] Make __builtin_debugtrap() a sink

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment.

In the meantime, I found this discussion: 
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20121015/153735.html
It looks like the reasoning behind this intrinsic not being noreturn is that 
the user might continue the execution in the debugger.
I think the main reason behind not marking this noreturn is to not allow the 
optimizer to remove code based on the usage of this builtin and thus prohibit 
debugging certain part of the code.
But it still might make sense to treat this builtin as a sink in the analyzer. 
What do you think?


https://reviews.llvm.org/D39551



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


[PATCH] D38362: Mark tests as unsupported in C++98 as well

2017-11-02 Thread Roger Ferrer Ibanez via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL317210: Mark tests as unsupported in C++98 as well (authored 
by rogfer01).

Changed prior to commit:
  https://reviews.llvm.org/D38362?vs=118005&id=121310#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38362

Files:
  libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
  libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp


Index: libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp
===
--- libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp
+++ libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp
@@ -9,7 +9,7 @@
 
 // 
 // UNSUPPORTED: libcpp-no-exceptions
-// UNSUPPORTED: c++03
+// UNSUPPORTED: c++98, c++03
 
 // template 
 // bool
Index: libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
===
--- libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
+++ libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
@@ -9,7 +9,7 @@
 
 // 
 // UNSUPPORTED: libcpp-no-exceptions
-// UNSUPPORTED: c++03
+// UNSUPPORTED: c++98, c++03
 
 // template 
 // bool


Index: libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp
===
--- libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp
+++ libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp
@@ -9,7 +9,7 @@
 
 // 
 // UNSUPPORTED: libcpp-no-exceptions
-// UNSUPPORTED: c++03
+// UNSUPPORTED: c++98, c++03
 
 // template 
 // bool
Index: libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
===
--- libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
+++ libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
@@ -9,7 +9,7 @@
 
 // 
 // UNSUPPORTED: libcpp-no-exceptions
-// UNSUPPORTED: c++03
+// UNSUPPORTED: c++98, c++03
 
 // template 
 // bool
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r317210 - Mark tests as unsupported in C++98 as well

2017-11-02 Thread Roger Ferrer Ibanez via cfe-commits
Author: rogfer01
Date: Thu Nov  2 08:01:43 2017
New Revision: 317210

URL: http://llvm.org/viewvc/llvm-project?rev=317210&view=rev
Log:
Mark tests as unsupported in C++98 as well

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


Modified:
libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp

Modified: libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp?rev=317210&r1=317209&r2=317210&view=diff
==
--- libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.match/exponential.pass.cpp Thu Nov  
2 08:01:43 2017
@@ -9,7 +9,7 @@
 
 // 
 // UNSUPPORTED: libcpp-no-exceptions
-// UNSUPPORTED: c++03
+// UNSUPPORTED: c++98, c++03
 
 // template 
 // bool

Modified: libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp?rev=317210&r1=317209&r2=317210&view=diff
==
--- libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp 
(original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.search/exponential.pass.cpp Thu Nov  
2 08:01:43 2017
@@ -9,7 +9,7 @@
 
 // 
 // UNSUPPORTED: libcpp-no-exceptions
-// UNSUPPORTED: c++03
+// UNSUPPORTED: c++98, c++03
 
 // template 
 // bool


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


[PATCH] D38362: Mark tests as unsupported in C++98 as well

2017-11-02 Thread Roger Ferrer Ibanez via Phabricator via cfe-commits
rogfer01 added a comment.

Thank you @mclow.lists !


Repository:
  rL LLVM

https://reviews.llvm.org/D38362



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


[libcxx] r317212 - Change a bunch of comments from C++1z to C++17. NFC

2017-11-02 Thread Marshall Clow via cfe-commits
Author: marshall
Date: Thu Nov  2 08:03:25 2017
New Revision: 317212

URL: http://llvm.org/viewvc/llvm-project?rev=317212&view=rev
Log:
Change a bunch of comments from C++1z to C++17. NFC

Modified:
libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.cxx1z.fail.cpp

libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.cxx1z.fail.cpp

Modified: libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp?rev=317212&r1=317211&r2=317212&view=diff
==
--- libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/selftest/test_macros.pass.cpp Thu Nov  2 08:03:25 
2017
@@ -56,7 +56,7 @@ void test_libcxx_macros()
 # endif
 #endif
 
-//  = C++1z features =
+//  = C++17 features =
 }
 
 int main()

Modified: 
libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp?rev=317212&r1=317211&r2=317212&view=diff
==
--- 
libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp
 (original)
+++ 
libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp
 Thu Nov  2 08:03:25 2017
@@ -12,7 +12,7 @@
 // template
 //   const_mem_fun_t
 //   mem_fun(S (T::*f)() const);
-// Removed in c++1z
+// Removed in c++17
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
 #include 

Modified: 
libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp?rev=317212&r1=317211&r2=317212&view=diff
==
--- 
libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp
 (original)
+++ 
libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp
 Thu Nov  2 08:03:25 2017
@@ -12,7 +12,7 @@
 // template
 //   const_mem_fun1_t
 //   mem_fun(S (T::*f)(A) const);
-// Removed in c++1z
+// Removed in c++17
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
 #include 

Modified: 
libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.fail.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.fail.cpp?rev=317212&r1=317211&r2=317212&view

[PATCH] D35068: [analyzer] Detect usages of unsafe I/O functions

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments.



Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:382
+DescFile<"CheckSecuritySyntaxOnly.cpp">;
+  def DeprecatedBufferHandling : Checker<"DeprecatedBufferHandling">,
+HelpText<"Warn on uses of deprecated buffer manipulating functions">,

I do not like the naming of these two checks, It feels like one of them warns 
for a subset of the other, however, it is not the case.
What about removing the "deprecated" part from the first check? 



Comment at: lib/Driver/ToolChains/Clang.cpp:2256
+  
CmdArgs.push_back("-analyzer-checker=security.insecureAPI.DeprecatedOrUnsafeBufferHandling");
+  
CmdArgs.push_back("-analyzer-checker=security.insecureAPI.DeprecatedBufferHandling");
 }

Do we want to turn on both of these by default? Warning on every use of 
`memset` will be very noisy for example. 



Comment at: lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp:597-598
+
+  if(!BR.getContext().getLangOpts().C11)
+return;
+

koldaniel wrote:
> NoQ wrote:
> > Note that you cannot easily figure out if the code is intended to get 
> > compiled only under C11 and above - maybe it's accidentally compiled under 
> > C11 for this user, but is otherwise intended to keep working under older 
> > standards.
> It is a possible scenario, how should I check if the checks should warn (safe 
> functions are available) if not by using this method?
This is the same approach some check takes in clang tidy. I think it is still 
better to not warn for non C11 users than warn for everybody. If a project is 
not interested in this check but they are interested in having C11 builds, they 
can turn this check off. (Or it can be off by default in the first place).



Comment at: lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp:147
+.Case("sprintf", &WalkAST::checkDeprecatedOrUnsafeBufferHandling)
+.Case("vsprintf", &WalkAST::checkDeprecatedOrUnsafeBufferHandling)
+.Case("scanf", &WalkAST::checkDeprecatedOrUnsafeBufferHandling)

This is the only print-related function in this group. Is this intended? 


https://reviews.llvm.org/D35068



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


[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments.



Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:41
+static const llvm::StringSet<> KnownBannedMacroNames = {"EAGAIN", 
"EWOULDBLOCK",
+  "SIGCLD", "SIGCHLD"};
 

Is this block clang formatted? The indentation of the second line looks 
strange. 


https://reviews.llvm.org/D38688



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


[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-02 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 121323.
barancsuk added a comment.

Fix shifted line


https://reviews.llvm.org/D38688

Files:
  clang-tidy/misc/RedundantExpressionCheck.cpp
  clang-tidy/misc/RedundantExpressionCheck.h
  docs/clang-tidy/checks/misc-redundant-expression.rst
  test/clang-tidy/misc-redundant-expression.cpp

Index: test/clang-tidy/misc-redundant-expression.cpp
===
--- test/clang-tidy/misc-redundant-expression.cpp
+++ test/clang-tidy/misc-redundant-expression.cpp
@@ -15,69 +15,71 @@
 extern int bar(int x);
 extern int bat(int x, int y);
 
-int Test(int X, int Y) {
+int TestSimpleEquivalent(int X, int Y) {
   if (X - X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent [misc-redundant-expression]
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent [misc-redundant-expression]
   if (X / X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
   if (X % X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
 
   if (X & X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
   if (X | X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
   if (X ^ X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
 
   if (X < X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
   if (X <= X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
   if (X > X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
   if (X >= X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
 
   if (X && X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
   if (X || X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
 
   if (X != (((X return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: both sides of operator are equivalent
 
   if (X + 1 == X + 1) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: both sides of operator are equivalent
   if (X + 1 != X + 1) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: both sides of operator are equivalent
   if (X + 1 <= X + 1) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: both sides of operator are equivalent
   if (X + 1 >= X + 1) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: both sides of operator are equivalent
 
   if ((X != 1 || Y != 1) && (X != 1 || Y != 1)) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: both sides of operator are equivalent
   if (P.a[X - P.x] != P.a[X - P.x]) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: both sides of operator are equivalent
 
   if ((int)X < (int)X) return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: both side of operator are equivalent
+  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: both sides of operator are equivalent
+  if (int(X) < int(X)) return 1;
+  // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: both sides of operator are equivalent
 
   if ( + "dummy" == + "dummy") return 1;
-  // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: both side of operator are equiv

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-02 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments.



Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:41
+static const llvm::StringSet<> KnownBannedMacroNames = {"EAGAIN", 
"EWOULDBLOCK",
+  "SIGCLD", "SIGCHLD"};
 

xazax.hun wrote:
> Is this block clang formatted? The indentation of the second line looks 
> strange. 
It was, but the second line shifted somehow. I fixed it in the updated diff.


https://reviews.llvm.org/D38688



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


[PATCH] D39114: [XRay] Initial XRay in Darwin Support

2017-11-02 Thread Kuba (Brecka) Mracek via Phabricator via cfe-commits
kubamracek accepted this revision.
kubamracek added a comment.
This revision is now accepted and ready to land.

Hi and sorry for replying so late! All of the changes LGTM with a few nits.

> Assembly for Darwin x86_64 and how we avoid the ELF'isms (do we need to 
> implement darwin-specific assembly for MachO?)

This should be actually easily solvable by `#include`'ing 
sanitizer_common/sanitizer_asm.h and then using the macros from there (perhaps 
introducing some new macros or generalizing the existing ones). Take a look at 
what was done in lib/tsan/rtl/tsan_rtl_amd64.S. Names of symbols should use a 
macro like `ASM_SYMBOL` which will add an underscore on macOS. `.type` 
directives should use `ASM_TYPE_FUNCTION`. And so on. It should be possible to 
reuse almost all of the assembly instructions unchanged. I think I have an ugly 
old patch for this somewhere, I can send it to you if you want.

> Syscalls, testing, etc. -- whether we need to do anything special here for 
> making it work on macOS.

We should try to move most of the tests in the Linux directory to a common 
tests directory. I don't see anything particularly Linux-y there.

Regarding syscalls, I'm not sure I understand the problem. Is XRay doing any 
syscall interception or something like that?




Comment at: compiler-rt/cmake/config-ix.cmake:419-425
+  # For XRay, only support x86_64 in APPLE.
+  # list_intersect(XRAY_SUPPORTED_ARCH
+  #   ALL_XRAY_SUPPORTED_ARCH
+  #   SANITIZER_COMMON_SUPPORTED_ARCH)
+  set(XRAY_SUPPORTED_ARCH ${X86_64})
+
+

Instead of this change, please do something similar like we do for 
`ALL_LSAN_SUPPORTED_ARCH` above (line 200).



Comment at: compiler-rt/lib/xray/CMakeLists.txt:82
+  add_compiler_rt_runtime(clang_rt.xray
+STATIC
+OS osx

`STATIC` is okay for now, but we have much better experience with dynamic 
libraries for runtimes. Is there some reason to use a static library?



Comment at: compiler-rt/test/xray/TestCases/Darwin/always-never-instrument.cc:12
+// RUN:FileCheck %s --check-prefix ALWAYSINSTR
+// REQUIRES: x86_64-linux
+// REQUIRES: built-in-llvm-tree

Should this `REQUIRES` be here?

Similarly, in all the tests in the `Linux/` directory, we should change 
`REQUIRES: x86_64-linux` to just `REQUIRES: x86_64`.


https://reviews.llvm.org/D39114



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


[PATCH] D39114: [XRay] Initial XRay in Darwin Support

2017-11-02 Thread Kuba (Brecka) Mracek via Phabricator via cfe-commits
kubamracek added a comment.

Also, please make sure this builds and tests pass before actually landing this 
patch. FYI, there are bots that run on older macOS versions (10.11 for sure, 
probably even older).


https://reviews.llvm.org/D39114



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


[PATCH] D39332: [clang-refactor] Introduce a new rename rule for qualified symbols

2017-11-02 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments.



Comment at: lib/Tooling/Refactoring/Rename/RenamingAction.cpp:101
+  std::string NewQualifiedName) {
+  return QualifiedRenameRule(std::move(OldQualifiedName),
+ std::move(NewQualifiedName));

hokein wrote:
> arphaman wrote:
> > It might be better to find the declaration (and report error if needed) 
> > during in initiation, and then pass the `ND` to the class. Maybe then both 
> > `RenameOccurrences` and `QualifiedRenameRule` could subclass from one base 
> > class that actually does just this:
> > 
> > ``` 
> > auto USRs = getUSRsForDeclaration(ND, Context.getASTContext());
> >   assert(!USRs.empty());
> >   return tooling::createRenameAtomicChanges(
> >   USRs, NewQualifiedName, 
> > Context.getASTContext().getTranslationUnitDecl());
> > ```
> Done. Introduced a common interface `USRRenameRule`.
`USRRenameRule` doesn't seem to be a very useful abstraction. I think what Alex 
proposed is a base class that implements `createSourceReplacements` which could 
be shared by both `RenameOccurrences` and `QualifiedRenameRule`. Intuitively, 
un-qualified rename is a special case of qualified rename (maybe?), where 
namespace is not changed.



Comment at: lib/Tooling/Refactoring/Rename/RenamingAction.cpp:115
+  /*Description=*/
+  "Finds and renames qualified symbols in code with no indexer support",
+  };

We should also document the behavior when namespace is changed. What would 
happen to symbol definitions and symbol references?


https://reviews.llvm.org/D39332



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


r317216 - Fix comment typo

2017-11-02 Thread Jan Korous via cfe-commits
Author: jkorous
Date: Thu Nov  2 09:37:00 2017
New Revision: 317216

URL: http://llvm.org/viewvc/llvm-project?rev=317216&view=rev
Log:
Fix comment typo

Modified:
cfe/trunk/lib/Parse/ParseExprCXX.cpp

Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=317216&r1=317215&r2=317216&view=diff
==
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Thu Nov  2 09:37:00 2017
@@ -249,7 +249,7 @@ bool Parser::ParseOptionalCXXScopeSpecif
 
   if (Tok.is(tok::code_completion)) {
 // Code completion for a nested-name-specifier, where the code
-// code completion token follows the '::'.
+// completion token follows the '::'.
 Actions.CodeCompleteQualifiedId(getCurScope(), SS, EnteringContext);
 // Include code completion token into the range of the scope otherwise
 // when we try to annotate the scope tokens the dangling code 
completion


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


r317220 - [CodeGen] add builtin attr tests to show errno-related diffs; NFC

2017-11-02 Thread Sanjay Patel via cfe-commits
Author: spatel
Date: Thu Nov  2 10:06:05 2017
New Revision: 317220

URL: http://llvm.org/viewvc/llvm-project?rev=317220&view=rev
Log:
[CodeGen] add builtin attr tests to show errno-related diffs; NFC

Added:
cfe/trunk/test/CodeGen/builtin-errno.c

Added: cfe/trunk/test/CodeGen/builtin-errno.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtin-errno.c?rev=317220&view=auto
==
--- cfe/trunk/test/CodeGen/builtin-errno.c (added)
+++ cfe/trunk/test/CodeGen/builtin-errno.c Thu Nov  2 10:06:05 2017
@@ -0,0 +1,777 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -S -o - -emit-llvm
  %s | FileCheck %s -check-prefix=NO__ERRNO
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -S -o - -emit-llvm 
-fmath-errno %s | FileCheck %s -check-prefix=HAS_ERRNO
+
+// Test math, complex, and other builtin attributes to see how errno affects 
the resulting codegen. 
+
+
+double *d;
+float f;
+float *fp;
+long double *l;
+int *i;
+const char *c;
+
+void foo() {
+  __builtin_abs(f);   __builtin_labs(f);  __builtin_llabs(f);
+
+// NO__ERRNO-NOT: .abs
+// NO__ERRNO-NOT: .labs
+// NO__ERRNO-NOT: .llabs
+// NO__ERRNO-NOT: @abs
+// NO__ERRNO-NOT: @labs
+// NO__ERRNO-NOT: @llabs
+// HAS_ERRNO-NOT: .abs
+// HAS_ERRNO-NOT: .labs
+// HAS_ERRNO-NOT: .llabs
+// HAS_ERRNO-NOT: @abs
+// HAS_ERRNO-NOT: @labs
+// HAS_ERRNO-NOT: @llabs
+
+  __builtin_atan2(f,f);__builtin_atan2f(f,f) ;  __builtin_atan2l(f, f);
+
+// NO__ERRNO: declare double @atan2(double, double) [[READNONE:#[0-9]+]]
+// NO__ERRNO: declare float @atan2f(float, float) [[READNONE]]
+// NO__ERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[READNONE]]
+// HAS_ERRNO: declare double @atan2(double, double) [[READNONE:#[0-9]+]]
+// HAS_ERRNO: declare float @atan2f(float, float) [[READNONE]]
+// HAS_ERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[READNONE]]
+
+  __builtin_copysign(f,f); __builtin_copysignf(f,f);__builtin_copysignl(f,f);
+
+// NO__ERRNO: declare double @llvm.copysign.f64(double, double) 
[[READNONE_INTRINSIC:#[0-9]+]]
+// NO__ERRNO: declare float @llvm.copysign.f32(float, float) 
[[READNONE_INTRINSIC]]
+// NO__ERRNO: declare x86_fp80 @llvm.copysign.f80(x86_fp80, x86_fp80) 
[[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare double @llvm.copysign.f64(double, double) 
[[READNONE_INTRINSIC:#[0-9]+]]
+// HAS_ERRNO: declare float @llvm.copysign.f32(float, float) 
[[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare x86_fp80 @llvm.copysign.f80(x86_fp80, x86_fp80) 
[[READNONE_INTRINSIC]]
+
+  __builtin_fabs(f);   __builtin_fabsf(f);  __builtin_fabsl(f);
+
+// NO__ERRNO: declare double @llvm.fabs.f64(double) [[READNONE_INTRINSIC]]
+// NO__ERRNO: declare float @llvm.fabs.f32(float) [[READNONE_INTRINSIC]]
+// NO__ERRNO: declare x86_fp80 @llvm.fabs.f80(x86_fp80) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare double @llvm.fabs.f64(double) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare float @llvm.fabs.f32(float) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare x86_fp80 @llvm.fabs.f80(x86_fp80) [[READNONE_INTRINSIC]]
+
+  __builtin_fmod(f,f); __builtin_fmodf(f,f);__builtin_fmodl(f,f);
+
+// NO__ERRNO-NOT: .fmod
+// NO__ERRNO-NOT: @fmod
+// HAS_ERRNO-NOT: .fmod
+// HAS_ERRNO-NOT: @fmod
+
+  __builtin_frexp(f,i);__builtin_frexpf(f,i);   __builtin_frexpl(f,i);
+
+// NO__ERRNO: declare double @frexp(double, i32*) [[NOT_READNONE:#[0-9]+]]
+// NO__ERRNO: declare float @frexpf(float, i32*) [[NOT_READNONE]]
+// NO__ERRNO: declare x86_fp80 @frexpl(x86_fp80, i32*) [[NOT_READNONE]]
+// HAS_ERRNO: declare double @frexp(double, i32*) [[NOT_READNONE:#[0-9]+]]
+// HAS_ERRNO: declare float @frexpf(float, i32*) [[NOT_READNONE]]
+// HAS_ERRNO: declare x86_fp80 @frexpl(x86_fp80, i32*) [[NOT_READNONE]]
+
+  __builtin_huge_val();__builtin_huge_valf();   __builtin_huge_vall();
+
+// NO__ERRNO-NOT: .huge
+// NO__ERRNO-NOT: @huge
+// HAS_ERRNO-NOT: .huge
+// HAS_ERRNO-NOT: @huge
+
+  __builtin_inf();__builtin_inff();   __builtin_infl();
+
+// NO__ERRNO-NOT: .inf
+// NO__ERRNO-NOT: @inf
+// HAS_ERRNO-NOT: .inf
+// HAS_ERRNO-NOT: @inf
+
+  __builtin_ldexp(f,f);__builtin_ldexpf(f,f);   __builtin_ldexpl(f,f);  
+
+// NO__ERRNO: declare double @ldexp(double, i32) [[READNONE]]
+// NO__ERRNO: declare float @ldexpf(float, i32) [[READNONE]]
+// NO__ERRNO: declare x86_fp80 @ldexpl(x86_fp80, i32) [[READNONE]]
+// HAS_ERRNO: declare double @ldexp(double, i32) [[READNONE]]
+// HAS_ERRNO: declare float @ldexpf(float, i32) [[READNONE]]
+// HAS_ERRNO: declare x86_fp80 @ldexpl(x86_fp80, i32) [[READNONE]]
+
+  __builtin_modf(f,d);   __builtin_modff(f,fp);  __builtin_modfl(f,l); 
+
+// NO__ERRNO: declare double @modf(double, double*) [[NOT_READNONE]]
+// NO__ERRNO: declare float @modff(float, float*) [[NOT_READNONE]]
+// NO__ERRNO: declare x86_fp80 @modfl(x86_fp80, x86_fp80*) [[NOT_READNONE]]
+// HAS_ERRNO: declare double @modf(double, double*) [[NOT_READNONE]]
+/

[PATCH] D39481: [CodeGen] fix const-ness of builtin equivalents of and functions that might set errno

2017-11-02 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment.

There's an oddity with fma. The version without __builtin has 'e' already

  LIBBUILTIN(fma, "", "fne", "math.h", ALL_LANGUAGES)
  LIBBUILTIN(fmaf, "", "fne", "math.h", ALL_LANGUAGES)
  LIBBUILTIN(fmal, "LdLdLdLd", "fne", "math.h", ALL_LANGUAGES)

But we don't check the const attribute in CGBuiltin.cpp before converting it to 
an intrinsic

  case Builtin::BIfma:
  case Builtin::BIfmaf:
  case Builtin::BIfmal:
  case Builtin::BI__builtin_fma:
  case Builtin::BI__builtin_fmaf:
  case Builtin::BI__builtin_fmal: {
// Rewrite fma to intrinsic.
Value *FirstArg = EmitScalarExpr(E->getArg(0));
llvm::Type *ArgType = FirstArg->getType();
Value *F = CGM.getIntrinsic(Intrinsic::fma, ArgType);
return RValue::get(
Builder.CreateCall(F, {FirstArg, EmitScalarExpr(E->getArg(1)),
   EmitScalarExpr(E->getArg(2))}));
  }


https://reviews.llvm.org/D39481



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


[PATCH] D39549: [clang-format] Sort using-declarations case sensitively with a special case for '_'

2017-11-02 Thread Benjamin Kramer via Phabricator via cfe-commits
bkramer added a comment.

Can we just write out the modified string comparison function instead of 
keeping both versions of the string around in memory? I'd prefer less state.


https://reviews.llvm.org/D39549



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


[PATCH] D39430: [clangd] formatting: don't ignore style

2017-11-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment.

Thanks for this!




Comment at: clangd/ClangdLSPServer.cpp:93
 
+void ClangdLSPServer::replyWithTextEditsOrError(
+Ctx C, std::string Code,

This function is pretty hard to understand from a high level - it's a bit of an 
odd split.

Is the duplication really so bad? The straight-line code could be easy to read:

auto File = Params.textDocument.uri.file;
auto Edits = Server.formatRange(File, Params.range);
if (Edits)
  C.reply(replacementsToEdits(Server.getDocument(File), Edits.get()));
else
  C.replyError(Edits.takeError());

(The "[" won't be needed after D39435, and we should add a replyError() 
overload that takes an Error)



Comment at: clangd/ClangdLSPServer.cpp:110
+Server.formatOnType(File, Params.position),
+"Could not find .clang-format file!");
 }

It doesn't seem reasonable to assume the error is always `.clang-format`. Can 
we just include the message in the error object?



Comment at: clangd/ClangdServer.cpp:41
   // Call clang-format.
-  // FIXME: Don't ignore style.
-  format::FormatStyle Style = format::getLLVMStyle();
-  auto Result = format::reformat(Style, Code, Ranges, Filename);
-
+  auto StyleOrError = format::getStyle("file", Filename, "LLVM");
+  if (!StyleOrError)

This needs to use the VFS I think. (I'm not familiar with the details of the 
VFS usage I'm afraid)


https://reviews.llvm.org/D39430



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


[PATCH] D39481: [CodeGen] fix const-ness of builtin equivalents of and functions that might set errno

2017-11-02 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment.

> But we don't check the const attribute in CGBuiltin.cpp before converting it 
> to an intrinsic

In practice, fma() implementations don't set errno (at least, glibc and msvcrt 
don't).  And people would be really annoyed if we forced them to use fast-math 
flags to generate an fma instruction.  So this is probably okay?


https://reviews.llvm.org/D39481



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


r317224 - [refactor][selection] canonicalize selected string literal to objc

2017-11-02 Thread Alex Lorenz via cfe-commits
Author: arphaman
Date: Thu Nov  2 11:05:48 2017
New Revision: 317224

URL: http://llvm.org/viewvc/llvm-project?rev=317224&view=rev
Log:
[refactor][selection] canonicalize selected string literal to objc
string literal when possible

Modified:
cfe/trunk/lib/Tooling/Refactoring/ASTSelection.cpp
cfe/trunk/unittests/Tooling/ASTSelectionTest.cpp

Modified: cfe/trunk/lib/Tooling/Refactoring/ASTSelection.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Refactoring/ASTSelection.cpp?rev=317224&r1=317223&r2=317224&view=diff
==
--- cfe/trunk/lib/Tooling/Refactoring/ASTSelection.cpp (original)
+++ cfe/trunk/lib/Tooling/Refactoring/ASTSelection.cpp Thu Nov  2 11:05:48 2017
@@ -249,9 +249,30 @@ struct SelectedNodeWithParents {
   SelectedNodeWithParents &operator=(SelectedNodeWithParents &&) = default;
   SelectedASTNode::ReferenceType Node;
   llvm::SmallVector Parents;
+
+  /// Canonicalizes the given selection by selecting different related AST 
nodes
+  /// when it makes sense to do so.
+  void canonicalize();
 };
 } // end anonymous namespace
 
+void SelectedNodeWithParents::canonicalize() {
+  const Stmt *S = Node.get().Node.get();
+  assert(S && "non statement selection!");
+  const Stmt *Parent = Parents[Parents.size() - 1].get().Node.get();
+  if (!Parent)
+return;
+  // Select the parent expression when:
+  // - The string literal in ObjC string literal is selected, e.g.:
+  // @"test"   becomes   @"test"
+  //  ~~ ~~~
+  if (isa(S) && isa(Parent))
+Node = Parents.pop_back_val();
+  // FIXME: Syntactic form -> Entire pseudo-object expr.
+  // FIXME: Callee -> Call.
+  // FIXME: Callee member expr -> Call.
+}
+
 /// Finds the set of bottom-most selected AST nodes that are in the selection
 /// tree with the specified selection kind.
 ///
@@ -330,7 +351,7 @@ CodeRangeASTSelection::create(SourceRang
 return None;
   const Stmt *CodeRangeStmt = Selected.Node.get().Node.get();
   if (!isa(CodeRangeStmt)) {
-// FIXME (Alex L): Canonicalize.
+Selected.canonicalize();
 return CodeRangeASTSelection(Selected.Node, Selected.Parents,
  /*AreChildrenSelected=*/false);
   }

Modified: cfe/trunk/unittests/Tooling/ASTSelectionTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/ASTSelectionTest.cpp?rev=317224&r1=317223&r2=317224&view=diff
==
--- cfe/trunk/unittests/Tooling/ASTSelectionTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/ASTSelectionTest.cpp Thu Nov  2 11:05:48 2017
@@ -972,4 +972,36 @@ TEST(ASTSelectionFinder, SimpleCodeRange
   SelectionFinderVisitor::Lang_OBJC);
 }
 
+TEST(ASTSelectionFinder, CanonicalizeObjCStringLiteral) {
+  StringRef Source = R"(
+void foo() {
+  (void)@"test";
+}
+  )";
+  // Just '"test"':
+  findSelectedASTNodesWithRange(
+  Source, {3, 10}, FileRange{{3, 10}, {3, 16}},
+  [](SourceRange SelectionRange, Optional Node) {
+EXPECT_TRUE(Node);
+Optional SelectedCode =
+CodeRangeASTSelection::create(SelectionRange, std::move(*Node));
+EXPECT_TRUE(SelectedCode);
+EXPECT_EQ(SelectedCode->size(), 1u);
+EXPECT_TRUE(isa((*SelectedCode)[0]));
+  },
+  SelectionFinderVisitor::Lang_OBJC);
+  // Just 'test':
+  findSelectedASTNodesWithRange(
+  Source, {3, 11}, FileRange{{3, 11}, {3, 15}},
+  [](SourceRange SelectionRange, Optional Node) {
+EXPECT_TRUE(Node);
+Optional SelectedCode =
+CodeRangeASTSelection::create(SelectionRange, std::move(*Node));
+EXPECT_TRUE(SelectedCode);
+EXPECT_EQ(SelectedCode->size(), 1u);
+EXPECT_TRUE(isa((*SelectedCode)[0]));
+  },
+  SelectionFinderVisitor::Lang_OBJC);
+}
+
 } // end anonymous namespace


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


[PATCH] D39481: [CodeGen] fix const-ness of builtin equivalents of and functions that might set errno

2017-11-02 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added a comment.

In https://reviews.llvm.org/D39481#914174, @craig.topper wrote:

> There's an oddity with fma. The version without __builtin has 'e' already


Something that is potentially relevant: POSIX says that fma() can set errno 
(http://pubs.opengroup.org/onlinepubs/9699919799/functions/fma.html), however, 
the glibc man page says that its fma() does not set errno 
(https://linux.die.net/man/3/fma).

> 
> 
>   LIBBUILTIN(fma, "", "fne", "math.h", ALL_LANGUAGES)
>   LIBBUILTIN(fmaf, "", "fne", "math.h", ALL_LANGUAGES)
>   LIBBUILTIN(fmal, "LdLdLdLd", "fne", "math.h", ALL_LANGUAGES)
> 
> 
> But we don't check the const attribute in CGBuiltin.cpp before converting it 
> to an intrinsic
> 
>   case Builtin::BIfma:
>   case Builtin::BIfmaf:
>   case Builtin::BIfmal:
>   case Builtin::BI__builtin_fma:
>   case Builtin::BI__builtin_fmaf:
>   case Builtin::BI__builtin_fmal: {
> // Rewrite fma to intrinsic.
> Value *FirstArg = EmitScalarExpr(E->getArg(0));
> llvm::Type *ArgType = FirstArg->getType();
> Value *F = CGM.getIntrinsic(Intrinsic::fma, ArgType);
> return RValue::get(
> Builder.CreateCall(F, {FirstArg, EmitScalarExpr(E->getArg(1)),
>EmitScalarExpr(E->getArg(2))}));
>   }
>




https://reviews.llvm.org/D39481



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


[PATCH] D39441: [refactor][extract] insert semicolons into extracted/inserted code when needed

2017-11-02 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 121339.
arphaman marked 3 inline comments as done.
arphaman added a comment.

Address review comments


Repository:
  rL LLVM

https://reviews.llvm.org/D39441

Files:
  include/clang/Lex/Lexer.h
  lib/Lex/Lexer.cpp
  lib/Tooling/Refactoring/CMakeLists.txt
  lib/Tooling/Refactoring/Extract.cpp
  lib/Tooling/Refactoring/Extract/Extract.cpp
  lib/Tooling/Refactoring/Extract/SourceExtraction.cpp
  lib/Tooling/Refactoring/Extract/SourceExtraction.h
  test/Refactor/Extract/ExtractExprIntoFunction.cpp
  test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
  test/Refactor/Extract/ExtractionSemicolonPolicy.m

Index: test/Refactor/Extract/ExtractionSemicolonPolicy.m
===
--- /dev/null
+++ test/Refactor/Extract/ExtractionSemicolonPolicy.m
@@ -0,0 +1,56 @@
+// RUN: clang-refactor extract -selection=test:%s %s -- 2>&1 | grep -v CHECK | FileCheck %s
+
+@interface NSArray
++ (id)arrayWithObjects:(const id [])objects count:(unsigned long)cnt;
+@end
+
+void extractStatementNoSemiObjCFor(NSArray *array) {
+  /*range astmt=->+2:4*/for (id i in array) {
+int x = 0;
+  }
+}
+// CHECK: 1 'astmt' results:
+// CHECK:  static void extracted() {
+// CHECK-NEXT: for (id i in array) {
+// CHECK-NEXT: int x = 0;
+// CHECK-NEXT: }{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+
+void extractStatementNoSemiSync() {
+  id lock;
+  /*range bstmt=->+2:4*/@synchronized(lock) {
+int x = 0;
+  }
+}
+// CHECK: 1 'bstmt' results:
+// CHECK:  static void extracted() {
+// CHECK-NEXT: @synchronized(lock) {
+// CHECK-NEXT: int x = 0;
+// CHECK-NEXT: }{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+
+void extractStatementNoSemiAutorel() {
+  /*range cstmt=->+2:4*/@autoreleasepool {
+int x = 0;
+  }
+}
+// CHECK: 1 'cstmt' results:
+// CHECK:  static void extracted() {
+// CHECK-NEXT: @autoreleasepool {
+// CHECK-NEXT: int x = 0;
+// CHECK-NEXT: }{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+
+void extractStatementNoSemiTryFinally() {
+  /*range dstmt=->+3:4*/@try {
+int x = 0;
+  } @finally {
+  }
+}
+// CHECK: 1 'dstmt' results:
+// CHECK:  static void extracted() {
+// CHECK-NEXT: @try {
+// CHECK-NEXT: int x = 0;
+// CHECK-NEXT: } @finally {
+// CHECK-NEXT: }{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
Index: test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
===
--- /dev/null
+++ test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
@@ -0,0 +1,192 @@
+// RUN: clang-refactor extract -selection=test:%s %s -- -std=c++11 2>&1 | grep -v CHECK | FileCheck %s
+
+struct Rectangle { int width, height; };
+
+void extractStatement(const Rectangle &r) {
+  /*range adeclstmt=->+0:59*/int area = r.width * r.height;
+}
+// CHECK: 1 'adeclstmt' results:
+// CHECK:  static void extracted() {
+// CHECK-NEXT: int area = r.width * r.height;{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void extractStatement(const Rectangle &r) {
+// CHECK-NEXT:   /*range adeclstmt=->+0:59*/extracted();{{$}}
+// CHECK-NEXT: }
+
+void extractStatementNoSemiIf(const Rectangle &r) {
+  /*range bextractif=->+2:4*/if (r.width) {
+int x = r.height;
+  }
+}
+// CHECK: 1 'bextractif' results:
+// CHECK:  static void extracted() {
+// CHECK-NEXT: if (r.width) {
+// CHECK-NEXT: int x = r.height;
+// CHECK-NEXT: }{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void extractStatementNoSemiIf(const Rectangle &r) {
+// CHECK-NEXT:   /*range bextractif=->+2:4*/extracted();{{$}}
+// CHECK-NEXT: }
+
+void extractStatementDontExtraneousSemi(const Rectangle &r) {
+  /*range cextractif=->+2:4*/if (r.width) {
+int x = r.height;
+  } ;
+} //^ This semicolon shouldn't be extracted.
+// CHECK: 1 'cextractif' results:
+// CHECK:  static void extracted() {
+// CHECK-NEXT: if (r.width) {
+// CHECK-NEXT: int x = r.height;
+// CHECK-NEXT: }{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void extractStatementDontExtraneousSemi(const Rectangle &r) {
+// CHECK-NEXT: extracted(); ;{{$}}
+// CHECK-NEXT: }
+
+void extractStatementNotSemiSwitch() {
+  /*range dextract=->+5:4*/switch (2) {
+  case 1:
+break;
+  case 2:
+break;
+  }
+}
+// CHECK: 1 'dextract' results:
+// CHECK:  static void extracted() {
+// CHECK-NEXT: switch (2) {
+// CHECK-NEXT: case 1:
+// CHECK-NEXT:   break;
+// CHECK-NEXT: case 2:
+// CHECK-NEXT:   break;
+// CHECK-NEXT: }{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void extractStatementNotSemiSwitch() {
+// CHECK-NEXT: extracted();{{$}}
+// CHECK-NEXT: }
+
+void extractStatementNotSemiWhile() {
+  /*range eextract=->+2:4*/while (true) {
+int x = 0;
+  }
+}
+// CHECK: 1 'eextract' results:
+// CHECK:  static void extracted() {
+// CHECK-NEXT: while (true) {
+// CHECK-NEXT: int x = 0;
+// CHECK-NEXT: }{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void extractStatementNotSemiWhile() {
+// CHECK-NEXT: extracted();{{$}}
+// CHECK-NEX

[PATCH] D39332: [clang-refactor] Introduce a new rename rule for qualified symbols

2017-11-02 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments.



Comment at: lib/Tooling/Refactoring/Rename/RenamingAction.cpp:101
+  std::string NewQualifiedName) {
+  return QualifiedRenameRule(std::move(OldQualifiedName),
+ std::move(NewQualifiedName));

ioeric wrote:
> hokein wrote:
> > arphaman wrote:
> > > It might be better to find the declaration (and report error if needed) 
> > > during in initiation, and then pass the `ND` to the class. Maybe then 
> > > both `RenameOccurrences` and `QualifiedRenameRule` could subclass from 
> > > one base class that actually does just this:
> > > 
> > > ``` 
> > > auto USRs = getUSRsForDeclaration(ND, Context.getASTContext());
> > >   assert(!USRs.empty());
> > >   return tooling::createRenameAtomicChanges(
> > >   USRs, NewQualifiedName, 
> > > Context.getASTContext().getTranslationUnitDecl());
> > > ```
> > Done. Introduced a common interface `USRRenameRule`.
> `USRRenameRule` doesn't seem to be a very useful abstraction. I think what 
> Alex proposed is a base class that implements `createSourceReplacements` 
> which could be shared by both `RenameOccurrences` and `QualifiedRenameRule`. 
> Intuitively, un-qualified rename is a special case of qualified rename 
> (maybe?), where namespace is not changed.
Yep, I meant that indeed.


https://reviews.llvm.org/D39332



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


r317227 - [OPENMP] Fix PR35152: Do not use getInvokeDest() function for EH checks.

2017-11-02 Thread Alexey Bataev via cfe-commits
Author: abataev
Date: Thu Nov  2 11:55:05 2017
New Revision: 317227

URL: http://llvm.org/viewvc/llvm-project?rev=317227&view=rev
Log:
[OPENMP] Fix PR35152: Do not use getInvokeDest() function for EH checks.

The compiler may crash under some conditions if the getInvokeDest() is
used, but later it is not used. Fixed this problem in OpenMP.

Modified:
cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
cfe/trunk/test/OpenMP/openmp_win_codegen.cpp

Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=317227&r1=317226&r2=317227&view=diff
==
--- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Thu Nov  2 11:55:05 2017
@@ -1451,7 +1451,8 @@ llvm::Value *CGOpenMPRuntime::getThreadI
   return ThreadID;
   }
   // If exceptions are enabled, do not use parameter to avoid possible crash.
-  if (!CGF.getInvokeDest() ||
+  if (!CGF.EHStack.requiresLandingPad() || !CGF.getLangOpts().Exceptions ||
+  !CGF.getLangOpts().CXXExceptions ||
   CGF.Builder.GetInsertBlock() == CGF.AllocaInsertPt->getParent()) {
 if (auto *OMPRegionInfo =
 dyn_cast_or_null(CGF.CapturedStmtInfo)) {

Modified: cfe/trunk/test/OpenMP/openmp_win_codegen.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/openmp_win_codegen.cpp?rev=317227&r1=317226&r2=317227&view=diff
==
--- cfe/trunk/test/OpenMP/openmp_win_codegen.cpp (original)
+++ cfe/trunk/test/OpenMP/openmp_win_codegen.cpp Thu Nov  2 11:55:05 2017
@@ -1,13 +1,36 @@
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple 
x86_64-pc-windows-msvc18.0.0 -std=c++11 -fms-compatibility-version=18 
-fms-extensions -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s
+// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple 
x86_64-pc-windows-msvc18.0.0 -std=c++11 -fms-compatibility-version=18 
-fms-extensions -emit-llvm %s -fexceptions -fcxx-exceptions -o - -O1 | 
FileCheck %s
 // REQUIRES: x86-registered-target
 // expected-no-diagnostics
 
 void foo();
 void bar();
 
+struct Test {
+  static void main() {
+int failed = 0;
+int j = 2;
+
+#pragma omp parallel
+{
+  int local_j = 3;
+#pragma omp single copyprivate(local_j)
+  {
+local_j = 4;
+  }
+
+  // Assure reports a data race, but value written to "j"
+  // should always be the same.
+  j = local_j;
+}
+
+  }
+};
+
 // CHECK-LABEL: @main
 int main() {
-  // CHECK: call void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) 
@__kmpc_fork_call(%ident_t* @0, i32 0, void (i32*, i32*, ...)* bitcast (void 
(i32*, i32*)* [[OUTLINED:@.+]] to void (i32*, i32*, ...)*))
+  // CHECK: call void @{{.+}}main
+  Test::main();
+  // CHECK: call void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) 
@__kmpc_fork_call(%ident_t* {{.*}}@0, i32 0, void (i32*, i32*, ...)* bitcast 
(void (i32*, i32*)* [[OUTLINED:@.+]] to void (i32*, i32*, ...)*))
 #pragma omp parallel
   {
 try {
@@ -24,15 +47,15 @@ int main() {
 }
 
 // CHECK: define internal void [[OUTLINED]](
-// CHECK: [[GID:%.+]] = call i32 @__kmpc_global_thread_num(%ident_t* @0)
+// CHECK: [[GID:%.+]] = {{.*}}call i32 @__kmpc_global_thread_num(%ident_t* 
{{.*}}@0)
 // CHECK: invoke void @{{.+}}foo
 // CHECK: catchswitch within
 // CHECK: catchpad within
-// CHECK: call void @__kmpc_critical(%ident_t* @0, i32 [[GID]],
+// CHECK: call void @__kmpc_critical(%ident_t* {{.*}}@0, i32 [[GID]],
 // CHECK: invoke void @{{.+}}bar
-// CHECK: call void @__kmpc_end_critical(%ident_t* @0, i32 [[GID]],
+// CHECK: call void @__kmpc_end_critical(%ident_t* {{.*}}@0, i32 [[GID]],
 // CHECK: catchret from
 // CHECK: cleanuppad within
-// CHECK: call void @__kmpc_end_critical(%ident_t* @0, i32 [[GID]],
+// CHECK: call void @__kmpc_end_critical(%ident_t* {{.*}}@0, i32 [[GID]],
 // CHECK: cleanupret from
 


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


r317228 - remove unused function from ObjCRuntime.h, NFC

2017-11-02 Thread Alex Lorenz via cfe-commits
Author: arphaman
Date: Thu Nov  2 12:01:34 2017
New Revision: 317228

URL: http://llvm.org/viewvc/llvm-project?rev=317228&view=rev
Log:
remove unused function from ObjCRuntime.h, NFC

Modified:
cfe/trunk/include/clang/Basic/ObjCRuntime.h

Modified: cfe/trunk/include/clang/Basic/ObjCRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/ObjCRuntime.h?rev=317228&r1=317227&r2=317228&view=diff
==
--- cfe/trunk/include/clang/Basic/ObjCRuntime.h (original)
+++ cfe/trunk/include/clang/Basic/ObjCRuntime.h Thu Nov  2 12:01:34 2017
@@ -67,11 +67,6 @@ public:
   ObjCRuntime(Kind kind, const VersionTuple &version)
 : TheKind(kind), Version(version) {}
 
-  void set(Kind kind, VersionTuple version) {
-TheKind = kind;
-Version = version;
-  }
-
   Kind getKind() const { return TheKind; }
   const VersionTuple &getVersion() const { return Version; }
 


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


[PATCH] D39481: [CodeGen] fix const-ness of builtin equivalents of and functions that might set errno

2017-11-02 Thread Sanjay Patel via Phabricator via cfe-commits
spatel updated this revision to Diff 121344.
spatel added a comment.

Patch updated:
Make const-ness of the builtins match const-ness of their lib function 
siblings. We're deferring fixing some of these that are obviously wrong to 
follow-up patches. Hopefully, the bugs are visible in the new test file (added 
at https://reviews.llvm.org/rL317220).

These are the differences I noted from the previous rev of the patch:
ceil, floor, rint, round, and everything in complex are left as constant 
regardless of errno.
lgamma is not constant regardless of errno.


https://reviews.llvm.org/D39481

Files:
  include/clang/Basic/Builtins.def
  test/CodeGen/builtin-errno.c
  test/CodeGen/builtin-sqrt.c

Index: test/CodeGen/builtin-sqrt.c
===
--- test/CodeGen/builtin-sqrt.c
+++ test/CodeGen/builtin-sqrt.c
@@ -1,18 +1,16 @@
 // RUN: %clang_cc1 -fmath-errno -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=HAS_ERRNO
 // RUN: %clang_cc1  -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=NO_ERRNO
 
-// FIXME: If a builtin is supposed to have identical semantics to its libm twin, then it
-// should not be marked "constant" in Builtins.def because that means it can't set errno.
-// Note that both runs have 'readnone' on the libcall here.
+// FIXME: If the builtin does not set errno, it should be converted to an LLVM intrinsic.
 
 float foo(float X) {
   // HAS_ERRNO: call float @sqrtf(float
   // NO_ERRNO: call float @sqrtf(float
   return __builtin_sqrtf(X);
 }
 
 // HAS_ERRNO: declare float @sqrtf(float) [[ATTR:#[0-9]+]]
-// HAS_ERRNO: attributes [[ATTR]] = { nounwind readnone {{.*}}}
+// HAS_ERRNO-NOT: attributes [[ATTR]] = {{{.*}} readnone
 
 // NO_ERRNO: declare float @sqrtf(float) [[ATTR:#[0-9]+]]
 // NO_ERRNO: attributes [[ATTR]] = { nounwind readnone {{.*}}}
Index: test/CodeGen/builtin-errno.c
===
--- test/CodeGen/builtin-errno.c
+++ test/CodeGen/builtin-errno.c
@@ -32,9 +32,9 @@
 // NO__ERRNO: declare double @atan2(double, double) [[READNONE:#[0-9]+]]
 // NO__ERRNO: declare float @atan2f(float, float) [[READNONE]]
 // NO__ERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[READNONE]]
-// HAS_ERRNO: declare double @atan2(double, double) [[READNONE:#[0-9]+]]
-// HAS_ERRNO: declare float @atan2f(float, float) [[READNONE]]
-// HAS_ERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[READNONE]]
+// HAS_ERRNO: declare double @atan2(double, double) [[NOT_READNONE:#[0-9]+]]
+// HAS_ERRNO: declare float @atan2f(float, float) [[NOT_READNONE]]
+// HAS_ERRNO: declare x86_fp80 @atan2l(x86_fp80, x86_fp80) [[NOT_READNONE]]
 
   __builtin_copysign(f,f); __builtin_copysignf(f,f);__builtin_copysignl(f,f);
 
@@ -66,7 +66,7 @@
 // NO__ERRNO: declare double @frexp(double, i32*) [[NOT_READNONE:#[0-9]+]]
 // NO__ERRNO: declare float @frexpf(float, i32*) [[NOT_READNONE]]
 // NO__ERRNO: declare x86_fp80 @frexpl(x86_fp80, i32*) [[NOT_READNONE]]
-// HAS_ERRNO: declare double @frexp(double, i32*) [[NOT_READNONE:#[0-9]+]]
+// HAS_ERRNO: declare double @frexp(double, i32*) [[NOT_READNONE]]
 // HAS_ERRNO: declare float @frexpf(float, i32*) [[NOT_READNONE]]
 // HAS_ERRNO: declare x86_fp80 @frexpl(x86_fp80, i32*) [[NOT_READNONE]]
 
@@ -89,9 +89,9 @@
 // NO__ERRNO: declare double @ldexp(double, i32) [[READNONE]]
 // NO__ERRNO: declare float @ldexpf(float, i32) [[READNONE]]
 // NO__ERRNO: declare x86_fp80 @ldexpl(x86_fp80, i32) [[READNONE]]
-// HAS_ERRNO: declare double @ldexp(double, i32) [[READNONE]]
-// HAS_ERRNO: declare float @ldexpf(float, i32) [[READNONE]]
-// HAS_ERRNO: declare x86_fp80 @ldexpl(x86_fp80, i32) [[READNONE]]
+// HAS_ERRNO: declare double @ldexp(double, i32) [[NOT_READNONE]]
+// HAS_ERRNO: declare float @ldexpf(float, i32) [[NOT_READNONE]]
+// HAS_ERRNO: declare x86_fp80 @ldexpl(x86_fp80, i32) [[NOT_READNONE]]
 
   __builtin_modf(f,d);   __builtin_modff(f,fp);  __builtin_modfl(f,l); 
 
@@ -125,9 +125,9 @@
 // NO__ERRNO: declare double @llvm.pow.f64(double, double) [[READNONE_INTRINSIC]]
 // NO__ERRNO: declare float @llvm.pow.f32(float, float) [[READNONE_INTRINSIC]]
 // NO__ERRNO: declare x86_fp80 @llvm.pow.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
-// HAS_ERRNO: declare double @llvm.pow.f64(double, double) [[READNONE_INTRINSIC]]
-// HAS_ERRNO: declare float @llvm.pow.f32(float, float) [[READNONE_INTRINSIC]]
-// HAS_ERRNO: declare x86_fp80 @llvm.pow.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
+// HAS_ERRNO: declare double @pow(double, double) [[NOT_READNONE]]
+// HAS_ERRNO: declare float @powf(float, float) [[NOT_READNONE]]
+// HAS_ERRNO: declare x86_fp80 @powl(x86_fp80, x86_fp80) [[NOT_READNONE]]
 
   __builtin_powi(f,f);__builtin_powif(f,f);   __builtin_powil(f,f);
 
@@ -144,63 +144,63 @@
 // NO__ERRNO: declare double @acos(double) [[READNONE]]
 // NO__ERRNO: declare float @acosf(float) [[READNONE]]
 // NO__

r317231 - revert r317228: remove unused function from ObjCRuntime.h, NFC

2017-11-02 Thread Alex Lorenz via cfe-commits
Author: arphaman
Date: Thu Nov  2 12:42:40 2017
New Revision: 317231

URL: http://llvm.org/viewvc/llvm-project?rev=317231&view=rev
Log:
revert r317228: remove unused function from ObjCRuntime.h, NFC

This function is actually used in LLDB

Modified:
cfe/trunk/include/clang/Basic/ObjCRuntime.h

Modified: cfe/trunk/include/clang/Basic/ObjCRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/ObjCRuntime.h?rev=317231&r1=317230&r2=317231&view=diff
==
--- cfe/trunk/include/clang/Basic/ObjCRuntime.h (original)
+++ cfe/trunk/include/clang/Basic/ObjCRuntime.h Thu Nov  2 12:42:40 2017
@@ -67,6 +67,11 @@ public:
   ObjCRuntime(Kind kind, const VersionTuple &version)
 : TheKind(kind), Version(version) {}
 
+  void set(Kind kind, VersionTuple version) {
+TheKind = kind;
+Version = version;
+  }
+
   Kind getKind() const { return TheKind; }
   const VersionTuple &getVersion() const { return Version; }
 


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


[PATCH] D39562: [CodeGen][ObjC] Fix an assertion failure caused by copy elision

2017-11-02 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak created this revision.
Herald added subscribers: kristof.beyls, aemerson.

The assertion failure occurs when a setter is called using the dot syntax to 
set a property of a class type that doesn't have trivial copy/move constructors 
or assignment operators. It happens only when clang is compiling for c++1z and 
copy elision allows avoiding copying a temporary to the argument passed to the 
setter method in Sema.

For example:

  struct S2 {
id f1;
  };
  
  @interface C
  @property S2 f;
  @end
  @implementation C
  @end
  
  void test(C *c) {
c.f = S2();
  }

When IRGen visits the ObjCMessageExpr for the call to the setter, it tries to 
emit a copy of an S2 object that has been constructed (this happens in 
AggExprEmitter::VisitOpaqueValueExpr) and the assertion in 
CodeGenFunction::EmitAggregateCopy fails because S2 doesn't have the trivial 
special functions needed to do the copy.

This is the AST of the ObjCMessageExpr:

  `-ObjCMessageExpr 0x7fe03c06b730  'void' selector=setF:
  | |-OpaqueValueExpr 0x7fe03c06b698  'C *'
  | | `-ImplicitCastExpr 0x7fe03c06b5e0  'C *' 
  | |   `-DeclRefExpr 0x7fe03c06b5b8  'C *__strong' lvalue 
ParmVar 0x7fe03c06b408 'c' 'C *__strong'
  | `-OpaqueValueExpr 0x7fe03c06b6e8  'struct S2'
  |   `-CXXBindTemporaryExpr 0x7fe03c06b678  'struct S2' 
(CXXTemporary 0x7fe03c06b670)
  | `-CXXTemporaryObjectExpr 0x7fe03c06b638  'struct 
S2' 'void (void)'

To avoid the crash, I modified CodeGenFunction::EmitAnyExprToTemp to return the 
value for the OpaqueValueExpr (which must have already been evaluated when it's 
visited, I think) so that it doesn't have to call EmitAggregateCopy to make a 
copy.

I'm actually unsure whether we should fix Sema and change the AST 
representation or fix IRGen as I did in this patch. I'm open to suggestions if 
anyone has a better idea to fix the crash.


https://reviews.llvm.org/D39562

Files:
  lib/CodeGen/CGExpr.cpp
  test/CodeGenObjCXX/property-dot-copy-elision.mm
  test/CodeGenObjCXX/property-objects.mm

Index: test/CodeGenObjCXX/property-objects.mm
===
--- test/CodeGenObjCXX/property-objects.mm
+++ test/CodeGenObjCXX/property-objects.mm
@@ -125,8 +125,6 @@
 // CHECK-NEXT: [[T1:%.*]] = sext i32 [[T0]] to i64
 // CHECK-NEXT: store i64 [[T1]], i64* [[X]], align 8
 // CHECK-NOT:  call
-// CHECK:  call void @llvm.memcpy
-// CHECK-NOT:  call
 // CHECK:  call void bitcast {{.*}} @objc_msgSend
 // CHECK-NOT:  call
 // CHECK:  ret void
@@ -147,8 +145,6 @@
 // CHECK-NOT:  call
 // CHECK:  store i64 [[T0]],
 // CHECK-NOT:  call
-// CHECK:  call void @llvm.memcpy
-// CHECK-NOT:  call
 // CHECK:  call void bitcast {{.*}} @objc_msgSend
 // CHECK-NOT:  call
 // CHECK:  ret void
@@ -168,8 +164,6 @@
 // CHECK-NOT:  call
 // CHECK:  store i64 [[T0]],
 // CHECK-NOT:  call
-// CHECK:  call void @llvm.memcpy
-// CHECK-NOT:  call
 // CHECK:  call void bitcast {{.*}} @objc_msgSend
 // CHECK-NOT:  call
 // CHECK:  ret void
@@ -216,8 +210,6 @@
 // CHECK-NOT:  call
 // CHECK:  store i32 [[T0]],
 // CHECK-NOT:  call
-// CHECK:  call void @llvm.memcpy
-// CHECK-NOT:  call
 // CHECK:  call void bitcast {{.*}} @objc_msgSend
 // CHECK-NOT:  call
 // CHECK:  ret void
Index: test/CodeGenObjCXX/property-dot-copy-elision.mm
===
--- /dev/null
+++ test/CodeGenObjCXX/property-dot-copy-elision.mm
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -std=c++1z -fobjc-arc -o - %s | FileCheck %s
+
+struct S0 {
+  id f;
+};
+
+struct S1 {
+  S1();
+  S1(S0);
+  id f;
+};
+
+@interface C
+@property S1 f;
+@end
+@implementation C
+@end
+
+// CHECK-LABEL: define void @_Z5test0P1C(
+// CHECK: %{{.*}} = alloca %
+// CHECK: %[[TEMP_LVALUE:.*]] = alloca %[[STRUCT_S0:.*]], align
+// CHECK: %[[AGG_TMP:.*]] = alloca %[[STRUCT_S1:.*]], align
+// CHECK: call void @_ZN2S0C1Ev(%[[STRUCT_S0]]* %[[TEMP_LVALUE]])
+// CHECK: call void @_ZN2S1C1E2S0(%[[STRUCT_S1]]* %[[AGG_TMP]], %[[STRUCT_S0]]* %[[TEMP_LVALUE]])
+// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %[[STRUCT_S1]]*)*)(i8* %{{.*}}, i8* %{{.*}}, %[[STRUCT_S1]]* %[[AGG_TMP]])
+
+void test0(C *c) {
+  c.f = S0();
+}
+
+// CHECK: define void @_Z5test1P1C(
+// CHECK: %{{.*}} = alloca %
+// CHECK: %[[TEMP_LVALUE:.*]] = alloca %[[STRUCT_S1:.*]], align
+// CHECK: call void @_ZN2S1C1Ev(%[[STRUCT_S1]]* %[[TEMP_LVALUE]])
+// CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %[[STRUCT_S1]]*)*)(i8* %{{.*}}, i8* %{{.*}}, %[[STRUCT_S1]]* %[[TEMP_LVALUE]])
+
+void test1(C *c) {
+  c.f = S1();
+}
Index: lib/CodeGen/CGExpr.cpp
===
--- lib/CodeGen/CGExpr.cpp
+++ lib/CodeGen/CGExpr.cpp
@@ -192,8 +192,12 @@
 RValue CodeGenFunction::EmitAnyExprToTemp(const Expr *E)

[PATCH] D39210: Add default calling convention support for regcall.

2017-11-02 Thread Elizabeth Andrews via Phabricator via cfe-commits
eandrews added a comment.

*ping*


https://reviews.llvm.org/D39210



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


[libclc] r317232 - acos: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:06 2017
New Revision: 317232

URL: http://llvm.org/viewvc/llvm-project?rev=317232&view=rev
Log:
acos: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/acos.inc
Modified:
libclc/trunk/generic/include/clc/math/acos.h

Modified: libclc/trunk/generic/include/clc/math/acos.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/acos.h?rev=317232&r1=317231&r2=317232&view=diff
==
--- libclc/trunk/generic/include/clc/math/acos.h (original)
+++ libclc/trunk/generic/include/clc/math/acos.h Thu Nov  2 12:48:06 2017
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION acos
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/acos.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/acos.inc?rev=317231&view=auto
==
--- libclc/trunk/generic/include/clc/math/acos.inc (original)
+++ libclc/trunk/generic/include/clc/math/acos.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE acos(__CLC_GENTYPE x);


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


[libclc] r317233 - acosh: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:11 2017
New Revision: 317233

URL: http://llvm.org/viewvc/llvm-project?rev=317233&view=rev
Log:
acosh: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/acosh.inc
Modified:
libclc/trunk/generic/include/clc/math/acosh.h

Modified: libclc/trunk/generic/include/clc/math/acosh.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/acosh.h?rev=317233&r1=317232&r2=317233&view=diff
==
--- libclc/trunk/generic/include/clc/math/acosh.h (original)
+++ libclc/trunk/generic/include/clc/math/acosh.h Thu Nov  2 12:48:11 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION acosh
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/acosh.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/acosh.inc?rev=317232&view=auto
==
--- libclc/trunk/generic/include/clc/math/acosh.inc (original)
+++ libclc/trunk/generic/include/clc/math/acosh.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE acosh(__CLC_GENTYPE x);


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


[libclc] r317239 - atanh: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:22 2017
New Revision: 317239

URL: http://llvm.org/viewvc/llvm-project?rev=317239&view=rev
Log:
atanh: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/atanh.inc
Modified:
libclc/trunk/generic/include/clc/math/atanh.h

Modified: libclc/trunk/generic/include/clc/math/atanh.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atanh.h?rev=317239&r1=317238&r2=317239&view=diff
==
--- libclc/trunk/generic/include/clc/math/atanh.h (original)
+++ libclc/trunk/generic/include/clc/math/atanh.h Thu Nov  2 12:48:22 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION atanh
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/atanh.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atanh.inc?rev=317238&view=auto
==
--- libclc/trunk/generic/include/clc/math/atanh.inc (original)
+++ libclc/trunk/generic/include/clc/math/atanh.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atanh(__CLC_GENTYPE x);


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


[libclc] r317236 - asinh: Use unary_dec instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:16 2017
New Revision: 317236

URL: http://llvm.org/viewvc/llvm-project?rev=317236&view=rev
Log:
asinh: Use unary_dec instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/asinh.inc
Modified:
libclc/trunk/generic/include/clc/math/asinh.h

Modified: libclc/trunk/generic/include/clc/math/asinh.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/asinh.h?rev=317236&r1=317235&r2=317236&view=diff
==
--- libclc/trunk/generic/include/clc/math/asinh.h (original)
+++ libclc/trunk/generic/include/clc/math/asinh.h Thu Nov  2 12:48:16 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION asinh
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/asinh.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/asinh.inc?rev=317235&view=auto
==
--- libclc/trunk/generic/include/clc/math/asinh.inc (original)
+++ libclc/trunk/generic/include/clc/math/asinh.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE asinh(__CLC_GENTYPE x);


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


[libclc] r317238 - atan: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:20 2017
New Revision: 317238

URL: http://llvm.org/viewvc/llvm-project?rev=317238&view=rev
Log:
atan: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/atan.inc
Modified:
libclc/trunk/generic/include/clc/math/atan.h

Modified: libclc/trunk/generic/include/clc/math/atan.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atan.h?rev=317238&r1=317237&r2=317238&view=diff
==
--- libclc/trunk/generic/include/clc/math/atan.h (original)
+++ libclc/trunk/generic/include/clc/math/atan.h Thu Nov  2 12:48:20 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION atan
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/atan.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atan.inc?rev=317237&view=auto
==
--- libclc/trunk/generic/include/clc/math/atan.inc (original)
+++ libclc/trunk/generic/include/clc/math/atan.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atan(__CLC_GENTYPE a);


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


[libclc] r317235 - asin: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:15 2017
New Revision: 317235

URL: http://llvm.org/viewvc/llvm-project?rev=317235&view=rev
Log:
asin: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/asin.inc
Modified:
libclc/trunk/generic/include/clc/math/asin.h

Modified: libclc/trunk/generic/include/clc/math/asin.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/asin.h?rev=317235&r1=317234&r2=317235&view=diff
==
--- libclc/trunk/generic/include/clc/math/asin.h (original)
+++ libclc/trunk/generic/include/clc/math/asin.h Thu Nov  2 12:48:15 2017
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION asin
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/asin.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/asin.inc?rev=317234&view=auto
==
--- libclc/trunk/generic/include/clc/math/asin.inc (original)
+++ libclc/trunk/generic/include/clc/math/asin.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE asin(__CLC_GENTYPE x);


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


[libclc] r317237 - asinpi: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:18 2017
New Revision: 317237

URL: http://llvm.org/viewvc/llvm-project?rev=317237&view=rev
Log:
asinpi: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/asinpi.inc
Modified:
libclc/trunk/generic/include/clc/math/asinpi.h

Modified: libclc/trunk/generic/include/clc/math/asinpi.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/asinpi.h?rev=317237&r1=317236&r2=317237&view=diff
==
--- libclc/trunk/generic/include/clc/math/asinpi.h (original)
+++ libclc/trunk/generic/include/clc/math/asinpi.h Thu Nov  2 12:48:18 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION asinpi
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/asinpi.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/asinpi.inc?rev=317236&view=auto
==
--- libclc/trunk/generic/include/clc/math/asinpi.inc (original)
+++ libclc/trunk/generic/include/clc/math/asinpi.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE asinpi(__CLC_GENTYPE x);


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


[libclc] r317241 - cbrt: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:25 2017
New Revision: 317241

URL: http://llvm.org/viewvc/llvm-project?rev=317241&view=rev
Log:
cbrt: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/cbrt.inc
Modified:
libclc/trunk/generic/include/clc/math/cbrt.h

Modified: libclc/trunk/generic/include/clc/math/cbrt.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/cbrt.h?rev=317241&r1=317240&r2=317241&view=diff
==
--- libclc/trunk/generic/include/clc/math/cbrt.h (original)
+++ libclc/trunk/generic/include/clc/math/cbrt.h Thu Nov  2 12:48:25 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION cbrt
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/cbrt.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/cbrt.inc?rev=317240&view=auto
==
--- libclc/trunk/generic/include/clc/math/cbrt.inc (original)
+++ libclc/trunk/generic/include/clc/math/cbrt.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE cbrt(__CLC_GENTYPE x);


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


[libclc] r317234 - acospi: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:13 2017
New Revision: 317234

URL: http://llvm.org/viewvc/llvm-project?rev=317234&view=rev
Log:
acospi: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/acospi.inc
Modified:
libclc/trunk/generic/include/clc/math/acospi.h

Modified: libclc/trunk/generic/include/clc/math/acospi.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/acospi.h?rev=317234&r1=317233&r2=317234&view=diff
==
--- libclc/trunk/generic/include/clc/math/acospi.h (original)
+++ libclc/trunk/generic/include/clc/math/acospi.h Thu Nov  2 12:48:13 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION acospi
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/acospi.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/acospi.inc?rev=317233&view=auto
==
--- libclc/trunk/generic/include/clc/math/acospi.inc (original)
+++ libclc/trunk/generic/include/clc/math/acospi.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE acospi(__CLC_GENTYPE x);


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


[libclc] r317240 - atanpi: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:23 2017
New Revision: 317240

URL: http://llvm.org/viewvc/llvm-project?rev=317240&view=rev
Log:
atanpi: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/atanpi.inc
Modified:
libclc/trunk/generic/include/clc/math/atanpi.h

Modified: libclc/trunk/generic/include/clc/math/atanpi.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atanpi.h?rev=317240&r1=317239&r2=317240&view=diff
==
--- libclc/trunk/generic/include/clc/math/atanpi.h (original)
+++ libclc/trunk/generic/include/clc/math/atanpi.h Thu Nov  2 12:48:23 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION atanpi
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/atanpi.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/atanpi.inc?rev=317239&view=auto
==
--- libclc/trunk/generic/include/clc/math/atanpi.inc (original)
+++ libclc/trunk/generic/include/clc/math/atanpi.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atanpi(__CLC_GENTYPE x);


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


[libclc] r317244 - cospi: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:31 2017
New Revision: 317244

URL: http://llvm.org/viewvc/llvm-project?rev=317244&view=rev
Log:
cospi: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/cospi.inc
Modified:
libclc/trunk/generic/include/clc/math/cospi.h

Modified: libclc/trunk/generic/include/clc/math/cospi.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/cospi.h?rev=317244&r1=317243&r2=317244&view=diff
==
--- libclc/trunk/generic/include/clc/math/cospi.h (original)
+++ libclc/trunk/generic/include/clc/math/cospi.h Thu Nov  2 12:48:31 2017
@@ -1,3 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION cospi
+
 #include 
+
 #undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/cospi.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/cospi.inc?rev=317243&view=auto
==
--- libclc/trunk/generic/include/clc/math/cospi.inc (original)
+++ libclc/trunk/generic/include/clc/math/cospi.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE cospi(__CLC_GENTYPE a);


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


[libclc] r317243 - cosh: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:30 2017
New Revision: 317243

URL: http://llvm.org/viewvc/llvm-project?rev=317243&view=rev
Log:
cosh: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/cosh.inc
Modified:
libclc/trunk/generic/include/clc/math/cosh.h

Modified: libclc/trunk/generic/include/clc/math/cosh.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/cosh.h?rev=317243&r1=317242&r2=317243&view=diff
==
--- libclc/trunk/generic/include/clc/math/cosh.h (original)
+++ libclc/trunk/generic/include/clc/math/cosh.h Thu Nov  2 12:48:30 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION cosh
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/cosh.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/cosh.inc?rev=317242&view=auto
==
--- libclc/trunk/generic/include/clc/math/cosh.inc (original)
+++ libclc/trunk/generic/include/clc/math/cosh.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE cosh(__CLC_GENTYPE x);


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


[libclc] r317245 - exp2: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:33 2017
New Revision: 317245

URL: http://llvm.org/viewvc/llvm-project?rev=317245&view=rev
Log:
exp2: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/exp2.inc
Modified:
libclc/trunk/generic/include/clc/math/exp2.h

Modified: libclc/trunk/generic/include/clc/math/exp2.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/exp2.h?rev=317245&r1=317244&r2=317245&view=diff
==
--- libclc/trunk/generic/include/clc/math/exp2.h (original)
+++ libclc/trunk/generic/include/clc/math/exp2.h Thu Nov  2 12:48:33 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION exp2
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/exp2.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/exp2.inc?rev=317244&view=auto
==
--- libclc/trunk/generic/include/clc/math/exp2.inc (original)
+++ libclc/trunk/generic/include/clc/math/exp2.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE exp2(__CLC_GENTYPE x);


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


[libclc] r317242 - cos: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:27 2017
New Revision: 317242

URL: http://llvm.org/viewvc/llvm-project?rev=317242&view=rev
Log:
cos: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/cos.inc
Modified:
libclc/trunk/generic/include/clc/math/cos.h

Modified: libclc/trunk/generic/include/clc/math/cos.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/cos.h?rev=317242&r1=317241&r2=317242&view=diff
==
--- libclc/trunk/generic/include/clc/math/cos.h (original)
+++ libclc/trunk/generic/include/clc/math/cos.h Thu Nov  2 12:48:27 2017
@@ -1,3 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION cos
+
 #include 
+
 #undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/cos.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/cos.inc?rev=317241&view=auto
==
--- libclc/trunk/generic/include/clc/math/cos.inc (original)
+++ libclc/trunk/generic/include/clc/math/cos.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE cos(__CLC_GENTYPE a);


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


[libclc] r317247 - log1p: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:37 2017
New Revision: 317247

URL: http://llvm.org/viewvc/llvm-project?rev=317247&view=rev
Log:
log1p: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/log1p.inc
Modified:
libclc/trunk/generic/include/clc/math/log1p.h

Modified: libclc/trunk/generic/include/clc/math/log1p.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/log1p.h?rev=317247&r1=317246&r2=317247&view=diff
==
--- libclc/trunk/generic/include/clc/math/log1p.h (original)
+++ libclc/trunk/generic/include/clc/math/log1p.h Thu Nov  2 12:48:37 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION log1p
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/log1p.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/log1p.inc?rev=317246&view=auto
==
--- libclc/trunk/generic/include/clc/math/log1p.inc (original)
+++ libclc/trunk/generic/include/clc/math/log1p.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE log1p(__CLC_GENTYPE a);


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


[libclc] r317248 - log2: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:39 2017
New Revision: 317248

URL: http://llvm.org/viewvc/llvm-project?rev=317248&view=rev
Log:
log2: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/log2.inc
Modified:
libclc/trunk/generic/include/clc/math/log2.h

Modified: libclc/trunk/generic/include/clc/math/log2.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/log2.h?rev=317248&r1=317247&r2=317248&view=diff
==
--- libclc/trunk/generic/include/clc/math/log2.h (original)
+++ libclc/trunk/generic/include/clc/math/log2.h Thu Nov  2 12:48:39 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION log2
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/log2.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/log2.inc?rev=317247&view=auto
==
--- libclc/trunk/generic/include/clc/math/log2.inc (original)
+++ libclc/trunk/generic/include/clc/math/log2.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE log2(__CLC_GENTYPE a);


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


[libclc] r317246 - lgamma: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:35 2017
New Revision: 317246

URL: http://llvm.org/viewvc/llvm-project?rev=317246&view=rev
Log:
lgamma: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/lgamma.inc
Modified:
libclc/trunk/generic/include/clc/math/lgamma.h

Modified: libclc/trunk/generic/include/clc/math/lgamma.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/lgamma.h?rev=317246&r1=317245&r2=317246&view=diff
==
--- libclc/trunk/generic/include/clc/math/lgamma.h (original)
+++ libclc/trunk/generic/include/clc/math/lgamma.h Thu Nov  2 12:48:35 2017
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION lgamma
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/lgamma.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/lgamma.inc?rev=317245&view=auto
==
--- libclc/trunk/generic/include/clc/math/lgamma.inc (original)
+++ libclc/trunk/generic/include/clc/math/lgamma.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE lgamma(__CLC_GENTYPE a);


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


[libclc] r317250 - log: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:43 2017
New Revision: 317250

URL: http://llvm.org/viewvc/llvm-project?rev=317250&view=rev
Log:
log: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/log.inc
Modified:
libclc/trunk/generic/include/clc/math/log.h

Modified: libclc/trunk/generic/include/clc/math/log.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/log.h?rev=317250&r1=317249&r2=317250&view=diff
==
--- libclc/trunk/generic/include/clc/math/log.h (original)
+++ libclc/trunk/generic/include/clc/math/log.h Thu Nov  2 12:48:43 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION log
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/log.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/log.inc?rev=317249&view=auto
==
--- libclc/trunk/generic/include/clc/math/log.inc (original)
+++ libclc/trunk/generic/include/clc/math/log.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE log(__CLC_GENTYPE a);


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


[libclc] r317249 - logb: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:41 2017
New Revision: 317249

URL: http://llvm.org/viewvc/llvm-project?rev=317249&view=rev
Log:
logb: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/logb.inc
Modified:
libclc/trunk/generic/include/clc/math/logb.h

Modified: libclc/trunk/generic/include/clc/math/logb.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/logb.h?rev=317249&r1=317248&r2=317249&view=diff
==
--- libclc/trunk/generic/include/clc/math/logb.h (original)
+++ libclc/trunk/generic/include/clc/math/logb.h Thu Nov  2 12:48:41 2017
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION logb
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/logb.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/logb.inc?rev=317248&view=auto
==
--- libclc/trunk/generic/include/clc/math/logb.inc (original)
+++ libclc/trunk/generic/include/clc/math/logb.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE logb(__CLC_GENTYPE a);


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


[libclc] r317251 - native_log10: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:44 2017
New Revision: 317251

URL: http://llvm.org/viewvc/llvm-project?rev=317251&view=rev
Log:
native_log10: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/native_log10.inc
Modified:
libclc/trunk/generic/include/clc/math/native_log10.h

Modified: libclc/trunk/generic/include/clc/math/native_log10.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/native_log10.h?rev=317251&r1=317250&r2=317251&view=diff
==
--- libclc/trunk/generic/include/clc/math/native_log10.h (original)
+++ libclc/trunk/generic/include/clc/math/native_log10.h Thu Nov  2 12:48:44 
2017
@@ -1,5 +1,9 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION native_log10
 #define __FLOAT_ONLY
+
 #include 
-#undef __CLC_BODY
+
 #undef __FLOAT_ONLY
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/native_log10.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/native_log10.inc?rev=317250&view=auto
==
--- libclc/trunk/generic/include/clc/math/native_log10.inc (original)
+++ libclc/trunk/generic/include/clc/math/native_log10.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE native_log10(__CLC_GENTYPE a);


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


[libclc] r317253 - native_log: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:48 2017
New Revision: 317253

URL: http://llvm.org/viewvc/llvm-project?rev=317253&view=rev
Log:
native_log: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/native_log.inc
Modified:
libclc/trunk/generic/include/clc/math/native_log.h

Modified: libclc/trunk/generic/include/clc/math/native_log.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/native_log.h?rev=317253&r1=317252&r2=317253&view=diff
==
--- libclc/trunk/generic/include/clc/math/native_log.h (original)
+++ libclc/trunk/generic/include/clc/math/native_log.h Thu Nov  2 12:48:48 2017
@@ -20,8 +20,12 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION native_log
 #define __FLOAT_ONLY
+
 #include 
-#undef __CLC_BODY
+
 #undef __FLOAT_ONLY
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/native_log.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/native_log.inc?rev=317252&view=auto
==
--- libclc/trunk/generic/include/clc/math/native_log.inc (original)
+++ libclc/trunk/generic/include/clc/math/native_log.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE native_log(__CLC_GENTYPE a);


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


[libclc] r317254 - sin: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:50 2017
New Revision: 317254

URL: http://llvm.org/viewvc/llvm-project?rev=317254&view=rev
Log:
sin: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/sin.inc
Modified:
libclc/trunk/generic/include/clc/math/sin.h

Modified: libclc/trunk/generic/include/clc/math/sin.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/sin.h?rev=317254&r1=317253&r2=317254&view=diff
==
--- libclc/trunk/generic/include/clc/math/sin.h (original)
+++ libclc/trunk/generic/include/clc/math/sin.h Thu Nov  2 12:48:50 2017
@@ -1,3 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION sin
+
 #include 
+
 #undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/sin.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/sin.inc?rev=317253&view=auto
==
--- libclc/trunk/generic/include/clc/math/sin.inc (original)
+++ libclc/trunk/generic/include/clc/math/sin.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sin(__CLC_GENTYPE a);


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


[libclc] r317255 - sinh: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:51 2017
New Revision: 317255

URL: http://llvm.org/viewvc/llvm-project?rev=317255&view=rev
Log:
sinh: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/sinh.inc
Modified:
libclc/trunk/generic/include/clc/math/sinh.h

Modified: libclc/trunk/generic/include/clc/math/sinh.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/sinh.h?rev=317255&r1=317254&r2=317255&view=diff
==
--- libclc/trunk/generic/include/clc/math/sinh.h (original)
+++ libclc/trunk/generic/include/clc/math/sinh.h Thu Nov  2 12:48:51 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION sinh
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/sinh.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/sinh.inc?rev=317254&view=auto
==
--- libclc/trunk/generic/include/clc/math/sinh.inc (original)
+++ libclc/trunk/generic/include/clc/math/sinh.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sinh(__CLC_GENTYPE x);


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


[libclc] r317252 - native_log2: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:46 2017
New Revision: 317252

URL: http://llvm.org/viewvc/llvm-project?rev=317252&view=rev
Log:
native_log2: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/native_log2.inc
Modified:
libclc/trunk/generic/include/clc/math/native_log2.h

Modified: libclc/trunk/generic/include/clc/math/native_log2.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/native_log2.h?rev=317252&r1=317251&r2=317252&view=diff
==
--- libclc/trunk/generic/include/clc/math/native_log2.h (original)
+++ libclc/trunk/generic/include/clc/math/native_log2.h Thu Nov  2 12:48:46 2017
@@ -20,8 +20,12 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION native_log2
 #define __FLOAT_ONLY
+
 #include 
-#undef __CLC_BODY
+
 #undef __FLOAT_ONLY
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/native_log2.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/native_log2.inc?rev=317251&view=auto
==
--- libclc/trunk/generic/include/clc/math/native_log2.inc (original)
+++ libclc/trunk/generic/include/clc/math/native_log2.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE native_log2(__CLC_GENTYPE a);


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


[libclc] r317258 - tan: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:57 2017
New Revision: 317258

URL: http://llvm.org/viewvc/llvm-project?rev=317258&view=rev
Log:
tan: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/tan.inc
Modified:
libclc/trunk/generic/include/clc/math/tan.h

Modified: libclc/trunk/generic/include/clc/math/tan.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/tan.h?rev=317258&r1=317257&r2=317258&view=diff
==
--- libclc/trunk/generic/include/clc/math/tan.h (original)
+++ libclc/trunk/generic/include/clc/math/tan.h Thu Nov  2 12:48:57 2017
@@ -1,2 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION tan
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/tan.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/tan.inc?rev=317257&view=auto
==
--- libclc/trunk/generic/include/clc/math/tan.inc (original)
+++ libclc/trunk/generic/include/clc/math/tan.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE tan(__CLC_GENTYPE x);


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


[libclc] r317256 - sinpi: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:53 2017
New Revision: 317256

URL: http://llvm.org/viewvc/llvm-project?rev=317256&view=rev
Log:
sinpi: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/sinpi.inc
Modified:
libclc/trunk/generic/include/clc/math/sinpi.h

Modified: libclc/trunk/generic/include/clc/math/sinpi.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/sinpi.h?rev=317256&r1=317255&r2=317256&view=diff
==
--- libclc/trunk/generic/include/clc/math/sinpi.h (original)
+++ libclc/trunk/generic/include/clc/math/sinpi.h Thu Nov  2 12:48:53 2017
@@ -1,3 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION sinpi
+
 #include 
+
 #undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/sinpi.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/sinpi.inc?rev=317255&view=auto
==
--- libclc/trunk/generic/include/clc/math/sinpi.inc (original)
+++ libclc/trunk/generic/include/clc/math/sinpi.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sinpi(__CLC_GENTYPE a);


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


[libclc] r317257 - sqrt: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:55 2017
New Revision: 317257

URL: http://llvm.org/viewvc/llvm-project?rev=317257&view=rev
Log:
sqrt: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/sqrt.inc
Modified:
libclc/trunk/generic/include/clc/math/sqrt.h

Modified: libclc/trunk/generic/include/clc/math/sqrt.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/sqrt.h?rev=317257&r1=317256&r2=317257&view=diff
==
--- libclc/trunk/generic/include/clc/math/sqrt.h (original)
+++ libclc/trunk/generic/include/clc/math/sqrt.h Thu Nov  2 12:48:55 2017
@@ -1,3 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION sqrt
+
 #include 
+
 #undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/sqrt.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/sqrt.inc?rev=317256&view=auto
==
--- libclc/trunk/generic/include/clc/math/sqrt.inc (original)
+++ libclc/trunk/generic/include/clc/math/sqrt.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sqrt(__CLC_GENTYPE a);


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


[libclc] r317260 - tgamma: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:49:00 2017
New Revision: 317260

URL: http://llvm.org/viewvc/llvm-project?rev=317260&view=rev
Log:
tgamma: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/tgamma.inc
Modified:
libclc/trunk/generic/include/clc/math/tgamma.h

Modified: libclc/trunk/generic/include/clc/math/tgamma.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/tgamma.h?rev=317260&r1=317259&r2=317260&view=diff
==
--- libclc/trunk/generic/include/clc/math/tgamma.h (original)
+++ libclc/trunk/generic/include/clc/math/tgamma.h Thu Nov  2 12:49:00 2017
@@ -1,3 +1,7 @@
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION tgamma
+
 #include 
+
 #undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/tgamma.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/tgamma.inc?rev=317259&view=auto
==
--- libclc/trunk/generic/include/clc/math/tgamma.inc (original)
+++ libclc/trunk/generic/include/clc/math/tgamma.inc (removed)
@@ -1 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE tgamma(__CLC_GENTYPE a);


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


[libclc] r317259 - tanh: Use unary_decl instead of custom inc file

2017-11-02 Thread Jan Vesely via cfe-commits
Author: jvesely
Date: Thu Nov  2 12:48:58 2017
New Revision: 317259

URL: http://llvm.org/viewvc/llvm-project?rev=317259&view=rev
Log:
tanh: Use unary_decl instead of custom inc file

Signed-off-by: Jan Vesely 
Reviewed-By: Aaron Watry 

Removed:
libclc/trunk/generic/include/clc/math/tanh.inc
Modified:
libclc/trunk/generic/include/clc/math/tanh.h

Modified: libclc/trunk/generic/include/clc/math/tanh.h
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/tanh.h?rev=317259&r1=317258&r2=317259&view=diff
==
--- libclc/trunk/generic/include/clc/math/tanh.h (original)
+++ libclc/trunk/generic/include/clc/math/tanh.h Thu Nov  2 12:48:58 2017
@@ -20,5 +20,10 @@
  * THE SOFTWARE.
  */
 
-#define __CLC_BODY 
+#define __CLC_BODY 
+#define __CLC_FUNCTION tanh
+
 #include 
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION

Removed: libclc/trunk/generic/include/clc/math/tanh.inc
URL: 
http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/tanh.inc?rev=317258&view=auto
==
--- libclc/trunk/generic/include/clc/math/tanh.inc (original)
+++ libclc/trunk/generic/include/clc/math/tanh.inc (removed)
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2014 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE tanh(__CLC_GENTYPE a);


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


[clang-tools-extra] r317261 - Update release notes (check SVN commit-after-approval access)

2017-11-02 Thread Ben Hamilton via cfe-commits
Author: benhamilton
Date: Thu Nov  2 13:00:17 2017
New Revision: 317261

URL: http://llvm.org/viewvc/llvm-project?rev=317261&view=rev
Log:
Update release notes (check SVN commit-after-approval access)

Summary:
I was just granted commit-after-approval access to SVN,
and @clattner recommended I try a test commit.

So, this tweaks the release notes as a test.

Reviewers: hokein, alexfh

Reviewed By: hokein

Subscribers: Wizard

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

Modified:
clang-tools-extra/trunk/docs/ReleaseNotes.rst

Modified: clang-tools-extra/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ReleaseNotes.rst?rev=317261&r1=317260&r2=317261&view=diff
==
--- clang-tools-extra/trunk/docs/ReleaseNotes.rst (original)
+++ clang-tools-extra/trunk/docs/ReleaseNotes.rst Thu Nov  2 13:00:17 2017
@@ -63,7 +63,8 @@ Improvements to clang-tidy
   
`_
 check
 
   Ensures Objective-C classes do not subclass any classes which are
-  not intended to be subclassed.
+  not intended to be subclassed. Includes a list of classes from Foundation
+  and UIKit which are documented as not supporting subclassing.
 
 - Renamed checks to use correct term "implicit conversion" instead of "implicit
   cast" and modified messages and option names accordingly:


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


[PATCH] D39210: Add default calling convention support for regcall.

2017-11-02 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

Looks good! Sorry for the delay.


https://reviews.llvm.org/D39210



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


[PATCH] D39551: [analyzer] Make __builtin_debugtrap() a sink

2017-11-02 Thread Devin Coughlin via Phabricator via cfe-commits
dcoughlin added a comment.

I believe that the intent of `__builtin_debugtrap()` is to provide an in-source 
mechanism so that the developer can trap into the debugger and then continue 
execution. For example, in the Swift codebase this is used in combination with 
a debug flag to break into the debugger at the beginning a specified pass. 
https://github.com/apple/swift/blob/master/lib/SILOptimizer/PassManager/PassManager.cpp#L339

Since the intent is to continue after the trap, I don't think the analyzer 
should treat it as a sink.

Did you get requests from users to treat it like a sink? Or false positives 
that would be resolved if were a sink? Or is this something you noticed by 
inspection?


https://reviews.llvm.org/D39551



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


  1   2   >