Re: Fix for the issue 12176

2017-09-28 Thread Jonathan Roelofs via cfe-commits

+silvas


On 9/28/17 2:19 PM, Oscar Forner Martinez via cfe-commits wrote:

Hi,

Please find attached a diff to fix the issue 12176.


Link for the lazy: llvm.org/PR12176

Let me know if there 
is anything any improvements you can think of.


Best regards,

Oscar


Extract-getDepthAndIndex-issue-12176.patch


Index: lib/Sema/DepthAndIndex.h
===
--- lib/Sema/DepthAndIndex.h(nonexistent)
+++ lib/Sema/DepthAndIndex.h(working copy)
@@ -0,0 +1,32 @@
+//===- DepthAndIndex.h - Static declaration of the getDepthAndIndex function 
-*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//===--===//
+//
+//  This file defines getDepthAndIndex function.
+//
+//===--===//
+
+#ifndef LLVM_CLANG_LIB_SEMA_DEPTHANDINDEX_H
+#define LLVM_CLANG_LIB_SEMA_DEPTHANDINDEX_H
+
+#include "clang/AST/DeclTemplate.h"
+#include "clang/Sema/DeclSpec.h"
+
+/// \brief Retrieve the depth and index of a template parameter.
+static std::pair


This should be just a declaration and a doxygen comment for it. Drop the 
'static'. You can also drop the "\brief" since autobrief is turned on.


Then the body should go in a *.cpp somewhere in lib/Sema.


+getDepthAndIndex(NamedDecl *ND) {
+  if (TemplateTypeParmDecl *TTP = dyn_cast(ND))
+return std::make_pair(TTP->getDepth(), TTP->getIndex());
+
+  if (NonTypeTemplateParmDecl *NTTP = dyn_cast(ND))
+return std::make_pair(NTTP->getDepth(), NTTP->getIndex());
+
+  TemplateTemplateParmDecl *TTP = cast(ND);
+  return std::make_pair(TTP->getDepth(), TTP->getIndex());
+}
+
+#endif // LLVM_CLANG_LIB_SEMA_DEPTHANDINDEX_H
\ No newline at end of file
Index: lib/Sema/SemaTemplateDeduction.cpp
===
--- lib/Sema/SemaTemplateDeduction.cpp  (revision 314321)
+++ lib/Sema/SemaTemplateDeduction.cpp  (working copy)
@@ -11,6 +11,7 @@
  
//===--===/
  
  #include "clang/Sema/TemplateDeduction.h"

+#include "DepthAndIndex.h"
  #include "TreeTransform.h"
  #include "clang/AST/ASTContext.h"
  #include "clang/AST/ASTLambda.h"
@@ -579,19 +580,6 @@
}
  }
  
-/// \brief Retrieve the depth and index of a template parameter.

-static std::pair
-getDepthAndIndex(NamedDecl *ND) {
-  if (TemplateTypeParmDecl *TTP = dyn_cast(ND))
-return std::make_pair(TTP->getDepth(), TTP->getIndex());
-
-  if (NonTypeTemplateParmDecl *NTTP = dyn_cast(ND))
-return std::make_pair(NTTP->getDepth(), NTTP->getIndex());
-
-  TemplateTemplateParmDecl *TTP = cast(ND);
-  return std::make_pair(TTP->getDepth(), TTP->getIndex());
-}
-
  /// \brief Retrieve the depth and index of an unexpanded parameter pack.
  static std::pair
  getDepthAndIndex(UnexpandedParameterPack UPP) {


Maybe this ^ one should go too?


Index: lib/Sema/SemaTemplateInstantiate.cpp


snip


Jon




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



--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded / Siemens
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r303873 - Don't defer to the GCC driver for linking arm-baremetal

2017-05-25 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Thu May 25 10:42:13 2017
New Revision: 303873

URL: http://llvm.org/viewvc/llvm-project?rev=303873&view=rev
Log:
Don't defer to the GCC driver for linking arm-baremetal

Also comes with a cmake cache for building the runtime bits:

 $ cmake  \
   -DBAREMETAL_ARMV6M_SYSROOT=/path/to/sysroot \
   -DBAREMETAL_ARMV7M_SYSROOT=/path/to/sysroot \
   -DBAREMETAL_ARMV7EM_SYSROOT=/path/to/sysroot \
   -C /path/to/clang/cmake/caches/BaremetalARM.cmake \
   /path/to/llvm

https://reviews.llvm.org/D33259

Added:
cfe/trunk/cmake/caches/BaremetalARM.cmake
cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp
cfe/trunk/lib/Driver/ToolChains/BareMetal.h
cfe/trunk/test/Driver/Inputs/baremetal_arm/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/5.0.0/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/5.0.0/.keep
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/6.0.0/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/6.0.0/.keep
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/v1/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/v1/.keep
cfe/trunk/test/Driver/baremetal.cpp
Modified:
cfe/trunk/lib/Driver/CMakeLists.txt
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
cfe/trunk/lib/Driver/ToolChains/Linux.cpp
cfe/trunk/test/Frontend/gnu-mcount.c

Added: cfe/trunk/cmake/caches/BaremetalARM.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/BaremetalARM.cmake?rev=303873&view=auto
==
--- cfe/trunk/cmake/caches/BaremetalARM.cmake (added)
+++ cfe/trunk/cmake/caches/BaremetalARM.cmake Thu May 25 10:42:13 2017
@@ -0,0 +1,50 @@
+set(LLVM_TARGETS_TO_BUILD ARM;X86 CACHE STRING "")
+
+# Builtins
+set(LLVM_BUILTIN_TARGETS "armv7m-none-eabi;armv6m-none-eabi;armv7em-none-eabi" 
CACHE STRING "Builtin Targets")
+
+set(BUILTINS_armv6m-none-eabi_CMAKE_SYSROOT ${BAREMETAL_ARMV6M_SYSROOT} CACHE 
STRING "armv6m-none-eabi Sysroot")
+set(BUILTINS_armv6m-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE STRING 
"armv6m-none-eabi System Name")
+set(BUILTINS_armv6m-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL 
"armv6m-none-eabi Baremetal build")
+set(BUILTINS_armv6m-none-eabi_COMPILER_RT_OS_DIR "baremetal" CACHE STRING 
"armv6m-none-eabi os dir")
+
+set(BUILTINS_armv7m-none-eabi_CMAKE_SYSROOT ${BAREMETAL_ARMV7M_SYSROOT} CACHE 
STRING "armv7m-none-eabi Sysroot")
+set(BUILTINS_armv7m-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE STRING 
"armv7m-none-eabi System Name")
+set(BUILTINS_armv7m-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL 
"armv7m-none-eabi Baremetal build")
+set(BUILTINS_armv7m-none-eabi_CMAKE_C_FLAGS "-mfpu=fp-armv8" CACHE STRING 
"armv7m-none-eabi C Flags")
+set(BUILTINS_armv7m-none-eabi_CMAKE_ASM_FLAGS "-mfpu=fp-armv8" CACHE STRING 
"armv7m-none-eabi ASM Flags")
+set(BUILTINS_armv7m-none-eabi_COMPILER_RT_OS_DIR "baremetal" CACHE STRING 
"armv7m-none-eabi os dir")
+
+set(BUILTINS_armv7em-none-eabi_CMAKE_SYSROOT ${BAREMETAL_ARMV7EM_SYSROOT} 
CACHE STRING "armv7em-none-eabi Sysroot")
+set(BUILTINS_armv7em-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE STRING 
"armv7em-none-eabi System Name")
+set(BUILTINS_armv7em-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL 
"armv7em-none-eabi Baremetal build")
+set(BUILTINS_armv7em-none-eabi_CMAKE_C_FLAGS "-mfpu=fp-armv8" CACHE STRING 
"armv7em-none-eabi C Flags")
+set(BUILTINS_armv7em-none-eabi_CMAKE_ASM_FLAGS "-mfpu=fp-armv8" CACHE STRING 
"armv7em-none-eabi ASM Flags")
+set(BUILTINS_armv7em-none-eabi_COMPILER_RT_OS_DIR "baremetal" CACHE STRING 
"armv7em-none-eabi os dir")
+
+set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
+set(LLVM_TOOLCHAIN_TOOLS
+  llc
+  llvm-ar
+  llvm-cxxfilt
+  llvm-dwarfdump
+  llvm-dsymutil
+  llvm-nm
+  llvm-objdump
+  llvm-ranlib
+  llvm-readobj
+  llvm-size
+  llvm-symbolizer
+  opt
+  CACHE STRING "")
+
+set(LLVM_DISTRIBUTION_COMPONENTS
+  clang
+  lld
+  clang-headers
+  builtins-armv6m-none-eabi
+  builtins-armv7m-none-eabi
+  builtins-armv7em-none-eabi
+  runtimes
+  ${LLVM_TOOLCHAIN_TOOLS}
+  CACHE STRING "")

Modified: cfe/trunk/lib/Driver/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CMakeLists.txt?rev=303873&r1=303872&r2=303873&view=diff
==
--- cfe/trunk/lib/Driver/CMakeLists.txt (original)
+++ cfe/trunk/lib/Driver/CMakeLists.txt Thu May 25 10:42:13 2017
@@ -30,6 +30,7 @@ add_clang_library(clangDriver
   ToolChains/AMDGPU.cpp
   ToolChains/AVR.cpp
   ToolChains/Bitrig.cpp
+  ToolChains/BareMetal.cpp
   ToolChains/Clang.cpp
   ToolChains/CloudABI.cpp
   ToolChains/CommonArgs.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=303873&r1=303872&r2

r303880 - Relax testcase to appease buildbots

2017-05-25 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Thu May 25 11:20:51 2017
New Revision: 303880

URL: http://llvm.org/viewvc/llvm-project?rev=303880&view=rev
Log:
Relax testcase to appease buildbots

When lld isn't built, the tests as they were previously, were too picky about
the path to the linker.

Modified:
cfe/trunk/test/Driver/baremetal.cpp

Modified: cfe/trunk/test/Driver/baremetal.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/baremetal.cpp?rev=303880&r1=303879&r2=303880&view=diff
==
--- cfe/trunk/test/Driver/baremetal.cpp (original)
+++ cfe/trunk/test/Driver/baremetal.cpp Thu May 25 11:20:51 2017
@@ -10,7 +10,7 @@
 // CHECK-V6M-C-SAME: "-internal-isystem" "[[SYSROOT]]/include/c++/v1"
 // CHECk-V6M-C-SAME: "-internal-isystem" "[[SYSROOT]]/include"
 // CHECK-V6M-C-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
-// CHECK-V6M-C-NEXT: "[[PREFIX_DIR:.*]]/bin/ld.lld" "{{.*}}.o" "-Bstatic"
+// CHECK-V6M-C-NEXT: "{{[^"]*}}ld.lld" "{{.*}}.o" "-Bstatic"
 // CHECK-V6M-C-SAME: "-L[[PREFIX_DIR]]/lib/clang/[[VERSION]]/lib/baremetal"
 // CHECK-V6M-C-SAME: "-T" "semihosted.lds" "-Lsome/directory/user/asked/for"
 // CHECK-V6M-C-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m.a"
@@ -32,8 +32,8 @@
 // RUN: -target armv6m-none-eabi \
 // RUN: --sysroot=%S/Inputs/baremetal_arm \
 // RUN:   | FileCheck --check-prefix=CHECK-V6M-DEFAULTCXX %s
-// CHECK-V6M-DEFAULTCXX: "[[PREFIX_DIR:.*]]/bin/ld.lld" "{{.*}}.o" "-Bstatic"
-// CHECK-V6M-DEFAULTCXX-SAME: "-L[[PREFIX_DIR]]/lib/clang/{{.*}}/lib/baremetal"
+// CHECK-V6M-DEFAULTCXX: "{{[^"]*}}ld.lld" "{{.*}}.o" "-Bstatic"
+// CHECK-V6M-DEFAULTCXX-SAME: "-L{{[^"]*}}/lib/clang/{{.*}}/lib/baremetal"
 // CHECK-V6M-DEFAULTCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
 // CHECK-V6M-DEFAULTCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m.a"
 // CHECK-V6M-DEFAULTCXX-SAME: "-o" "{{.*}}.o"
@@ -45,8 +45,8 @@
 // RUN:   | FileCheck --check-prefix=CHECK-V6M-LIBCXX %s
 // CHECK-V6M-LIBCXX-NOT: "-internal-isystem" "{{[^"]+}}/include/c++/{{[^v].*}}"
 // CHECK-V6M-LIBCXX: "-internal-isystem" "{{[^"]+}}/include/c++/v1"
-// CHECK-V6M-LIBCXX: "[[PREFIX_DIR:.*]]/bin/ld.lld" "{{.*}}.o" "-Bstatic"
-// CHECK-V6M-LIBCXX-SAME: "-L[[PREFIX_DIR]]/lib/clang/{{.*}}/lib/baremetal"
+// CHECK-V6M-LIBCXX: "{{[^"]*}}ld.lld" "{{.*}}.o" "-Bstatic"
+// CHECK-V6M-LIBCXX-SAME: "-L{{[^"]*}}/lib/clang/{{.*}}/lib/baremetal"
 // CHECK-V6M-LIBCXX-SAME: "-lc++" "-lc++abi" "-lunwind"
 // CHECK-V6M-LIBCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m.a"
 // CHECK-V6M-LIBCXX-SAME: "-o" "{{.*}}.o"
@@ -58,8 +58,8 @@
 // RUN:   | FileCheck --check-prefix=CHECK-V6M-LIBSTDCXX %s
 // CHECK-V6M-LIBSTDCXX-NOT: "-internal-isystem" "{{[^"]+}}/include/c++/v1"
 // CHECK-V6M-LIBSTDCXX: "-internal-isystem" "{{[^"]+}}/include/c++/6.0.0"
-// CHECK-V6M-LIBSTDCXX: "[[PREFIX_DIR:.*]]/bin/ld.lld" "{{.*}}.o" "-Bstatic"
-// CHECK-V6M-LIBSTDCXX-SAME: "-L[[PREFIX_DIR]]/lib/clang/{{.*}}/lib/baremetal"
+// CHECK-V6M-LIBSTDCXX: "{{[^"]*}}ld.lld" "{{.*}}.o" "-Bstatic"
+// CHECK-V6M-LIBSTDCXX-SAME: "-L{{[^"]*}}/lib/clang/{{.*}}/lib/baremetal"
 // CHECK-V6M-LIBSTDCXX-SAME: "-lstdc++" "-lsupc++" "-lunwind"
 // CHECK-V6M-LIBSTDCXX-SAME: "-lc" "-lm" "-lclang_rt.builtins-armv6m.a"
 // CHECK-V6M-LIBSTDCXX-SAME: "-o" "{{.*}}.o"
@@ -69,8 +69,8 @@
 // RUN: --sysroot=%S/Inputs/baremetal_arm \
 // RUN: -nodefaultlibs \
 // RUN:   | FileCheck --check-prefix=CHECK-V6M-NDL %s
-// CHECK-V6M-NDL: "[[PREFIX_DIR:.*]]/bin/ld.lld" "{{.*}}.o" "-Bstatic"
-// CHECK-V6M-NDL-SAME: "-L[[PREFIX_DIR]]/lib/clang/{{.*}}/lib/baremetal" "-o" 
"{{.*}}.o"
+// CHECK-V6M-NDL: "{{[^"]*}}ld.lld" "{{.*}}.o" "-Bstatic"
+// CHECK-V6M-NDL-SAME: "-L{{[^"]*}}/lib/clang/{{.*}}/lib/baremetal" "-o" 
"{{.*}}.o"
 
 // RUN: %clangxx -target arm-none-eabi -v 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-THREAD-MODEL


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


r303898 - Appease more buildbots about r303873

2017-05-25 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Thu May 25 13:55:22 2017
New Revision: 303898

URL: http://llvm.org/viewvc/llvm-project?rev=303898&view=rev
Log:
Appease more buildbots about r303873

Modified:
cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp?rev=303898&r1=303897&r2=303898&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp Thu May 25 13:55:22 2017
@@ -136,6 +136,7 @@ std::string BareMetal::findLibCxxInclude
 return Dir.str();
   }
   }
+  llvm_unreachable("unhandled LibType");
 }
 
 void BareMetal::AddClangCXXStdlibIncludeArgs(


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


Re: r303873 - Don't defer to the GCC driver for linking arm-baremetal

2017-05-25 Thread Jonathan Roelofs via cfe-commits



On 5/25/17 11:39 AM, Galina Kistanova wrote:

Hello Jonathan,

This commit broke one of our builders:

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/2608/steps/build-unified-tree/logs/stdio

Please have a look at this?


r303898 should take care of that.


Jon



Thanks

Galina

On Thu, May 25, 2017 at 8:42 AM, Jonathan Roelofs via cfe-commits 
mailto:cfe-commits@lists.llvm.org>> wrote:


Author: jroelofs
Date: Thu May 25 10:42:13 2017
New Revision: 303873

URL: http://llvm.org/viewvc/llvm-project?rev=303873&view=rev
<http://llvm.org/viewvc/llvm-project?rev=303873&view=rev>
Log:
Don't defer to the GCC driver for linking arm-baremetal

Also comes with a cmake cache for building the runtime bits:

 $ cmake  \
   -DBAREMETAL_ARMV6M_SYSROOT=/path/to/sysroot \
   -DBAREMETAL_ARMV7M_SYSROOT=/path/to/sysroot \
   -DBAREMETAL_ARMV7EM_SYSROOT=/path/to/sysroot \
   -C /path/to/clang/cmake/caches/BaremetalARM.cmake \
   /path/to/llvm

https://reviews.llvm.org/D33259 <https://reviews.llvm.org/D33259>

Added:
cfe/trunk/cmake/caches/BaremetalARM.cmake
cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp
cfe/trunk/lib/Driver/ToolChains/BareMetal.h
cfe/trunk/test/Driver/Inputs/baremetal_arm/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/5.0.0/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/5.0.0/.keep
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/6.0.0/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/6.0.0/.keep
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/v1/
cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/v1/.keep
cfe/trunk/test/Driver/baremetal.cpp
Modified:
cfe/trunk/lib/Driver/CMakeLists.txt
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
cfe/trunk/lib/Driver/ToolChains/Linux.cpp
cfe/trunk/test/Frontend/gnu-mcount.c

Added: cfe/trunk/cmake/caches/BaremetalARM.cmake
URL:

http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/BaremetalARM.cmake?rev=303873&view=auto

<http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/BaremetalARM.cmake?rev=303873&view=auto>

==
--- cfe/trunk/cmake/caches/BaremetalARM.cmake (added)
+++ cfe/trunk/cmake/caches/BaremetalARM.cmake Thu May 25 10:42:13 2017
@@ -0,0 +1,50 @@
+set(LLVM_TARGETS_TO_BUILD ARM;X86 CACHE STRING "")
+
+# Builtins
+set(LLVM_BUILTIN_TARGETS
"armv7m-none-eabi;armv6m-none-eabi;armv7em-none-eabi" CACHE STRING
"Builtin Targets")
+
+set(BUILTINS_armv6m-none-eabi_CMAKE_SYSROOT
${BAREMETAL_ARMV6M_SYSROOT} CACHE STRING "armv6m-none-eabi Sysroot")
+set(BUILTINS_armv6m-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE
STRING "armv6m-none-eabi System Name")
+set(BUILTINS_armv6m-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON
CACHE BOOL "armv6m-none-eabi Baremetal build")
+set(BUILTINS_armv6m-none-eabi_COMPILER_RT_OS_DIR "baremetal"
CACHE STRING "armv6m-none-eabi os dir")
+
+set(BUILTINS_armv7m-none-eabi_CMAKE_SYSROOT
${BAREMETAL_ARMV7M_SYSROOT} CACHE STRING "armv7m-none-eabi Sysroot")
+set(BUILTINS_armv7m-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE
STRING "armv7m-none-eabi System Name")
+set(BUILTINS_armv7m-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON
CACHE BOOL "armv7m-none-eabi Baremetal build")
+set(BUILTINS_armv7m-none-eabi_CMAKE_C_FLAGS "-mfpu=fp-armv8"
CACHE STRING "armv7m-none-eabi C Flags")
+set(BUILTINS_armv7m-none-eabi_CMAKE_ASM_FLAGS "-mfpu=fp-armv8"
CACHE STRING "armv7m-none-eabi ASM Flags")
+set(BUILTINS_armv7m-none-eabi_COMPILER_RT_OS_DIR "baremetal"
CACHE STRING "armv7m-none-eabi os dir")
+
+set(BUILTINS_armv7em-none-eabi_CMAKE_SYSROOT
${BAREMETAL_ARMV7EM_SYSROOT} CACHE STRING "armv7em-none-eabi Sysroot")
+set(BUILTINS_armv7em-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE
STRING "armv7em-none-eabi System Name")
+set(BUILTINS_armv7em-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON
CACHE BOOL "armv7em-none-eabi Baremetal build")
+set(BUILTINS_armv7em-none-eabi_CMAKE_C_FLAGS "-mfpu=fp-armv8"
CACHE STRING "armv7em-none-eabi C Flags")
+set(BUILTINS_armv7em-none-eabi_CMAKE_ASM_FLAGS "-mfpu=fp-armv8"
CACHE STRING "armv7em-none-eabi ASM Flags")
+set(BUILTINS_armv7em-none-eabi_COMPILER_RT_OS_DIR "baremetal"
CACHE STRIN

Re: r303873 - Don't defer to the GCC driver for linking arm-baremetal

2017-05-25 Thread Jonathan Roelofs via cfe-commits



On 5/25/17 2:41 PM, Hans Wennborg wrote:

The test was failing on Windows; r303910 for that.


Oh yuk.. thanks for fixing that.


Jon



On Thu, May 25, 2017 at 11:55 AM, Jonathan Roelofs via cfe-commits
 wrote:


On 5/25/17 11:39 AM, Galina Kistanova wrote:

Hello Jonathan,

This commit broke one of our builders:

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/2608/steps/build-unified-tree/logs/stdio

Please have a look at this?


r303898 should take care of that.


Jon



Thanks

Galina

On Thu, May 25, 2017 at 8:42 AM, Jonathan Roelofs via cfe-commits
 wrote:

Author: jroelofs
Date: Thu May 25 10:42:13 2017
New Revision: 303873

URL: http://llvm.org/viewvc/llvm-project?rev=303873&view=rev
Log:
Don't defer to the GCC driver for linking arm-baremetal

Also comes with a cmake cache for building the runtime bits:

  $ cmake  \
-DBAREMETAL_ARMV6M_SYSROOT=/path/to/sysroot \
-DBAREMETAL_ARMV7M_SYSROOT=/path/to/sysroot \
-DBAREMETAL_ARMV7EM_SYSROOT=/path/to/sysroot \
-C /path/to/clang/cmake/caches/BaremetalARM.cmake \
/path/to/llvm

https://reviews.llvm.org/D33259

Added:
 cfe/trunk/cmake/caches/BaremetalARM.cmake
 cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp
 cfe/trunk/lib/Driver/ToolChains/BareMetal.h
 cfe/trunk/test/Driver/Inputs/baremetal_arm/
 cfe/trunk/test/Driver/Inputs/baremetal_arm/include/
 cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/
 cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/5.0.0/
 cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/5.0.0/.keep
 cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/6.0.0/
 cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/6.0.0/.keep
 cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/v1/
 cfe/trunk/test/Driver/Inputs/baremetal_arm/include/c++/v1/.keep
 cfe/trunk/test/Driver/baremetal.cpp
Modified:
 cfe/trunk/lib/Driver/CMakeLists.txt
 cfe/trunk/lib/Driver/Driver.cpp
 cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
 cfe/trunk/lib/Driver/ToolChains/Linux.cpp
 cfe/trunk/test/Frontend/gnu-mcount.c

Added: cfe/trunk/cmake/caches/BaremetalARM.cmake
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/caches/BaremetalARM.cmake?rev=303873&view=auto

==
--- cfe/trunk/cmake/caches/BaremetalARM.cmake (added)
+++ cfe/trunk/cmake/caches/BaremetalARM.cmake Thu May 25 10:42:13 2017
@@ -0,0 +1,50 @@
+set(LLVM_TARGETS_TO_BUILD ARM;X86 CACHE STRING "")
+
+# Builtins
+set(LLVM_BUILTIN_TARGETS
"armv7m-none-eabi;armv6m-none-eabi;armv7em-none-eabi" CACHE STRING "Builtin
Targets")
+
+set(BUILTINS_armv6m-none-eabi_CMAKE_SYSROOT ${BAREMETAL_ARMV6M_SYSROOT}
CACHE STRING "armv6m-none-eabi Sysroot")
+set(BUILTINS_armv6m-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE STRING
"armv6m-none-eabi System Name")
+set(BUILTINS_armv6m-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL
"armv6m-none-eabi Baremetal build")
+set(BUILTINS_armv6m-none-eabi_COMPILER_RT_OS_DIR "baremetal" CACHE STRING
"armv6m-none-eabi os dir")
+
+set(BUILTINS_armv7m-none-eabi_CMAKE_SYSROOT ${BAREMETAL_ARMV7M_SYSROOT}
CACHE STRING "armv7m-none-eabi Sysroot")
+set(BUILTINS_armv7m-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE STRING
"armv7m-none-eabi System Name")
+set(BUILTINS_armv7m-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL
"armv7m-none-eabi Baremetal build")
+set(BUILTINS_armv7m-none-eabi_CMAKE_C_FLAGS "-mfpu=fp-armv8" CACHE STRING
"armv7m-none-eabi C Flags")
+set(BUILTINS_armv7m-none-eabi_CMAKE_ASM_FLAGS "-mfpu=fp-armv8" CACHE
STRING "armv7m-none-eabi ASM Flags")
+set(BUILTINS_armv7m-none-eabi_COMPILER_RT_OS_DIR "baremetal" CACHE STRING
"armv7m-none-eabi os dir")
+
+set(BUILTINS_armv7em-none-eabi_CMAKE_SYSROOT ${BAREMETAL_ARMV7EM_SYSROOT}
CACHE STRING "armv7em-none-eabi Sysroot")
+set(BUILTINS_armv7em-none-eabi_CMAKE_SYSTEM_NAME Generic CACHE STRING
"armv7em-none-eabi System Name")
+set(BUILTINS_armv7em-none-eabi_COMPILER_RT_BAREMETAL_BUILD ON CACHE BOOL
"armv7em-none-eabi Baremetal build")
+set(BUILTINS_armv7em-none-eabi_CMAKE_C_FLAGS "-mfpu=fp-armv8" CACHE
STRING "armv7em-none-eabi C Flags")
+set(BUILTINS_armv7em-none-eabi_CMAKE_ASM_FLAGS "-mfpu=fp-armv8" CACHE
STRING "armv7em-none-eabi ASM Flags")
+set(BUILTINS_armv7em-none-eabi_COMPILER_RT_OS_DIR "baremetal" CACHE
STRING "armv7em-none-eabi os dir")
+
+set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
+set(LLVM_TOOLCHAIN_TOOLS
+  llc
+  llvm-ar
+  llvm-cxxfilt
+  llvm-dwarfdump
+  llvm-dsymutil
+  llvm-nm
+  llvm-objdump
+  llvm-ranlib
+  llvm-readobj
+  llvm-size
+  llvm-symbolizer
+  opt
+  CACHE STRING "")
+
+set(LLVM_DISTRIBUTION_COMPON

[libcxx] r321563 - Update CREDITS.txt with personal email

2017-12-29 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Fri Dec 29 11:15:20 2017
New Revision: 321563

URL: http://llvm.org/viewvc/llvm-project?rev=321563&view=rev
Log:
Update CREDITS.txt with personal email

Modified:
libcxx/trunk/CREDITS.TXT

Modified: libcxx/trunk/CREDITS.TXT
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CREDITS.TXT?rev=321563&r1=321562&r2=321563&view=diff
==
--- libcxx/trunk/CREDITS.TXT (original)
+++ libcxx/trunk/CREDITS.TXT Fri Dec 29 11:15:20 2017
@@ -101,7 +101,7 @@ E: nico.ri...@gmail.com
 D: Windows fixes
 
 N: Jon Roelofs
-E: jonat...@codesourcery.com
+E: jonat...@jroelofs.com
 D: Remote testing, Newlib port, baremetal/single-threaded support.
 
 N: Jonathan Sauer


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


[libcxxabi] r321564 - Update CREDITS.txt with personal email address

2017-12-29 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Fri Dec 29 11:16:12 2017
New Revision: 321564

URL: http://llvm.org/viewvc/llvm-project?rev=321564&view=rev
Log:
Update CREDITS.txt with personal email address

Modified:
libcxxabi/trunk/CREDITS.TXT

Modified: libcxxabi/trunk/CREDITS.TXT
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CREDITS.TXT?rev=321564&r1=321563&r2=321564&view=diff
==
--- libcxxabi/trunk/CREDITS.TXT (original)
+++ libcxxabi/trunk/CREDITS.TXT Fri Dec 29 11:16:12 2017
@@ -58,7 +58,7 @@ E: e...@olofsson.info
 D: Minor patches and fixes
 
 N: Jon Roelofs
-E: jonat...@codesourcery.com
+E: jonat...@jroelofs.com
 D: ARM EHABI Unwind & Exception Handling, Bare-metal
 
 N: Nico Weber


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


[libcxxabi] r321569 - Try again, this time with the correct address

2017-12-29 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Fri Dec 29 11:26:28 2017
New Revision: 321569

URL: http://llvm.org/viewvc/llvm-project?rev=321569&view=rev
Log:
Try again, this time with the correct address

Modified:
libcxxabi/trunk/CREDITS.TXT

Modified: libcxxabi/trunk/CREDITS.TXT
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/CREDITS.TXT?rev=321569&r1=321568&r2=321569&view=diff
==
--- libcxxabi/trunk/CREDITS.TXT (original)
+++ libcxxabi/trunk/CREDITS.TXT Fri Dec 29 11:26:28 2017
@@ -58,7 +58,7 @@ E: e...@olofsson.info
 D: Minor patches and fixes
 
 N: Jon Roelofs
-E: jonat...@jroelofs.com
+E: jroel...@jroelofs.com
 D: ARM EHABI Unwind & Exception Handling, Bare-metal
 
 N: Nico Weber


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


[libcxx] r321570 - Try again, this time with the correct address

2017-12-29 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Fri Dec 29 11:26:53 2017
New Revision: 321570

URL: http://llvm.org/viewvc/llvm-project?rev=321570&view=rev
Log:
Try again, this time with the correct address

Modified:
libcxx/trunk/CREDITS.TXT

Modified: libcxx/trunk/CREDITS.TXT
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CREDITS.TXT?rev=321570&r1=321569&r2=321570&view=diff
==
--- libcxx/trunk/CREDITS.TXT (original)
+++ libcxx/trunk/CREDITS.TXT Fri Dec 29 11:26:53 2017
@@ -101,7 +101,7 @@ E: nico.ri...@gmail.com
 D: Windows fixes
 
 N: Jon Roelofs
-E: jonat...@jroelofs.com
+E: jroel...@jroelofs.com
 D: Remote testing, Newlib port, baremetal/single-threaded support.
 
 N: Jonathan Sauer


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


r312651 - Fix ARM bare metal driver to support atomics

2017-09-06 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Wed Sep  6 10:09:25 2017
New Revision: 312651

URL: http://llvm.org/viewvc/llvm-project?rev=312651&view=rev
Log:
Fix ARM bare metal driver to support atomics

The new bare metal support only supports the single thread model. This causes
the builtin atomic functions (e.g.: __atomic_fetch_add) to not generate
thread-safe assembly for these operations, which breaks our firmware. We target
bare metal, and need to atomically modify variables in our interrupt routines,
and task threads.

Internally, the -mthread-model flag determines whether to lower or expand
atomic operations (see D4984).

This change removes the overridden thread model methods, and instead relies on
the base ToolChain class to validate the thread model (which already includes
logic to validate single thread model support). If the single thread model is
required, the -mthread-model flag will have to be provided.

As a workaround "-mthread-model posix" could be provided, but it only works due
to a bug in the validation of the -mthread-model flag (separate patch coming to
fix this).

https://reviews.llvm.org/D37493

Patch by: Ian Tessier!

Modified:
cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp
cfe/trunk/lib/Driver/ToolChains/BareMetal.h
cfe/trunk/test/Driver/baremetal.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp?rev=312651&r1=312650&r2=312651&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/BareMetal.cpp Wed Sep  6 10:09:25 2017
@@ -65,14 +65,6 @@ Tool *BareMetal::buildLinker() const {
   return new tools::baremetal::Linker(*this);
 }
 
-std::string BareMetal::getThreadModel() const {
-  return "single";
-}
-
-bool BareMetal::isThreadModelSupported(const StringRef Model) const {
-  return Model == "single";
-}
-
 std::string BareMetal::getRuntimesDir() const {
   SmallString<128> Dir(getDriver().ResourceDir);
   llvm::sys::path::append(Dir, "lib", "baremetal");

Modified: cfe/trunk/lib/Driver/ToolChains/BareMetal.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/BareMetal.h?rev=312651&r1=312650&r2=312651&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/BareMetal.h (original)
+++ cfe/trunk/lib/Driver/ToolChains/BareMetal.h Wed Sep  6 10:09:25 2017
@@ -38,8 +38,6 @@ public:
   bool isPICDefaultForced() const override { return false; }
   bool SupportsProfiling() const override { return false; }
   bool SupportsObjCGC() const override { return false; }
-  std::string getThreadModel() const override;
-  bool isThreadModelSupported(const StringRef Model) const override;
 
   RuntimeLibType GetDefaultRuntimeLibType() const override {
 return ToolChain::RLT_CompilerRT;

Modified: cfe/trunk/test/Driver/baremetal.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/baremetal.cpp?rev=312651&r1=312650&r2=312651&view=diff
==
--- cfe/trunk/test/Driver/baremetal.cpp (original)
+++ cfe/trunk/test/Driver/baremetal.cpp Wed Sep  6 10:09:25 2017
@@ -74,4 +74,12 @@
 
 // RUN: %clangxx -target arm-none-eabi -v 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-THREAD-MODEL
-// CHECK-THREAD-MODEL: Thread model: single
+// CHECK-THREAD-MODEL: Thread model: posix
+
+// RUN: %clangxx -target arm-none-eabi -mthread-model single -v 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-SINGLE
+// CHECK-THREAD-MODEL-SINGLE: Thread model: single
+
+// RUN: %clangxx -target arm-none-eabi -mthread-model posix -v 2>&1 \
+// RUN:   | FileCheck %s --check-prefix=CHECK-THREAD-MODEL-POSIX
+// CHECK-THREAD-MODEL-POSIX: Thread model: posix


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


r312748 - Fix validation of the -mthread-model flag in the Clang driver

2017-09-07 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Thu Sep  7 15:01:25 2017
New Revision: 312748

URL: http://llvm.org/viewvc/llvm-project?rev=312748&view=rev
Log:
Fix validation of the -mthread-model flag in the Clang driver

The ToolChain class validates the -mthread-model flag in the constructor which
doesn't work correctly since the thread model methods are virtual methods. The
check is moved into Clang::ConstructJob() when constructing the internal
command line.

https://reviews.llvm.org/D37496

Patch by: Ian Tessier!

Modified:
cfe/trunk/lib/Driver/ToolChain.cpp
cfe/trunk/lib/Driver/ToolChains/Clang.cpp

Modified: cfe/trunk/lib/Driver/ToolChain.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=312748&r1=312747&r2=312748&view=diff
==
--- cfe/trunk/lib/Driver/ToolChain.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChain.cpp Thu Sep  7 15:01:25 2017
@@ -74,11 +74,6 @@ ToolChain::ToolChain(const Driver &D, co
 : D(D), Triple(T), Args(Args), CachedRTTIArg(GetRTTIArgument(Args)),
   CachedRTTIMode(CalculateRTTIMode(Args, Triple, CachedRTTIArg)),
   EffectiveTriple() {
-  if (Arg *A = Args.getLastArg(options::OPT_mthread_model))
-if (!isThreadModelSupported(A->getValue()))
-  D.Diag(diag::err_drv_invalid_thread_model_for_target)
-  << A->getValue() << A->getAsString(Args);
-
   std::string CandidateLibPath = getArchSpecificLibPath();
   if (getVFS().exists(CandidateLibPath))
 getFilePaths().push_back(CandidateLibPath);

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=312748&r1=312747&r2=312748&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Thu Sep  7 15:01:25 2017
@@ -3235,8 +3235,12 @@ void Clang::ConstructJob(Compilation &C,
   }
 
   CmdArgs.push_back("-mthread-model");
-  if (Arg *A = Args.getLastArg(options::OPT_mthread_model))
+  if (Arg *A = Args.getLastArg(options::OPT_mthread_model)) {
+if (!getToolChain().isThreadModelSupported(A->getValue()))
+  D.Diag(diag::err_drv_invalid_thread_model_for_target)
+  << A->getValue() << A->getAsString(Args);
 CmdArgs.push_back(A->getValue());
+  }
   else
 CmdArgs.push_back(Args.MakeArgString(getToolChain().getThreadModel()));
 


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


Re: [PATCH] D24770: [libcxxabi] cleanup the use of LIBCXXABI_HAS_NO_THREADS macro (NFC)

2016-09-20 Thread Jonathan Roelofs via cfe-commits
jroelofs added a subscriber: jroelofs.
jroelofs accepted this revision.
jroelofs added a reviewer: jroelofs.
jroelofs added a comment.
This revision is now accepted and ready to land.

LGTM


https://reviews.llvm.org/D24770



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


[clang-tools-extra] 3486cc0 - [clang-tidy] Generalize HeaderFileExtensions.{h,cpp}. NFC

2020-03-09 Thread Jonathan Roelofs via cfe-commits

Author: Jonathan Roelofs
Date: 2020-03-09T11:32:44-06:00
New Revision: 3486cc014b208df3897cf5656db0d0fdeae26d6b

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

LOG: [clang-tidy] Generalize HeaderFileExtensions.{h,cpp}. NFC

https://reviews.llvm.org/D75489

Added: 
clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp
clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h

Modified: 
clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.h
clang-tools-extra/clang-tidy/utils/CMakeLists.txt
clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp
clang-tools-extra/clang-tidy/utils/HeaderGuard.h

Removed: 
clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.cpp
clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h



diff  --git 
a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp 
b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
index 1e2184e324fc..7403762122bd 100644
--- a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
@@ -31,8 +31,8 @@ 
DynamicStaticInitializersCheck::DynamicStaticInitializersCheck(StringRef Name,
 : ClangTidyCheck(Name, Context),
   RawStringHeaderFileExtensions(Options.getLocalOrGlobal(
 "HeaderFileExtensions", utils::defaultHeaderFileExtensions())) {
-  if (!utils::parseHeaderFileExtensions(RawStringHeaderFileExtensions,
-HeaderFileExtensions, ',')) {
+  if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
+  HeaderFileExtensions, ',')) {
 llvm::errs() << "Invalid header file extension: "
  << RawStringHeaderFileExtensions << "\n";
   }

diff  --git 
a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h 
b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
index 1cf6e408aa42..ac0d32202d61 100644
--- a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
+++ b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
@@ -10,7 +10,7 @@
 #define 
LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_DYNAMIC_STATIC_INITIALIZERS_CHECK_H
 
 #include "../ClangTidyCheck.h"
-#include "../utils/HeaderFileExtensionsUtils.h"
+#include "../utils/FileExtensionsUtils.h"
 
 namespace clang {
 namespace tidy {
@@ -36,7 +36,7 @@ class DynamicStaticInitializersCheck : public ClangTidyCheck {
 
 private:
   const std::string RawStringHeaderFileExtensions;
-  utils::HeaderFileExtensionsSet HeaderFileExtensions;
+  utils::FileExtensionsSet HeaderFileExtensions;
 };
 
 } // namespace bugprone

diff  --git a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp 
b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
index c6d72494243c..09eb266efb35 100644
--- a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
@@ -24,8 +24,8 @@ 
GlobalNamesInHeadersCheck::GlobalNamesInHeadersCheck(StringRef Name,
 : ClangTidyCheck(Name, Context),
   RawStringHeaderFileExtensions(Options.getLocalOrGlobal(
   "HeaderFileExtensions", utils::defaultHeaderFileExtensions())) {
-  if (!utils::parseHeaderFileExtensions(RawStringHeaderFileExtensions,
-HeaderFileExtensions, ',')) {
+  if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
+  HeaderFileExtensions, ',')) {
 llvm::errs() << "Invalid header file extension: "
  << RawStringHeaderFileExtensions << "\n";
   }

diff  --git a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h 
b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
index 730ef60c70fc..cd69df72962e 100644
--- a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
+++ b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
@@ -10,7 +10,7 @@
 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_GLOBALNAMESINHEADERSCHECK_H
 
 #include "../ClangTidyCheck.h"
-#include "../utils/HeaderFileExtensionsUtils.h"
+#include "../utils/FileExtensionsUtils.h"
 
 namespace c

[clang-tools-extra] 47caa69 - [clang-tidy] Use ; as separator for HeaderFileExtensions

2020-03-09 Thread Jonathan Roelofs via cfe-commits

Author: Jonathan Roelofs
Date: 2020-03-09T11:32:44-06:00
New Revision: 47caa69120e582bf1b795ec646f069c83b0e9456

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

LOG: [clang-tidy] Use ; as separator for HeaderFileExtensions

... and deprecate use of ',' for the same.

https://reviews.llvm.org/D75621

Added: 


Modified: 
clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.h
clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.h
clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp
clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h
clang-tools-extra/clang-tidy/utils/HeaderGuard.h
clang-tools-extra/docs/ReleaseNotes.rst

Removed: 




diff  --git 
a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp 
b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
index 7403762122bd..d4d3ff9af75e 100644
--- a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
@@ -32,7 +32,8 @@ 
DynamicStaticInitializersCheck::DynamicStaticInitializersCheck(StringRef Name,
   RawStringHeaderFileExtensions(Options.getLocalOrGlobal(
 "HeaderFileExtensions", utils::defaultHeaderFileExtensions())) {
   if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
-  HeaderFileExtensions, ',')) {
+  HeaderFileExtensions,
+  utils::defaultFileExtensionDelimiters())) {
 llvm::errs() << "Invalid header file extension: "
  << RawStringHeaderFileExtensions << "\n";
   }

diff  --git 
a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h 
b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
index ac0d32202d61..f06b2d036386 100644
--- a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
+++ b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h
@@ -19,11 +19,12 @@ namespace bugprone {
 /// Finds dynamically initialized static variables in header files.
 ///
 /// The check supports these options:
-///   - `HeaderFileExtensions`: a comma-separated list of filename extensions 
of
-/// header files (The filename extensions should not contain "." prefix).
-/// "h,hh,hpp,hxx" by default.
+///   - `HeaderFileExtensions`: a semicolon-separated list of filename
+/// extensions of header files (The filename extensions should not contain
+/// "." prefix). ";h;hh;hpp;hxx" by default.
+//
 /// For extension-less header files, using an empty string or leaving an
-/// empty string between "," if there are other filename extensions.
+/// empty string between ";" if there are other filename extensions.
 class DynamicStaticInitializersCheck : public ClangTidyCheck {
 public:
   DynamicStaticInitializersCheck(StringRef Name, ClangTidyContext *Context);

diff  --git a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp 
b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
index 09eb266efb35..968adb882391 100644
--- a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
@@ -25,7 +25,8 @@ 
GlobalNamesInHeadersCheck::GlobalNamesInHeadersCheck(StringRef Name,
   RawStringHeaderFileExtensions(Options.getLocalOrGlobal(
   "HeaderFileExtensions", utils::defaultHeaderFileExtensions())) {
   if (!utils::parseFileExtensions(RawStringHeaderFileExtensions,
-  HeaderFileExtensions, ',')) {
+  HeaderFileExtensions,
+  utils::defaultFileExtensionDelimiters())) {
 llvm::errs() << "Invalid header file extension: "
  << RawStringHeaderFileExtensions << "\n";
   }

diff  --git a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h 
b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
index cd69df72962e..aa569dedcdb4 100644
--- a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
+++ b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
@@ -21,11 +21,12 @@ namespace readab

[clang-tools-extra] c71ef7a - Drop HEADER_ per review feedback on D74669

2020-03-09 Thread Jonathan Roelofs via cfe-commits

Author: Jonathan Roelofs
Date: 2020-03-09T12:14:22-06:00
New Revision: c71ef7a85d2447903ff9240aff649a57d70b050d

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

LOG: Drop HEADER_ per review feedback on D74669

Added: 


Modified: 
clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h 
b/clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h
index 4b7810430427..43fc573aad65 100644
--- a/clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h
+++ b/clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h
@@ -6,8 +6,8 @@
 //
 
//===--===//
 
-#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_HEADER_FILE_EXTENSIONS_UTILS_H
-#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_HEADER_FILE_EXTENSIONS_UTILS_H
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_FILE_EXTENSIONS_UTILS_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_FILE_EXTENSIONS_UTILS_H
 
 #include "clang/Basic/SourceLocation.h"
 #include "clang/Basic/SourceManager.h"
@@ -53,4 +53,4 @@ bool isFileExtension(StringRef FileName,
 } // namespace tidy
 } // namespace clang
 
-#endif // 
LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_HEADER_FILE_EXTENSIONS_UTILS_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_FILE_EXTENSIONS_UTILS_H



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


[clang-tools-extra] 1e0669b - [clang-tidy] New check: bugprone-suspicious-include

2020-03-09 Thread Jonathan Roelofs via cfe-commits

Author: Jonathan Roelofs
Date: 2020-03-09T15:54:32-06:00
New Revision: 1e0669bfe05f0f48ee88152c4a1d581f484f8d67

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

LOG: [clang-tidy] New check: bugprone-suspicious-include

Detects and fixes suspicious code like: `#include "foo.cpp"`.

Inspired by: https://twitter.com/lefticus/status/1228458240364687360?s=20

https://reviews.llvm.org/D74669

Added: 
clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.h
clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-include.rst
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/a
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/a.cpp
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/a.hpp
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/c.c
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/c.cc
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/c.cxx
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/i.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone-suspicious-include.cpp

Modified: 
clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp
clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h
clang-tools-extra/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp 
b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
index 86936c678562..9dcb315a257a 100644
--- a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
@@ -45,6 +45,7 @@
 #include "StringIntegerAssignmentCheck.h"
 #include "StringLiteralWithEmbeddedNulCheck.h"
 #include "SuspiciousEnumUsageCheck.h"
+#include "SuspiciousIncludeCheck.h"
 #include "SuspiciousMemsetUsageCheck.h"
 #include "SuspiciousMissingCommaCheck.h"
 #include "SuspiciousSemicolonCheck.h"
@@ -140,6 +141,8 @@ class BugproneModule : public ClangTidyModule {
 "bugprone-string-literal-with-embedded-nul");
 CheckFactories.registerCheck(
 "bugprone-suspicious-enum-usage");
+CheckFactories.registerCheck(
+"bugprone-suspicious-include");
 CheckFactories.registerCheck(
 "bugprone-suspicious-memset-usage");
 CheckFactories.registerCheck(

diff  --git a/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt 
b/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
index c9078ed390d1..a24f3bc7eb0d 100644
--- a/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
@@ -37,6 +37,7 @@ add_clang_library(clangTidyBugproneModule
   StringIntegerAssignmentCheck.cpp
   StringLiteralWithEmbeddedNulCheck.cpp
   SuspiciousEnumUsageCheck.cpp
+  SuspiciousIncludeCheck.cpp
   SuspiciousMemsetUsageCheck.cpp
   SuspiciousMissingCommaCheck.cpp
   SuspiciousSemicolonCheck.cpp

diff  --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp 
b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
new file mode 100644
index ..ade7b111fc9a
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
@@ -0,0 +1,105 @@
+//===--- SuspiciousIncludeCheck.cpp - clang-tidy 
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "SuspiciousIncludeCheck.h"
+#include "clang/AST/ASTContext.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+namespace {
+class SuspiciousIncludePPCallbacks : public PPCallbacks {
+public:
+  explicit SuspiciousIncludePPCallbacks(SuspiciousIncludeCheck &Check,
+const SourceManager &SM,
+Preprocessor *PP)
+  : Check(Check), PP(PP) {}
+
+  void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
+  StringRef FileName, bool IsAngled,
+  CharSourceRange FilenameRange, const FileEntry *File,
+  StringRef SearchPath, StringRef RelativePath,
+  const Module *Imported,
+  SrcMgr::CharacteristicKind FileType) override;
+
+private:
+  SuspiciousIncludeCheck &Check;
+  Preprocessor *PP;
+};
+} // namespace
+
+SuspiciousIncludeCheck::SuspiciousIncludeCheck(StringRef Name

[clang-tools-extra] 698a127 - release notes: fix new check name

2020-03-09 Thread Jonathan Roelofs via cfe-commits

Author: Jonathan Roelofs
Date: 2020-03-09T16:11:35-06:00
New Revision: 698a12712920c214e39bb215fe26fad2e099425b

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

LOG: release notes: fix new check name

Added: 


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

Removed: 




diff  --git a/clang-tools-extra/docs/ReleaseNotes.rst 
b/clang-tools-extra/docs/ReleaseNotes.rst
index 4526cf251d8c..aa9ff71ef7f8 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -98,7 +98,7 @@ New checks
 
   Finds recursive functions and diagnoses them.
 
-- New :doc:`bugprone-suspicious-includei
+- New :doc:`bugprone-suspicious-include
   ` check.
 
   Finds includes that appear to be referring to implementation files (which



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


[clang-tools-extra] 2e9d33b - Add missing list.rst entry

2020-03-09 Thread Jonathan Roelofs via cfe-commits

Author: Jonathan Roelofs
Date: 2020-03-09T16:27:35-06:00
New Revision: 2e9d33bccd587763fc284098b5cc60cfb9c25251

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

LOG: Add missing list.rst entry

Added: 


Modified: 
clang-tools-extra/docs/clang-tidy/checks/list.rst

Removed: 




diff  --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst 
b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index 05741385615a..5a5140bcd429 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -80,6 +80,7 @@ Clang-Tidy Checks
`bugprone-string-integer-assignment 
`_, "Yes"
`bugprone-string-literal-with-embedded-nul 
`_,
`bugprone-suspicious-enum-usage `_,
+   `bugprone-suspicious-include `_,
`bugprone-suspicious-memset-usage 
`_, "Yes"
`bugprone-suspicious-missing-comma 
`_,
`bugprone-suspicious-semicolon `_, "Yes"



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


[clang-tools-extra] 52bbdad - [clang-tidy][docs] Post-commit feedback on D74669

2020-03-09 Thread Jonathan Roelofs via cfe-commits

Author: Jonathan Roelofs
Date: 2020-03-09T16:51:41-06:00
New Revision: 52bbdad7d63fd060d102b3591b433d116a982255

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

LOG: [clang-tidy][docs] Post-commit feedback on D74669

Added: 


Modified: 
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-include.rst

Removed: 




diff  --git a/clang-tools-extra/docs/ReleaseNotes.rst 
b/clang-tools-extra/docs/ReleaseNotes.rst
index aa9ff71ef7f8..3da1433934c4 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -82,6 +82,13 @@ New checks
 
   Checks for usages of identifiers reserved for use by the implementation.
 
+- New :doc:`bugprone-suspicious-include
+  ` check.
+
+  Finds cases where an include refers to what appears to be an implementation
+  file, which often leads to hard-to-track-down ODR violations, and diagnoses
+  them.
+
 - New :doc:`cert-oop57-cpp
   ` check.
 
@@ -98,12 +105,6 @@ New checks
 
   Finds recursive functions and diagnoses them.
 
-- New :doc:`bugprone-suspicious-include
-  ` check.
-
-  Finds includes that appear to be referring to implementation files (which
-  tends to cause ODR violations), and diagnoses them.
-
 New check aliases
 ^
 

diff  --git 
a/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-include.rst 
b/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-include.rst
index 95a90c4f1fb8..9d6c41da504e 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-include.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-include.rst
@@ -3,8 +3,8 @@
 bugprone-suspicious-include
 ===
 
-The checker detects various cases when an include refers to what appears to be
-an implementation file, which often leads to hard-to-track-down ODR violations.
+The check detects various cases when an include refers to what appears to be an
+implementation file, which often leads to hard-to-track-down ODR violations.
 
 Examples:
 
@@ -20,7 +20,7 @@ Options
 ---
 .. option:: HeaderFileExtensions
 
-   Default value: ";h;hh;hpp;hxx"
+   Default value: `";h;hh;hpp;hxx"`
A semicolon-separated list of filename extensions of header files (the
filename extensions should not contain a "." prefix). For extension-less
header files, use an empty string or leave an empty string between ";"
@@ -28,6 +28,6 @@ Options
 
 .. option:: ImplementationFileExtensions
 
-   Default value: "c;cc;cpp;cxx"
+   Default value: `"c;cc;cpp;cxx"`
Likewise, a semicolon-separated list of filename extensions of
implementation files.



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


[clang-tools-extra] 2c9cf9f - [clang-tidy] New check: bugprone-suspicious-include

2020-03-12 Thread Jonathan Roelofs via cfe-commits

Author: Jonathan Roelofs
Date: 2020-03-12T09:59:28-06:00
New Revision: 2c9cf9f4ddd01ae9eb47522266a6343104f9d0b5

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

LOG: [clang-tidy] New check: bugprone-suspicious-include

Detects and fixes suspicious code like: `#include "foo.cpp"`.

Inspired by: https://twitter.com/lefticus/status/1228458240364687360?s=20

https://reviews.llvm.org/D74669

Added: 
clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.h
clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-include.rst
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/a
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/a.cpp
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/a.hpp
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/c.c
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/c.cc
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/c.cxx
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/i.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone-suspicious-include.cpp

Modified: 
clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp
clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h
clang-tools-extra/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp 
b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
index 86936c678562..9dcb315a257a 100644
--- a/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
@@ -45,6 +45,7 @@
 #include "StringIntegerAssignmentCheck.h"
 #include "StringLiteralWithEmbeddedNulCheck.h"
 #include "SuspiciousEnumUsageCheck.h"
+#include "SuspiciousIncludeCheck.h"
 #include "SuspiciousMemsetUsageCheck.h"
 #include "SuspiciousMissingCommaCheck.h"
 #include "SuspiciousSemicolonCheck.h"
@@ -140,6 +141,8 @@ class BugproneModule : public ClangTidyModule {
 "bugprone-string-literal-with-embedded-nul");
 CheckFactories.registerCheck(
 "bugprone-suspicious-enum-usage");
+CheckFactories.registerCheck(
+"bugprone-suspicious-include");
 CheckFactories.registerCheck(
 "bugprone-suspicious-memset-usage");
 CheckFactories.registerCheck(

diff  --git a/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt 
b/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
index c9078ed390d1..a24f3bc7eb0d 100644
--- a/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
@@ -37,6 +37,7 @@ add_clang_library(clangTidyBugproneModule
   StringIntegerAssignmentCheck.cpp
   StringLiteralWithEmbeddedNulCheck.cpp
   SuspiciousEnumUsageCheck.cpp
+  SuspiciousIncludeCheck.cpp
   SuspiciousMemsetUsageCheck.cpp
   SuspiciousMissingCommaCheck.cpp
   SuspiciousSemicolonCheck.cpp

diff  --git a/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp 
b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
new file mode 100644
index ..87ff284408dc
--- /dev/null
+++ b/clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp
@@ -0,0 +1,108 @@
+//===--- SuspiciousIncludeCheck.cpp - clang-tidy 
--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "SuspiciousIncludeCheck.h"
+#include "clang/AST/ASTContext.h"
+
+namespace clang {
+namespace tidy {
+namespace bugprone {
+
+namespace {
+class SuspiciousIncludePPCallbacks : public PPCallbacks {
+public:
+  explicit SuspiciousIncludePPCallbacks(SuspiciousIncludeCheck &Check,
+const SourceManager &SM,
+Preprocessor *PP)
+  : Check(Check), PP(PP) {}
+
+  void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
+  StringRef FileName, bool IsAngled,
+  CharSourceRange FilenameRange, const FileEntry *File,
+  StringRef SearchPath, StringRef RelativePath,
+  const Module *Imported,
+  SrcMgr::CharacteristicKind FileType) override;
+
+private:
+  SuspiciousIncludeCheck &Check;
+  Preprocessor *PP;
+};
+} // namespace
+
+SuspiciousIncludeCheck::SuspiciousIncludeCheck(StringRef Name

[clang] 39fe440 - [clang] Fix EOL whitespace. NFC

2020-01-28 Thread Jonathan Roelofs via cfe-commits

Author: Jonathan Roelofs
Date: 2020-01-28T08:47:37-07:00
New Revision: 39fe44024689cf6d10b249db8694efbdcc6afc14

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

LOG: [clang] Fix EOL whitespace. NFC

Added: 


Modified: 
clang/lib/AST/ASTContext.cpp

Removed: 




diff  --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 75919566aa83..72969490e32d 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -636,7 +636,7 @@ comments::FullComment *ASTContext::getCommentForDecl(
   return FC;
 }
 
-void 
+void
 ASTContext::CanonicalTemplateTemplateParm::Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &C,
TemplateTemplateParmDecl *Parm) 
{



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


r290390 - Fix example: byref struct's init was incorrect, and the block literal's holder should point to it.

2016-12-22 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Thu Dec 22 17:48:23 2016
New Revision: 290390

URL: http://llvm.org/viewvc/llvm-project?rev=290390&view=rev
Log:
Fix example: byref struct's init was incorrect, and the block literal's holder 
should point to it.

Modified:
cfe/trunk/docs/Block-ABI-Apple.rst

Modified: cfe/trunk/docs/Block-ABI-Apple.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/Block-ABI-Apple.rst?rev=290390&r1=290389&r2=290390&view=diff
==
--- cfe/trunk/docs/Block-ABI-Apple.rst (original)
+++ cfe/trunk/docs/Block-ABI-Apple.rst Thu Dec 22 17:48:23 2016
@@ -530,13 +530,13 @@ and:
 
 .. code-block:: c
 
-struct _block_byref_i i = {( .forwarding=&i, .flags=0, .size=sizeof(struct 
_block_byref_i) )};
+struct _block_byref_i i = {( .isa=NULL, .forwarding=&i, .flags=0, 
.size=sizeof(struct _block_byref_i), .captured_i=2 )};
 struct __block_literal_5 _block_literal = {
   &_NSConcreteStackBlock,
   (1<<25)|(1<<29), ,
   __block_invoke_5,
   &__block_descriptor_5,
-  2,
+  &i,
 };
 
 Importing ``__attribute__((NSObject))`` ``__block`` variables


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


Re: [PATCH] D27123: Add AVR target and toolchain to Clang

2017-01-04 Thread Jonathan Roelofs via cfe-commits



On 1/4/17 2:52 AM, Dylan McKay wrote:

I've just raised a bug here

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

> What's necessary for sign-off? Should I ping the reviewer (Richard 
Smith) again?


I think so long as Richard or someone else who actively works on Clang 
signs off. Perhaps somebody else is keen to review?


On the other hand, I can review it and then ask if there aren't any 
objections to it being in-tree within a few days, I can commit it.


LGTM


Jon



On Wed, Jan 4, 2017 at 7:20 PM, Senthil Kumar Selvaraj 
> wrote:



Dylan McKay writes:

> Did you get the BugZilla account sorted Senthil?

Nope, direct email also didn't help. Can you please file a bug with

Title:

UINT16_TYPE and INT16_TYPE are defined as short instead of int for AVR

Description:

   UINT16_TYPE and INT16_TYPE are implicitly defined by the
preprocessor
   to the short type, rather than int. While shorts and ints are both
   16 bits wide on the avr, gcc picks ints to represent 16 bits
wherever
   possible, and picking short can cause issues with C++ name mangling
   (see https://reviews.llvm.org/D27123#615854
). Therefore, clang should
   define the two types to short.

   Clang's
lib/Frontend/InitPreprocessor.cpp::DefineExactWidthIntType does not
   use TargetInfo::getIntTypeByWidth. Instead,
   InitializePredefinedMacros calls
   the function with the specific type
(SignedShort/UnsignedShort), because
   getShortWidth() > getCharWidth(), but getIntWidth() ==
   getShortWidth().


What's necessary for sign-off? Should I ping the reviewer (Richard
Smith) again?

Regards
Senthil




--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded

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


Re: [PATCH] D23524: [libc++abi] Fix backtrace_test.pass.cpp failure seemingly caused by inlining differences.

2016-08-15 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

I'm not sure that's guaranteed behavior either. That being said, I don't see a 
more robust way to write this test.


https://reviews.llvm.org/D23524



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


Re: [PATCH] D23420: libcxx: Fix libcxx test on aarch64 with libunwind

2016-08-22 Thread Jonathan Roelofs via cfe-commits
jroelofs accepted this revision.
jroelofs added a comment.
This revision is now accepted and ready to land.

LGTM


https://reviews.llvm.org/D23420



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


Re: [PATCH] D21803: [libcxxabi] Provide a fallback __cxa_thread_atexit() implementation

2016-09-01 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In https://reviews.llvm.org/D21803#532309, @EricWF wrote:

> `__thread`
>
> What do you think of this idea?


You'll have to guard it against all the platforms that don't support TLS. 
Darwin 10.6 is one of them.


https://reviews.llvm.org/D21803



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


Re: [PATCH] D21803: [libcxxabi] Provide a fallback __cxa_thread_atexit() implementation

2016-09-01 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In https://reviews.llvm.org/D21803#532382, @EricWF wrote:

> In https://reviews.llvm.org/D21803#532347, @jroelofs wrote:
>
> > In https://reviews.llvm.org/D21803#532309, @EricWF wrote:
> >
> > > `__thread`
> > >
> > > What do you think of this idea?
> >
> >
> > You'll have to guard it against all the platforms that don't support TLS. 
> > Darwin 10.6 is one of them.
>
>
> Which is fine because we shouldn't supply a definition of 
> `__cxa_thread_atexit` on those platforms.


Ah, ok. Sounds good.


https://reviews.llvm.org/D21803



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


Re: [PATCH] trivial documentation fix regarding Obj-C ARC objc_arc_weak_reference_unavailable

2016-09-02 Thread Jonathan Roelofs via cfe-commits



On 9/2/16 9:26 AM, Sean McBride via cfe-commits wrote:

Friendly ping... this is a very trivial documentation patch...


LGTM




On Wed, 10 Aug 2016 13:57:07 -0400, Sean McBride via cfe-commits said:


Fixed incorrect docs that referred to:
objc_arc_weak_unavailable
when it should be:
objc_arc_weak_reference_unavailable

Cheers,

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


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


--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r281227 - Trivial documentation fix regarding Obj-C ARC objc_arc_weak_reference_unavailable

2016-09-12 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Mon Sep 12 11:14:52 2016
New Revision: 281227

URL: http://llvm.org/viewvc/llvm-project?rev=281227&view=rev
Log:
Trivial documentation fix regarding Obj-C ARC 
objc_arc_weak_reference_unavailable

Fixed incorrect docs that referred to:
  objc_arc_weak_unavailable
when it should be:
  objc_arc_weak_reference_unavailable

Patch by: Sean McBride!

Modified:
cfe/trunk/docs/AutomaticReferenceCounting.rst

Modified: cfe/trunk/docs/AutomaticReferenceCounting.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/AutomaticReferenceCounting.rst?rev=281227&r1=281226&r2=281227&view=diff
==
--- cfe/trunk/docs/AutomaticReferenceCounting.rst (original)
+++ cfe/trunk/docs/AutomaticReferenceCounting.rst Mon Sep 12 11:14:52 2016
@@ -910,10 +910,10 @@ not support ``__weak`` references.
   binary compatibility.
 
 A class may indicate that it does not support weak references by providing the
-``objc_arc_weak_unavailable`` attribute on the class's interface declaration.  
A
+``objc_arc_weak_reference_unavailable`` attribute on the class's interface 
declaration.  A
 retainable object pointer type is **weak-unavailable** if
 is a pointer to an (optionally protocol-qualified) Objective-C class ``T`` 
where
-``T`` or one of its superclasses has the ``objc_arc_weak_unavailable``
+``T`` or one of its superclasses has the 
``objc_arc_weak_reference_unavailable``
 attribute.  A program is ill-formed if it applies the ``__weak`` ownership
 qualifier to a weak-unavailable type or if the value operand of a weak
 assignment operation has a weak-unavailable type.


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


r297756 - Fix misspelled enum

2017-03-14 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Tue Mar 14 12:29:33 2017
New Revision: 297756

URL: http://llvm.org/viewvc/llvm-project?rev=297756&view=rev
Log:
Fix misspelled enum

https://reviews.llvm.org/D30945

Modified:
cfe/trunk/include/clang/Parse/Parser.h
cfe/trunk/lib/Parse/ParseOpenMP.cpp
cfe/trunk/lib/Parse/ParseStmt.cpp

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=297756&r1=297755&r2=297756&view=diff
==
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Tue Mar 14 12:29:33 2017
@@ -1686,7 +1686,7 @@ private:
 
   StmtResult ParseStatement(SourceLocation *TrailingElseLoc = nullptr,
 bool AllowOpenMPStandalone = false);
-  enum AllowedContsructsKind {
+  enum AllowedConstructsKind {
 /// \brief Allow any declarations, statements, OpenMP directives.
 ACK_Any,
 /// \brief Allow only statements and non-standalone OpenMP directives.
@@ -1695,11 +1695,11 @@ private:
 ACK_StatementsOpenMPAnyExecutable
   };
   StmtResult
-  ParseStatementOrDeclaration(StmtVector &Stmts, AllowedContsructsKind Allowed,
+  ParseStatementOrDeclaration(StmtVector &Stmts, AllowedConstructsKind Allowed,
   SourceLocation *TrailingElseLoc = nullptr);
   StmtResult ParseStatementOrDeclarationAfterAttributes(
  StmtVector &Stmts,
- AllowedContsructsKind Allowed,
+ AllowedConstructsKind Allowed,
  SourceLocation *TrailingElseLoc,
  ParsedAttributesWithRange &Attrs);
   StmtResult ParseExprStatement();
@@ -1728,7 +1728,7 @@ private:
   StmtResult ParseAsmStatement(bool &msAsm);
   StmtResult ParseMicrosoftAsmStatement(SourceLocation AsmLoc);
   StmtResult ParsePragmaLoopHint(StmtVector &Stmts,
- AllowedContsructsKind Allowed,
+ AllowedConstructsKind Allowed,
  SourceLocation *TrailingElseLoc,
  ParsedAttributesWithRange &Attrs);
 
@@ -2587,7 +2587,7 @@ private:
   /// executable directives are allowed.
   ///
   StmtResult
-  ParseOpenMPDeclarativeOrExecutableDirective(AllowedContsructsKind Allowed);
+  ParseOpenMPDeclarativeOrExecutableDirective(AllowedConstructsKind Allowed);
   /// \brief Parses clause of kind \a CKind for directive of a kind \a Kind.
   ///
   /// \param DKind Kind of current directive.

Modified: cfe/trunk/lib/Parse/ParseOpenMP.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseOpenMP.cpp?rev=297756&r1=297755&r2=297756&view=diff
==
--- cfe/trunk/lib/Parse/ParseOpenMP.cpp (original)
+++ cfe/trunk/lib/Parse/ParseOpenMP.cpp Tue Mar 14 12:29:33 2017
@@ -806,7 +806,7 @@ Parser::DeclGroupPtrTy Parser::ParseOpen
 /// annot_pragma_openmp_end
 ///
 StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective(
-AllowedContsructsKind Allowed) {
+AllowedConstructsKind Allowed) {
   assert(Tok.is(tok::annot_pragma_openmp) && "Not an OpenMP directive!");
   ParenBraceBracketBalancer BalancerRAIIObj(*this);
   SmallVector Clauses;

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=297756&r1=297755&r2=297756&view=diff
==
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Tue Mar 14 12:29:33 2017
@@ -97,7 +97,7 @@ StmtResult Parser::ParseStatement(Source
 ///
 StmtResult
 Parser::ParseStatementOrDeclaration(StmtVector &Stmts,
-AllowedContsructsKind Allowed,
+AllowedConstructsKind Allowed,
 SourceLocation *TrailingElseLoc) {
 
   ParenBraceBracketBalancer BalancerRAIIObj(*this);
@@ -150,7 +150,7 @@ private:
 
 StmtResult
 Parser::ParseStatementOrDeclarationAfterAttributes(StmtVector &Stmts,
-  AllowedContsructsKind Allowed, SourceLocation *TrailingElseLoc,
+  AllowedConstructsKind Allowed, SourceLocation *TrailingElseLoc,
   ParsedAttributesWithRange &Attrs) {
   const char *SemiError = nullptr;
   StmtResult Res;
@@ -1903,7 +1903,7 @@ StmtResult Parser::ParseReturnStatement(
 }
 
 StmtResult Parser::ParsePragmaLoopHint(StmtVector &Stmts,
-   AllowedContsructsKind Allowed,
+   AllowedConstructsKind Allowed,
SourceLocation *TrailingElseLoc,
ParsedAttributesWithRange &

r298275 - Fix some sphinx -Werror's

2017-03-20 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Mon Mar 20 12:07:49 2017
New Revision: 298275

URL: http://llvm.org/viewvc/llvm-project?rev=298275&view=rev
Log:
Fix some sphinx -Werror's

... mostly having to do with code blocks which the syntax highlighter chokes on

Modified:
cfe/trunk/docs/ClangFormatStyleOptions.rst
cfe/trunk/docs/ReleaseNotes.rst

Modified: cfe/trunk/docs/ClangFormatStyleOptions.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormatStyleOptions.rst?rev=298275&r1=298274&r2=298275&view=diff
==
--- cfe/trunk/docs/ClangFormatStyleOptions.rst (original)
+++ cfe/trunk/docs/ClangFormatStyleOptions.rst Mon Mar 20 12:07:49 2017
@@ -302,7 +302,7 @@ the configuration (without a prefix: ``A
 
 .. code-block:: c++
 
-  class {
+  class Foo {
 void f() { foo(); }
   };
 
@@ -311,7 +311,7 @@ the configuration (without a prefix: ``A
 
 .. code-block:: c++
 
-  class {
+  class Foo {
 void f() { foo(); }
   };
   void f() { bar(); }
@@ -898,7 +898,7 @@ the configuration (without a prefix: ``A
 
   .. code-block:: c++
 
- CommentPragmas: '^ FOOBAR pragma:'
+ // CommentPragmas: '^ FOOBAR pragma:'
  // Will leave the following line unaffected
  #include  // FOOBAR pragma: keep
 

Modified: cfe/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=298275&r1=298274&r2=298275&view=diff
==
--- cfe/trunk/docs/ReleaseNotes.rst (original)
+++ cfe/trunk/docs/ReleaseNotes.rst Mon Mar 20 12:07:49 2017
@@ -135,32 +135,43 @@ clang-format
 * Option **BreakBeforeInheritanceComma** added to break before ``:`` and ``,`` 
 in case of
   multiple inheritance in a class declaration. Enabled by default in the 
Mozilla coding style.
 
-  .. code-block:: c++
-
- true:  false:
- class MyClass  vs. class MyClass : public X, public Y 
{
- : public X };
- , public Y {
- };
+  +-++
+  | true| false  |
+  +=++
+  | .. code-block:: c++ | .. code-block:: c++|
+  | ||
+  |   class MyClass |   class MyClass : public X, public Y { |
+  |   : public X|   };   |
+  |   , public Y {  ||
+  |   };||
+  +-++
 
 * Align block comment decorations.
 
-  .. code-block:: c++
-
- /* line 1  /* line 1
-   * line 2   becomes:   * line 2
-  */ */
+  +--+-+
+  | Before   | After   |
+  +==+=+
+  |  .. code-block:: c++ | .. code-block:: c++ |
+  |  | |
+  |/* line 1 |   /* line 1 |
+  |  * line 2|* line 2 |
+  | */   |*/   |
+  +--+-+
 
 * The :doc:`ClangFormatStyleOptions` documentation provides detailed examples 
for most options.
 
 * Namespace end comments are now added or updated automatically.
 
-  .. code-block:: c++
-
- namespace A {  namespace A {
- int i; int i;
- int j;   becomes:  int j;
- }  } // namespace A
+  +-+-+
+  | Before  | After   |
+  +=+=+
+  | .. code-block:: c++ | .. code-block:: c++ |
+  | | |
+  |   namespace A { |   namespace A { |
+  |   int i;|   int i;|
+  |   int j;|   int j;|
+  |   } |   } |
+  +-+-+
 
 * Comment reflow support added. Overly long comment lines will now be reflown 
with the rest of
   the paragraph instead of just broken. Option **ReflowComments** added and 
enabled by default.


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


Re: [PATCH] D31140: [LLVMbugs] [Bug 18710] Only generate .ARM.exidx and .ARM.extab when needed in EHABI

2017-03-21 Thread Jonathan Roelofs via cfe-commits



On 3/21/17 1:53 PM, Christian Bruel via Phabricator wrote:

chrib added a comment.

In https://reviews.llvm.org/D31140#706411, @jroelofs wrote:


Can you clarify the logic here? It's my understanding that:

`-fno-exceptions` does *not* imply `-fno-unwind-tables`

however:

`-fno-unwind-tables` *does* imply that exceptions cannot be used on targets 
that require the tables to do unwinding.


Yes, (bad things might happen or (std::terminate will be called, or destructors 
not called.)...

But -f[no]-unwind-tables implies the UWTable attribute, not NoUwind attribute. 
To toggle NoUnwind, use -fno-exceptions

And this is getting worse with .canunwind which means DoesNotThrow :)

in my understanding,  the logic is as follow:

Since "An exception cannot propagate through a function with a nounwind table. The 
exception handling runtime environment terminates the program if it encounters a nounwind 
table during exception processing." (ARM Information Center)

The "nounwind" LLVM attribute, which means "Function does not throw" translates 
as the EXIDX_CANTUNWIND value in the exception table index table which needs to be created for the 
purpose (for the function)


I think the problem is here, actually. "nounwind" implies "does not 
throw", but "does not throw" really should not imply "nounwind". This is 
something that ought to be clarified in the langref with the addition of 
a "does not throw" attribute. Then the optimizer should be fixed to 
deduce "does not throw" instead of "nounwind", and we can let "nounwind" 
continue to imply .cantunwind.




And of course without exception runtime environment (the test here) we don't 
need this table. So I can see 3 cases:

- nounwind set :Generate .cantunwind directive and unwind 
table
- nounwind set but not EH   Do not generate the .cantunwind directive and do 
not emit the unwind table
- uwtable set Need to generate the unwind table (even 
without EH)

The  disable-arm-cantunwind flag means: without EH support if the function does 
not throw, do dot generate the exception tables and the EXIDX_CANTUNWIND value.


I'm not a big fan of this workaround flag. I'd rather see this fixed by 
clarifying/fixing the semantics of the IR.



Jon




https://reviews.llvm.org/D31140





--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded

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


r298549 - Actually install scan-build / ccc-analyzer / c++-analyzer on windows

2017-03-22 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Wed Mar 22 16:13:49 2017
New Revision: 298549

URL: http://llvm.org/viewvc/llvm-project?rev=298549&view=rev
Log:
Actually install scan-build / ccc-analyzer / c++-analyzer on windows

Before, we were only installing the wrappers... oops.

Modified:
cfe/trunk/tools/scan-build/CMakeLists.txt

Modified: cfe/trunk/tools/scan-build/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/CMakeLists.txt?rev=298549&r1=298548&r2=298549&view=diff
==
--- cfe/trunk/tools/scan-build/CMakeLists.txt (original)
+++ cfe/trunk/tools/scan-build/CMakeLists.txt Wed Mar 22 16:13:49 2017
@@ -4,8 +4,11 @@ include(GNUInstallDirs)
 
 if (WIN32 AND NOT CYGWIN)
   set(BinFiles
+scan-build
 scan-build.bat)
   set(LibexecFiles
+ccc-analyzer
+c++-analyzer
 ccc-analyzer.bat
 c++-analyzer.bat)
 else()


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


Re: [PATCH] Use the correct ObjC++ personality

2017-03-26 Thread Jonathan Roelofs via cfe-commits



On 3/26/17 10:13 AM, Jonathan Schleifer via cfe-commits wrote:

Use the correct EH personality for ObjC++ code.

Previously, it would just always use the ObjC DWARF personality, even with SjLj 
or SEH exceptions.

diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp
index 228efec51b..ca1535182e 100644
--- a/lib/CodeGen/CGException.cpp
+++ b/lib/CodeGen/CGException.cpp
@@ -180,8 +180,8 @@ static const EHPersonality &getObjCXXPersonality(const 
llvm::Triple &T,
  // The GCC runtime's personality function inherently doesn't support
  // mixed EH.  Use the C++ personality just to avoid returning null.
  case ObjCRuntime::GCC:
-  case ObjCRuntime::ObjFW: // XXX: this will change soon
-return EHPersonality::GNU_ObjC;
+  case ObjCRuntime::ObjFW:
+return getObjCPersonality(T, L);
  case ObjCRuntime::GNUstep:
return EHPersonality::GNU_ObjCXX;
  }



Testcase?

Jon


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



--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libunwind] r298922 - [libunwind] Add sphinx docs

2017-03-28 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Tue Mar 28 10:21:43 2017
New Revision: 298922

URL: http://llvm.org/viewvc/llvm-project?rev=298922&view=rev
Log:
[libunwind] Add sphinx docs

https://reviews.llvm.org/D31375

Added:
libunwind/trunk/docs/
libunwind/trunk/docs/BuildingLibunwind.rst
libunwind/trunk/docs/CMakeLists.txt
libunwind/trunk/docs/README.txt
libunwind/trunk/docs/conf.py
libunwind/trunk/docs/index.rst
Modified:
libunwind/trunk/CMakeLists.txt

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=298922&r1=298921&r2=298922&view=diff
==
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Tue Mar 28 10:21:43 2017
@@ -122,6 +122,7 @@ option(LIBUNWIND_ENABLE_STATIC "Build li
 option(LIBUNWIND_ENABLE_CROSS_UNWINDING "Enable cross-platform unwinding 
support." OFF)
 option(LIBUNWIND_ENABLE_ARM_WMMX "Enable unwinding support for ARM WMMX 
registers." OFF)
 option(LIBUNWIND_ENABLE_THREADS "Build libunwind with threading support." ON)
+option(LIBUNWIND_INCLUDE_DOCS "Build the libunwind documentation." 
${LLVM_INCLUDE_DOCS})
 
 set(LIBUNWIND_TARGET_TRIPLE "" CACHE STRING "Target triple for cross 
compiling.")
 set(LIBUNWIND_GCC_TOOLCHAIN "" CACHE PATH "GCC toolchain for cross compiling.")
@@ -303,3 +304,7 @@ if (NOT LIBUNWIND_CXX_INCLUDE_PATHS STRE
 endif()
 
 add_subdirectory(src)
+
+if (LIBUNWIND_INCLUDE_DOCS)
+  add_subdirectory(docs)
+endif()

Added: libunwind/trunk/docs/BuildingLibunwind.rst
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/docs/BuildingLibunwind.rst?rev=298922&view=auto
==
--- libunwind/trunk/docs/BuildingLibunwind.rst (added)
+++ libunwind/trunk/docs/BuildingLibunwind.rst Tue Mar 28 10:21:43 2017
@@ -0,0 +1,167 @@
+.. _BuildingLibunwind:
+
+==
+Building libunwind
+==
+
+.. contents::
+  :local:
+
+.. _build instructions:
+
+Getting Started
+===
+
+On Mac OS, the easiest way to get this library is to link with -lSystem.
+However if you want to build tip-of-trunk from here (getting the bleeding
+edge), read on.
+
+The basic steps needed to build libc++ are:
+
+#. Checkout LLVM:
+
+   * ``cd where-you-want-llvm-to-live``
+   * ``svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm``
+
+#. Checkout libunwind:
+
+   * ``cd where-you-want-llvm-to-live``
+   * ``cd llvm/runtimes``
+   * ``svn co http://llvm.org/svn/llvm-project/libunwind/trunk libunwind``
+
+#. Configure and build libunwind:
+
+   CMake is the only supported configuration system.
+
+   Clang is the preferred compiler when building and using libunwind.
+
+   * ``cd where you want to build llvm``
+   * ``mkdir build``
+   * ``cd build``
+   * ``cmake -G  [options] ``
+
+   For more information about configuring libunwind see :ref:`CMake Options`.
+
+   * ``make unwind`` --- will build libunwind.
+   * ``make check-unwind`` --- will run the test suite.
+
+   Shared and static libraries for libunwind should now be present in 
llvm/build/lib.
+
+#. **Optional**: Install libunwind
+
+   If your system already provides an unwinder, it is important to be careful
+   not to replace it. Remember Use the CMake option ``CMAKE_INSTALL_PREFIX`` to
+   select a safe place to install libunwind.
+
+   * ``make install-unwind`` --- Will install the libraries and the headers
+
+
+It is sometimes beneficial to build outside of the LLVM tree. An out-of-tree
+build would look like this:
+
+.. code-block:: bash
+
+  $ cd where-you-want-libunwind-to-live
+  $ # Check out llvm, and libunwind
+  $ ``svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm``
+  $ ``svn co http://llvm.org/svn/llvm-project/libunwind/trunk libunwind``
+  $ cd where-you-want-to-build
+  $ mkdir build && cd build
+  $ export CC=clang CXX=clang++
+  $ cmake -DLLVM_PATH=path/to/llvm \
+  path/to/libunwind
+  $ make
+
+
+.. _CMake Options:
+
+CMake Options
+=
+
+Here are some of the CMake variables that are used often, along with a
+brief explanation and LLVM-specific notes. For full documentation, check the
+CMake docs or execute ``cmake --help-variable VARIABLE_NAME``.
+
+**CMAKE_BUILD_TYPE**:STRING
+  Sets the build type for ``make`` based generators. Possible values are
+  Release, Debug, RelWithDebInfo and MinSizeRel. On systems like Visual Studio
+  the user sets the build type with the IDE settings.
+
+**CMAKE_INSTALL_PREFIX**:PATH
+  Path where LLVM will be installed if "make install" is invoked or the
+  "INSTALL" target is built.
+
+**CMAKE_CXX_COMPILER**:STRING
+  The C++ compiler to use when building and testing libunwind.
+
+
+.. _libunwind-specific options:
+
+libunwind specific options
+--
+
+.. option:: LIBUNWIND_BUILD_32_BITS:BOOL
+
+  **Default**: Same as LLVM_BUILD_32_BITS
+
+  Toggle whether libunwind should

[libunwind] r299381 - Try to trigger the new docs builder. NFC

2017-04-03 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Mon Apr  3 14:23:11 2017
New Revision: 299381

URL: http://llvm.org/viewvc/llvm-project?rev=299381&view=rev
Log:
Try to trigger the new docs builder. NFC

Modified:
libunwind/trunk/docs/index.rst

Modified: libunwind/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/docs/index.rst?rev=299381&r1=299380&r2=299381&view=diff
==
--- libunwind/trunk/docs/index.rst (original)
+++ libunwind/trunk/docs/index.rst Mon Apr  3 14:23:11 2017
@@ -64,6 +64,7 @@ Notes and Known Issues
 
 * TODO
 
+
 Getting Involved
 
 


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


r292375 - Warn when calling a non interrupt function from an interrupt on ARM

2017-01-18 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Wed Jan 18 09:31:11 2017
New Revision: 292375

URL: http://llvm.org/viewvc/llvm-project?rev=292375&view=rev
Log:
Warn when calling a non interrupt function from an interrupt on ARM

The idea for this originated from a really tricky bug: ISRs on ARM don't
automatically save off the VFP regs, so if say, memcpy gets interrupted and the
ISR itself calls memcpy, the regs are left clobbered when the ISR is done.

https://reviews.llvm.org/D28820

Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/Sema/arm-interrupt-attr.c

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=292375&r1=292374&r2=292375&view=diff
==
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Jan 18 09:31:11 
2017
@@ -259,6 +259,9 @@ def err_anyx86_interrupt_attribute : Err
   "a pointer as the first parameter|a %2 type as the second parameter}1">;
 def err_anyx86_interrupt_called : Error<
   "interrupt service routine cannot be called directly">;
+def warn_arm_interrupt_calling_convention : Warning<
+   "call to function without interrupt attribute could clobber interruptee's 
VFP registers">,
+   InGroup;
 def warn_mips_interrupt_attribute : Warning<
"MIPS 'interrupt' attribute only applies to functions that have "
"%select{no parameters|a 'void' return type}0">,

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=292375&r1=292374&r2=292375&view=diff
==
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Jan 18 09:31:11 2017
@@ -5395,6 +5395,15 @@ Sema::BuildResolvedCallExpr(Expr *Fn, Na
 return ExprError();
   }
 
+  // Interrupt handlers don't save off the VFP regs automatically on ARM,
+  // so there's some risk when calling out to non-interrupt handler functions
+  // that the callee might not preserve them. This is easy to diagnose here,
+  // but can be very challenging to debug.
+  if (auto *Caller = getCurFunctionDecl())
+if (Caller->hasAttr())
+  if (!FDecl->hasAttr())
+Diag(Fn->getExprLoc(), diag::warn_arm_interrupt_calling_convention);
+
   // Promote the function operand.
   // We special-case function promotion here because we only allow promoting
   // builtin functions to function pointers in the callee of a call.

Modified: cfe/trunk/test/Sema/arm-interrupt-attr.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/arm-interrupt-attr.c?rev=292375&r1=292374&r2=292375&view=diff
==
--- cfe/trunk/test/Sema/arm-interrupt-attr.c (original)
+++ cfe/trunk/test/Sema/arm-interrupt-attr.c Wed Jan 18 09:31:11 2017
@@ -17,3 +17,14 @@ __attribute__((interrupt("UNDEF"))) void
 __attribute__((interrupt)) void foo8() {}
 __attribute__((interrupt())) void foo9() {}
 __attribute__((interrupt(""))) void foo10() {}
+
+void callee1();
+__attribute__((interrupt("IRQ"))) void callee2();
+void caller1() {
+  callee1();
+  callee2();
+}
+__attribute__((interrupt("IRQ"))) void caller2() {
+  callee1(); // expected-warning {{call to function without interrupt 
attribute could clobber interruptee's VFP registers}}
+  callee2();
+}


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


[libcxxabi] r292418 - Revert r286788

2017-01-18 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Wed Jan 18 12:12:39 2017
New Revision: 292418

URL: http://llvm.org/viewvc/llvm-project?rev=292418&view=rev
Log:
Revert r286788

The Itanium ABI [1] specifies that __cxa_demangle accept either:

   1) symbol names, which start with "_Z"
   2) type manglings, which do not start with "_Z"

r286788 erroneously assumes that it should only handle symbols, so this patch
reverts it and adds a counterexample to the testcase.

1: https://mentorembedded.github.io/cxx-abi/abi.html#demangler


Reviewers: zygoloid, EricWF

Modified:
libcxxabi/trunk/src/cxa_demangle.cpp
libcxxabi/trunk/test/test_demangle.pass.cpp

Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=292418&r1=292417&r2=292418&view=diff
==
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Wed Jan 18 12:12:39 2017
@@ -4979,22 +4979,12 @@ __cxa_demangle(const char *mangled_name,
 return nullptr;
 }
 
-size_t len = std::strlen(mangled_name);
-if (len < 2 || strncmp(mangled_name, "_Z", 2))
-{
-if (len < 4 || strncmp(mangled_name, "___Z", 4))
-{
-if (status)
-*status = invalid_mangled_name;
-return nullptr;
-}
-}
-
 size_t internal_size = buf != nullptr ? *n : 0;
 arena a;
 Db db(a);
 db.template_param.emplace_back(a);
 int internal_status = success;
+size_t len = std::strlen(mangled_name);
 demangle(mangled_name, mangled_name + len, db,
  internal_status);
 if (internal_status == success && db.fix_forward_references &&

Modified: libcxxabi/trunk/test/test_demangle.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_demangle.pass.cpp?rev=292418&r1=292417&r2=292418&view=diff
==
--- libcxxabi/trunk/test/test_demangle.pass.cpp (original)
+++ libcxxabi/trunk/test/test_demangle.pass.cpp Wed Jan 18 12:12:39 2017
@@ -29594,6 +29594,9 @@ const char* cases[][2] =
 // NOTE: disable this test since it is a negative test case, you cannot 
demangle a non-mangled symbol
 // {"\x6D", nullptr},  // This use to crash with ASAN
 {"_ZTIU4_farrVKPi", "typeinfo for int* const volatile restrict _far"},
+
+// mangled names can include type manglings too, which don't start with _Z:
+{"i", "int"},
 };
 
 const unsigned N = sizeof(cases) / sizeof(cases[0]);


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


Re: [libcxxabi] r292418 - Revert r286788

2017-01-18 Thread Jonathan Roelofs via cfe-commits



On 1/18/17 11:26 AM, Richard Smith via cfe-commits wrote:

On 18 January 2017 at 10:12, Jonathan Roelofs via cfe-commits
mailto:cfe-commits@lists.llvm.org>> wrote:

Author: jroelofs
Date: Wed Jan 18 12:12:39 2017
New Revision: 292418

URL: http://llvm.org/viewvc/llvm-project?rev=292418&view=rev
<http://llvm.org/viewvc/llvm-project?rev=292418&view=rev>
Log:
Revert r286788

The Itanium ABI [1] specifies that __cxa_demangle accept either:

   1) symbol names, which start with "_Z"
   2) type manglings, which do not start with "_Z"

r286788 erroneously assumes that it should only handle symbols, so
this patch
reverts it and adds a counterexample to the testcase.

1: https://mentorembedded.github.io/cxx-abi/abi.html#demangler
<https://mentorembedded.github.io/cxx-abi/abi.html#demangler>


Thanks! Just FYI, the ABI document now lives
here: https://itanium-cxx-abi.github.io/cxx-abi/


Ah, didn't realize the canonical location changed. Should I get someone 
to change where this redirect points?


   "http://www.codesourcery.com/cxx-abi/: External link to this page"

As-is, that points at the 'mentorembedded.github.io' one.


Jon



Reviewers: zygoloid, EricWF

Modified:
libcxxabi/trunk/src/cxa_demangle.cpp
libcxxabi/trunk/test/test_demangle.pass.cpp




--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: Add warning for c++ member variable shadowing

2017-02-07 Thread Jonathan Roelofs via cfe-commits



On 1/24/17 8:10 PM, Saleem Abdulrasool via cfe-commits wrote:

Don't use the cast for the check, use isa.  Although, since you use the
value later, it is probably better to write this as:

if (const auto *RD = cast(CurContext))
  CheckShadowInheritedVariabless(Loc, Name.getAsString(), RD, RD);



@compnerd: s/cast/dyn_cast/ or s/cast/dyn_cast_or_null/, right?


Jon


--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: Add warning for c++ member variable shadowing

2017-02-07 Thread Jonathan Roelofs via cfe-commits



On 2/7/17 7:30 PM, Saleem Abdulrasool wrote:



On Tue, Feb 7, 2017 at 1:09 PM, Jonathan Roelofs 
mailto:jonat...@codesourcery.com>> wrote:




On 1/24/17 8:10 PM, Saleem Abdulrasool via cfe-commits wrote:

Don't use the cast for the check, use isa.  Although, since
you use the
value later, it is probably better to write this as:

if (const auto *RD = cast(CurContext))
  CheckShadowInheritedVariabless(Loc, Name.getAsString(),
RD, RD);



@compnerd: s/cast/dyn_cast/ or s/cast/dyn_cast_or_null/, right?


Only in that it looks weird.  There is an assert that CurContext is a 
CXXRecordDecl, so the cast is perfectly fine.


Oh, I see. the branch is never expected to go the other way... yeah, 
that is a strange, non-idiomatic use of 'if'.



Jon



Jon


-- 
Jon Roelofs

jonat...@codesourcery.com 
CodeSourcery / Mentor Embedded




--
Saleem Abdulrasool
compnerd (at) compnerd (dot) org


--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded

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


[libunwind] r307266 - Add a test harness

2017-07-06 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Thu Jul  6 08:20:12 2017
New Revision: 307266

URL: http://llvm.org/viewvc/llvm-project?rev=307266&view=rev
Log:
Add a test harness

Mostly cargo-culted from libcxxabi, since the unwinder was forked from there in
the first place. There may still be cruft that's only applicable to libcxxabi,
but that can be addressed in-tree.

https://reviews.llvm.org/D35038

Added:
libunwind/trunk/test/CMakeLists.txt
libunwind/trunk/test/libunwind/
libunwind/trunk/test/libunwind/__init__.py
libunwind/trunk/test/libunwind/test/
libunwind/trunk/test/libunwind/test/__init__.py
libunwind/trunk/test/libunwind/test/config.py
libunwind/trunk/test/lit.cfg
libunwind/trunk/test/lit.site.cfg.in
Modified:
libunwind/trunk/CMakeLists.txt
libunwind/trunk/test/libunwind_02.pass.cpp

Modified: libunwind/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=307266&r1=307265&r2=307266&view=diff
==
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Thu Jul  6 08:20:12 2017
@@ -321,3 +321,5 @@ add_subdirectory(src)
 if (LIBUNWIND_INCLUDE_DOCS)
   add_subdirectory(docs)
 endif()
+
+add_subdirectory(test)

Added: libunwind/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/test/CMakeLists.txt?rev=307266&view=auto
==
--- libunwind/trunk/test/CMakeLists.txt (added)
+++ libunwind/trunk/test/CMakeLists.txt Thu Jul  6 08:20:12 2017
@@ -0,0 +1,35 @@
+include(AddLLVM) # for add_lit_testsuite
+macro(pythonize_bool var)
+  if (${var})
+set(${var} True)
+  else()
+set(${var} False)
+  endif()
+endmacro()
+
+if (NOT DEFINED LIBCXX_ENABLE_SHARED)
+  set(LIBCXX_ENABLE_SHARED ON)
+endif()
+
+pythonize_bool(LIBUNWIND_BUILD_32_BITS)
+pythonize_bool(LIBCXX_ENABLE_SHARED)
+pythonize_bool(LIBUNWIND_ENABLE_SHARED)
+pythonize_bool(LIBUNWIND_ENABLE_THREADS)
+pythonize_bool(LIBUNWIND_ENABLE_EXCEPTIONS)
+pythonize_bool(LIBUNWIND_USE_LLVM_UNWINDER)
+pythonize_bool(LIBUNWIND_BUILD_EXTERNAL_THREAD_LIBRARY)
+set(LIBUNWIND_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
+"TargetInfo to use when setting up test environment.")
+set(LIBUNWIND_EXECUTOR "None" CACHE STRING
+"Executor to use when running tests.")
+
+set(AUTO_GEN_COMMENT "## Autogenerated by libunwind configuration.\n# Do not 
edit!")
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+  @ONLY)
+
+add_lit_testsuite(check-unwind "Running libunwind tests"
+  ${CMAKE_CURRENT_BINARY_DIR}
+  DEPENDS ${LIBUNWIND_TEST_DEPS}
+  )

Added: libunwind/trunk/test/libunwind/__init__.py
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/test/libunwind/__init__.py?rev=307266&view=auto
==
(empty)

Added: libunwind/trunk/test/libunwind/test/__init__.py
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/test/libunwind/test/__init__.py?rev=307266&view=auto
==
(empty)

Added: libunwind/trunk/test/libunwind/test/config.py
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/test/libunwind/test/config.py?rev=307266&view=auto
==
--- libunwind/trunk/test/libunwind/test/config.py (added)
+++ libunwind/trunk/test/libunwind/test/config.py Thu Jul  6 08:20:12 2017
@@ -0,0 +1,70 @@
+#===--===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===--===##
+import os
+import sys
+
+from libcxx.test.config import Configuration as LibcxxConfiguration
+
+
+class Configuration(LibcxxConfiguration):
+# pylint: disable=redefined-outer-name
+def __init__(self, lit_config, config):
+super(Configuration, self).__init__(lit_config, config)
+self.libunwind_src_root = None
+self.libunwind_obj_root = None
+self.abi_library_path = None
+self.libcxx_src_root = None
+
+def configure_src_root(self):
+self.libunwind_src_root = self.get_lit_conf(
+'libunwind_src_root',
+os.path.dirname(self.config.test_source_root))
+self.libcxx_src_root = self.get_lit_conf(
+'libcxx_src_root',
+os.path.join(self.libunwind_src_root, '/../libcxx'))
+
+def configure_obj_root(self):
+self.libunwind_obj_root = self.get_lit_conf('libunwind_obj_root')
+super(Configuration, self).configure_obj_root()
+
+def has_cpp_feature(se

[libunwind] r309147 - Partial fix for PR33858

2017-07-26 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Wed Jul 26 11:13:57 2017
New Revision: 309147

URL: http://llvm.org/viewvc/llvm-project?rev=309147&view=rev
Log:
Partial fix for PR33858

https://reviews.llvm.org/D35848

Modified:
libunwind/trunk/test/CMakeLists.txt
libunwind/trunk/test/lit.site.cfg.in

Modified: libunwind/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/test/CMakeLists.txt?rev=309147&r1=309146&r2=309147&view=diff
==
--- libunwind/trunk/test/CMakeLists.txt (original)
+++ libunwind/trunk/test/CMakeLists.txt Wed Jul 26 11:13:57 2017
@@ -16,7 +16,6 @@ pythonize_bool(LIBCXX_ENABLE_SHARED)
 pythonize_bool(LIBUNWIND_ENABLE_SHARED)
 pythonize_bool(LIBUNWIND_ENABLE_THREADS)
 pythonize_bool(LIBUNWIND_ENABLE_EXCEPTIONS)
-pythonize_bool(LIBUNWIND_USE_LLVM_UNWINDER)
 pythonize_bool(LIBUNWIND_BUILD_EXTERNAL_THREAD_LIBRARY)
 set(LIBUNWIND_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
 "TargetInfo to use when setting up test environment.")

Modified: libunwind/trunk/test/lit.site.cfg.in
URL: 
http://llvm.org/viewvc/llvm-project/libunwind/trunk/test/lit.site.cfg.in?rev=309147&r1=309146&r2=309147&view=diff
==
--- libunwind/trunk/test/lit.site.cfg.in (original)
+++ libunwind/trunk/test/lit.site.cfg.in Wed Jul 26 11:13:57 2017
@@ -7,7 +7,7 @@ config.abi_library_path = "@LIBU
 config.libcxx_src_root  = "@LIBUNWIND_LIBCXX_PATH@"
 config.libunwind_headers= "@LIBUNWIND_SOURCE_DIR@/include"
 config.cxx_library_root = "@LIBUNWIND_LIBCXX_LIBRARY_PATH@"
-config.llvm_unwinder= "@LIBUNWIND_USE_LLVM_UNWINDER@"
+config.llvm_unwinder= "1"
 config.enable_threads   = "@LIBUNWIND_ENABLE_THREADS@"
 config.use_sanitizer= "@LLVM_USE_SANITIZER@"
 config.enable_32bit = "@LIBUNWIND_BUILD_32_BITS@"


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


Re: [PATCH] [analyzer] Fix -x language argument for C preprocessed sources

2018-01-15 Thread Jonathan Roelofs via cfe-commits

LGTM. Would you like me to commit it for you?


Jon


On 1/14/18 3:50 AM, Paul Fertser wrote:

clang's -x option doesn't accept c-cpp-output as a language (even though
463eb6ab was merged, the driver still doesn't handle that).

This bug prevents testing C language projects when ccache is used.

Fixes #25851.

Investigation and patch by Dave Rigby.
---
  tools/scan-build/libexec/ccc-analyzer | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/scan-build/libexec/ccc-analyzer 
b/tools/scan-build/libexec/ccc-analyzer
index b0ec7e7..73cd2ff 100755
--- a/tools/scan-build/libexec/ccc-analyzer
+++ b/tools/scan-build/libexec/ccc-analyzer
@@ -419,7 +419,7 @@ my %LangMap = (
'cc'  => 'c++',
'C'   => 'c++',
'ii'  => 'c++-cpp-output',
-  'i'   => $IsCXX ? 'c++-cpp-output' : 'c-cpp-output',
+  'i'   => $IsCXX ? 'c++-cpp-output' : 'cpp-output',
'm'   => 'objective-c',
'mi'  => 'objective-c-cpp-output',
'mm'  => 'objective-c++',
@@ -439,7 +439,7 @@ my %LangsAccepted = (
"c" => 1,
"c++" => 1,
"objective-c++" => 1,
-  "c-cpp-output" => 1,
+  "cpp-output" => 1,
"objective-c-cpp-output" => 1,
"c++-cpp-output" => 1
  );


--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded / Siemens

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


Re: [PATCH] [scan-build] Add an option to skip overriding CC and CXX make vars

2018-01-15 Thread Jonathan Roelofs via cfe-commits

LGTM. Would you like me to commit it for you?


Jon


On 1/14/18 9:22 AM, Paul Fertser wrote:

Autoconf and some other systems tend to add essential compilation
options to CC (e.g. -std=gnu99). When running such an auto-generated
makefile, scan-build does not need to change CC and CXX as they are
already set to use ccc-analyzer by a configure script.

Implement a new option --keep-cc as was proposed in this discussion:
http://lists.llvm.org/pipermail/cfe-dev/2013-September/031832.html
---
  tools/scan-build/bin/scan-build | 24 
  1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/tools/scan-build/bin/scan-build b/tools/scan-build/bin/scan-build
index cbf3bf3..49018eb 100755
--- a/tools/scan-build/bin/scan-build
+++ b/tools/scan-build/bin/scan-build
@@ -51,6 +51,7 @@ my %Options = (
OutputDir => undef,# Parent directory to store HTML files.
HtmlTitle => basename($CurrentDir)." - scan-build results",
IgnoreErrors => 0, # Ignore build errors.
+  KeepCC => 0,   # Do not override CC and CXX make variables
ViewResults => 0,  # View results when the build terminates.
ExitStatusFoundBugs => 0,  # Exit status reflects whether bugs were found
ShowDescription => 0,  # Display the description of the defect in the 
list
@@ -1062,6 +1063,7 @@ sub RunXcodebuild {
  sub RunBuildCommand {
my $Args = shift;
my $IgnoreErrors = shift;
+  my $KeepCC = shift;
my $Cmd = $Args->[0];
my $CCAnalyzer = shift;
my $CXXAnalyzer = shift;
@@ -1099,8 +1101,10 @@ sub RunBuildCommand {
  unshift @$Args, $CXXAnalyzer;
}
elsif ($Cmd eq "make" or $Cmd eq "gmake" or $Cmd eq "mingw32-make") {
-AddIfNotPresent($Args, "CC=$CCAnalyzer");
-AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
+if (!$KeepCC) {
+  AddIfNotPresent($Args, "CC=$CCAnalyzer");
+  AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
+}
  if ($IgnoreErrors) {
AddIfNotPresent($Args,"-k");
AddIfNotPresent($Args,"-i");
@@ -1158,6 +1162,12 @@ OPTIONS:
 currently supports make and xcodebuild. This is a convenience option; one
 can specify this behavior directly using build options.
  
+ --keep-cc

+
+   Do not override CC and CXX make variables. Useful when running make in
+   autoconf-based (and similar) projects where configure can add extra flags
+   to those variables.
+
   --html-title [title]
   --html-title=[title]
  
@@ -1532,6 +1542,12 @@ sub ProcessArgs {

next;
  }
  
+if ($arg eq "--keep-cc") {

+  shift @$Args;
+  $Options{KeepCC} = 1;
+  next;
+}
+
  if ($arg =~ /^--use-cc(=(.+))?$/) {
shift @$Args;
my $cc;
@@ -1838,8 +1854,8 @@ my %EnvVars = (
  );
  
  # Run the build.

-my $ExitStatus = RunBuildCommand(\@ARGV, $Options{IgnoreErrors}, $Cmd, $CmdCXX,
-\%EnvVars);
+my $ExitStatus = RunBuildCommand(\@ARGV, $Options{IgnoreErrors}, 
$Options{KeepCC},
+   $Cmd, $CmdCXX, \%EnvVars);
  
  if (defined $Options{OutputFormat}) {

if ($Options{OutputFormat} =~ /plist/) {


--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded / Siemens

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


r323664 - [analyzer] Fix -x language argument for C preprocessed sources

2018-01-29 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Mon Jan 29 08:37:53 2018
New Revision: 323664

URL: http://llvm.org/viewvc/llvm-project?rev=323664&view=rev
Log:
[analyzer] Fix -x language argument for C preprocessed sources

clang's -x option doesn't accept c-cpp-output as a language (even though
463eb6ab was merged, the driver still doesn't handle that).

This bug prevents testing C language projects when ccache is used.

Fixes #25851.

Investigation and patch by Dave Rigby.


Modified:
cfe/trunk/tools/scan-build/libexec/ccc-analyzer

Modified: cfe/trunk/tools/scan-build/libexec/ccc-analyzer
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/libexec/ccc-analyzer?rev=323664&r1=323663&r2=323664&view=diff
==
--- cfe/trunk/tools/scan-build/libexec/ccc-analyzer (original)
+++ cfe/trunk/tools/scan-build/libexec/ccc-analyzer Mon Jan 29 08:37:53 2018
@@ -419,7 +419,7 @@ my %LangMap = (
   'cc'  => 'c++',
   'C'   => 'c++',
   'ii'  => 'c++-cpp-output',
-  'i'   => $IsCXX ? 'c++-cpp-output' : 'c-cpp-output',
+  'i'   => $IsCXX ? 'c++-cpp-output' : 'cpp-output',
   'm'   => 'objective-c',
   'mi'  => 'objective-c-cpp-output',
   'mm'  => 'objective-c++',
@@ -439,7 +439,7 @@ my %LangsAccepted = (
   "c" => 1,
   "c++" => 1,
   "objective-c++" => 1,
-  "c-cpp-output" => 1,
+  "cpp-output" => 1,
   "objective-c-cpp-output" => 1,
   "c++-cpp-output" => 1
 );


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


r323665 - [scan-build] Add an option to skip overriding CC and CXX make vars

2018-01-29 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Mon Jan 29 08:49:34 2018
New Revision: 323665

URL: http://llvm.org/viewvc/llvm-project?rev=323665&view=rev
Log:
[scan-build] Add an option to skip overriding CC and CXX make vars

Autoconf and some other systems tend to add essential compilation
options to CC (e.g. -std=gnu99). When running such an auto-generated
makefile, scan-build does not need to change CC and CXX as they are
already set to use ccc-analyzer by a configure script.

Implement a new option --keep-cc as was proposed in this discussion:
http://lists.llvm.org/pipermail/cfe-dev/2013-September/031832.html

Patch by Paul Fertser!

Modified:
cfe/trunk/tools/scan-build/bin/scan-build
cfe/trunk/www/analyzer/scan-build.html

Modified: cfe/trunk/tools/scan-build/bin/scan-build
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/bin/scan-build?rev=323665&r1=323664&r2=323665&view=diff
==
--- cfe/trunk/tools/scan-build/bin/scan-build (original)
+++ cfe/trunk/tools/scan-build/bin/scan-build Mon Jan 29 08:49:34 2018
@@ -51,6 +51,7 @@ my %Options = (
   OutputDir => undef,# Parent directory to store HTML files.
   HtmlTitle => basename($CurrentDir)." - scan-build results",
   IgnoreErrors => 0, # Ignore build errors.
+  KeepCC => 0,   # Do not override CC and CXX make variables
   ViewResults => 0,  # View results when the build terminates.
   ExitStatusFoundBugs => 0,  # Exit status reflects whether bugs were found
   ShowDescription => 0,  # Display the description of the defect in the 
list
@@ -1062,6 +1063,7 @@ sub RunXcodebuild {
 sub RunBuildCommand {
   my $Args = shift;
   my $IgnoreErrors = shift;
+  my $KeepCC = shift;
   my $Cmd = $Args->[0];
   my $CCAnalyzer = shift;
   my $CXXAnalyzer = shift;
@@ -1099,8 +1101,10 @@ sub RunBuildCommand {
 unshift @$Args, $CXXAnalyzer;
   }
   elsif ($Cmd eq "make" or $Cmd eq "gmake" or $Cmd eq "mingw32-make") {
-AddIfNotPresent($Args, "CC=$CCAnalyzer");
-AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
+if (!$KeepCC) {
+  AddIfNotPresent($Args, "CC=$CCAnalyzer");
+  AddIfNotPresent($Args, "CXX=$CXXAnalyzer");
+}
 if ($IgnoreErrors) {
   AddIfNotPresent($Args,"-k");
   AddIfNotPresent($Args,"-i");
@@ -1158,6 +1162,12 @@ OPTIONS:
currently supports make and xcodebuild. This is a convenience option; one
can specify this behavior directly using build options.
 
+ --keep-cc
+
+   Do not override CC and CXX make variables. Useful when running make in
+   autoconf-based (and similar) projects where configure can add extra flags
+   to those variables.
+
  --html-title [title]
  --html-title=[title]
 
@@ -1532,6 +1542,12 @@ sub ProcessArgs {
   next;
 }
 
+if ($arg eq "--keep-cc") {
+  shift @$Args;
+  $Options{KeepCC} = 1;
+  next;
+}
+
 if ($arg =~ /^--use-cc(=(.+))?$/) {
   shift @$Args;
   my $cc;
@@ -1838,8 +1854,8 @@ my %EnvVars = (
 );
 
 # Run the build.
-my $ExitStatus = RunBuildCommand(\@ARGV, $Options{IgnoreErrors}, $Cmd, $CmdCXX,
-\%EnvVars);
+my $ExitStatus = RunBuildCommand(\@ARGV, $Options{IgnoreErrors}, 
$Options{KeepCC},
+   $Cmd, $CmdCXX, \%EnvVars);
 
 if (defined $Options{OutputFormat}) {
   if ($Options{OutputFormat} =~ /plist/) {

Modified: cfe/trunk/www/analyzer/scan-build.html
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/scan-build.html?rev=323665&r1=323664&r2=323665&view=diff
==
--- cfe/trunk/www/analyzer/scan-build.html (original)
+++ cfe/trunk/www/analyzer/scan-build.html Mon Jan 29 08:49:34 2018
@@ -248,7 +248,7 @@ you will probably need to run config
 
 
 $ scan-build ./configure
-$ scan-build make
+$ scan-build --keepk-cc make
 
 
 The reason configure also needs to be run through


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


r323864 - Fix typo. NFC

2018-01-31 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Wed Jan 31 04:06:15 2018
New Revision: 323864

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

Modified:
cfe/trunk/www/analyzer/scan-build.html

Modified: cfe/trunk/www/analyzer/scan-build.html
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/scan-build.html?rev=323864&r1=323863&r2=323864&view=diff
==
--- cfe/trunk/www/analyzer/scan-build.html (original)
+++ cfe/trunk/www/analyzer/scan-build.html Wed Jan 31 04:06:15 2018
@@ -248,7 +248,7 @@ you will probably need to run config
 
 
 $ scan-build ./configure
-$ scan-build --keepk-cc make
+$ scan-build --keep-cc make
 
 
 The reason configure also needs to be run through


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


Re: [PATCH] D30339: [libcxxabi] Disable calls to fprintf when building for baremetal targets in release mode

2017-02-24 Thread Jonathan Roelofs via cfe-commits



On 2/24/17 1:30 PM, Eric Fiselier via Phabricator wrote:

EricWF added a comment.

In https://reviews.llvm.org/D30339#685921, @jroelofs wrote:


In https://reviews.llvm.org/D30339#685919, @rmaprath wrote:


Perhaps change `config.h` and remove the definition there and adjust other 
places accordingly?

The current form is very easy to trip over.


Eric's point is that LIBCXXABI_BAREMETAL is a 0/1 flag, not a 
defined/not-defined flag. Please don't change from one form to the other... 
it's disruptive to build systems.


I actually think it's better to maintain consistency between libc++ and 
libc++abi. And libc++ never uses 0/1 flags. So I would rather see a fix in 
`config.h`.

Frankly I don't care that it is disruptive to build systems unless it's the 
build system owned by LLVM.


What I really care about is the interface between the build system owned 
by LLVM, and the one driving it.



Jon




Repository:
   rL LLVM

https://reviews.llvm.org/D30339





--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded

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


Re: [PATCH] D30339: [libcxxabi] Disable calls to fprintf when building for baremetal targets in release mode

2017-02-24 Thread Jonathan Roelofs via cfe-commits



On 2/24/17 1:48 PM, Eric Fiselier wrote:
Inserting arbitrary feature macros into CMake should not be a 
supported scenario because it results is macros, such as this one, 
which are seemingly dead.


Good point.


Jon



/Eric

On Fri, Feb 24, 2017 at 1:44 PM, Jonathan Roelofs 
mailto:jonat...@codesourcery.com>> wrote:




On 2/24/17 1:30 PM, Eric Fiselier via Phabricator wrote:

EricWF added a comment.

In https://reviews.llvm.org/D30339#685921
, @jroelofs wrote:

In https://reviews.llvm.org/D30339#685919
, @rmaprath wrote:

Perhaps change `config.h` and remove the definition
there and adjust other places accordingly?

The current form is very easy to trip over.


Eric's point is that LIBCXXABI_BAREMETAL is a 0/1 flag,
not a defined/not-defined flag. Please don't change from
one form to the other... it's disruptive to build systems.


I actually think it's better to maintain consistency between
libc++ and libc++abi. And libc++ never uses 0/1 flags. So I
would rather see a fix in `config.h`.

Frankly I don't care that it is disruptive to build systems
unless it's the build system owned by LLVM.


What I really care about is the interface between the build system
owned by LLVM, and the one driving it.


Jon




Repository:
   rL LLVM

https://reviews.llvm.org/D30339 




-- 
Jon Roelofs

jonat...@codesourcery.com 
CodeSourcery / Mentor Embedded




--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded

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


Re: [libcxxabi] r296940 - Fix PR25874 - Detect features required for cxa_thread_atexit_test.pass.cpp

2017-03-03 Thread Jonathan Roelofs via cfe-commits



On 3/3/17 6:26 PM, Eric Fiselier via cfe-commits wrote:

Author: ericwf
Date: Fri Mar  3 19:26:41 2017
New Revision: 296940

URL: http://llvm.org/viewvc/llvm-project?rev=296940&view=rev
Log:
Fix PR25874 - Detect features required for cxa_thread_atexit_test.pass.cpp

Modified:
libcxxabi/trunk/test/CMakeLists.txt
libcxxabi/trunk/test/cxa_thread_atexit_test.pass.cpp
libcxxabi/trunk/test/libcxxabi/test/config.py
libcxxabi/trunk/test/lit.site.cfg.in

Modified: libcxxabi/trunk/test/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/CMakeLists.txt?rev=296940&r1=296939&r2=296940&view=diff
==
--- libcxxabi/trunk/test/CMakeLists.txt (original)
+++ libcxxabi/trunk/test/CMakeLists.txt Fri Mar  3 19:26:41 2017
@@ -18,6 +18,7 @@ pythonize_bool(LIBCXXABI_ENABLE_THREADS)
 pythonize_bool(LIBCXXABI_ENABLE_EXCEPTIONS)
 pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
 pythonize_bool(LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
+pythonize_bool(LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)


AFAIU, this is only allows specifying it at build time and not 
auto-detection of it. Did you intend on setting this via something like 
a CHECK_CXX_SOURCE_COMPILES check?



Jon


--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxxabi] r296940 - Fix PR25874 - Detect features required for cxa_thread_atexit_test.pass.cpp

2017-03-03 Thread Jonathan Roelofs via cfe-commits



On 3/3/17 7:45 PM, Eric Fiselier wrote:
LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL should be set by 
`check_library_exists` at the bottom of `config-ix.cmake`.

Ah, cool.


Jon



On Fri, Mar 3, 2017 at 7:22 PM, Jonathan Roelofs 
mailto:jonat...@codesourcery.com>> wrote:




On 3/3/17 6:26 PM, Eric Fiselier via cfe-commits wrote:

Author: ericwf
Date: Fri Mar  3 19:26:41 2017
New Revision: 296940

URL: http://llvm.org/viewvc/llvm-project?rev=296940&view=rev

Log:
Fix PR25874 - Detect features required for
cxa_thread_atexit_test.pass.cpp

Modified:
libcxxabi/trunk/test/CMakeLists.txt
libcxxabi/trunk/test/cxa_thread_atexit_test.pass.cpp
libcxxabi/trunk/test/libcxxabi/test/config.py
libcxxabi/trunk/test/lit.site.cfg.in 

Modified: libcxxabi/trunk/test/CMakeLists.txt
URL:

http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/CMakeLists.txt?rev=296940&r1=296939&r2=296940&view=diff



==
--- libcxxabi/trunk/test/CMakeLists.txt (original)
+++ libcxxabi/trunk/test/CMakeLists.txt Fri Mar  3 19:26:41 2017
@@ -18,6 +18,7 @@ pythonize_bool(LIBCXXABI_ENABLE_THREADS)
 pythonize_bool(LIBCXXABI_ENABLE_EXCEPTIONS)
 pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
 pythonize_bool(LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
+pythonize_bool(LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)


AFAIU, this is only allows specifying it at build time and not
auto-detection of it. Did you intend on setting this via something
like a CHECK_CXX_SOURCE_COMPILES check?


Jon


-- 
Jon Roelofs

jonat...@codesourcery.com 
CodeSourcery / Mentor Embedded




--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded

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


[PATCH] D26796: [Driver] Use arch type to find compiler-rt libraries (on Linux)

2016-11-17 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

Testcase?


https://reviews.llvm.org/D26796



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


[PATCH] D26796: [Driver] Use arch type to find compiler-rt libraries (on Linux)

2016-11-17 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.



Comment at: test/Driver/print-libgcc-file-name-clangrt.c:11
 // RUN:   | FileCheck --check-prefix=CHECK-CLANGRT-I686 %s
-// CHECK-CLANGRT-I686: libclang_rt.builtins-i686.a
+// CHECK-CLANGRT-I686: libclang_rt.builtins-i386.a

This CHECK's name is now a lie.


https://reviews.llvm.org/D26796



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


[PATCH] D27005: [lit] Support custom parsers in parseIntegratedTestScript

2016-11-22 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

Should probably add a testcase in lit/tests that exercises the new CUSTOM 
parser stuff, so people working on LIT don't have to build/test libc++ in order 
to know whether they've broken its testsuite.


https://reviews.llvm.org/D27005



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


[PATCH] D27005: [lit] Support custom parsers in parseIntegratedTestScript

2016-11-23 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In https://reviews.llvm.org/D27005#603979, @EricWF wrote:

> In https://reviews.llvm.org/D27005#603692, @jroelofs wrote:
>
> > Should probably add a testcase in lit/tests that exercises the new CUSTOM 
> > parser stuff, so people working on LIT don't have to build/test libc++ in 
> > order to know whether they've broken its testsuite.
>
>
> I plan to implement tests. I just wanted to ensure the approach was agreeable 
> first.


Looks like a good approach to me.


https://reviews.llvm.org/D27005



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


r288444 - Delete tautological assertion.

2016-12-01 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Thu Dec  1 18:51:58 2016
New Revision: 288444

URL: http://llvm.org/viewvc/llvm-project?rev=288444&view=rev
Log:
Delete tautological assertion.

After r256463, both the LHS and RHS now refer to the same variable. Before,
they referred to the member, the parameter respectively. Now GCC6's
-Wtautological-compare complains.

Modified:
cfe/trunk/lib/AST/DeclTemplate.cpp

Modified: cfe/trunk/lib/AST/DeclTemplate.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclTemplate.cpp?rev=288444&r1=288443&r2=288444&view=diff
==
--- cfe/trunk/lib/AST/DeclTemplate.cpp (original)
+++ cfe/trunk/lib/AST/DeclTemplate.cpp Thu Dec  1 18:51:58 2016
@@ -36,7 +36,6 @@ TemplateParameterList::TemplateParameter
   : TemplateLoc(TemplateLoc), LAngleLoc(LAngleLoc), RAngleLoc(RAngleLoc),
 NumParams(Params.size()), ContainsUnexpandedParameterPack(false),
 HasRequiresClause(static_cast(RequiresClause)) {
-  assert(this->NumParams == NumParams && "Too many template parameters");
   for (unsigned Idx = 0; Idx < NumParams; ++Idx) {
 NamedDecl *P = Params[Idx];
 begin()[Idx] = P;


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


r288818 - Fix doc string typo: s/@__yes/@__objc_yes/

2016-12-06 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Tue Dec  6 09:45:41 2016
New Revision: 288818

URL: http://llvm.org/viewvc/llvm-project?rev=288818&view=rev
Log:
Fix doc string typo: s/@__yes/@__objc_yes/

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

Modified: cfe/trunk/include/clang/AST/ExprObjC.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprObjC.h?rev=288818&r1=288817&r2=288818&view=diff
==
--- cfe/trunk/include/clang/AST/ExprObjC.h (original)
+++ cfe/trunk/include/clang/AST/ExprObjC.h Tue Dec  6 09:45:41 2016
@@ -90,7 +90,7 @@ public:
 /// ObjCBoxedExpr - used for generalized expression boxing.
 /// as in: @(strdup("hello world")), @(random()) or @(view.frame)
 /// Also used for boxing non-parenthesized numeric literals;
-/// as in: @42 or \@true (c++/objc++) or \@__yes (c/objc).
+/// as in: @42 or \@true (c++/objc++) or \@__objc_yes (c/objc).
 class ObjCBoxedExpr : public Expr {
   Stmt *SubExpr;
   ObjCMethodDecl *BoxingMethod;


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


r302207 - Document that Multilib flags must be actual flags

2017-05-04 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Thu May  4 19:18:27 2017
New Revision: 302207

URL: http://llvm.org/viewvc/llvm-project?rev=302207&view=rev
Log:
Document that Multilib flags must be actual flags

This is because -print-multi-lib depends on them being flags for correctness.

Fixes a case of this in the arm-android multilib selection logic.

Modified:
cfe/trunk/include/clang/Driver/Multilib.h
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
cfe/trunk/test/Driver/android-ndk-standalone.cpp

Modified: cfe/trunk/include/clang/Driver/Multilib.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Multilib.h?rev=302207&r1=302206&r2=302207&view=diff
==
--- cfe/trunk/include/clang/Driver/Multilib.h (original)
+++ cfe/trunk/include/clang/Driver/Multilib.h Thu May  4 19:18:27 2017
@@ -70,7 +70,14 @@ public:
   /// All elements begin with either '+' or '-'
   const flags_list &flags() const { return Flags; }
   flags_list &flags() { return Flags; }
+
   /// Add a flag to the flags list
+  /// \p Flag must be a flag accepted by the driver with its leading '-' 
removed,
+  /// and replaced with either:
+  ///   '-' which contraindicates using this multilib with that flag
+  /// or:
+  ///   '+' which promotes using this multilib in the presence of that flag
+  /// otherwise '-print-multi-lib' will not emit them correctly.
   Multilib &flag(StringRef F) {
 assert(F.front() == '+' || F.front() == '-');
 Flags.push_back(F);

Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=302207&r1=302206&r2=302207&view=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Thu May  4 19:18:27 2017
@@ -893,6 +893,8 @@ static bool isSoftFloatABI(const ArgList
   A->getValue() == StringRef("soft"));
 }
 
+/// \p Flag must be a flag accepted by the driver with its leading '-' removed,
+// otherwise '-print-multi-lib' will not emit them correctly.
 static void addMultilibFlag(bool Enabled, const char *const Flag,
 std::vector &Flags) {
   if (Enabled)
@@ -1437,17 +1439,17 @@ static void findAndroidArmMultilibs(cons
   // Find multilibs with subdirectories like armv7-a, thumb, armv7-a/thumb.
   FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS());
   Multilib ArmV7Multilib = makeMultilib("/armv7-a")
-   .flag("+armv7")
-   .flag("-thumb");
+   .flag("+march=armv7-a")
+   .flag("-mthumb");
   Multilib ThumbMultilib = makeMultilib("/thumb")
-   .flag("-armv7")
-   .flag("+thumb");
+   .flag("-march=armv7-a")
+   .flag("+mthumb");
   Multilib ArmV7ThumbMultilib = makeMultilib("/armv7-a/thumb")
-   .flag("+armv7")
-   .flag("+thumb");
+   .flag("+march=armv7-a")
+   .flag("+mthumb");
   Multilib DefaultMultilib = makeMultilib("")
-   .flag("-armv7")
-   .flag("-thumb");
+   .flag("-march=armv7-a")
+   .flag("-mthumb");
   MultilibSet AndroidArmMultilibs =
   MultilibSet()
   .Either(ThumbMultilib, ArmV7Multilib,
@@ -1465,8 +1467,8 @@ static void findAndroidArmMultilibs(cons
   bool IsArmV7Mode = (IsArmArch || IsThumbArch) &&
   (llvm::ARM::parseArchVersion(Arch) == 7 ||
(IsArmArch && Arch == "" && IsV7SubArch));
-  addMultilibFlag(IsArmV7Mode, "armv7", Flags);
-  addMultilibFlag(IsThumbMode, "thumb", Flags);
+  addMultilibFlag(IsArmV7Mode, "march=armv7-a", Flags);
+  addMultilibFlag(IsThumbMode, "mthumb", Flags);
 
   if (AndroidArmMultilibs.select(Flags, Result.SelectedMultilib))
 Result.Multilibs = AndroidArmMultilibs;

Modified: cfe/trunk/test/Driver/android-ndk-standalone.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/android-ndk-standalone.cpp?rev=302207&r1=302206&r2=302207&view=diff
==
--- cfe/trunk/test/Driver/android-ndk-standalone.cpp (original)
+++ cfe/trunk/test/Driver/android-ndk-standalone.cpp Thu May  4 19:18:27 2017
@@ -172,6 +172,20 @@
 // CHECK-ARMV7THUMB-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ 
]*}}/lib/armv7-a"
 // CHECK-ARMV7THUMB-NOT: "-L{{.*}}/lib/gcc/arm-linux-androideabi/4.9/../{{[^ 
]*}}/lib"
 // CHECK-ARMV7THUMB: "-L{{.*}}/sysroot/usr/lib"
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target arm-linux-androideabi -stdlib=libstdc++ \
+//

r302296 - Multilib: add dump methods

2017-05-05 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Fri May  5 16:30:13 2017
New Revision: 302296

URL: http://llvm.org/viewvc/llvm-project?rev=302296&view=rev
Log:
Multilib: add dump methods

Modified:
cfe/trunk/include/clang/Driver/Multilib.h
cfe/trunk/lib/Driver/Multilib.cpp

Modified: cfe/trunk/include/clang/Driver/Multilib.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Multilib.h?rev=302296&r1=302295&r2=302296&view=diff
==
--- cfe/trunk/include/clang/Driver/Multilib.h (original)
+++ cfe/trunk/include/clang/Driver/Multilib.h Fri May  5 16:30:13 2017
@@ -84,6 +84,7 @@ public:
 return *this;
   }
 
+  LLVM_DUMP_METHOD void dump() const;
   /// \brief print summary of the Multilib
   void print(raw_ostream &OS) const;
 
@@ -157,6 +158,7 @@ public:
 
   unsigned size() const { return Multilibs.size(); }
 
+  LLVM_DUMP_METHOD void dump() const;
   void print(raw_ostream &OS) const;
 
   MultilibSet &setIncludeDirsCallback(IncludeDirsFunc F) {

Modified: cfe/trunk/lib/Driver/Multilib.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Multilib.cpp?rev=302296&r1=302295&r2=302296&view=diff
==
--- cfe/trunk/lib/Driver/Multilib.cpp (original)
+++ cfe/trunk/lib/Driver/Multilib.cpp Fri May  5 16:30:13 2017
@@ -80,6 +80,10 @@ Multilib &Multilib::includeSuffix(String
   return *this;
 }
 
+LLVM_DUMP_METHOD void Multilib::dump() const {
+  print(llvm::errs());
+}
+
 void Multilib::print(raw_ostream &OS) const {
   assert(GCCSuffix.empty() || (StringRef(GCCSuffix).front() == '/'));
   if (GCCSuffix.empty())
@@ -270,6 +274,10 @@ bool MultilibSet::select(const Multilib:
   return false;
 }
 
+LLVM_DUMP_METHOD void MultilibSet::dump() const {
+  print(llvm::errs());
+}
+
 void MultilibSet::print(raw_ostream &OS) const {
   for (const Multilib &M : *this)
 OS << M << "\n";


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


r302443 - Fix grammar in comment. NFC

2017-05-08 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Mon May  8 12:06:17 2017
New Revision: 302443

URL: http://llvm.org/viewvc/llvm-project?rev=302443&view=rev
Log:
Fix grammar in comment. NFC

Modified:
cfe/trunk/test/Misc/warning-flags.c

Modified: cfe/trunk/test/Misc/warning-flags.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/warning-flags.c?rev=302443&r1=302442&r2=302443&view=diff
==
--- cfe/trunk/test/Misc/warning-flags.c (original)
+++ cfe/trunk/test/Misc/warning-flags.c Mon May  8 12:06:17 2017
@@ -6,8 +6,8 @@ This test serves two purposes:
 (1) It documents all existing warnings that currently have no associated -W 
flag,
 and ensures that the list never grows.
 
-If take an existing warning and add a flag, this test will fail.  To
-fix this test, simply remove that warning from the list below.
+If you take an existing warning and add a flag, this test will fail.
+To fix this test, simply remove that warning from the list below.
 
 (2) It prevents us adding new warnings to Clang that have no -W flag.  All
 new warnings should have -W flags.


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


Re: [PATCH] D12689: [libc++][static linking] std streams are not initialized prior to their use in static object constructors

2015-09-10 Thread Jonathan Roelofs via cfe-commits
jroelofs added a subscriber: jroelofs.
jroelofs added a comment.

A testcase would be good, regardless of which of the proposed fixes ends up 
being chosen.


http://reviews.llvm.org/D12689



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


Re: [PATCH] D12996: Driver: support ARM/HF on a single toolchain

2015-09-21 Thread Jonathan Roelofs via cfe-commits
jroelofs added a subscriber: jroelofs.
jroelofs added a comment.

You'll also need a corresponding patch for compiler-rt to make it use the new 
name appropriately.


http://reviews.llvm.org/D12996



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


Re: [PATCH] D13051: Add placeholder __libcpp_relaxed_store() for when atomic builtins are not available.

2015-09-22 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In http://reviews.llvm.org/D13051#250836, @EricWF wrote:

> Does armv4 need lib calls for atomic operations on "unsigned long"?


IIRC, yes.


http://reviews.llvm.org/D13051



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


Re: [PATCH] D13051: Add placeholder __libcpp_relaxed_store() for when atomic builtins are not available.

2015-09-22 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In http://reviews.llvm.org/D13051#250910, @EricWF wrote:

> @jroelofs @dim, could we fallback to the __sync_* builtins on arm?


@dim would need armv4-flavored implementations of them in compiler-rt (if 
that's what he's using)... the existing ones use instructions that v4 doesn't 
have. Implementation-wise, they'd have to use `__kuser_cmpxchg`. See: 
https://www.kernel.org/doc/Documentation/arm/kernel_user_helpers.txt


http://reviews.llvm.org/D13051



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


Re: [PATCH] D12996: Driver: support ARM/HF on a single toolchain

2015-09-23 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

Won't it break hf-only builds, if you don't do both commits at the same time?


http://reviews.llvm.org/D12996



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


Re: [PATCH] D12996: Driver: support ARM/HF on a single toolchain

2015-09-24 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

Oh, yeah, true.


http://reviews.llvm.org/D12996



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


Re: [PATCH] D12996: Driver: support ARM/HF on a single toolchain

2015-09-25 Thread Jonathan Roelofs via cfe-commits
jroelofs accepted this revision.
jroelofs added a reviewer: jroelofs.
jroelofs added a comment.
This revision is now accepted and ready to land.

Now that you've got http://reviews.llvm.org/D13155 squared away, LGTM.


http://reviews.llvm.org/D12996



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


Re: [PATCH] D13407: [libcxx] Capture configuration information when installing the libc++ headers

2015-10-05 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

Design doc looks good! I think it captures all the design constraints well, and 
the proposed solution satisfies those constraints as far as I am concerned.

Thumbs up from me... but I'll still defer the final 'LGTM' to @mclow.lists.


http://reviews.llvm.org/D13407



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


Re: [PATCH] D13465: Add SafeStack support for test-suite.

2015-10-06 Thread Jonathan Roelofs via cfe-commits
jroelofs added a subscriber: jroelofs.
jroelofs accepted this revision.
jroelofs added a reviewer: jroelofs.
jroelofs added a comment.
This revision is now accepted and ready to land.

LGTM


http://reviews.llvm.org/D13465



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


Re: [PATCH] D13465: Add SafeStack support for test-suite.

2015-10-06 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In http://reviews.llvm.org/D13465#260628, @tharvik wrote:

> When running the test suite, it gives a bunch of `undefined reference to 
> '__safestack_unsafe_stack_ptr'`.
>  See regression results .


Sounds like it's missing the safestack runtime, which should be provided by 
building compiler-rt.


http://reviews.llvm.org/D13465



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


Re: [libcxx] r249475 - Remove unnecessary inline functions capturing the contents of C library macros.

2015-10-06 Thread Jonathan Roelofs via cfe-commits



On 10/6/15 4:03 PM, Richard Smith via cfe-commits wrote:

Author: rsmith
Date: Tue Oct  6 17:03:22 2015
New Revision: 249475

URL: http://llvm.org/viewvc/llvm-project?rev=249475&view=rev
Log:
Remove unnecessary inline functions capturing the contents of C library macros.

The C standard requires that these be provided as functions even if they're
also provided as macros, and a strict reading of the C++ standard library rules
suggests that (for instance) &::isdigit == &::std::isdigit, so these wrappers
are technically non-conforming.


Mind adding testcases to reinforce those identities, quoting the 
relevant bit(s) of the standard?



Jon





--
Jon Roelofs
jonat...@codesourcery.com
CodeSourcery / Mentor Embedded
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D11781: Refactored pthread usage in libcxx

2015-08-10 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: include/__config:742
@@ +741,3 @@
+#ifndef _LIBCPP_HAS_NO_THREADS
+# if defined(__FreeBSD__) || \
+defined(__NetBSD__) || \

@espositofulvio: @ed meant this:

```
#ifndef _WIN32
#  include 
#  if _POSIX_THREADS > 0
...
#  endif
#endif
```

Which //is// the correct way to test for this.


Repository:
  rL LLVM

http://reviews.llvm.org/D11781



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


Re: [PATCH] D11781: Refactored pthread usage in libcxx

2015-08-10 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: include/__config:742
@@ +741,3 @@
+#ifndef _LIBCPP_HAS_NO_THREADS
+# if defined(__FreeBSD__) || \
+defined(__NetBSD__) || \

jroelofs wrote:
> @espositofulvio: @ed meant this:
> 
> ```
> #ifndef _WIN32
> #  include 
> #  if _POSIX_THREADS > 0
> ...
> #  endif
> #endif
> ```
> 
> Which //is// the correct way to test for this.
That being said, there have been discussions before about whether or not we 
should #include  in <__config>, with the conclusion being that we 
shouldn't.

It would be better if this were a CMake configure-time check that sets 
_LIBCPP_THREAD_API, rather than these build-time guards.


Repository:
  rL LLVM

http://reviews.llvm.org/D11781



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


Re: [PATCH] D11781: Refactored pthread usage in libcxx

2015-08-10 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: include/__config:742
@@ +741,3 @@
+#ifndef _LIBCPP_HAS_NO_THREADS
+# if defined(__FreeBSD__) || \
+defined(__NetBSD__) || \

espositofulvio wrote:
> jroelofs wrote:
> > jroelofs wrote:
> > > @espositofulvio: @ed meant this:
> > > 
> > > ```
> > > #ifndef _WIN32
> > > #  include 
> > > #  if _POSIX_THREADS > 0
> > > ...
> > > #  endif
> > > #endif
> > > ```
> > > 
> > > Which //is// the correct way to test for this.
> > That being said, there have been discussions before about whether or not we 
> > should #include  in <__config>, with the conclusion being that we 
> > shouldn't.
> > 
> > It would be better if this were a CMake configure-time check that sets 
> > _LIBCPP_THREAD_API, rather than these build-time guards.
> Tried adding that as configure time checks, but then libcxxabi fails to 
> compile because of the guard in __config to check that _LIBCPP_THREAD_API has 
> beed defined when _LIBCPP_HAS_NO_THREADS is not. 
> 
> As a side note: Is Windows the only OS which hasn't got unistd.h?
> Tried adding that as configure time checks...

Can you put the patch for that up on gist.github.com, or a pastebin?... I'll 
take a look.

> As a side note: Is Windows the only OS which hasn't got unistd.h?

For the platforms libcxx currently builds on, yes.


Repository:
  rL LLVM

http://reviews.llvm.org/D11781



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


Re: [PATCH] D11781: Refactored pthread usage in libcxx

2015-08-11 Thread Jonathan Roelofs via cfe-commits
jroelofs added a subscriber: EricWF.


Comment at: include/__config:742
@@ +741,3 @@
+#ifndef _LIBCPP_HAS_NO_THREADS
+# if defined(__FreeBSD__) || \
+defined(__NetBSD__) || \

espositofulvio wrote:
> theraven wrote:
> > espositofulvio wrote:
> > > jroelofs wrote:
> > > > espositofulvio wrote:
> > > > > jroelofs wrote:
> > > > > > jroelofs wrote:
> > > > > > > @espositofulvio: @ed meant this:
> > > > > > > 
> > > > > > > ```
> > > > > > > #ifndef _WIN32
> > > > > > > #  include 
> > > > > > > #  if _POSIX_THREADS > 0
> > > > > > > ...
> > > > > > > #  endif
> > > > > > > #endif
> > > > > > > ```
> > > > > > > 
> > > > > > > Which //is// the correct way to test for this.
> > > > > > That being said, there have been discussions before about whether 
> > > > > > or not we should #include  in <__config>, with the 
> > > > > > conclusion being that we shouldn't.
> > > > > > 
> > > > > > It would be better if this were a CMake configure-time check that 
> > > > > > sets _LIBCPP_THREAD_API, rather than these build-time guards.
> > > > > Tried adding that as configure time checks, but then libcxxabi fails 
> > > > > to compile because of the guard in __config to check that 
> > > > > _LIBCPP_THREAD_API has beed defined when _LIBCPP_HAS_NO_THREADS is 
> > > > > not. 
> > > > > 
> > > > > As a side note: Is Windows the only OS which hasn't got unistd.h?
> > > > > Tried adding that as configure time checks...
> > > > 
> > > > Can you put the patch for that up on gist.github.com, or a pastebin?... 
> > > > I'll take a look.
> > > > 
> > > > > As a side note: Is Windows the only OS which hasn't got unistd.h?
> > > > 
> > > > For the platforms libcxx currently builds on, yes.
> > > > Can you put the patch for that up on gist.github.com, or a pastebin?... 
> > > > I'll take a look.
> > > 
> > > It's here https://gist.github.com/espositofulvio/eac2fb08acf2e430c516
> > I'm sorry to have triggered this bikeshed.  Given that, of the currently 
> > supported platforms, Windows is the only one where we want to use threads 
> > but don't want to use PTHREADS, I think it's fine to have this check be 
> > !WIN32.  The important thing is having the check *in one place* so that the 
> > person who wants to add the *second* non-pthread threading implementation 
> > doesn't have a load of different places to look: they can just change it in 
> > `__config` and then chase all of the compile failures.
> Given that it's something I suggested in a comment on the first revision, I 
> was happy to try it out. It was also a quick change. Unfortunately it brakes 
> libcxxabi build (at least the way I've done it), so I'm happy to make the 
> change if @jroelofs finds another way 
I meant something like this: 
https://gist.github.com/jroelofs/279cb2639ad910b953d2

... which doesn't quite work yet, but should give you the idea. I don't know 
how to get CMake to treat `${CMAKE_BINARY_DIR}/include/c++/v1` as the includes 
directory instead of `${CMAKE_CURRENT_SOURCE_DIR}/../include`. Maybe @ericwf 
can help with that?

Basically the idea is that we have cmake create a __config_site header which 
__config includes.  This new header would then have the definitions for these 
kinds of configure-time decisions.


Repository:
  rL LLVM

http://reviews.llvm.org/D11781



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


Re: [PATCH] D11781: Refactored pthread usage in libcxx

2015-08-11 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: include/__config:742
@@ +741,3 @@
+#ifndef _LIBCPP_HAS_NO_THREADS
+# if defined(__FreeBSD__) || \
+defined(__NetBSD__) || \

jroelofs wrote:
> espositofulvio wrote:
> > theraven wrote:
> > > espositofulvio wrote:
> > > > jroelofs wrote:
> > > > > espositofulvio wrote:
> > > > > > jroelofs wrote:
> > > > > > > jroelofs wrote:
> > > > > > > > @espositofulvio: @ed meant this:
> > > > > > > > 
> > > > > > > > ```
> > > > > > > > #ifndef _WIN32
> > > > > > > > #  include 
> > > > > > > > #  if _POSIX_THREADS > 0
> > > > > > > > ...
> > > > > > > > #  endif
> > > > > > > > #endif
> > > > > > > > ```
> > > > > > > > 
> > > > > > > > Which //is// the correct way to test for this.
> > > > > > > That being said, there have been discussions before about whether 
> > > > > > > or not we should #include  in <__config>, with the 
> > > > > > > conclusion being that we shouldn't.
> > > > > > > 
> > > > > > > It would be better if this were a CMake configure-time check that 
> > > > > > > sets _LIBCPP_THREAD_API, rather than these build-time guards.
> > > > > > Tried adding that as configure time checks, but then libcxxabi 
> > > > > > fails to compile because of the guard in __config to check that 
> > > > > > _LIBCPP_THREAD_API has beed defined when _LIBCPP_HAS_NO_THREADS is 
> > > > > > not. 
> > > > > > 
> > > > > > As a side note: Is Windows the only OS which hasn't got unistd.h?
> > > > > > Tried adding that as configure time checks...
> > > > > 
> > > > > Can you put the patch for that up on gist.github.com, or a 
> > > > > pastebin?... I'll take a look.
> > > > > 
> > > > > > As a side note: Is Windows the only OS which hasn't got unistd.h?
> > > > > 
> > > > > For the platforms libcxx currently builds on, yes.
> > > > > Can you put the patch for that up on gist.github.com, or a 
> > > > > pastebin?... I'll take a look.
> > > > 
> > > > It's here https://gist.github.com/espositofulvio/eac2fb08acf2e430c516
> > > I'm sorry to have triggered this bikeshed.  Given that, of the currently 
> > > supported platforms, Windows is the only one where we want to use threads 
> > > but don't want to use PTHREADS, I think it's fine to have this check be 
> > > !WIN32.  The important thing is having the check *in one place* so that 
> > > the person who wants to add the *second* non-pthread threading 
> > > implementation doesn't have a load of different places to look: they can 
> > > just change it in `__config` and then chase all of the compile failures.
> > Given that it's something I suggested in a comment on the first revision, I 
> > was happy to try it out. It was also a quick change. Unfortunately it 
> > brakes libcxxabi build (at least the way I've done it), so I'm happy to 
> > make the change if @jroelofs finds another way 
> I meant something like this: 
> https://gist.github.com/jroelofs/279cb2639ad910b953d2
> 
> ... which doesn't quite work yet, but should give you the idea. I don't know 
> how to get CMake to treat `${CMAKE_BINARY_DIR}/include/c++/v1` as the 
> includes directory instead of `${CMAKE_CURRENT_SOURCE_DIR}/../include`. Maybe 
> @ericwf can help with that?
> 
> Basically the idea is that we have cmake create a __config_site header which 
> __config includes.  This new header would then have the definitions for these 
> kinds of configure-time decisions.
I tinkered around with this a bit more, and got it to work. I've updated the 
gist to reflect that.

To simplify things for @espositofulvio, I'm going to split out the 
__config_site part of this change into its own review.


Repository:
  rL LLVM

http://reviews.llvm.org/D11781



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


Re: [PATCH] D11781: Refactored pthread usage in libcxx

2015-08-11 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: include/__config:744
@@ +743,3 @@
+#ifndef _LIBCPP_HAS_NO_THREADS
+# ifndef _LIBCPP_THREAD_API
+#  error "No thread API"

The reason to use `CMAKE_BINARY_DIR` over `CMAKE_CURRENT_SOURCE_DIR` as the 
location for this build product is so that the source directory doesn't get 
polluted by builds.

Unfortunately that means that both libcxx and libcxxabi need to be pointed at 
the headers in the build directory, and not the ones from the source directory. 

I do have a pair of patches for this, which I'll post shortly.


Repository:
  rL LLVM

http://reviews.llvm.org/D11781



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


[PATCH] D11963: Create a __config_site file to capture configuration decisions.

2015-08-11 Thread Jonathan Roelofs via cfe-commits
jroelofs created this revision.
jroelofs added reviewers: mclow.lists, danalbert.
jroelofs added subscribers: EricWF, ed, espositofulvio, cfe-commits, 
mclow.lists.

This also means that we no longer have to teach lit how to define them when 
running tests.

I have a corresponding patch for libcxxabi to go with this, which I will post 
shortly.



@mclow.lists this is something that we discussed a few months ago, but I never 
got around to implementing... I just want to make sure you're still ok with 
having this kind of CMake-generated include file.

http://reviews.llvm.org/D11963

Files:
  CMakeLists.txt
  include/CMakeLists.txt
  include/__config
  test/libcxx/test/config.py
  test/std/atomics/libcpp-has-no-threads.pass.cpp
  test/std/utilities/date.time/tested_elsewhere.pass.cpp

Index: test/std/utilities/date.time/tested_elsewhere.pass.cpp
===
--- test/std/utilities/date.time/tested_elsewhere.pass.cpp
+++ test/std/utilities/date.time/tested_elsewhere.pass.cpp
@@ -30,9 +30,11 @@
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS$
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 }
Index: test/std/atomics/libcpp-has-no-threads.pass.cpp
===
--- test/std/atomics/libcpp-has-no-threads.pass.cpp
+++ test/std/atomics/libcpp-has-no-threads.pass.cpp
@@ -8,6 +8,8 @@
 //===--===//
 // XFAIL: libcpp-has-no-threads
 
+#include <__config_site>
+
 #ifdef _LIBCPP_HAS_NO_THREADS
 #error This should be XFAIL'd for the purpose of detecting that the LIT feature\
  'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
Index: test/libcxx/test/config.py
===
--- test/libcxx/test/config.py
+++ test/libcxx/test/config.py
@@ -392,7 +392,7 @@
 self.cxx.compile_flags += ['-I' + support_path]
 self.cxx.compile_flags += ['-include', os.path.join(support_path, 'nasty_macros.hpp')]
 libcxx_headers = self.get_lit_conf(
-'libcxx_headers', os.path.join(self.libcxx_src_root, 'include'))
+'libcxx_headers', os.path.join(self.cxx_library_root, '..', 'include', 'c++', 'v1'))
 if not os.path.isdir(libcxx_headers):
 self.lit_config.fatal("libcxx_headers='%s' is not a directory."
   % libcxx_headers)
@@ -416,36 +416,28 @@
 if not enable_global_filesystem_namespace:
 self.config.available_features.add(
 'libcpp-has-no-global-filesystem-namespace')
-self.cxx.compile_flags += [
-'-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE']
 
 def configure_compile_flags_no_stdin(self):
 enable_stdin = self.get_lit_bool('enable_stdin', True)
 if not enable_stdin:
 self.config.available_features.add('libcpp-has-no-stdin')
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDIN']
 
 def configure_compile_flags_no_stdout(self):
 enable_stdout = self.get_lit_bool('enable_stdout', True)
 if not enable_stdout:
 self.config.available_features.add('libcpp-has-no-stdout')
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDOUT']
 
 def configure_compile_flags_no_threads(self):
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_THREADS']
 self.config.available_features.add('libcpp-has-no-threads')
 
 def configure_compile_flags_no_thread_unsafe_c_functions(self):
 enable_thread_unsafe_c_functions = self.get_lit_bool(
 'enable_thread_unsafe_c_functions', True)
 if not enable_thread_unsafe_c_functions:
-self.cxx.compile_flags += [
-'-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS']
 self.config.available_features.add(
 'libcpp-has-no-thread-unsafe-c-functions')
 
 def configure_compile_flags_no_monotonic_clock(self):
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_MONOTONIC_CLOCK']
 self.config.available_features.add('libcpp-has-no-monotonic-clock')
 
 def configure_link_flags(self):
Index: include/__config
===
--- include/__config
+++ include/__config
@@ -15,6 +15,8 @@
 #pragma GCC system_header
 #endif
 
+#include <__config_site>
+
 #ifdef __GNUC__
 #define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
 #else
Index: include/CMakeLists.txt
===
--- include/CMakeLists.txt
+++ include/CMakeLi

Re: [PATCH] D11963: Create a __config_site file to capture configuration decisions.

2015-08-11 Thread Jonathan Roelofs via cfe-commits
jroelofs updated this revision to Diff 31878.
jroelofs added a comment.

fix typo


http://reviews.llvm.org/D11963

Files:
  CMakeLists.txt
  include/CMakeLists.txt
  include/__config
  test/libcxx/test/config.py
  test/std/atomics/libcpp-has-no-threads.pass.cpp
  test/std/utilities/date.time/tested_elsewhere.pass.cpp

Index: test/std/utilities/date.time/tested_elsewhere.pass.cpp
===
--- test/std/utilities/date.time/tested_elsewhere.pass.cpp
+++ test/std/utilities/date.time/tested_elsewhere.pass.cpp
@@ -30,9 +30,11 @@
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 }
Index: test/std/atomics/libcpp-has-no-threads.pass.cpp
===
--- test/std/atomics/libcpp-has-no-threads.pass.cpp
+++ test/std/atomics/libcpp-has-no-threads.pass.cpp
@@ -8,6 +8,8 @@
 //===--===//
 // XFAIL: libcpp-has-no-threads
 
+#include <__config_site>
+
 #ifdef _LIBCPP_HAS_NO_THREADS
 #error This should be XFAIL'd for the purpose of detecting that the LIT feature\
  'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
Index: test/libcxx/test/config.py
===
--- test/libcxx/test/config.py
+++ test/libcxx/test/config.py
@@ -392,7 +392,7 @@
 self.cxx.compile_flags += ['-I' + support_path]
 self.cxx.compile_flags += ['-include', os.path.join(support_path, 'nasty_macros.hpp')]
 libcxx_headers = self.get_lit_conf(
-'libcxx_headers', os.path.join(self.libcxx_src_root, 'include'))
+'libcxx_headers', os.path.join(self.cxx_library_root, '..', 'include', 'c++', 'v1'))
 if not os.path.isdir(libcxx_headers):
 self.lit_config.fatal("libcxx_headers='%s' is not a directory."
   % libcxx_headers)
@@ -416,36 +416,28 @@
 if not enable_global_filesystem_namespace:
 self.config.available_features.add(
 'libcpp-has-no-global-filesystem-namespace')
-self.cxx.compile_flags += [
-'-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE']
 
 def configure_compile_flags_no_stdin(self):
 enable_stdin = self.get_lit_bool('enable_stdin', True)
 if not enable_stdin:
 self.config.available_features.add('libcpp-has-no-stdin')
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDIN']
 
 def configure_compile_flags_no_stdout(self):
 enable_stdout = self.get_lit_bool('enable_stdout', True)
 if not enable_stdout:
 self.config.available_features.add('libcpp-has-no-stdout')
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDOUT']
 
 def configure_compile_flags_no_threads(self):
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_THREADS']
 self.config.available_features.add('libcpp-has-no-threads')
 
 def configure_compile_flags_no_thread_unsafe_c_functions(self):
 enable_thread_unsafe_c_functions = self.get_lit_bool(
 'enable_thread_unsafe_c_functions', True)
 if not enable_thread_unsafe_c_functions:
-self.cxx.compile_flags += [
-'-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS']
 self.config.available_features.add(
 'libcpp-has-no-thread-unsafe-c-functions')
 
 def configure_compile_flags_no_monotonic_clock(self):
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_MONOTONIC_CLOCK']
 self.config.available_features.add('libcpp-has-no-monotonic-clock')
 
 def configure_link_flags(self):
Index: include/__config
===
--- include/__config
+++ include/__config
@@ -15,6 +15,8 @@
 #pragma GCC system_header
 #endif
 
+#include <__config_site>
+
 #ifdef __GNUC__
 #define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
 #else
Index: include/CMakeLists.txt
===
--- include/CMakeLists.txt
+++ include/CMakeLists.txt
@@ -5,6 +5,7 @@
   PATTERN "*"
   PATTERN "CMakeLists.txt" EXCLUDE
   PATTERN ".svn" EXCLUDE
+  PATTERN "__config_site.in" EXCLUDE
   ${LIBCXX_SUPPORT_HEADER_PATTERN}
   )
 
Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -84,7 +84,7 @@
 option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for thread-unsafe C functions" ON)
 option(LIBCXX_ENABLE_MONOTONIC_CLOCK

Re: [PATCH] D11963: Create a __config_site file to capture configuration decisions.

2015-08-11 Thread Jonathan Roelofs via cfe-commits
jroelofs updated this revision to Diff 31885.
jroelofs added a comment.

@danalbert: sigh, yes.


http://reviews.llvm.org/D11963

Files:
  CMakeLists.txt
  include/CMakeLists.txt
  include/__config
  include/__config_site.in
  test/libcxx/test/config.py
  test/std/atomics/libcpp-has-no-threads.pass.cpp
  test/std/utilities/date.time/tested_elsewhere.pass.cpp

Index: test/std/utilities/date.time/tested_elsewhere.pass.cpp
===
--- test/std/utilities/date.time/tested_elsewhere.pass.cpp
+++ test/std/utilities/date.time/tested_elsewhere.pass.cpp
@@ -30,9 +30,11 @@
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 }
Index: test/std/atomics/libcpp-has-no-threads.pass.cpp
===
--- test/std/atomics/libcpp-has-no-threads.pass.cpp
+++ test/std/atomics/libcpp-has-no-threads.pass.cpp
@@ -8,6 +8,8 @@
 //===--===//
 // XFAIL: libcpp-has-no-threads
 
+#include <__config_site>
+
 #ifdef _LIBCPP_HAS_NO_THREADS
 #error This should be XFAIL'd for the purpose of detecting that the LIT feature\
  'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
Index: test/libcxx/test/config.py
===
--- test/libcxx/test/config.py
+++ test/libcxx/test/config.py
@@ -392,7 +392,7 @@
 self.cxx.compile_flags += ['-I' + support_path]
 self.cxx.compile_flags += ['-include', os.path.join(support_path, 'nasty_macros.hpp')]
 libcxx_headers = self.get_lit_conf(
-'libcxx_headers', os.path.join(self.libcxx_src_root, 'include'))
+'libcxx_headers', os.path.join(self.cxx_library_root, '..', 'include', 'c++', 'v1'))
 if not os.path.isdir(libcxx_headers):
 self.lit_config.fatal("libcxx_headers='%s' is not a directory."
   % libcxx_headers)
@@ -416,36 +416,28 @@
 if not enable_global_filesystem_namespace:
 self.config.available_features.add(
 'libcpp-has-no-global-filesystem-namespace')
-self.cxx.compile_flags += [
-'-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE']
 
 def configure_compile_flags_no_stdin(self):
 enable_stdin = self.get_lit_bool('enable_stdin', True)
 if not enable_stdin:
 self.config.available_features.add('libcpp-has-no-stdin')
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDIN']
 
 def configure_compile_flags_no_stdout(self):
 enable_stdout = self.get_lit_bool('enable_stdout', True)
 if not enable_stdout:
 self.config.available_features.add('libcpp-has-no-stdout')
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDOUT']
 
 def configure_compile_flags_no_threads(self):
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_THREADS']
 self.config.available_features.add('libcpp-has-no-threads')
 
 def configure_compile_flags_no_thread_unsafe_c_functions(self):
 enable_thread_unsafe_c_functions = self.get_lit_bool(
 'enable_thread_unsafe_c_functions', True)
 if not enable_thread_unsafe_c_functions:
-self.cxx.compile_flags += [
-'-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS']
 self.config.available_features.add(
 'libcpp-has-no-thread-unsafe-c-functions')
 
 def configure_compile_flags_no_monotonic_clock(self):
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_MONOTONIC_CLOCK']
 self.config.available_features.add('libcpp-has-no-monotonic-clock')
 
 def configure_link_flags(self):
Index: include/__config_site.in
===
--- include/__config_site.in
+++ include/__config_site.in
@@ -0,0 +1,11 @@
+#ifndef _LIBCPP_CONFIG_SITE
+#define _LIBCPP_CONFIG_SITE
+
+#cmakedefine _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
+#cmakedefine _LIBCPP_HAS_NO_STDIN
+#cmakedefine _LIBCPP_HAS_NO_STDOUT
+#cmakedefine _LIBCPP_HAS_NO_THREADS
+#cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK
+#cmakedefine _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
+
+#endif
Index: include/__config
===
--- include/__config
+++ include/__config
@@ -15,6 +15,8 @@
 #pragma GCC system_header
 #endif
 
+#include <__config_site>
+
 #ifdef __GNUC__
 #define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
 #else
Index: include/CMakeLists.txt
==

Re: [PATCH] D11963: Create a __config_site file to capture configuration decisions.

2015-08-12 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: include/__config:19
@@ -18,1 +18,3 @@
+#include <__config_site>
+
 #ifdef __GNUC__

espositofulvio wrote:
> mclow.lists wrote:
> > I'm reluctant to do this; because every include file slows down compilation 
> > - for every program that we compile.
> > 
> > However, this may be the right thing to do.
> I'm with Jonathan here, having config params dealt with this way it's easier 
> and make things more manageable while the price of a slowdown, I think, 
> shouldn't be substantial.
Another option would be to rename `__config` to `__config.in`, and put the 
`#cmakedefine` lines in here. Then the include tree isn't changed.


Comment at: test/std/atomics/libcpp-has-no-threads.pass.cpp:11
@@ -10,1 +10,3 @@
 
+#include <__config_site>
+

mclow.lists wrote:
> This is not the right include file. 
> 
> How about "#include ", which defined in the standard (to do 
> nothing), but includes "<__config>"
> 
> Really, this test doesn't belong in test/std/, but in test/libcxx, but this 
> change didn't put it there.
> 
I think it'd be better for me to just move the test. What is  supposed 
to be for?


http://reviews.llvm.org/D11963



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


Re: [PATCH] D11963: Create a __config_site file to capture configuration decisions.

2015-08-12 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: include/__config:19
@@ -18,1 +18,3 @@
+#include <__config_site>
+
 #ifdef __GNUC__

jroelofs wrote:
> mclow.lists wrote:
> > espositofulvio wrote:
> > > mclow.lists wrote:
> > > > I'm reluctant to do this; because every include file slows down 
> > > > compilation - for every program that we compile.
> > > > 
> > > > However, this may be the right thing to do.
> > > I'm with Jonathan here, having config params dealt with this way it's 
> > > easier and make things more manageable while the price of a slowdown, I 
> > > think, shouldn't be substantial.
> > I just realized that this will complicate life for libc++ developers. 
> > Today, I can make a change in the checked-out directory, and test it by 
> > using `clang -I `.  Now, I'll have to actually build and 
> > install the headers some where to test.  [ Especially when testing against 
> > an installed compiler whose libc++ does not have a __config_site file ]
> Another option would be to rename `__config` to `__config.in`, and put the 
> `#cmakedefine` lines in here. Then the include tree isn't changed.
> Now, I'll have to actually build and install the headers some where to test.

Just building is sufficient. The headers get copied to the build directory, 
along with this new file.


> [ Especially when testing against an installed compiler whose libc++ does not 
> have a __config_site file ]

Why does your workflow rely on testing libcxx binaries against installed 
headers from a _different_ build of the library? That seems very dicey.


http://reviews.llvm.org/D11963



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


Re: [PATCH] D11963: Create a __config_site file to capture configuration decisions.

2015-08-12 Thread Jonathan Roelofs via cfe-commits
jroelofs updated this revision to Diff 31949.
jroelofs added a comment.

Add license text to the new file, and move the two has-no-threads tests to 
test/libcxx.


http://reviews.llvm.org/D11963

Files:
  CMakeLists.txt
  include/CMakeLists.txt
  include/__config
  include/__config_site.in
  test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
  test/libcxx/test/config.py
  test/std/atomics/libcpp-has-no-threads.fail.cpp
  test/std/atomics/libcpp-has-no-threads.pass.cpp
  test/std/utilities/date.time/tested_elsewhere.pass.cpp

Index: test/std/utilities/date.time/tested_elsewhere.pass.cpp
===
--- test/std/utilities/date.time/tested_elsewhere.pass.cpp
+++ test/std/utilities/date.time/tested_elsewhere.pass.cpp
@@ -30,9 +30,11 @@
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 }
Index: test/std/atomics/libcpp-has-no-threads.pass.cpp
===
--- test/std/atomics/libcpp-has-no-threads.pass.cpp
+++ test/std/atomics/libcpp-has-no-threads.pass.cpp
@@ -1,18 +0,0 @@
-//===--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===--===//
-// XFAIL: libcpp-has-no-threads
-
-#ifdef _LIBCPP_HAS_NO_THREADS
-#error This should be XFAIL'd for the purpose of detecting that the LIT feature\
- 'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
-#endif
-
-int main()
-{
-}
Index: test/std/atomics/libcpp-has-no-threads.fail.cpp
===
--- test/std/atomics/libcpp-has-no-threads.fail.cpp
+++ test/std/atomics/libcpp-has-no-threads.fail.cpp
@@ -1,23 +0,0 @@
-//===--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===--===//
-
-// 
-
-// Test that including  fails to compile when _LIBCPP_HAS_NO_THREADS
-// is defined.
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-#define _LIBCPP_HAS_NO_THREADS
-#endif
-
-#include 
-
-int main()
-{
-}
Index: test/libcxx/test/config.py
===
--- test/libcxx/test/config.py
+++ test/libcxx/test/config.py
@@ -392,7 +392,7 @@
 self.cxx.compile_flags += ['-I' + support_path]
 self.cxx.compile_flags += ['-include', os.path.join(support_path, 'nasty_macros.hpp')]
 libcxx_headers = self.get_lit_conf(
-'libcxx_headers', os.path.join(self.libcxx_src_root, 'include'))
+'libcxx_headers', os.path.join(self.cxx_library_root, '..', 'include', 'c++', 'v1'))
 if not os.path.isdir(libcxx_headers):
 self.lit_config.fatal("libcxx_headers='%s' is not a directory."
   % libcxx_headers)
@@ -416,36 +416,28 @@
 if not enable_global_filesystem_namespace:
 self.config.available_features.add(
 'libcpp-has-no-global-filesystem-namespace')
-self.cxx.compile_flags += [
-'-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE']
 
 def configure_compile_flags_no_stdin(self):
 enable_stdin = self.get_lit_bool('enable_stdin', True)
 if not enable_stdin:
 self.config.available_features.add('libcpp-has-no-stdin')
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDIN']
 
 def configure_compile_flags_no_stdout(self):
 enable_stdout = self.get_lit_bool('enable_stdout', True)
 if not enable_stdout:
 self.config.available_features.add('libcpp-has-no-stdout')
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_STDOUT']
 
 def configure_compile_flags_no_threads(self):
-self.cxx.compile_flags += ['-D_LIBCPP_HAS_NO_THREADS']
 self.config.available_features.add('libcpp-has-no-threads')
 
 def configure_compile_flags_no_thread_unsafe_c_functions(self):
 enable_thread_unsafe_c_functions = self.get_lit_bool(
 'enable_thread_unsafe_c_functions', True)
 if not enable_thread_unsafe_c_functions:
-self.cxx.compile_flags += [
-'-D_LIBCPP_HAS

Re: [PATCH] D11963: Create a __config_site file to capture configuration decisions.

2015-08-19 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In http://reviews.llvm.org/D11963#227444, @EricWF wrote:

> I also just realized that this change will currently likely play havoc with 
> how libc++ and libc++abi build together. In order to build libc++ and 
> libc++abi together we would need to
>
> 1. Configure libc++ pointing to the libc++abi headers in order to generate 
> the __config_site file.
> 2. Configure libc++abi pointing it to the libc++ build directory for the 
> headers.
> 3. build libc++abi
> 4. build libc++
>
>   I'm not quite sure how this would work for an in-tree build.


This patch, combined with http://reviews.llvm.org/D11964, works the way you 
describe.

> However if we do things as I suggested above we can keep the current two step 
> build process.





http://reviews.llvm.org/D11963



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


Re: [PATCH] D11963: Create a __config_site file to capture configuration decisions.

2015-08-19 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In http://reviews.llvm.org/D11963#227441, @EricWF wrote:

> @jroelofs What do you think of an approach like this?


Having two copies of the __config_site file makes me uncomfortable, but I could 
put up with that given that they're effectively the same for 99% of people who 
will want to build this library.

That being said, @mclow.lists raised a few concerns with the overall 
strategy... I don't want to keep pushing on this patch if his plan is to 
pocket-veto it.


http://reviews.llvm.org/D11963



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


Re: [PATCH] D11963: Create a __config_site file to capture configuration decisions.

2015-08-19 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

In http://reviews.llvm.org/D11963#228024, @EricWF wrote:

> Wouldn't it still be a mess if you build both libc++ and libc++abi 
> out-of-tree? The user would have to be aware of these weird requirements.


Oh, yeah, true. Do we have any out-of-tree builders to make sure those 
configurations are supported?


http://reviews.llvm.org/D11963



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


Re: [PATCH] D12129: [libcxx] Add new Sphinx documentation

2015-08-20 Thread Jonathan Roelofs via cfe-commits
jroelofs accepted this revision.
jroelofs added a comment.
This revision is now accepted and ready to land.

Both styles look ok to me, with a slight preference toward matching clang's.



Comment at: docs/BuildingLibcxx.rst:56
@@ +55,3 @@
+Mac users, remember to be careful when replacing the system's libc++.
+**Your system will not be able to boot without a functioning libc++.**
+

Is there a way to make this more prominent, perhaps by putting it in a red box? 
This is a very important detail that is very painful to recover from if you 
miss it.


Comment at: docs/BuildingLibcxx.rst:243
@@ +242,3 @@
+
+Note the first two entries happen to be what we are looking for. This
+may not be correct on other platforms.

s/Note the/Note that the/


Comment at: docs/index.rst:87
@@ +86,3 @@
+   
+OS   Arch CompilersABI Library
+   

Should we mention the unwinders used/supported here too?


http://reviews.llvm.org/D12129



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


Re: [PATCH] D12129: [libcxx] Add new Sphinx documentation

2015-08-20 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: docs/BuildingLibcxx.rst:57
@@ +56,3 @@
+  select a safe place to install libc++.
+
+  * ``make install-libcxx install-libcxxabi`` --- Will install the libraries 
and the headers

I feel like a warning is not enough... perhaps a hard error, with a message 
that says something like: "If you're really really sure you know what you're 
doing, add -DLIBCXX_OVERRIDE_DARWIN_INSTALL=YES to silence this message"?


Comment at: docs/index.rst:88
@@ +87,3 @@
+OS   Arch CompilersABI Library
+   
+Mac OS X i386, x86_64 Clang, GCC   libc++abi

Yeah. This is good for now. I just wanted to mention it while I was thinking of 
it.


http://reviews.llvm.org/D12129



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


Re: [PATCH] D12209: [libcxx] Remove installation rules on Darwin when it would overwrite the system installation.

2015-08-20 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

I like it!


http://reviews.llvm.org/D12209



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


[PATCH] D12294: Misc cleanups re-commandeered from D11963.

2015-08-24 Thread Jonathan Roelofs via cfe-commits
jroelofs created this revision.
jroelofs added a reviewer: EricWF.
jroelofs added a subscriber: cfe-commits.

This separates out the bits of D11963 which were drive-by fixes, which aren't 
really relevant to the __config_site part of that change.

http://reviews.llvm.org/D12294

Files:
  CMakeLists.txt
  test/std/atomics/libcpp-has-no-threads.fail.cpp
  test/std/atomics/libcpp-has-no-threads.pass.cpp
  test/std/utilities/date.time/tested_elsewhere.pass.cpp

Index: test/std/utilities/date.time/tested_elsewhere.pass.cpp
===
--- test/std/utilities/date.time/tested_elsewhere.pass.cpp
+++ test/std/utilities/date.time/tested_elsewhere.pass.cpp
@@ -30,9 +30,11 @@
 static_assert((std::is_same::value), 
"");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), 
"");
+#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
 static_assert((std::is_same::value), 
"");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), 
"");
 static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 }
Index: test/std/atomics/libcpp-has-no-threads.pass.cpp
===
--- test/std/atomics/libcpp-has-no-threads.pass.cpp
+++ test/std/atomics/libcpp-has-no-threads.pass.cpp
@@ -1,18 +0,0 @@
-//===--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===--===//
-// XFAIL: libcpp-has-no-threads
-
-#ifdef _LIBCPP_HAS_NO_THREADS
-#error This should be XFAIL'd for the purpose of detecting that the LIT 
feature\
- 'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
-#endif
-
-int main()
-{
-}
Index: test/std/atomics/libcpp-has-no-threads.fail.cpp
===
--- test/std/atomics/libcpp-has-no-threads.fail.cpp
+++ test/std/atomics/libcpp-has-no-threads.fail.cpp
@@ -1,23 +0,0 @@
-//===--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===--===//
-
-// 
-
-// Test that including  fails to compile when _LIBCPP_HAS_NO_THREADS
-// is defined.
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-#define _LIBCPP_HAS_NO_THREADS
-#endif
-
-#include 
-
-int main()
-{
-}
Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -84,7 +84,7 @@
 option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for 
thread-unsafe C functions" ON)
 option(LIBCXX_ENABLE_MONOTONIC_CLOCK
   "Build libc++ with support for a monotonic clock.
-   This option may only be used when LIBCXX_ENABLE_THREADS=OFF." ON)
+   This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON)
 
 # Misc options 
 option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
@@ -247,7 +247,7 @@
 define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS 
-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)
 
 
-# Sanitizer flags
+# Sanitizer flags =
 
 # Configure for sanitizers. If LIBCXX_BUILT_STANDALONE then we have to do
 # the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it.


Index: test/std/utilities/date.time/tested_elsewhere.pass.cpp
===
--- test/std/utilities/date.time/tested_elsewhere.pass.cpp
+++ test/std/utilities/date.time/tested_elsewhere.pass.cpp
@@ -30,9 +30,11 @@
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 }
Index: test/std/atomics/libcpp-has-no-threads.pass.cpp
===
--- test/std/atomics/libcpp-has-no-threads.pass.cpp
+++ test/std/atomics/libcpp-has-no-threads.pass.cpp
@@ -1,18 +0,0 @@
-//===--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed un

Re: [PATCH] D12294: Misc cleanups re-commandeered from D11963.

2015-08-24 Thread Jonathan Roelofs via cfe-commits
jroelofs updated this revision to Diff 32996.
jroelofs added a comment.

The diff uploaded strangely... trying again.


http://reviews.llvm.org/D12294

Files:
  CMakeLists.txt
  test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
  test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
  test/std/atomics/libcpp-has-no-threads.fail.cpp
  test/std/atomics/libcpp-has-no-threads.pass.cpp
  test/std/utilities/date.time/tested_elsewhere.pass.cpp

Index: test/std/utilities/date.time/tested_elsewhere.pass.cpp
===
--- test/std/utilities/date.time/tested_elsewhere.pass.cpp
+++ test/std/utilities/date.time/tested_elsewhere.pass.cpp
@@ -30,9 +30,11 @@
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 }
Index: test/std/atomics/libcpp-has-no-threads.pass.cpp
===
--- test/std/atomics/libcpp-has-no-threads.pass.cpp
+++ test/std/atomics/libcpp-has-no-threads.pass.cpp
@@ -1,18 +0,0 @@
-//===--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===--===//
-// XFAIL: libcpp-has-no-threads
-
-#ifdef _LIBCPP_HAS_NO_THREADS
-#error This should be XFAIL'd for the purpose of detecting that the LIT feature\
- 'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
-#endif
-
-int main()
-{
-}
Index: test/std/atomics/libcpp-has-no-threads.fail.cpp
===
--- test/std/atomics/libcpp-has-no-threads.fail.cpp
+++ test/std/atomics/libcpp-has-no-threads.fail.cpp
@@ -1,23 +0,0 @@
-//===--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===--===//
-
-// 
-
-// Test that including  fails to compile when _LIBCPP_HAS_NO_THREADS
-// is defined.
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-#define _LIBCPP_HAS_NO_THREADS
-#endif
-
-#include 
-
-int main()
-{
-}
Index: test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
===
--- test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
+++ test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
@@ -0,0 +1,18 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+// XFAIL: libcpp-has-no-threads
+
+#ifdef _LIBCPP_HAS_NO_THREADS
+#error This should be XFAIL'd for the purpose of detecting that the LIT feature\
+   'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
+#endif
+
+int main()
+{
+}
Index: test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
===
--- test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
+++ test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
@@ -0,0 +1,23 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+// 
+
+// Test that including  fails to compile when _LIBCPP_HAS_NO_THREADS
+// is defined.
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+#define _LIBCPP_HAS_NO_THREADS
+#endif
+
+#include 
+
+int main()
+{
+}
Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -84,7 +84,7 @@
 option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for thread-unsafe C functions" ON)
 option(LIBCXX_ENABLE_MONOTONIC_CLOCK
   "Build libc++ with support for a monotonic clock.
-   This option may only be used when LIBCXX_ENABLE_THREADS=OFF." ON)
+   This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON)

Re: [PATCH] D12294: Misc cleanups re-commandeered from D11963.

2015-08-24 Thread Jonathan Roelofs via cfe-commits
jroelofs closed this revision.
jroelofs added a comment.

r245876


http://reviews.llvm.org/D12294



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


[libcxx] r245876 - Misc drive-by cleanups. NFC

2015-08-24 Thread Jonathan Roelofs via cfe-commits
Author: jroelofs
Date: Mon Aug 24 16:20:07 2015
New Revision: 245876

URL: http://llvm.org/viewvc/llvm-project?rev=245876&view=rev
Log:
Misc drive-by cleanups. NFC

http://reviews.llvm.org/D12294

Added:
libcxx/trunk/test/libcxx/atomics/
libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
Removed:
libcxx/trunk/test/std/atomics/libcpp-has-no-threads.fail.cpp
libcxx/trunk/test/std/atomics/libcpp-has-no-threads.pass.cpp
Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/test/std/utilities/date.time/tested_elsewhere.pass.cpp

Modified: libcxx/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=245876&r1=245875&r2=245876&view=diff
==
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Mon Aug 24 16:20:07 2015
@@ -85,7 +85,7 @@ option(LIBCXX_ENABLE_THREADS "Build libc
 option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for 
thread-unsafe C functions" ON)
 option(LIBCXX_ENABLE_MONOTONIC_CLOCK
   "Build libc++ with support for a monotonic clock.
-   This option may only be used when LIBCXX_ENABLE_THREADS=OFF." ON)
+   This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON)
 
 # Misc options 
 option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
@@ -248,7 +248,7 @@ define_if_not(LIBCXX_ENABLE_MONOTONIC_CL
 define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS 
-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)
 
 
-# Sanitizer flags
+# Sanitizer flags =
 
 # Configure for sanitizers. If LIBCXX_BUILT_STANDALONE then we have to do
 # the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it.

Added: libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp?rev=245876&view=auto
==
--- libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp (added)
+++ libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.fail.cpp Mon Aug 24 
16:20:07 2015
@@ -0,0 +1,23 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+// 
+
+// Test that including  fails to compile when _LIBCPP_HAS_NO_THREADS
+// is defined.
+
+#ifndef _LIBCPP_HAS_NO_THREADS
+#define _LIBCPP_HAS_NO_THREADS
+#endif
+
+#include 
+
+int main()
+{
+}

Added: libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp?rev=245876&view=auto
==
--- libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/atomics/libcpp-has-no-threads.pass.cpp Mon Aug 24 
16:20:07 2015
@@ -0,0 +1,18 @@
+//===--===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+// XFAIL: libcpp-has-no-threads
+
+#ifdef _LIBCPP_HAS_NO_THREADS
+#error This should be XFAIL'd for the purpose of detecting that the LIT 
feature\
+   'libcpp-has-no-threads' is available iff _LIBCPP_HAS_NO_THREADS is defined
+#endif
+
+int main()
+{
+}

Removed: libcxx/trunk/test/std/atomics/libcpp-has-no-threads.fail.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/atomics/libcpp-has-no-threads.fail.cpp?rev=245875&view=auto
==
--- libcxx/trunk/test/std/atomics/libcpp-has-no-threads.fail.cpp (original)
+++ libcxx/trunk/test/std/atomics/libcpp-has-no-threads.fail.cpp (removed)
@@ -1,23 +0,0 @@
-//===--===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===--===//
-
-// 
-
-// Test that including  fails to compile when _LIBCPP_HAS_NO_THREADS
-// is defined.
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-#defin

Re: [PATCH] D12209: [libcxx] Remove installation rules on Darwin when it would overwrite the system installation.

2015-08-25 Thread Jonathan Roelofs via cfe-commits
jroelofs accepted this revision.
This revision is now accepted and ready to land.


Comment at: CMakeLists.txt:105
@@ +104,3 @@
+if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT 
LIBCXX_OVERRIDE_DARWIN_INSTALL)
+  if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr")
+message(WARNING "Disabling libc++ install rules because installation would 
"

I would check for "/usr/" too.


http://reviews.llvm.org/D12209



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


Re: [PATCH] D12209: [libcxx] Remove installation rules on Darwin when it would overwrite the system installation.

2015-08-25 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

Ah, I only tested it by editing the CMakeCache.txt manually... ship it!


http://reviews.llvm.org/D12209



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


Re: [PATCH] D11333: [libcxx] Add special warning flag detection logic to compiler.py

2015-08-26 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

the `addWarningFlagIfSupported` part of this patch LGTM.



Comment at: test/libcxx/compiler.py:88
@@ -87,1 +87,3 @@
 
+def compileString(self, source, out=None, flags=[], env=None, cwd=None):
+cmd = self.compileCmd('-', out, flags)

this looks unused to me.


Comment at: test/libcxx/compiler.py:105
@@ -98,1 +104,3 @@
 
+def compileLinkString(self, source, out=None, flags=[], env=None, 
cwd=None):
+cmd = self.compileLinkCmd('-', out, flags)

this looks unused to me.


http://reviews.llvm.org/D11333



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


Re: [PATCH] D11333: [libcxx] Add special warning flag detection logic to compiler.py

2015-08-26 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment.

I'd say put them in when you have actual uses for them


http://reviews.llvm.org/D11333



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


Re: [PATCH] D11333: [libcxx] Add special warning flag detection logic to compiler.py

2015-08-26 Thread Jonathan Roelofs via cfe-commits
jroelofs added inline comments.


Comment at: test/libcxx/compiler.py:195
@@ +194,3 @@
+cmd.remove('-v')
+out, err, rc = lit.util.executeCommand(cmd, input='#error\n')
+assert rc != 0

... you could at least use `compileString` here.


http://reviews.llvm.org/D11333



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


  1   2   3   >