[PATCH] D51020: MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMP: Fix build with newer libstdc++

2018-08-20 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added a reviewer: homerdin.

Repository:
  rT test-suite

https://reviews.llvm.org/D51020

Files:
  MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h


Index: MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
===
--- MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
+++ MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
@@ -99,9 +99,9 @@
 
 struct cmp_str
 {
-   bool operator()(char const *a, char const *b)
+   bool operator()(const string &a, const string &b)
{
-  return strcmp(a, b) < 0;
+  return a.compare(b) < 0;
}
 };
 


Index: MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
===
--- MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
+++ MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
@@ -99,9 +99,9 @@
 
 struct cmp_str
 {
-   bool operator()(char const *a, char const *b)
+   bool operator()(const string &a, const string &b)
{
-  return strcmp(a, b) < 0;
+  return a.compare(b) < 0;
}
 };
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51021: ABI-Testsuite: Force the old c++11 ABI in mangling/test.xpp

2018-08-20 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added a reviewer: Sunil_Srivastava.

The check lines for this test assume the old c++11 ABI.

This resolved PR33132.


Repository:
  rT test-suite

https://reviews.llvm.org/D51021

Files:
  ABI-Testsuite/test/mangling/test.xpp


Index: ABI-Testsuite/test/mangling/test.xpp
===
--- ABI-Testsuite/test/mangling/test.xpp
+++ ABI-Testsuite/test/mangling/test.xpp
@@ -1,6 +1,6 @@
 // This file is distributed under the University of Illinois Open Source 
License.
 // See LICENSE.TXT for details.
-// RUN: cxx_compiler cxx_11 -c %s -o %t.o
+// RUN: cxx_compiler cxx_11 -D_GLIBCXX_USE_CXX11_ABI=0 -c %s -o %t.o
 // RUN: bindump %t.o | FileCheck -allow-deprecated-dag-overlap prefixes %s
 
 #include 


Index: ABI-Testsuite/test/mangling/test.xpp
===
--- ABI-Testsuite/test/mangling/test.xpp
+++ ABI-Testsuite/test/mangling/test.xpp
@@ -1,6 +1,6 @@
 // This file is distributed under the University of Illinois Open Source License.
 // See LICENSE.TXT for details.
-// RUN: cxx_compiler cxx_11 -c %s -o %t.o
+// RUN: cxx_compiler cxx_11 -D_GLIBCXX_USE_CXX11_ABI=0 -c %s -o %t.o
 // RUN: bindump %t.o | FileCheck -allow-deprecated-dag-overlap prefixes %s
 
 #include 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51020: MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMP: Fix build with newer libstdc++

2018-08-21 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL340320: MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMP: Fix 
build with newer libstdc++ (authored by tstellar, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D51020

Files:
  test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h


Index: 
test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
===
--- test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
+++ test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
@@ -99,9 +99,9 @@
 
 struct cmp_str
 {
-   bool operator()(char const *a, char const *b)
+   bool operator()(const string &a, const string &b)
{
-  return strcmp(a, b) < 0;
+  return a.compare(b) < 0;
}
 };
 


Index: test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
===
--- test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
+++ test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h
@@ -99,9 +99,9 @@
 
 struct cmp_str
 {
-   bool operator()(char const *a, char const *b)
+   bool operator()(const string &a, const string &b)
{
-  return strcmp(a, b) < 0;
+  return a.compare(b) < 0;
}
 };
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51021: ABI-Testsuite: Force the old c++11 ABI in mangling/test.xpp

2018-08-21 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL340322: ABI-Testsuite: Force the old c++11 ABI in 
mangling/test.xpp (authored by tstellar, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D51021

Files:
  test-suite/trunk/ABI-Testsuite/test/mangling/test.xpp


Index: test-suite/trunk/ABI-Testsuite/test/mangling/test.xpp
===
--- test-suite/trunk/ABI-Testsuite/test/mangling/test.xpp
+++ test-suite/trunk/ABI-Testsuite/test/mangling/test.xpp
@@ -1,6 +1,6 @@
 // This file is distributed under the University of Illinois Open Source 
License.
 // See LICENSE.TXT for details.
-// RUN: cxx_compiler cxx_11 -c %s -o %t.o
+// RUN: cxx_compiler cxx_11 -D_GLIBCXX_USE_CXX11_ABI=0 -c %s -o %t.o
 // RUN: bindump %t.o | FileCheck -allow-deprecated-dag-overlap prefixes %s
 
 #include 


Index: test-suite/trunk/ABI-Testsuite/test/mangling/test.xpp
===
--- test-suite/trunk/ABI-Testsuite/test/mangling/test.xpp
+++ test-suite/trunk/ABI-Testsuite/test/mangling/test.xpp
@@ -1,6 +1,6 @@
 // This file is distributed under the University of Illinois Open Source License.
 // See LICENSE.TXT for details.
-// RUN: cxx_compiler cxx_11 -c %s -o %t.o
+// RUN: cxx_compiler cxx_11 -D_GLIBCXX_USE_CXX11_ABI=0 -c %s -o %t.o
 // RUN: bindump %t.o | FileCheck -allow-deprecated-dag-overlap prefixes %s
 
 #include 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51567: CMake: Consolidate gtest detection code

2018-08-31 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: chandlerc, beanz.
Herald added a subscriber: mgorny.

This makes it possible to build the unittests with only the gtest sources
and without a full LLVM source tree.


Repository:
  rC Clang

https://reviews.llvm.org/D51567

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -142,12 +142,6 @@
 set(LLVM_UTILS_PROVIDED ON)
 set(CLANG_TEST_DEPS FileCheck count not)
   endif()
-  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
-  AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-  AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} utils/unittest)
-  endif()
 else()
   # Seek installed Lit.
   find_program(LLVM_LIT
@@ -486,12 +480,18 @@
 
 
 if( CLANG_INCLUDE_TESTS )
-  if(EXISTS 
${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
+  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
 add_subdirectory(unittests)
 list(APPEND CLANG_TEST_DEPS ClangUnitTests)
 list(APPEND CLANG_TEST_PARAMS
   clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
   )
+if (CLANG_BUILT_STANDALONE
+AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
+  add_subdirectory(${UNITTEST_DIR} utils/unittest)
+endif()
   endif()
   add_subdirectory(test)
 


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -142,12 +142,6 @@
 set(LLVM_UTILS_PROVIDED ON)
 set(CLANG_TEST_DEPS FileCheck count not)
   endif()
-  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
-  AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-  AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} utils/unittest)
-  endif()
 else()
   # Seek installed Lit.
   find_program(LLVM_LIT
@@ -486,12 +480,18 @@
 
 
 if( CLANG_INCLUDE_TESTS )
-  if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
+  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
 add_subdirectory(unittests)
 list(APPEND CLANG_TEST_DEPS ClangUnitTests)
 list(APPEND CLANG_TEST_PARAMS
   clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
   )
+if (CLANG_BUILT_STANDALONE
+AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
+  add_subdirectory(${UNITTEST_DIR} utils/unittest)
+endif()
   endif()
   add_subdirectory(test)
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51567: CMake: Consolidate gtest detection code

2018-09-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In https://reviews.llvm.org/D51567#1222704, @chandlerc wrote:

> I mean, sure.
>
> I really don't know that supporting this ever expanding diversity of build 
> strategies is worth its cost, but I don't see a specific reason to not take 
> this patch


I actually agree with you that we don't want to be supporting every possible 
strategy in trunk.  I usually try to keep Fedora specific stuff like this out 
of trunk, but in this case it looked like a useful code simplification that 
might be generally helpful.


Repository:
  rC Clang

https://reviews.llvm.org/D51567



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


[PATCH] D32577: CMake: Replace open-coded find_package

2018-09-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 164141.
tstellar added a comment.

Rebase on trunk.


Repository:
  rC Clang

https://reviews.llvm.org/D32577

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -64,13 +64,8 @@
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)
 
-  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
-  if(EXISTS ${LLVMCONFIG_FILE})
-list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
-include(${LLVMCONFIG_FILE})
-  else()
-message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
-  endif()
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
 
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -64,13 +64,8 @@
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)
 
-  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
-  if(EXISTS ${LLVMCONFIG_FILE})
-list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
-include(${LLVMCONFIG_FILE})
-  else()
-message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
-  endif()
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
 
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51714: CMake: Deprecate using llvm-config to detect llvm installation

2018-09-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: chandlerc, beanz, mgorny, chapuni.
Herald added subscribers: dexonsmith, mehdi_amini.

clang currently uses llvm-config to determine the installation paths
for llvm's headers and binaries.  clang is also using LLVM's cmake
files to determine other information about the LLVM build, like
LLVM_LIBDIR_SUFFIX, LLVM_VERSION_*, etc.  Since the installation
paths are also available via the cmake files, we can simplify the code
by only relying on information from cmake about the LLVM install and
dropping the use of llvm-config altogether.

In addition to simplifying the code, the cmake files have more
accurate information about the llvm installation paths.  llvm-config
assumes that the lib, bin, and cmake directories are always located
in the same place relative to the path of the llvm-config executable.
This can be wrong if a user decides to install headers, binaries
or libraries to a non-standard location: e.g. static libraries
installed to /usr/lib/llvm6.0/

This patch takes the first step towards dropping llvm-config by
removing the automatic detection of llvm-config (users can still
manually supply a path to llvm-config by passing
-DLLVM_CONFIG=/usr/bin/llvm-config to cmake) and adding a
deprecation warning when users try to use this option.


Repository:
  rC Clang

https://reviews.llvm.org/D51714

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -7,9 +7,14 @@
 
   # Rely on llvm-config.
   set(CONFIG_OUTPUT)
-  find_program(LLVM_CONFIG "llvm-config")
   if(LLVM_CONFIG)
+set (LLVM_CONFIG_FOUND 1)
 message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
+message(WARNING "Using llvm-config to detect the LLVM installation is \
+  deprecated.  The installed cmake files should be used \
+  instead.  CMake should be able to detect your LLVM install \
+  automatically, but you can also use LLVM_DIR to specify \
+  the path containing LLVMConfig.cmake.")
 set(CONFIG_COMMAND ${LLVM_CONFIG}
   "--assertion-mode"
   "--bindir"
@@ -32,41 +37,51 @@
   message(STATUS "${CONFIG_COMMAND_STR}")
   message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
 endif()
-  else()
-message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
+
+list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
+list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
+list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
+list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
+list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
+list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH)
+
+# Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes.
+# CMake assumes slashes as PATH.
+file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH)
   endif()
 
-  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
-  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
-  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
-  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
-  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
-  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
-  list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH)
 
   if(NOT MSVC_IDE)
 set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
   CACHE BOOL "Enable assertions")
 # Assertions should follow llvm-config's.
 mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
   endif()
 
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
+
+  # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
+  # LLVM_CONFIG.
+  if (NOT LLVM_CONFIG_FOUND)
+# Pull values from LLVMConfig.cmake.  We can drop this once the llvm-config
+# path is removed.
+set(TOOLS_BINARY_DIR ${LLVM_TOOLS_BINARY_DIR})
+set(LIBRARY_DIR ${LLVM_LIBRARY_DIR})
+set(INCLUDE_DIR ${LLVM_INCLUDE_DIR})
+set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR})
+  endif()
+
   set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
   set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
   set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
   set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
 
-  # Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes.
-  # CMake assumes slashes as PATH.
-  file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH)
-
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)
 
-  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
-  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
-
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
   set(LLVM_LIBRARY_OUTPUT_INTDIR 
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})


Index: CMakeList

[PATCH] D51714: CMake: Deprecate using llvm-config to detect llvm installation

2018-09-06 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In https://reviews.llvm.org/D51714#1225545, @mgorny wrote:

> Is LLVM_CONFIG dropped from cache here? I suspect the warning might fire for 
> everyone who has LLVM configured.


Yes, it is dropped from the cache, is it a problem to having the warning fire 
for people who have already configured LLVM?


Repository:
  rC Clang

https://reviews.llvm.org/D51714



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


[PATCH] D32595: CMakeLists: Don't set LLVM_MAIN_SRC_DIR when building stand-alone clang

2017-05-31 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In https://reviews.llvm.org/D32595#769044, @beanz wrote:

> Is this really something we should be supporting? Building and testing clang 
> with potentially out-of-sync lit or gtest seems undesirable to me.


This is actually what this patch is trying to avoid.   For example prior to 
this patch, if you build and install llvm trunk to /usr/local, and then 
checkout an older stable branch in your llvm tree,  when you try and build 
clang from trunk using the llvm install from /usr/local, it will pull lit and 
gtest from the LLVM source tree which is now  much older than the checkout of 
clang you are using.

> It is worth noting that we do have mods to gtest, so supporting any standard 
> distribution of it seems like a not great idea. The general approach in the 
> past for standalone builds has been to disable testing unless an LLVM source 
> tree is available, and I think that might be the right approach.
> 
> Also, this all kinda becomes moot if LLVM moves to a mono-repo (really not 
> trying to troll here), because people actively developing LLVM projects will 
> basically be forced to have LLVM source trees anyways.
> 
> Thoughts?


https://reviews.llvm.org/D32595



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


[PATCH] D34212: docs: Document binary compatibility issue due to bug in gcc

2017-06-14 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.

Reported in PR33161.


https://reviews.llvm.org/D34212

Files:
  docs/BinaryCompatibilityWithOtherCompilers.rst


Index: docs/BinaryCompatibilityWithOtherCompilers.rst
===
--- /dev/null
+++ docs/BinaryCompatibilityWithOtherCompilers.rst
@@ -0,0 +1,39 @@
+=
+Binary compatibility with other compilers
+=
+
+Introduction
+
+
+This document describes some of the known binary compatibility problems
+when mixing object files built by clang with object files built by
+other compilers.
+
+If you run into a compatibility issue, please file a bug at bugs.llvm.org.
+
+gcc C++ ABI bug with variadic templates
+===
+
+Older versions of gcc incorrectly mangle variadic class/function templates,
+which can lead to undefined symbol errors when linking gcc built objects
+with clang built objects.
+
+gcc does emit the correct symbol name as an alias for the incorrect one,
+so libraries built by gcc are not affected by this bug.  You can only
+hit this bug if you have a library built by clang and you try to link
+against it with a gcc built object that uses a variadic class/function
+template from the library.
+
+workarounds:
+^^^
+
+* Use gcc 5.1.0 or newer.
+* Pass the -fabi-version=6 option to gcc when using versions < 5.1.0.
+
+gcc bug report:
+^^^
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51322
+
+llvm bug report:
+
+https://llvm.org/PR33161


Index: docs/BinaryCompatibilityWithOtherCompilers.rst
===
--- /dev/null
+++ docs/BinaryCompatibilityWithOtherCompilers.rst
@@ -0,0 +1,39 @@
+=
+Binary compatibility with other compilers
+=
+
+Introduction
+
+
+This document describes some of the known binary compatibility problems
+when mixing object files built by clang with object files built by
+other compilers.
+
+If you run into a compatibility issue, please file a bug at bugs.llvm.org.
+
+gcc C++ ABI bug with variadic templates
+===
+
+Older versions of gcc incorrectly mangle variadic class/function templates,
+which can lead to undefined symbol errors when linking gcc built objects
+with clang built objects.
+
+gcc does emit the correct symbol name as an alias for the incorrect one,
+so libraries built by gcc are not affected by this bug.  You can only
+hit this bug if you have a library built by clang and you try to link
+against it with a gcc built object that uses a variadic class/function
+template from the library.
+
+workarounds:
+^^^
+
+* Use gcc 5.1.0 or newer.
+* Pass the -fabi-version=6 option to gcc when using versions < 5.1.0.
+
+gcc bug report:
+^^^
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51322
+
+llvm bug report:
+
+https://llvm.org/PR33161
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D44130: Driver: Add gcc search path for RHEL devtoolset-7

2018-03-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.

Repository:
  rC Clang

https://reviews.llvm.org/D44130

Files:
  lib/Driver/ToolChains/Gnu.cpp


Index: lib/Driver/ToolChains/Gnu.cpp
===
--- lib/Driver/ToolChains/Gnu.cpp
+++ lib/Driver/ToolChains/Gnu.cpp
@@ -1802,6 +1802,7 @@
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-4/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-3/root/usr");


Index: lib/Driver/ToolChains/Gnu.cpp
===
--- lib/Driver/ToolChains/Gnu.cpp
+++ lib/Driver/ToolChains/Gnu.cpp
@@ -1802,6 +1802,7 @@
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-4/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-3/root/usr");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34848: Driver: Don't mix system tools with devtoolset tools on RHEL

2018-03-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Ping.


https://reviews.llvm.org/D34848



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


[PATCH] D42608: Driver: Prefer vendor supplied gcc toolchain

2018-03-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Ping


Repository:
  rC Clang

https://reviews.llvm.org/D42608



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


[PATCH] D32577: CMake: Replace open-coded find_package

2018-11-12 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL346731: CMake: Replace open-coded find_package (authored by 
tstellar, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D32577

Files:
  cfe/trunk/CMakeLists.txt


Index: cfe/trunk/CMakeLists.txt
===
--- cfe/trunk/CMakeLists.txt
+++ cfe/trunk/CMakeLists.txt
@@ -68,13 +68,8 @@
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)
 
-  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
-  if(EXISTS ${LLVMCONFIG_FILE})
-list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
-include(${LLVMCONFIG_FILE})
-  else()
-message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
-  endif()
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
 
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)


Index: cfe/trunk/CMakeLists.txt
===
--- cfe/trunk/CMakeLists.txt
+++ cfe/trunk/CMakeLists.txt
@@ -68,13 +68,8 @@
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)
 
-  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
-  if(EXISTS ${LLVMCONFIG_FILE})
-list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
-include(${LLVMCONFIG_FILE})
-  else()
-message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
-  endif()
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
 
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51714: CMake: Deprecate using llvm-config to detect llvm installation

2018-11-12 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC346732: CMake: Deprecate using llvm-config to detect llvm 
installation (authored by tstellar, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D51714?vs=167413&id=173808#toc

Repository:
  rC Clang

https://reviews.llvm.org/D51714

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -11,9 +11,14 @@
 
   # Rely on llvm-config.
   set(CONFIG_OUTPUT)
-  find_program(LLVM_CONFIG "llvm-config")
   if(LLVM_CONFIG)
+set (LLVM_CONFIG_FOUND 1)
 message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
+message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
+  deprecated.  The installed cmake files should be used \
+  instead.  CMake should be able to detect your LLVM install \
+  automatically, but you can also use LLVM_DIR to specify \
+  the path containing LLVMConfig.cmake.")
 set(CONFIG_COMMAND ${LLVM_CONFIG}
   "--assertion-mode"
   "--bindir"
@@ -36,41 +41,51 @@
   message(STATUS "${CONFIG_COMMAND_STR}")
   message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
 endif()
-  else()
-message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
+
+list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
+list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
+list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
+list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
+list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
+list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH)
+
+# Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes.
+# CMake assumes slashes as PATH.
+file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH)
   endif()
 
-  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
-  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
-  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
-  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
-  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
-  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
-  list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH)
 
   if(NOT MSVC_IDE)
 set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
   CACHE BOOL "Enable assertions")
 # Assertions should follow llvm-config's.
 mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
   endif()
 
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
+
+  # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
+  # LLVM_CONFIG.
+  if (NOT LLVM_CONFIG_FOUND)
+# Pull values from LLVMConfig.cmake.  We can drop this once the llvm-config
+# path is removed.
+set(TOOLS_BINARY_DIR ${LLVM_TOOLS_BINARY_DIR})
+set(LIBRARY_DIR ${LLVM_LIBRARY_DIR})
+set(INCLUDE_DIR ${LLVM_INCLUDE_DIR})
+set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR})
+  endif()
+
   set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
   set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
   set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
   set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
 
-  # Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes.
-  # CMake assumes slashes as PATH.
-  file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH)
-
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)
 
-  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
-  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
-
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
   set(LLVM_LIBRARY_OUTPUT_INTDIR 
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -11,9 +11,14 @@
 
   # Rely on llvm-config.
   set(CONFIG_OUTPUT)
-  find_program(LLVM_CONFIG "llvm-config")
   if(LLVM_CONFIG)
+set (LLVM_CONFIG_FOUND 1)
 message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
+message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
+  deprecated.  The installed cmake files should be used \
+  instead.  CMake should be able to detect your LLVM install \
+  automatically, but you can also use LLVM_DIR to specify \
+  the path containing LLVMConfig.cmake.")
 set(CONFIG_COMMAND ${LLVM_CONFIG}
   "--assertion-mode"
   "--bindir"
@@ -36,41 +41,51 @@
   message(STATUS "${CONFIG_COMMAND_STR}")
   message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
 endif()
-  else()
-message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
+
+list(GET CONFIG_OUTPUT 0 ENA

[PATCH] D58537: lib/Header: Simplify CMakeLists.txt

2019-02-26 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 188500.
tstellar added a comment.

Use macros instead of functions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58537/new/

https://reviews.llvm.org/D58537

Files:
  clang/lib/Headers/CMakeLists.txt


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -123,60 +123,53 @@
 )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
-
-# Generate arm_neon.h
-clang_tablegen(arm_neon.h -gen-arm-neon
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
-# Generate arm_fp16.h
-clang_tablegen(arm_fp16.h -gen-arm-fp16
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_fp16.td)
-
 set(out_files)
-foreach( f ${files} ${cuda_wrapper_files} )
-  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
-  set( dst ${output_dir}/${f} )
+
+function(copy_header_to_output_dir src_dir file)
+  set(src ${src_dir}/${file})
+  set(dst ${output_dir}/${file})
   add_custom_command(OUTPUT ${dst}
 DEPENDS ${src}
 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
-COMMENT "Copying clang's ${f}...")
+COMMENT "Copying clang's ${file}...")
   list(APPEND out_files ${dst})
+  # The list function only updates out_files in the current scope.  We need
+  # call set in order to also update the variable for the parent's scope.
+  # The parent in this case is the caller of the function.
+  set(out_files ${out_files} PARENT_SCOPE)
+endfunction(copy_header_to_output_dir)
+
+function(clang_generate_header td_option td_file file_list)
+  clang_tablegen(${out_file} ${td_option}
+  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
+  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/${td_file})
+
+  copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} out_file file_list)
+endfunction(clang_generate_header)
+
+
+# Copy header files from the source directory to the build directory
+foreach( f ${files} ${cuda_wrapper_files} )
+  copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f})
 endforeach( f )
 
-add_custom_command(OUTPUT ${output_dir}/arm_neon.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h ${output_dir}/arm_neon.h
-  COMMENT "Copying clang's arm_neon.h...")
-list(APPEND out_files ${output_dir}/arm_neon.h)
-add_custom_command(OUTPUT ${output_dir}/arm_fp16.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h ${output_dir}/arm_fp16.h
-  COMMENT "Copying clang's arm_fp16.h...")
-list(APPEND out_files ${output_dir}/arm_fp16.h)
+# Generate header files and copy them to the build directory
+# Generate arm_neon.h
+clang_generate_header(-gen-arm-neon arm_neon.td arm_neon.h)
+# Generate arm_fp16.h
+clang_generate_header(-gen-arm-fp16 arm_fp16.td arm_fp16.h)
 
 add_custom_target(clang-headers ALL DEPENDS ${out_files})
 set_target_properties(clang-headers PROPERTIES
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
 
 install(
-  FILES ${cuda_wrapper_files}
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION 
lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
+  DIRECTORY ${output_dir}
+  DESTINATION ${header_install_dir}
+  COMPONENT clang-headers)
 
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-headers


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -123,60 +123,53 @@
 )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
-
-# Generate arm_neon.h
-clang_tablegen(arm_neon.h -gen-arm-neon
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
-# Generate arm_fp16.h
-clang_tablegen(arm_fp16.h -gen-arm-fp16
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_fp16.td)
-
 set(out_files)
-foreach( f ${files} ${cuda_wrapper_files} )
-  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
-  set( dst ${output_dir}/${f} )
+
+function(copy_header_to_out

[PATCH] D58537: lib/Header: Simplify CMakeLists.txt

2019-02-26 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D58537#1411657 , @tstellar wrote:

> Use macros instead of functions.


I mean "Use functions instead of macros."


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58537/new/

https://reviews.llvm.org/D58537



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


[PATCH] D58537: lib/Header: Simplify CMakeLists.txt

2019-02-28 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 188749.
tstellar added a comment.

Fix an issue with the generated arm headers that I discovered after
doing some more testing.  Also, remove comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58537/new/

https://reviews.llvm.org/D58537

Files:
  clang/lib/Headers/CMakeLists.txt


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -123,60 +123,51 @@
 )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
-
-# Generate arm_neon.h
-clang_tablegen(arm_neon.h -gen-arm-neon
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
-# Generate arm_fp16.h
-clang_tablegen(arm_fp16.h -gen-arm-fp16
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_fp16.td)
-
 set(out_files)
-foreach( f ${files} ${cuda_wrapper_files} )
-  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
-  set( dst ${output_dir}/${f} )
+
+function(copy_header_to_output_dir src_dir file)
+  set(src ${src_dir}/${file})
+  set(dst ${output_dir}/${file})
   add_custom_command(OUTPUT ${dst}
 DEPENDS ${src}
 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
-COMMENT "Copying clang's ${f}...")
+COMMENT "Copying clang's ${file}...")
   list(APPEND out_files ${dst})
+  set(out_files ${out_files} PARENT_SCOPE)
+endfunction(copy_header_to_output_dir)
+
+function(clang_generate_header td_option td_file out_file)
+  clang_tablegen(${out_file} ${td_option}
+  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
+  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/${td_file})
+
+  copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
+  set(out_files ${out_files} PARENT_SCOPE)
+endfunction(clang_generate_header)
+
+
+# Copy header files from the source directory to the build directory
+foreach( f ${files} ${cuda_wrapper_files} )
+  copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f})
 endforeach( f )
 
-add_custom_command(OUTPUT ${output_dir}/arm_neon.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h ${output_dir}/arm_neon.h
-  COMMENT "Copying clang's arm_neon.h...")
-list(APPEND out_files ${output_dir}/arm_neon.h)
-add_custom_command(OUTPUT ${output_dir}/arm_fp16.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h ${output_dir}/arm_fp16.h
-  COMMENT "Copying clang's arm_fp16.h...")
-list(APPEND out_files ${output_dir}/arm_fp16.h)
+# Generate header files and copy them to the build directory
+# Generate arm_neon.h
+clang_generate_header(-gen-arm-neon arm_neon.td arm_neon.h)
+# Generate arm_fp16.h
+clang_generate_header(-gen-arm-fp16 arm_fp16.td arm_fp16.h)
 
 add_custom_target(clang-headers ALL DEPENDS ${out_files})
 set_target_properties(clang-headers PROPERTIES
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
 
 install(
-  FILES ${cuda_wrapper_files}
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION 
lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
+  DIRECTORY ${output_dir}
+  DESTINATION ${header_install_dir}
+  COMPONENT clang-headers)
 
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-headers


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -123,60 +123,51 @@
 )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
-
-# Generate arm_neon.h
-clang_tablegen(arm_neon.h -gen-arm-neon
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
-# Generate arm_fp16.h
-clang_tablegen(arm_fp16.h -gen-arm-fp16
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_fp16.td)
-
 set(out_files)
-foreach( f ${files} ${cuda_wrapper_files} )
-  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
-  set( dst ${output_dir}/${f} )
+
+function(copy_header_to_output_dir src_dir file)
+  set(src ${src_dir}/${file})
+  set(dst ${output_dir}/${file})
   add

[PATCH] D58537: lib/Header: Simplify CMakeLists.txt

2019-03-01 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D58537#1415534 , @smeenai wrote:

> @tstellar are you planning to land this soon? It'll conflict with D58791 
> , but I'm not planning to land that for 
> another few days, so I can rebase on top of this one.


Yes, I'll push this later today.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58537/new/

https://reviews.llvm.org/D58537



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


[PATCH] D58537: lib/Header: Simplify CMakeLists.txt

2019-03-01 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL355253: lib/Header: Simplify CMakeLists.txt (authored by 
tstellar, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D58537?vs=188749&id=189010#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58537/new/

https://reviews.llvm.org/D58537

Files:
  cfe/trunk/lib/Headers/CMakeLists.txt


Index: cfe/trunk/lib/Headers/CMakeLists.txt
===
--- cfe/trunk/lib/Headers/CMakeLists.txt
+++ cfe/trunk/lib/Headers/CMakeLists.txt
@@ -123,60 +123,51 @@
 )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
-
-# Generate arm_neon.h
-clang_tablegen(arm_neon.h -gen-arm-neon
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
-# Generate arm_fp16.h
-clang_tablegen(arm_fp16.h -gen-arm-fp16
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_fp16.td)
-
 set(out_files)
-foreach( f ${files} ${cuda_wrapper_files} )
-  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
-  set( dst ${output_dir}/${f} )
+
+function(copy_header_to_output_dir src_dir file)
+  set(src ${src_dir}/${file})
+  set(dst ${output_dir}/${file})
   add_custom_command(OUTPUT ${dst}
 DEPENDS ${src}
 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
-COMMENT "Copying clang's ${f}...")
+COMMENT "Copying clang's ${file}...")
   list(APPEND out_files ${dst})
+  set(out_files ${out_files} PARENT_SCOPE)
+endfunction(copy_header_to_output_dir)
+
+function(clang_generate_header td_option td_file out_file)
+  clang_tablegen(${out_file} ${td_option}
+  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
+  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/${td_file})
+
+  copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
+  set(out_files ${out_files} PARENT_SCOPE)
+endfunction(clang_generate_header)
+
+
+# Copy header files from the source directory to the build directory
+foreach( f ${files} ${cuda_wrapper_files} )
+  copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f})
 endforeach( f )
 
-add_custom_command(OUTPUT ${output_dir}/arm_neon.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h ${output_dir}/arm_neon.h
-  COMMENT "Copying clang's arm_neon.h...")
-list(APPEND out_files ${output_dir}/arm_neon.h)
-add_custom_command(OUTPUT ${output_dir}/arm_fp16.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h ${output_dir}/arm_fp16.h
-  COMMENT "Copying clang's arm_fp16.h...")
-list(APPEND out_files ${output_dir}/arm_fp16.h)
+# Generate header files and copy them to the build directory
+# Generate arm_neon.h
+clang_generate_header(-gen-arm-neon arm_neon.td arm_neon.h)
+# Generate arm_fp16.h
+clang_generate_header(-gen-arm-fp16 arm_fp16.td arm_fp16.h)
 
 add_custom_target(clang-headers ALL DEPENDS ${out_files})
 set_target_properties(clang-headers PROPERTIES
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
 
 install(
-  FILES ${cuda_wrapper_files}
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION 
lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
+  DIRECTORY ${output_dir}
+  DESTINATION ${header_install_dir}
+  COMPONENT clang-headers)
 
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-headers


Index: cfe/trunk/lib/Headers/CMakeLists.txt
===
--- cfe/trunk/lib/Headers/CMakeLists.txt
+++ cfe/trunk/lib/Headers/CMakeLists.txt
@@ -123,60 +123,51 @@
 )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
-
-# Generate arm_neon.h
-clang_tablegen(arm_neon.h -gen-arm-neon
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
-# Generate arm_fp16.h
-clang_tablegen(arm_fp16.h -gen-arm-fp16
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_fp16.td)
-
 set(out_files)
-foreach( f ${files} ${cuda_wrapper_files} )
-  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
-  

[PATCH] D58791: [build] Rename clang-headers to clang-resource-headers

2019-03-01 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

This looks good, but could you also add an entry in the ReleaseNotes for this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58791/new/

https://reviews.llvm.org/D58791



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


[PATCH] D59987: Add support for detection of devtoolset-8

2019-03-29 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

LGTM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59987/new/

https://reviews.llvm.org/D59987



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


[PATCH] D59987: Add support for detection of devtoolset-8

2019-04-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Do you have commit access?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59987/new/

https://reviews.llvm.org/D59987



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


[PATCH] D59987: Add support for detection of devtoolset-8

2019-04-08 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D59987#1454543 , @rpopescu wrote:

> In D59987#1454422 , @tstellar wrote:
>
> > Do you have commit access?
>
>
> Hi Tom, I don't think that I do. I have created the account just before 
> submitting the patch. Should I request it, or?


I'll commit it for you.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59987/new/

https://reviews.llvm.org/D59987



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


[PATCH] D59987: Add support for detection of devtoolset-8

2019-04-09 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL358002: Add support for detection of devtoolset-8 (authored 
by tstellar, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D59987?vs=192800&id=194304#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59987/new/

https://reviews.llvm.org/D59987

Files:
  cfe/trunk/lib/Driver/ToolChains/Gnu.cpp


Index: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
===
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
@@ -1875,6 +1875,7 @@
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-8/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-4/root/usr");


Index: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
===
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
@@ -1875,6 +1875,7 @@
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-8/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-4/root/usr");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D58537: lib/Header: Simplify CMakeLists.txt

2019-04-22 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D58537#1474824 , @smeenai wrote:

> @tstellar ping. Someone appears to be running into this on the CMake mailing 
> list too: https://cmake.org/pipermail/cmake/2019-April/069359.html


Sorry, I missed this.  I will take a look.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58537/new/

https://reviews.llvm.org/D58537



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


[PATCH] D58537: lib/Header: Simplify CMakeLists.txt

2019-04-22 Thread Tom Stellard via Phabricator via cfe-commits
tstellar marked an inline comment as done.
tstellar added inline comments.



Comment at: cfe/trunk/lib/Headers/CMakeLists.txt:168
 install(
-  FILES ${cuda_wrapper_files}
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION 
lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
+  DIRECTORY ${output_dir}
+  DESTINATION ${header_install_dir}

vzakhari wrote:
> This change results in a use of CMAKE_CFG_INTDIR, which expands to 
> $(Configuration) inside cmake_install.cmake, when using Visual Studio 
> generator. CMake cannot reasonably expand $(Configuration), so Visual Studio 
> builds are broken for me after this change-set.
> 
> Can we revert to installation from FILES relative to the current source dir?  
> This will require keeping a separate list of source files in 
> copy_header_to_output_dir(), and using this list in the install() command.
> 
> I do understand that the intention was, probably, to copy headers files into 
> output_dir along with creating some structure inside output_dir, and then 
> installing the whole output_dir verbatim to the install dir.  It will be hard 
> to achieve this with the change I suggest, but can we fix Visual Studio 
> builds in any other way?
> 
> FWIW, vcproj invokes the installation with the following command: cmake 
> -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake
> CMake could have expanded CMAKE_CFG_INTDIR as ${BUILD_TYPE} instead of 
> $(Configuration) inside cmake_install.cmake.
> This change results in a use of CMAKE_CFG_INTDIR, which expands to 
> $(Configuration) inside cmake_install.cmake, when using Visual Studio 
> generator. CMake cannot reasonably expand $(Configuration), so Visual Studio 
> builds are broken for me after this change-set.

Prior to this change we were installing the arm generated files from 
${CMAKE_CURRENT_BINARY_DIR}.  Do we really need to use 
${LLVM_LIBRARY_OUTPUT_INTDIR} as the base for output_dir?  Could we use 
${CMAKE_CURRENT_BINARY_DIR} instead?  That seems like it would fix this issue.

> FWIW, vcproj invokes the installation with the following command: cmake 
> -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake
CMake could have expanded CMAKE_CFG_INTDIR as ${BUILD_TYPE} instead of 
$(Configuration) inside cmake_install.cmake.

Are the vc project files part of the LLVM source tree?







Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58537/new/

https://reviews.llvm.org/D58537



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


[PATCH] D61046: Fix compilation warnings when compiling with GCC 7.3

2019-04-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: llvm/trunk/lib/Target/AMDGPU/R600ISelLowering.cpp:1717-1722
+// Fix spurious warning with gcc 7.3 -O3 for NewBldVec[i] below
+// warning: array subscript is above array bounds [-Warray-bounds]
+#if defined(__GNUC__) && __GNUC__ >= 7 && __GNUC_MINOR__ >= 3
+if (i >= 4)
+  continue;
+#endif

We don't want to  have ifdefs for specific compilers, can this be fixed another 
way or dropped from the patch?



Comment at: llvm/trunk/unittests/IR/ConstantRangeTest.cpp:398-401
+#if defined(__GNUC__) && __GNUC__ >= 7
+// Silence warning: variable 'HaveInterrupt3' set but not used
+(void)&HaveInterrupt3;
+#endif

Same here, no compiler specific ifdefs.



Comment at: llvm/trunk/unittests/Transforms/Scalar/CMakeLists.txt:14-17
+# Workaround for the gcc 6.1 bug 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80916.
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 
6.0)
+  set_source_files_properties(LoopPassManagerTest.cpp PROPERTIES COMPILE_FLAGS 
-Wno-unused-function)
+endif()

Same thing here too.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61046/new/

https://reviews.llvm.org/D61046



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


[PATCH] D61054: lib/Header: Fix Visual Studio builds

2019-04-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: smeenai, vzakhari, phosek.
Herald added a subscriber: mgorny.
Herald added a project: clang.

This is a follow up to r355253, which inadvertently broke Visual
Studio builds by trying to copy files from CMAKE_CFG_INTDIR.

See https://reviews.llvm.org/D58537#inline-532492


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61054

Files:
  clang/lib/Headers/CMakeLists.txt


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -126,7 +126,7 @@
   ppc_wrappers/mmintrin.h
 )
 
-set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
+set(output_dir 
${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 set(out_files)
 
 function(copy_header_to_output_dir src_dir file)


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -126,7 +126,7 @@
   ppc_wrappers/mmintrin.h
 )
 
-set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
+set(output_dir ${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 set(out_files)
 
 function(copy_header_to_output_dir src_dir file)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D58537: lib/Header: Simplify CMakeLists.txt

2019-04-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar marked an inline comment as done.
tstellar added a comment.

Can you test D61054 ?




Comment at: cfe/trunk/lib/Headers/CMakeLists.txt:168
 install(
-  FILES ${cuda_wrapper_files}
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION 
lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
+  DIRECTORY ${output_dir}
+  DESTINATION ${header_install_dir}

vzakhari wrote:
> tstellar wrote:
> > vzakhari wrote:
> > > This change results in a use of CMAKE_CFG_INTDIR, which expands to 
> > > $(Configuration) inside cmake_install.cmake, when using Visual Studio 
> > > generator. CMake cannot reasonably expand $(Configuration), so Visual 
> > > Studio builds are broken for me after this change-set.
> > > 
> > > Can we revert to installation from FILES relative to the current source 
> > > dir?  This will require keeping a separate list of source files in 
> > > copy_header_to_output_dir(), and using this list in the install() command.
> > > 
> > > I do understand that the intention was, probably, to copy headers files 
> > > into output_dir along with creating some structure inside output_dir, and 
> > > then installing the whole output_dir verbatim to the install dir.  It 
> > > will be hard to achieve this with the change I suggest, but can we fix 
> > > Visual Studio builds in any other way?
> > > 
> > > FWIW, vcproj invokes the installation with the following command: cmake 
> > > -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake
> > > CMake could have expanded CMAKE_CFG_INTDIR as ${BUILD_TYPE} instead of 
> > > $(Configuration) inside cmake_install.cmake.
> > > This change results in a use of CMAKE_CFG_INTDIR, which expands to 
> > > $(Configuration) inside cmake_install.cmake, when using Visual Studio 
> > > generator. CMake cannot reasonably expand $(Configuration), so Visual 
> > > Studio builds are broken for me after this change-set.
> > 
> > Prior to this change we were installing the arm generated files from 
> > ${CMAKE_CURRENT_BINARY_DIR}.  Do we really need to use 
> > ${LLVM_LIBRARY_OUTPUT_INTDIR} as the base for output_dir?  Could we use 
> > ${CMAKE_CURRENT_BINARY_DIR} instead?  That seems like it would fix this 
> > issue.
> > 
> > > FWIW, vcproj invokes the installation with the following command: cmake 
> > > -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake
> > CMake could have expanded CMAKE_CFG_INTDIR as ${BUILD_TYPE} instead of 
> > $(Configuration) inside cmake_install.cmake.
> > 
> > Are the vc project files part of the LLVM source tree?
> > 
> > 
> > 
> > 
> > 
> As I understand, ${CMAKE_CURRENT_BINARY_DIR} is the same directory for all 
> (Debug, Release) builds for the multiconfiguration builders.  I am not sure 
> if it is possible to run Debug and Release builds in parallel, which would 
> imply parallel access to the generated files.  Maybe it is a potential 
> problem, but we have it even now inside clang_generate_header() function.
> 
> VC project files are generated by CMake, that is why I said CMake could have 
> used ${BUILD_TYPE} in the cmake_install.cmake files instead of 
> $(Configuration).
> 
> I guess just using ${CMAKE_CURRENT_BINARY_DIR} as the output_dir will solve 
> the current problem.  It should work as long as Debug and Release versions of 
> the header files are functionally equivalent, and noone runs Debug and 
> Release builds in parallel.
> I guess just using ${CMAKE_CURRENT_BINARY_DIR} as the output_dir will solve 
> the current problem. It should work as long as Debug and Release versions of 
> the header files are functionally equivalent, and noone runs Debug and 
> Release builds in parallel.

Ok, the generated files were already installing from 
${CMAKE_CURRENT_BINARY_DIR}, so if that is a problem than this was already 
broken before this patch.  The header files should be equivalent for all build 
types anyway.




Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58537/new/

https://reviews.llvm.org/D58537



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


[PATCH] D61046: Fix compilation warnings when compiling with GCC 7.3

2019-04-24 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: llvm/trunk/unittests/Transforms/Scalar/CMakeLists.txt:14-17
+# Workaround for the gcc 6.1 bug 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80916.
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 
6.0)
+  set_source_files_properties(LoopPassManagerTest.cpp PROPERTIES COMPILE_FLAGS 
-Wno-unused-function)
+endif()

aganea wrote:
> tstellar wrote:
> > Same thing here too.
> Not sure I understand, there're plenty of compiler-specific examples in the 
> .cmake files. Is there an alternate way to fix this?
I know there are some, but I don't think a warning like this is important 
enough to fix with a compiler specific work-around.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61046/new/

https://reviews.llvm.org/D61046



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


[PATCH] D61046: Fix compilation warnings when compiling with GCC 7.3

2019-04-24 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: llvm/trunk/unittests/Transforms/Scalar/CMakeLists.txt:14-17
+# Workaround for the gcc 6.1 bug 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80916.
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 
6.0)
+  set_source_files_properties(LoopPassManagerTest.cpp PROPERTIES COMPILE_FLAGS 
-Wno-unused-function)
+endif()

aganea wrote:
> tstellar wrote:
> > aganea wrote:
> > > tstellar wrote:
> > > > Same thing here too.
> > > Not sure I understand, there're plenty of compiler-specific examples in 
> > > the .cmake files. Is there an alternate way to fix this?
> > I know there are some, but I don't think a warning like this is important 
> > enough to fix with a compiler specific work-around.
> You mean more like
> ```
> # Workaround for the gcc 6.1 bug 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80916.
> if (NOT MSVC)
>   set_source_files_properties(LoopPassManagerTest.cpp PROPERTIES 
> COMPILE_FLAGS -Wno-unused-function)
> endif()
> ```
> Or leave the warning? There's already an #ifdef below in 
> LoopPassManagerTest.cpp but it's not at the right place, this simply corrects 
> it.
Ok, I see in this case you are just moving the ifdef out of the code and into 
CMake.  I really don't like either approach, but I guess this is fine.  I would 
limit the work-around to only known broken compilers though.  It looks like 
this might be fixed in gcc 9.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61046/new/

https://reviews.llvm.org/D61046



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


[PATCH] D61054: lib/Header: Fix Visual Studio builds

2019-04-25 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rC359257: lib/Header: Fix Visual Studio builds (authored by 
tstellar, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61054?vs=196373&id=196771#toc

Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61054/new/

https://reviews.llvm.org/D61054

Files:
  lib/Headers/CMakeLists.txt


Index: lib/Headers/CMakeLists.txt
===
--- lib/Headers/CMakeLists.txt
+++ lib/Headers/CMakeLists.txt
@@ -126,7 +126,7 @@
   ppc_wrappers/mmintrin.h
 )
 
-set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
+set(output_dir 
${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 set(out_files)
 
 function(copy_header_to_output_dir src_dir file)


Index: lib/Headers/CMakeLists.txt
===
--- lib/Headers/CMakeLists.txt
+++ lib/Headers/CMakeLists.txt
@@ -126,7 +126,7 @@
   ppc_wrappers/mmintrin.h
 )
 
-set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
+set(output_dir ${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 set(out_files)
 
 function(copy_header_to_output_dir src_dir file)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61220: lib/Header: Fix Visual Studio builds try #2

2019-04-26 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: smeenai, vzakhari, phosek.
Herald added a subscriber: mgorny.
Herald added a project: clang.

This is a follow up to r355253 and a better fix than the first attempt
which was r359257.

We can't install anything from ${CMAKE_CFG_INTDIR}, because this value
is only defined at build time, but we still must make sure to copy the
headers into ${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include, because the lit
tests look for headers there.  So for this fix we revert to the
old behavior of copying the headers to 
${CMAKE_CFG_INTDIR}/lib/clang/$VERSION/include
during the build and then installing them from the source tree.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61220

Files:
  clang/lib/Headers/CMakeLists.txt


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -128,6 +128,7 @@
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
 set(out_files)
+set(install_files)
 
 function(copy_header_to_output_dir src_dir file)
   set(src ${src_dir}/${file})
@@ -138,6 +139,8 @@
 COMMENT "Copying clang's ${file}...")
   list(APPEND out_files ${dst})
   set(out_files ${out_files} PARENT_SCOPE)
+  list(APPEND install_files ${src})
+  set(install_files ${install_files} PARENT_SCOPE)
 endfunction(copy_header_to_output_dir)
 
 function(clang_generate_header td_option td_file out_file)
@@ -147,6 +150,7 @@
 
   copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
   set(out_files ${out_files} PARENT_SCOPE)
+  set(install_files ${install_files} PARENT_SCOPE)
 endfunction(clang_generate_header)
 
 
@@ -169,7 +173,7 @@
 set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
 
 install(
-  DIRECTORY ${output_dir}
+  FILES ${install_files}
   DESTINATION ${header_install_dir}
   COMPONENT clang-resource-headers)
 


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -128,6 +128,7 @@
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
 set(out_files)
+set(install_files)
 
 function(copy_header_to_output_dir src_dir file)
   set(src ${src_dir}/${file})
@@ -138,6 +139,8 @@
 COMMENT "Copying clang's ${file}...")
   list(APPEND out_files ${dst})
   set(out_files ${out_files} PARENT_SCOPE)
+  list(APPEND install_files ${src})
+  set(install_files ${install_files} PARENT_SCOPE)
 endfunction(copy_header_to_output_dir)
 
 function(clang_generate_header td_option td_file out_file)
@@ -147,6 +150,7 @@
 
   copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
   set(out_files ${out_files} PARENT_SCOPE)
+  set(install_files ${install_files} PARENT_SCOPE)
 endfunction(clang_generate_header)
 
 
@@ -169,7 +173,7 @@
 set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
 
 install(
-  DIRECTORY ${output_dir}
+  FILES ${install_files}
   DESTINATION ${header_install_dir}
   COMPONENT clang-resource-headers)
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61220: lib/Header: Fix Visual Studio builds try #2

2019-04-29 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 197233.
tstellar added a comment.

- Fix install directory
- Use a separate install targets for each sub-directory like it was done before 
r355253.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61220/new/

https://reviews.llvm.org/D61220

Files:
  clang/lib/Headers/CMakeLists.txt


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -166,13 +166,23 @@
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 
 install(
-  DIRECTORY ${output_dir}
+  FILES ${files}
   DESTINATION ${header_install_dir}
   COMPONENT clang-resource-headers)
 
+install(
+  FILES ${cuda_wrapper_files}
+  DESTINATION ${header_install_dir}/cuda_wrappers
+  COMPONENT clang-resource-headers)
+
+install(
+  FILES ${ppc_wrapper_files}
+  DESTINATION ${header_install_dir}/ppc_wrappers
+  COMPONENT clang-resource-headers)
+
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-resource-headers
DEPENDS clang-resource-headers


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -166,13 +166,23 @@
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 
 install(
-  DIRECTORY ${output_dir}
+  FILES ${files}
   DESTINATION ${header_install_dir}
   COMPONENT clang-resource-headers)
 
+install(
+  FILES ${cuda_wrapper_files}
+  DESTINATION ${header_install_dir}/cuda_wrappers
+  COMPONENT clang-resource-headers)
+
+install(
+  FILES ${ppc_wrapper_files}
+  DESTINATION ${header_install_dir}/ppc_wrappers
+  COMPONENT clang-resource-headers)
+
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-resource-headers
DEPENDS clang-resource-headers
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61220: lib/Header: Fix Visual Studio builds try #2

2019-04-29 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 197244.
tstellar marked an inline comment as done.
tstellar added a comment.

Make sure to install the generated files.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61220/new/

https://reviews.llvm.org/D61220

Files:
  clang/lib/Headers/CMakeLists.txt


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -127,7 +127,11 @@
 )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
+
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+
 set(out_files)
+set(generated_files)
 
 function(copy_header_to_output_dir src_dir file)
   set(src ${src_dir}/${file})
@@ -147,6 +151,8 @@
 
   copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
   set(out_files ${out_files} PARENT_SCOPE)
+  list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
+  set(generated_files ${generated_files} PARENT_SCOPE)
 endfunction(clang_generate_header)
 
 
@@ -166,13 +172,21 @@
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
-
 install(
-  DIRECTORY ${output_dir}
+  FILES ${files} ${generated_files}
   DESTINATION ${header_install_dir}
   COMPONENT clang-resource-headers)
 
+install(
+  FILES ${cuda_wrapper_files}
+  DESTINATION ${header_install_dir}/cuda_wrappers
+  COMPONENT clang-resource-headers)
+
+install(
+  FILES ${ppc_wrapper_files}
+  DESTINATION ${header_install_dir}/ppc_wrappers
+  COMPONENT clang-resource-headers)
+
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-resource-headers
DEPENDS clang-resource-headers


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -127,7 +127,11 @@
 )
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
+
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+
 set(out_files)
+set(generated_files)
 
 function(copy_header_to_output_dir src_dir file)
   set(src ${src_dir}/${file})
@@ -147,6 +151,8 @@
 
   copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
   set(out_files ${out_files} PARENT_SCOPE)
+  list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
+  set(generated_files ${generated_files} PARENT_SCOPE)
 endfunction(clang_generate_header)
 
 
@@ -166,13 +172,21 @@
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
-
 install(
-  DIRECTORY ${output_dir}
+  FILES ${files} ${generated_files}
   DESTINATION ${header_install_dir}
   COMPONENT clang-resource-headers)
 
+install(
+  FILES ${cuda_wrapper_files}
+  DESTINATION ${header_install_dir}/cuda_wrappers
+  COMPONENT clang-resource-headers)
+
+install(
+  FILES ${ppc_wrapper_files}
+  DESTINATION ${header_install_dir}/ppc_wrappers
+  COMPONENT clang-resource-headers)
+
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-resource-headers
DEPENDS clang-resource-headers
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61220: lib/Header: Fix Visual Studio builds try #2

2019-04-30 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359654: lib/Header: Fix Visual Studio builds try #2 
(authored by tstellar, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61220?vs=197244&id=197506#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61220/new/

https://reviews.llvm.org/D61220

Files:
  cfe/trunk/lib/Headers/CMakeLists.txt


Index: cfe/trunk/lib/Headers/CMakeLists.txt
===
--- cfe/trunk/lib/Headers/CMakeLists.txt
+++ cfe/trunk/lib/Headers/CMakeLists.txt
@@ -128,6 +128,7 @@
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
 set(out_files)
+set(generated_files)
 
 function(copy_header_to_output_dir src_dir file)
   set(src ${src_dir}/${file})
@@ -147,6 +148,8 @@
 
   copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
   set(out_files ${out_files} PARENT_SCOPE)
+  list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
+  set(generated_files ${generated_files} PARENT_SCOPE)
 endfunction(clang_generate_header)
 
 
@@ -166,13 +169,23 @@
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 
 install(
-  DIRECTORY ${output_dir}
+  FILES ${files} ${generated_files}
   DESTINATION ${header_install_dir}
   COMPONENT clang-resource-headers)
 
+install(
+  FILES ${cuda_wrapper_files}
+  DESTINATION ${header_install_dir}/cuda_wrappers
+  COMPONENT clang-resource-headers)
+
+install(
+  FILES ${ppc_wrapper_files}
+  DESTINATION ${header_install_dir}/ppc_wrappers
+  COMPONENT clang-resource-headers)
+
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-resource-headers
DEPENDS clang-resource-headers


Index: cfe/trunk/lib/Headers/CMakeLists.txt
===
--- cfe/trunk/lib/Headers/CMakeLists.txt
+++ cfe/trunk/lib/Headers/CMakeLists.txt
@@ -128,6 +128,7 @@
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
 set(out_files)
+set(generated_files)
 
 function(copy_header_to_output_dir src_dir file)
   set(src ${src_dir}/${file})
@@ -147,6 +148,8 @@
 
   copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
   set(out_files ${out_files} PARENT_SCOPE)
+  list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
+  set(generated_files ${generated_files} PARENT_SCOPE)
 endfunction(clang_generate_header)
 
 
@@ -166,13 +169,23 @@
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
 
 install(
-  DIRECTORY ${output_dir}
+  FILES ${files} ${generated_files}
   DESTINATION ${header_install_dir}
   COMPONENT clang-resource-headers)
 
+install(
+  FILES ${cuda_wrapper_files}
+  DESTINATION ${header_install_dir}/cuda_wrappers
+  COMPONENT clang-resource-headers)
+
+install(
+  FILES ${ppc_wrapper_files}
+  DESTINATION ${header_install_dir}/ppc_wrappers
+  COMPONENT clang-resource-headers)
+
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-resource-headers
DEPENDS clang-resource-headers
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D51714: CMake: Deprecate using llvm-config to detect llvm installation

2018-09-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 167413.
tstellar added a comment.

Use cmake's DEPRECATION message.


Repository:
  rC Clang

https://reviews.llvm.org/D51714

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -7,9 +7,14 @@
 
   # Rely on llvm-config.
   set(CONFIG_OUTPUT)
-  find_program(LLVM_CONFIG "llvm-config")
   if(LLVM_CONFIG)
+set (LLVM_CONFIG_FOUND 1)
 message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
+message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
+  deprecated.  The installed cmake files should be used \
+  instead.  CMake should be able to detect your LLVM install \
+  automatically, but you can also use LLVM_DIR to specify \
+  the path containing LLVMConfig.cmake.")
 set(CONFIG_COMMAND ${LLVM_CONFIG}
   "--assertion-mode"
   "--bindir"
@@ -32,41 +37,51 @@
   message(STATUS "${CONFIG_COMMAND_STR}")
   message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
 endif()
-  else()
-message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
+
+list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
+list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
+list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
+list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
+list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
+list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH)
+
+# Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes.
+# CMake assumes slashes as PATH.
+file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH)
   endif()
 
-  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
-  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
-  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
-  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
-  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
-  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
-  list(GET CONFIG_OUTPUT 6 LLVM_CONFIG_CMAKE_PATH)
 
   if(NOT MSVC_IDE)
 set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
   CACHE BOOL "Enable assertions")
 # Assertions should follow llvm-config's.
 mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
   endif()
 
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
+  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
+
+  # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
+  # LLVM_CONFIG.
+  if (NOT LLVM_CONFIG_FOUND)
+# Pull values from LLVMConfig.cmake.  We can drop this once the llvm-config
+# path is removed.
+set(TOOLS_BINARY_DIR ${LLVM_TOOLS_BINARY_DIR})
+set(LIBRARY_DIR ${LLVM_LIBRARY_DIR})
+set(INCLUDE_DIR ${LLVM_INCLUDE_DIR})
+set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR})
+  endif()
+
   set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
   set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
   set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
   set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
   set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
 
-  # Normalize LLVM_CMAKE_PATH. --cmakedir might contain backslashes.
-  # CMake assumes slashes as PATH.
-  file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_PATH} LLVM_CMAKE_PATH)
-
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)
 
-  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_PATH}")
-  list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
-
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
   set(LLVM_LIBRARY_OUTPUT_INTDIR 
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})


Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -7,9 +7,14 @@
 
   # Rely on llvm-config.
   set(CONFIG_OUTPUT)
-  find_program(LLVM_CONFIG "llvm-config")
   if(LLVM_CONFIG)
+set (LLVM_CONFIG_FOUND 1)
 message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
+message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
+  deprecated.  The installed cmake files should be used \
+  instead.  CMake should be able to detect your LLVM install \
+  automatically, but you can also use LLVM_DIR to specify \
+  the path containing LLVMConfig.cmake.")
 set(CONFIG_COMMAND ${LLVM_CONFIG}
   "--assertion-mode"
   "--bindir"
@@ -32,41 +37,51 @@
   message(STATUS "${CONFIG_COMMAND_STR}")
   message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
 endif()
-  else()
-message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
+
+list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
+list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
+list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
+list(GET CONFIG_OUTPUT 4 LLVM

[PATCH] D51714: CMake: Deprecate using llvm-config to detect llvm installation

2018-09-28 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In https://reviews.llvm.org/D51714#1248643, @smeenai wrote:

> Is there anything holding this up?


No hold up, I just wanted to address the review comment.  I'll commit on Monday 
if there are no other comments.


Repository:
  rC Clang

https://reviews.llvm.org/D51714



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


[PATCH] D42608: Driver: Prefer vendor supplied gcc toolchain

2018-10-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

I've implemented an alternative solution here that I think is a little more 
robust: https://reviews.llvm.org/D52861


Repository:
  rC Clang

https://reviews.llvm.org/D42608



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


[PATCH] D52861: Driver: Prefer gcc toolchains with libgcc_s.so when not static linking libgcc

2018-10-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.

Fedora ships cross-compilers on all platforms, so a user could end up
with a gcc x86_64 cross-compiler installed on an x86_64 system.  clang
maintains a list of supported triples for each target and when all
else is equal will prefer toolchains with triples that appear earlier
in the list.

The cross-compiler triple on Fedora is x86_64-linux-gnu and this comes
before the Fedora system compiler's triple: x86_64-redhat-linux in
the triples list, so the cross compiler is always preferred.  This
is a problem, because the cross compiler is missing libraries, like
libgcc_s.so, that clang expects to be there so linker invocations
will fail.

This patch fixes this by checking for the existence of libgcc_s.so
when it is required and taking that into account when selecting a
toolchain.


Repository:
  rC Clang

https://reviews.llvm.org/D52861

Files:
  lib/Driver/ToolChains/Gnu.cpp
  lib/Driver/ToolChains/Gnu.h
  test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o
  test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o
  
test/Driver/Inputs/fedora_28_tree/usr/lib/gcc/x86_64-redhat-linux/7/libgcc_s.so
  test/Driver/linux-ld.c


Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -717,6 +717,18 @@
 // CHECK-FEDORA-21-AARCH64: 
"{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|}}crtend.o"
 // CHECK-FEDORA-21-AARCH64: 
"{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|}}crtn.o"
 //
+// Check that clang does not select the cross compiler by default on Fedora 28.
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --target=x86_64-unknown-linux-gnu \
+// RUN: --gcc-toolchain="" \
+// RUN: --sysroot=%S/Inputs/fedora_28_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-FEDORA-28-X86_64 %s
+//
+// CHECK-FEDORA-28-X86_64: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-FEDORA-28-X86_64: 
"[[SYSROOT]]/usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o"
+// CHECK-FEDORA-28-X86_64: "-L[[SYSROOT]]/usr/lib/gcc/x86_64-redhat-linux/7"
+//
 // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN: --target=arm-unknown-linux-gnueabi \
 // RUN: --gcc-toolchain="" \
Index: lib/Driver/ToolChains/Gnu.h
===
--- lib/Driver/ToolChains/Gnu.h
+++ lib/Driver/ToolChains/Gnu.h
@@ -186,6 +186,7 @@
   /// Driver, and has logic for fuzzing that where appropriate.
   class GCCInstallationDetector {
 bool IsValid;
+bool HasLibGccShared;
 llvm::Triple GCCTriple;
 const Driver &D;
 
@@ -209,7 +210,8 @@
 MultilibSet Multilibs;
 
   public:
-explicit GCCInstallationDetector(const Driver &D) : IsValid(false), D(D) {}
+explicit GCCInstallationDetector(const Driver &D)
+: IsValid(false), HasLibGccShared(false), D(D) {}
 void init(const llvm::Triple &TargetTriple, const llvm::opt::ArgList &Args,
   ArrayRef ExtraTripleAliases = None);
 
Index: lib/Driver/ToolChains/Gnu.cpp
===
--- lib/Driver/ToolChains/Gnu.cpp
+++ lib/Driver/ToolChains/Gnu.cpp
@@ -2199,6 +2199,8 @@
(TargetArch == llvm::Triple::x86 &&
 TargetTriple.getOS() != llvm::Triple::Solaris)}};
 
+  bool NeedLibgccShared = !Args.hasArg(options::OPT_static_libgcc) &&
+  !Args.hasArg(options::OPT_static);
   for (auto &Suffix : Suffixes) {
 if (!Suffix.Active)
   continue;
@@ -2216,8 +2218,17 @@
   continue; // Saw this path before; no need to look at it again.
   if (CandidateVersion.isOlderThan(4, 1, 1))
 continue;
-  if (CandidateVersion <= Version)
-continue;
+
+  bool CandidateHasLibGccShared = false;
+  if (CandidateVersion <= Version) {
+if (NeedLibgccShared && !HasLibGccShared) {
+  CandidateHasLibGccShared =
+D.getVFS().exists(LI->path() + "/libgcc_s.so");
+
+}
+if (HasLibGccShared || !CandidateHasLibGccShared)
+  continue;
+  }
 
   if (!ScanGCCForMultilibs(TargetTriple, Args, LI->path(),
NeedsBiarchSuffix))
@@ -2231,6 +2242,7 @@
   GCCInstallPath = (LibDir + "/" + LibSuffix + "/" + VersionText).str();
   GCCParentLibPath = (GCCInstallPath + "/../" + Suffix.ReversePath).str();
   IsValid = true;
+  HasLibGccShared = CandidateHasLibGccShared;
 }
   }
 }


Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -717,6 +717,18 @@
 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0{{/|}}crtend.o"
 // CHECK-FEDORA-21-AARCH64: "{{.*}}/usr/lib/gcc/aarch64-redhat-linux/4.9.0/../../../../lib64{{/|}}crtn.o"
 //
+// Check that clang

[PATCH] D57930: [Driver] Verify GCCInstallation is valid

2019-02-08 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/lib/Driver/ToolChains/Linux.cpp:259-260
 
   if (GCCInstallation.getParentLibPath().find("opt/rh/devtoolset") !=
   StringRef::npos)
 // With devtoolset on RHEL, we want to add a bin directory that is relative

Do we need to add the same check here too?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57930/new/

https://reviews.llvm.org/D57930



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


[PATCH] D58204: CMake: Fix stand-alone clang builds since r353268

2019-02-13 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: phosek, andrewrk, smeenai.
Herald added subscribers: cfe-commits, mgorny.
Herald added projects: clang, LLVM.

Handle the case where LLVM_MAIN_SRC_DIR is not set and also use
LLVM_CMAKE_DIR for locating installed cmake files rather than
LLVM_CMAKE_PATH.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D58204

Files:
  clang/lib/Basic/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake


Index: llvm/cmake/modules/AddLLVM.cmake
===
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1718,6 +1718,9 @@
 endfunction()
 
 function(find_first_existing_vc_file path out_var)
+  if(NOT EXISTS "${path}")
+return()
+  endif()
   if(EXISTS "${path}/.svn")
 set(svn_files
   "${path}/.svn/wc.db"   # SVN 1.7
Index: clang/lib/Basic/CMakeLists.txt
===
--- clang/lib/Basic/CMakeLists.txt
+++ clang/lib/Basic/CMakeLists.txt
@@ -10,7 +10,7 @@
 # The VC revision include that we want to generate.
 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
 
-set(generate_vcs_version_script 
"${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake")
+set(generate_vcs_version_script 
"${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
 
 if(llvm_vc)
   set(llvm_source_dir ${LLVM_MAIN_SRC_DIR})


Index: llvm/cmake/modules/AddLLVM.cmake
===
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1718,6 +1718,9 @@
 endfunction()
 
 function(find_first_existing_vc_file path out_var)
+  if(NOT EXISTS "${path}")
+return()
+  endif()
   if(EXISTS "${path}/.svn")
 set(svn_files
   "${path}/.svn/wc.db"   # SVN 1.7
Index: clang/lib/Basic/CMakeLists.txt
===
--- clang/lib/Basic/CMakeLists.txt
+++ clang/lib/Basic/CMakeLists.txt
@@ -10,7 +10,7 @@
 # The VC revision include that we want to generate.
 set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
 
-set(generate_vcs_version_script "${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake")
+set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
 
 if(llvm_vc)
   set(llvm_source_dir ${LLVM_MAIN_SRC_DIR})
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D58204: CMake: Fix stand-alone clang builds since r353268

2019-02-13 Thread Tom Stellard via Phabricator via cfe-commits
tstellar marked an inline comment as done.
tstellar added inline comments.



Comment at: clang/lib/Basic/CMakeLists.txt:13
 
-set(generate_vcs_version_script 
"${LLVM_CMAKE_PATH}/GenerateVersionFromVCS.cmake")
+set(generate_vcs_version_script 
"${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
 

smeenai wrote:
> Will this work when using llvm-config instead of LLVM's CMake package?
I will test this and  a few other configurations to make sure.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58204/new/

https://reviews.llvm.org/D58204



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


[PATCH] D58204: CMake: Fix stand-alone clang builds since r353268

2019-02-13 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 186769.
tstellar added a comment.

Updated patch to fix non-standalone builds.  There is more refactoring
that could be done, but this at least restores functionality to before
r353268.

I have tested non-standalone builds and standalone builds with and
without llvm-config.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58204/new/

https://reviews.llvm.org/D58204

Files:
  clang/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake


Index: llvm/cmake/modules/AddLLVM.cmake
===
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1718,6 +1718,9 @@
 endfunction()
 
 function(find_first_existing_vc_file path out_var)
+  if(NOT EXISTS "${path}")
+return()
+  endif()
   if(EXISTS "${path}/.svn")
 set(svn_files
   "${path}/.svn/wc.db"   # SVN 1.7
Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -75,6 +75,11 @@
 set(LIBRARY_DIR ${LLVM_LIBRARY_DIR})
 set(INCLUDE_DIR ${LLVM_INCLUDE_DIR})
 set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR})
+# The LLVM_CMAKE_PATH variable is set when doing non-standalone builds and
+# used in this project, so we need to make sure we set this value.
+# FIXME: LLVM_CMAKE_DIR comes from LLVMConfig.cmake.  We should rename
+# LLVM_CMAKE_PATH to LLVM_CMAKE_DIR throughout the project.
+set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR})
   endif()
 
   set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")


Index: llvm/cmake/modules/AddLLVM.cmake
===
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1718,6 +1718,9 @@
 endfunction()
 
 function(find_first_existing_vc_file path out_var)
+  if(NOT EXISTS "${path}")
+return()
+  endif()
   if(EXISTS "${path}/.svn")
 set(svn_files
   "${path}/.svn/wc.db"   # SVN 1.7
Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -75,6 +75,11 @@
 set(LIBRARY_DIR ${LLVM_LIBRARY_DIR})
 set(INCLUDE_DIR ${LLVM_INCLUDE_DIR})
 set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR})
+# The LLVM_CMAKE_PATH variable is set when doing non-standalone builds and
+# used in this project, so we need to make sure we set this value.
+# FIXME: LLVM_CMAKE_DIR comes from LLVMConfig.cmake.  We should rename
+# LLVM_CMAKE_PATH to LLVM_CMAKE_DIR throughout the project.
+set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR})
   endif()
 
   set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D54880: Ignore gcc's stack-clash-protection flag

2019-02-19 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.
Herald added a project: clang.

See D42593 , I don't think it's good to ignore 
security flags like this.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54880/new/

https://reviews.llvm.org/D54880



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


[PATCH] D42593: GCC compatibility: Ignore -fstack-clash-protection

2019-02-19 Thread Tom Stellard via Phabricator via cfe-commits
tstellar abandoned this revision.
tstellar added a comment.
Herald added a subscriber: jdoerfert.
Herald added a project: clang.

I agree with Joerg, I don't think we should be ignoring these kinds of security 
flags (even though we already ignore -fstack-check).


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D42593/new/

https://reviews.llvm.org/D42593



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


[PATCH] D58204: CMake: Fix stand-alone clang builds since r353268

2019-02-19 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL354417: CMake: Fix stand-alone clang builds since r353268 
(authored by tstellar, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D58204?vs=186769&id=187473#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58204/new/

https://reviews.llvm.org/D58204

Files:
  cfe/trunk/CMakeLists.txt
  llvm/trunk/cmake/modules/AddLLVM.cmake


Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -1718,6 +1718,9 @@
 endfunction()
 
 function(find_first_existing_vc_file path out_var)
+  if(NOT EXISTS "${path}")
+return()
+  endif()
   if(EXISTS "${path}/.svn")
 set(svn_files
   "${path}/.svn/wc.db"   # SVN 1.7
Index: cfe/trunk/CMakeLists.txt
===
--- cfe/trunk/CMakeLists.txt
+++ cfe/trunk/CMakeLists.txt
@@ -75,6 +75,11 @@
 set(LIBRARY_DIR ${LLVM_LIBRARY_DIR})
 set(INCLUDE_DIR ${LLVM_INCLUDE_DIR})
 set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR})
+# The LLVM_CMAKE_PATH variable is set when doing non-standalone builds and
+# used in this project, so we need to make sure we set this value.
+# FIXME: LLVM_CMAKE_DIR comes from LLVMConfig.cmake.  We should rename
+# LLVM_CMAKE_PATH to LLVM_CMAKE_DIR throughout the project.
+set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR})
   endif()
 
   set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")


Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -1718,6 +1718,9 @@
 endfunction()
 
 function(find_first_existing_vc_file path out_var)
+  if(NOT EXISTS "${path}")
+return()
+  endif()
   if(EXISTS "${path}/.svn")
 set(svn_files
   "${path}/.svn/wc.db"   # SVN 1.7
Index: cfe/trunk/CMakeLists.txt
===
--- cfe/trunk/CMakeLists.txt
+++ cfe/trunk/CMakeLists.txt
@@ -75,6 +75,11 @@
 set(LIBRARY_DIR ${LLVM_LIBRARY_DIR})
 set(INCLUDE_DIR ${LLVM_INCLUDE_DIR})
 set(LLVM_OBJ_DIR ${LLVM_BINARY_DIR})
+# The LLVM_CMAKE_PATH variable is set when doing non-standalone builds and
+# used in this project, so we need to make sure we set this value.
+# FIXME: LLVM_CMAKE_DIR comes from LLVMConfig.cmake.  We should rename
+# LLVM_CMAKE_PATH to LLVM_CMAKE_DIR throughout the project.
+set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR})
   endif()
 
   set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D58537: lib/Header: Simplify CMakeLists.txt

2019-02-21 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: chandlerc, smeenai, mgorny.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Replace cut and pasted code with cmake macros and reduce the number of
install commands.  This fixes an issue where the headers were being
installed twice.

This clean up should also make future modifications easier, like
adding a cmake option to install header files into a custom resource
directory.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D58537

Files:
  clang/lib/Headers/CMakeLists.txt


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -124,59 +124,48 @@
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
 
-# Generate arm_neon.h
-clang_tablegen(arm_neon.h -gen-arm-neon
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
-# Generate arm_fp16.h
-clang_tablegen(arm_fp16.h -gen-arm-fp16
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_fp16.td)
-
-set(out_files)
-foreach( f ${files} ${cuda_wrapper_files} )
-  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
-  set( dst ${output_dir}/${f} )
+macro(copy_header_to_output_dir src_dir file)
+  set(src ${src_dir}/${file})
+  set(dst ${output_dir}/${file})
   add_custom_command(OUTPUT ${dst}
 DEPENDS ${src}
 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
-COMMENT "Copying clang's ${f}...")
+COMMENT "Copying clang's ${file}...")
   list(APPEND out_files ${dst})
+endmacro(copy_header_to_output_dir)
+
+macro(clang_generate_header td_option td_file out_file)
+  clang_tablegen(${out_file} ${td_option}
+  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
+  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/${td_file})
+
+  copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
+endmacro(clang_generate_header)
+
+
+# Copy header files from the source directory to the build directory
+set(out_files)
+foreach( f ${files} ${cuda_wrapper_files} )
+  copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f})
 endforeach( f )
 
-add_custom_command(OUTPUT ${output_dir}/arm_neon.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h ${output_dir}/arm_neon.h
-  COMMENT "Copying clang's arm_neon.h...")
-list(APPEND out_files ${output_dir}/arm_neon.h)
-add_custom_command(OUTPUT ${output_dir}/arm_fp16.h
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMMAND ${CMAKE_COMMAND} -E copy_if_different 
${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h ${output_dir}/arm_fp16.h
-  COMMENT "Copying clang's arm_fp16.h...")
-list(APPEND out_files ${output_dir}/arm_fp16.h)
+# Generate header files and copy them to the build directory
+# Generate arm_neon.h
+clang_generate_header(-gen-arm-neon arm_neon.td arm_neon.h)
+# Generate arm_fp16.h
+clang_generate_header(-gen-arm-fp16 arm_fp16.td arm_fp16.h)
 
 add_custom_target(clang-headers ALL DEPENDS ${out_files})
 set_target_properties(clang-headers PROPERTIES
   FOLDER "Misc"
   RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
 
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
-
-install(
-  FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_fp16.h
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
+set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
 
 install(
-  FILES ${cuda_wrapper_files}
-  COMPONENT clang-headers
-  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
-  DESTINATION 
lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include/cuda_wrappers)
+  DIRECTORY ${output_dir}
+  DESTINATION ${header_install_dir}
+  COMPONENT clang-headers)
 
 if (NOT LLVM_ENABLE_IDE)
   add_llvm_install_targets(install-clang-headers


Index: clang/lib/Headers/CMakeLists.txt
===
--- clang/lib/Headers/CMakeLists.txt
+++ clang/lib/Headers/CMakeLists.txt
@@ -124,59 +124,48 @@
 
 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
 
-# Generate arm_neon.h
-clang_tablegen(arm_neon.h -gen-arm-neon
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
-# Generate arm_fp16.h
-clang_tablegen(arm_fp16.h -gen-arm-fp16
-  -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
-  SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_fp16.td)
-
-set(out_files)
-foreach( f ${files} ${cuda_wrapper_files} )
-  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
-  set( dst ${output_dir}/${f} )
+macro(copy

[PATCH] D63503: cmake: Add CLANG_LINK_CLANG_DYLIB option

2019-06-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: mgorny, beanz, smeenai, phosek, sylvestre.ledru.
Herald added subscribers: cfe-commits, arphaman.
Herald added a project: clang.

Setting CLANG_LINK_CLANG_DYLIB=ON causes clang tools to link against
libclang_shared.so instead of the individual component libraries.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63503

Files:
  clang/CMakeLists.txt
  clang/cmake/modules/AddClang.cmake
  clang/examples/AnnotateFunctions/CMakeLists.txt
  clang/examples/PrintFunctionNames/CMakeLists.txt
  clang/examples/clang-interpreter/CMakeLists.txt
  clang/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
  clang/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
  clang/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
  clang/tools/arcmt-test/CMakeLists.txt
  clang/tools/clang-check/CMakeLists.txt
  clang/tools/clang-diff/CMakeLists.txt
  clang/tools/clang-extdef-mapping/CMakeLists.txt
  clang/tools/clang-format/CMakeLists.txt
  clang/tools/clang-import-test/CMakeLists.txt
  clang/tools/clang-offload-bundler/CMakeLists.txt
  clang/tools/clang-refactor/CMakeLists.txt
  clang/tools/clang-rename/CMakeLists.txt
  clang/tools/clang-scan-deps/CMakeLists.txt
  clang/tools/diagtool/CMakeLists.txt
  clang/tools/driver/CMakeLists.txt
  clang/unittests/AST/CMakeLists.txt
  clang/unittests/ASTMatchers/CMakeLists.txt
  clang/unittests/ASTMatchers/Dynamic/CMakeLists.txt
  clang/unittests/Analysis/CMakeLists.txt
  clang/unittests/Basic/CMakeLists.txt
  clang/unittests/CodeGen/CMakeLists.txt
  clang/unittests/CrossTU/CMakeLists.txt
  clang/unittests/Driver/CMakeLists.txt
  clang/unittests/Format/CMakeLists.txt
  clang/unittests/Frontend/CMakeLists.txt
  clang/unittests/Index/CMakeLists.txt
  clang/unittests/Lex/CMakeLists.txt
  clang/unittests/Rename/CMakeLists.txt
  clang/unittests/Rewrite/CMakeLists.txt
  clang/unittests/Sema/CMakeLists.txt
  clang/unittests/Serialization/CMakeLists.txt
  clang/unittests/StaticAnalyzer/CMakeLists.txt
  clang/unittests/Tooling/CMakeLists.txt
  clang/unittests/Tooling/Syntax/CMakeLists.txt

Index: clang/unittests/Tooling/Syntax/CMakeLists.txt
===
--- clang/unittests/Tooling/Syntax/CMakeLists.txt
+++ clang/unittests/Tooling/Syntax/CMakeLists.txt
@@ -6,7 +6,7 @@
   TokensTest.cpp
 )
 
-target_link_libraries(SyntaxTests
+clang_target_link_libraries(SyntaxTests
   PRIVATE
   clangAST
   clangBasic
@@ -15,5 +15,9 @@
   clangSerialization
   clangTooling
   clangToolingSyntax
-  LLVMTestingSupport
   )
+
+target_link_libraries(SyntaxTests
+  PRIVATE
+  LLVMTestingSupport
+)
Index: clang/unittests/Tooling/CMakeLists.txt
===
--- clang/unittests/Tooling/CMakeLists.txt
+++ clang/unittests/Tooling/CMakeLists.txt
@@ -56,7 +56,7 @@
   TransformerTest.cpp
   )
 
-target_link_libraries(ToolingTests
+clang_target_link_libraries(ToolingTests
   PRIVATE
   clangAST
   clangASTMatchers
@@ -70,8 +70,11 @@
   clangToolingCore
   clangToolingInclusions
   clangToolingRefactoring
-  LLVMTestingSupport
   )
 
+target_link_libraries(ToolingTests
+  PRIVATE
+  LLVMTestingSupport
+)
 
 add_subdirectory(Syntax)
Index: clang/unittests/StaticAnalyzer/CMakeLists.txt
===
--- clang/unittests/StaticAnalyzer/CMakeLists.txt
+++ clang/unittests/StaticAnalyzer/CMakeLists.txt
@@ -9,7 +9,7 @@
   SymbolReaperTest.cpp
   )
 
-target_link_libraries(StaticAnalysisTests
+clang_target_link_libraries(StaticAnalysisTests
   PRIVATE
   clangBasic
   clangAnalysis
Index: clang/unittests/Serialization/CMakeLists.txt
===
--- clang/unittests/Serialization/CMakeLists.txt
+++ clang/unittests/Serialization/CMakeLists.txt
@@ -7,7 +7,7 @@
   InMemoryModuleCacheTest.cpp
   )
 
-target_link_libraries(SerializationTests
+clang_target_link_libraries(SerializationTests
   PRIVATE
   clangAST
   clangBasic
Index: clang/unittests/Sema/CMakeLists.txt
===
--- clang/unittests/Sema/CMakeLists.txt
+++ clang/unittests/Sema/CMakeLists.txt
@@ -7,7 +7,7 @@
   CodeCompleteTest.cpp
   )
 
-target_link_libraries(SemaTests
+clang_target_link_libraries(SemaTests
   PRIVATE
   clangAST
   clangBasic
@@ -16,5 +16,9 @@
   clangSema
   clangSerialization
   clangTooling
-  LLVMTestingSupport
   )
+
+target_link_libraries(SemaTests
+  PRIVATE
+  LLVMTestingSupport
+)
Index: clang/unittests/Rewrite/CMakeLists.txt
===
--- clang/unittests/Rewrite/CMakeLists.txt
+++ clang/unittests/Rewrite/CMakeLists.txt
@@ -5,7 +5,7 @@
 add_clang_unittest(RewriteTests
   RewriteBufferTest.cpp
   )
-target_link_libraries(RewriteTests
+clang_target_link_libraries(RewriteTests
   PRIVATE
   clangRewrite
   )
Index: clang/unittests/Renam

[PATCH] D64580: cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros

2019-07-11 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: beanz, smeenai.
Herald added subscribers: dexonsmith, steven_wu, mgorny, mehdi_amini.
Herald added projects: clang, LLVM.

This will simplify the macros by allowing us to remove the hard-coded
list of libraries that should be installed when
LLVM_INSTALL_TOOLCHAIN_ONLY is enabled.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64580

Files:
  clang/cmake/modules/AddClang.cmake
  clang/tools/libclang/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/tools/llvm-shlib/CMakeLists.txt
  llvm/tools/lto/CMakeLists.txt
  llvm/tools/remarks-shlib/CMakeLists.txt

Index: llvm/tools/remarks-shlib/CMakeLists.txt
===
--- llvm/tools/remarks-shlib/CMakeLists.txt
+++ llvm/tools/remarks-shlib/CMakeLists.txt
@@ -8,7 +8,7 @@
 
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
 
-add_llvm_library(Remarks SHARED ${SOURCES})
+add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES})
 
 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
   DESTINATION include/llvm-c
Index: llvm/tools/lto/CMakeLists.txt
===
--- llvm/tools/lto/CMakeLists.txt
+++ llvm/tools/lto/CMakeLists.txt
@@ -20,7 +20,7 @@
 
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
 
-add_llvm_library(LTO SHARED ${SOURCES} DEPENDS intrinsics_gen)
+add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS intrinsics_gen)
 
 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
   DESTINATION include/llvm-c
Index: llvm/tools/llvm-shlib/CMakeLists.txt
===
--- llvm/tools/llvm-shlib/CMakeLists.txt
+++ llvm/tools/llvm-shlib/CMakeLists.txt
@@ -39,7 +39,10 @@
 add_custom_target(libLLVMExports DEPENDS ${LLVM_EXPORTED_SYMBOL_FILE})
   endif()
 
-  add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
+  if (LLVM_LINK_LLVM_DYLIB)
+set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
+  endif()
+  add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
 
   list(REMOVE_DUPLICATES LIB_NAMES)
   if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
@@ -105,7 +108,7 @@
 
   add_custom_target(libLLVMCExports DEPENDS ${LLVM_EXPORTED_SYMBOL_FILE})
 
-  add_llvm_library(LLVM-C SHARED ${SOURCES})
+  add_llvm_library(LLVM-C SHARED ${SOURCES} INSTALL_WITH_TOOLCHAIN)
   
   target_link_libraries(LLVM-C PUBLIC LLVM)
   add_dependencies(LLVM-C libLLVMCExports)
Index: llvm/cmake/modules/AddLLVM.cmake
===
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -657,7 +657,7 @@
 
 macro(add_llvm_library name)
   cmake_parse_arguments(ARG
-"SHARED;BUILDTREE_ONLY;MODULE"
+"SHARED;BUILDTREE_ONLY;MODULE;INSTALL_WITH_TOOLCHAIN"
 ""
 ""
 ${ARGN})
@@ -685,11 +685,7 @@
   elseif(ARG_BUILDTREE_ONLY)
 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
   else()
-if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR
-${name} STREQUAL "LTO" OR
-${name} STREQUAL "LLVM-C" OR
-${name} STREQUAL "Remarks" OR
-(LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM"))
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
 
   set(export_to_llvmexports)
   if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
Index: clang/tools/libclang/CMakeLists.txt
===
--- clang/tools/libclang/CMakeLists.txt
+++ clang/tools/libclang/CMakeLists.txt
@@ -94,7 +94,7 @@
 remove_definitions("-D_XOPEN_SOURCE=700")
 endif()
 
-add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC}
+add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC} INSTALL_WITH_TOOLCHAIN
   OUTPUT_NAME ${output_name}
   ${SOURCES}
   DEPENDS clang-resource-headers
Index: clang/cmake/modules/AddClang.cmake
===
--- clang/cmake/modules/AddClang.cmake
+++ clang/cmake/modules/AddClang.cmake
@@ -44,7 +44,7 @@
 
 macro(add_clang_library name)
   cmake_parse_arguments(ARG
-"SHARED"
+"SHARED;INSTALL_WITH_TOOLCHAIN"
 ""
 "ADDITIONAL_HEADERS"
 ${ARGN})
@@ -97,7 +97,7 @@
   if(TARGET ${name})
 target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})
 
-if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
   set(export_to_clangtargets)
   if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
   "clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64582: cmake: Fix install of libclang_shared.so when LLVM_INSTALL_TOOLCHAIN_ONLY=ON

2019-07-11 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: beanz, smeenai.
Herald added a subscriber: mgorny.
Herald added a project: clang.
tstellar added a parent revision: D64580: cmake: Add INSTALL_WITH_TOOLCHAIN 
option to add_*_library macros.

If CLANG_LINK_CLANG_DYLIB is also enabled, then this library needs to be
installed.

Fixes PR42575.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64582

Files:
  clang/tools/clang-shlib/CMakeLists.txt


Index: clang/tools/clang-shlib/CMakeLists.txt
===
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -11,8 +11,13 @@
   list(APPEND _DEPS $)
 endforeach ()
 
+if (CLANG_LINK_CLANG_DYLIB)
+  set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
+endif()
+
 add_clang_library(clang_shared
   SHARED
+  ${INSTALL_WITH_TOOLCHAIN}
   clang-shlib.cpp
   ${_OBJECTS}
   LINK_LIBS


Index: clang/tools/clang-shlib/CMakeLists.txt
===
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -11,8 +11,13 @@
   list(APPEND _DEPS $)
 endforeach ()
 
+if (CLANG_LINK_CLANG_DYLIB)
+  set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
+endif()
+
 add_clang_library(clang_shared
   SHARED
+  ${INSTALL_WITH_TOOLCHAIN}
   clang-shlib.cpp
   ${_OBJECTS}
   LINK_LIBS
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64608: [OpenCL] Make TableGen'd builtin tables and helper functions static

2019-07-11 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: Pierre, Anastasia.
Herald added a subscriber: yaxunl.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64608

Files:
  clang/lib/Sema/SemaLookup.cpp
  clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp


Index: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
===
--- clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -207,7 +207,7 @@
 }
 
 void BuiltinNameEmitter::EmitSignatureTable() {
-  OS << "OpenCLType OpenCLSignature[] = {\n";
+  OS << "static const OpenCLType OpenCLSignature[] = {\n";
   for (auto &P : SignatureSet) {
 OS << "// " << P.second << "\n";
 for (Record *R : P.first) {
@@ -222,7 +222,7 @@
 }
 
 void BuiltinNameEmitter::EmitBuiltinTable() {
-  OS << "OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
+  OS << "static const OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
   for (auto &i : OverloadInfo) {
 StringRef Name = i.first;
 OS << "// " << Name << "\n";
@@ -255,7 +255,7 @@
   OS << R"(
 // Return 0 if name is not a recognized OpenCL builtin, or an index
 // into a table of declarations if it is an OpenCL builtin.
-std::pair isOpenCLBuiltin(llvm::StringRef name) {
+static std::pair isOpenCLBuiltin(llvm::StringRef name) {
 
 )";
 
Index: clang/lib/Sema/SemaLookup.cpp
===
--- clang/lib/Sema/SemaLookup.cpp
+++ clang/lib/Sema/SemaLookup.cpp
@@ -688,7 +688,7 @@
  unsigned Len) {
 
   for (unsigned i = 0; i < Len; ++i) {
-OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
+const OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
 ASTContext &Context = S.Context;
 
 // Ignore this BIF if the version is incorrect.


Index: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
===
--- clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -207,7 +207,7 @@
 }
 
 void BuiltinNameEmitter::EmitSignatureTable() {
-  OS << "OpenCLType OpenCLSignature[] = {\n";
+  OS << "static const OpenCLType OpenCLSignature[] = {\n";
   for (auto &P : SignatureSet) {
 OS << "// " << P.second << "\n";
 for (Record *R : P.first) {
@@ -222,7 +222,7 @@
 }
 
 void BuiltinNameEmitter::EmitBuiltinTable() {
-  OS << "OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
+  OS << "static const OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
   for (auto &i : OverloadInfo) {
 StringRef Name = i.first;
 OS << "// " << Name << "\n";
@@ -255,7 +255,7 @@
   OS << R"(
 // Return 0 if name is not a recognized OpenCL builtin, or an index
 // into a table of declarations if it is an OpenCL builtin.
-std::pair isOpenCLBuiltin(llvm::StringRef name) {
+static std::pair isOpenCLBuiltin(llvm::StringRef name) {
 
 )";
 
Index: clang/lib/Sema/SemaLookup.cpp
===
--- clang/lib/Sema/SemaLookup.cpp
+++ clang/lib/Sema/SemaLookup.cpp
@@ -688,7 +688,7 @@
  unsigned Len) {
 
   for (unsigned i = 0; i < Len; ++i) {
-OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
+const OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
 ASTContext &Context = S.Context;
 
 // Ignore this BIF if the version is incorrect.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64580: cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macros

2019-07-12 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL365902: cmake: Add INSTALL_WITH_TOOLCHAIN option to 
add_*_library macros (authored by tstellar, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D64580?vs=209285&id=209482#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64580/new/

https://reviews.llvm.org/D64580

Files:
  cfe/trunk/cmake/modules/AddClang.cmake
  cfe/trunk/tools/libclang/CMakeLists.txt
  llvm/trunk/cmake/modules/AddLLVM.cmake
  llvm/trunk/tools/llvm-shlib/CMakeLists.txt
  llvm/trunk/tools/lto/CMakeLists.txt
  llvm/trunk/tools/remarks-shlib/CMakeLists.txt

Index: llvm/trunk/tools/remarks-shlib/CMakeLists.txt
===
--- llvm/trunk/tools/remarks-shlib/CMakeLists.txt
+++ llvm/trunk/tools/remarks-shlib/CMakeLists.txt
@@ -8,7 +8,7 @@
 
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
 
-add_llvm_library(Remarks SHARED ${SOURCES})
+add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES})
 
 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
   DESTINATION include/llvm-c
Index: llvm/trunk/tools/lto/CMakeLists.txt
===
--- llvm/trunk/tools/lto/CMakeLists.txt
+++ llvm/trunk/tools/lto/CMakeLists.txt
@@ -20,7 +20,7 @@
 
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
 
-add_llvm_library(LTO SHARED ${SOURCES} DEPENDS intrinsics_gen)
+add_llvm_library(LTO SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES} DEPENDS intrinsics_gen)
 
 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
   DESTINATION include/llvm-c
Index: llvm/trunk/tools/llvm-shlib/CMakeLists.txt
===
--- llvm/trunk/tools/llvm-shlib/CMakeLists.txt
+++ llvm/trunk/tools/llvm-shlib/CMakeLists.txt
@@ -39,7 +39,10 @@
 add_custom_target(libLLVMExports DEPENDS ${LLVM_EXPORTED_SYMBOL_FILE})
   endif()
 
-  add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES})
+  if (LLVM_LINK_LLVM_DYLIB)
+set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
+  endif()
+  add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
 
   list(REMOVE_DUPLICATES LIB_NAMES)
   if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
@@ -105,7 +108,7 @@
 
   add_custom_target(libLLVMCExports DEPENDS ${LLVM_EXPORTED_SYMBOL_FILE})
 
-  add_llvm_library(LLVM-C SHARED ${SOURCES})
+  add_llvm_library(LLVM-C SHARED ${SOURCES} INSTALL_WITH_TOOLCHAIN)
   
   target_link_libraries(LLVM-C PUBLIC LLVM)
   add_dependencies(LLVM-C libLLVMCExports)
Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -657,7 +657,7 @@
 
 macro(add_llvm_library name)
   cmake_parse_arguments(ARG
-"SHARED;BUILDTREE_ONLY;MODULE"
+"SHARED;BUILDTREE_ONLY;MODULE;INSTALL_WITH_TOOLCHAIN"
 ""
 ""
 ${ARGN})
@@ -685,11 +685,7 @@
   elseif(ARG_BUILDTREE_ONLY)
 set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
   else()
-if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR
-${name} STREQUAL "LTO" OR
-${name} STREQUAL "LLVM-C" OR
-${name} STREQUAL "Remarks" OR
-(LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM"))
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
 
   set(export_to_llvmexports)
   if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
Index: cfe/trunk/tools/libclang/CMakeLists.txt
===
--- cfe/trunk/tools/libclang/CMakeLists.txt
+++ cfe/trunk/tools/libclang/CMakeLists.txt
@@ -94,7 +94,7 @@
 remove_definitions("-D_XOPEN_SOURCE=700")
 endif()
 
-add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC}
+add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC} INSTALL_WITH_TOOLCHAIN
   OUTPUT_NAME ${output_name}
   ${SOURCES}
   DEPENDS clang-resource-headers
Index: cfe/trunk/cmake/modules/AddClang.cmake
===
--- cfe/trunk/cmake/modules/AddClang.cmake
+++ cfe/trunk/cmake/modules/AddClang.cmake
@@ -44,7 +44,7 @@
 
 macro(add_clang_library name)
   cmake_parse_arguments(ARG
-"SHARED"
+"SHARED;INSTALL_WITH_TOOLCHAIN"
 ""
 "ADDITIONAL_HEADERS"
 ${ARGN})
@@ -97,7 +97,7 @@
   if(TARGET ${name})
 target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})
 
-if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
   set(export_to_clangtargets)
   if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
   "clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
___

[PATCH] D64582: cmake: Fix install of libclang_shared.so when LLVM_INSTALL_TOOLCHAIN_ONLY=ON

2019-07-12 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL365905: cmake: Fix install of libclang-cpp.so when 
LLVM_INSTALL_TOOLCHAIN_ONLY=ON (authored by tstellar, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64582?vs=209295&id=209490#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64582/new/

https://reviews.llvm.org/D64582

Files:
  cfe/trunk/tools/clang-shlib/CMakeLists.txt


Index: cfe/trunk/tools/clang-shlib/CMakeLists.txt
===
--- cfe/trunk/tools/clang-shlib/CMakeLists.txt
+++ cfe/trunk/tools/clang-shlib/CMakeLists.txt
@@ -38,8 +38,13 @@
   list(APPEND _DEPS ${lib})
 endforeach ()
 
+if (CLANG_LINK_CLANG_DYLIB)
+  set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
+endif()
+
 add_clang_library(clang-cpp
   SHARED
+  ${INSTALL_WITH_TOOLCHAIN}
   clang-shlib.cpp
   ${_OBJECTS}
   LINK_LIBS


Index: cfe/trunk/tools/clang-shlib/CMakeLists.txt
===
--- cfe/trunk/tools/clang-shlib/CMakeLists.txt
+++ cfe/trunk/tools/clang-shlib/CMakeLists.txt
@@ -38,8 +38,13 @@
   list(APPEND _DEPS ${lib})
 endforeach ()
 
+if (CLANG_LINK_CLANG_DYLIB)
+  set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
+endif()
+
 add_clang_library(clang-cpp
   SHARED
+  ${INSTALL_WITH_TOOLCHAIN}
   clang-shlib.cpp
   ${_OBJECTS}
   LINK_LIBS
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D64608: [OpenCL] Make TableGen'd builtin tables and helper functions static

2019-07-15 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366143: [OpenCL] Make TableGen'd builtin tables and 
helper functions static (authored by tstellar, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64608?vs=209383&id=209975#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64608/new/

https://reviews.llvm.org/D64608

Files:
  cfe/trunk/lib/Sema/SemaLookup.cpp
  cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp


Index: cfe/trunk/lib/Sema/SemaLookup.cpp
===
--- cfe/trunk/lib/Sema/SemaLookup.cpp
+++ cfe/trunk/lib/Sema/SemaLookup.cpp
@@ -688,7 +688,7 @@
  unsigned Len) {
 
   for (unsigned i = 0; i < Len; ++i) {
-OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
+const OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
 ASTContext &Context = S.Context;
 
 // Ignore this BIF if the version is incorrect.
Index: cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
===
--- cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -207,7 +207,7 @@
 }
 
 void BuiltinNameEmitter::EmitSignatureTable() {
-  OS << "OpenCLType OpenCLSignature[] = {\n";
+  OS << "static const OpenCLType OpenCLSignature[] = {\n";
   for (auto &P : SignatureSet) {
 OS << "// " << P.second << "\n";
 for (Record *R : P.first) {
@@ -222,7 +222,7 @@
 }
 
 void BuiltinNameEmitter::EmitBuiltinTable() {
-  OS << "OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
+  OS << "static const OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
   for (auto &i : OverloadInfo) {
 StringRef Name = i.first;
 OS << "// " << Name << "\n";
@@ -255,7 +255,7 @@
   OS << R"(
 // Return 0 if name is not a recognized OpenCL builtin, or an index
 // into a table of declarations if it is an OpenCL builtin.
-std::pair isOpenCLBuiltin(llvm::StringRef name) {
+static std::pair isOpenCLBuiltin(llvm::StringRef name) {
 
 )";
 


Index: cfe/trunk/lib/Sema/SemaLookup.cpp
===
--- cfe/trunk/lib/Sema/SemaLookup.cpp
+++ cfe/trunk/lib/Sema/SemaLookup.cpp
@@ -688,7 +688,7 @@
  unsigned Len) {
 
   for (unsigned i = 0; i < Len; ++i) {
-OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
+const OpenCLBuiltinDecl &Decl = OpenCLBuiltins[Index - 1 + i];
 ASTContext &Context = S.Context;
 
 // Ignore this BIF if the version is incorrect.
Index: cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
===
--- cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ cfe/trunk/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -207,7 +207,7 @@
 }
 
 void BuiltinNameEmitter::EmitSignatureTable() {
-  OS << "OpenCLType OpenCLSignature[] = {\n";
+  OS << "static const OpenCLType OpenCLSignature[] = {\n";
   for (auto &P : SignatureSet) {
 OS << "// " << P.second << "\n";
 for (Record *R : P.first) {
@@ -222,7 +222,7 @@
 }
 
 void BuiltinNameEmitter::EmitBuiltinTable() {
-  OS << "OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
+  OS << "static const OpenCLBuiltinDecl OpenCLBuiltins[] = {\n";
   for (auto &i : OverloadInfo) {
 StringRef Name = i.first;
 OS << "// " << Name << "\n";
@@ -255,7 +255,7 @@
   OS << R"(
 // Return 0 if name is not a recognized OpenCL builtin, or an index
 // into a table of declarations if it is an OpenCL builtin.
-std::pair isOpenCLBuiltin(llvm::StringRef name) {
+static std::pair isOpenCLBuiltin(llvm::StringRef name) {
 
 )";
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66176: Fix Driver/modules.cpp test to work when build directory name contains '.s'

2019-08-13 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: dyung, rsmith, hansw.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66176

Files:
  clang/test/Driver/modules.cpp


Index: clang/test/Driver/modules.cpp
===
--- clang/test/Driver/modules.cpp
+++ clang/test/Driver/modules.cpp
@@ -15,7 +15,8 @@
 // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | 
FileCheck %s --check-prefix=CHECK-COMPILE
 //
 // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}}
-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}
+// Check for extra space to avoid failures when the build directory contains 
'.s' in its path.
+// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}{{ }}
 // CHECK-COMPILE-SAME: -x pcm
 // CHECK-COMPILE-SAME: {{.*}}.pcm
 


Index: clang/test/Driver/modules.cpp
===
--- clang/test/Driver/modules.cpp
+++ clang/test/Driver/modules.cpp
@@ -15,7 +15,8 @@
 // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-COMPILE
 //
 // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}}
-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}
+// Check for extra space to avoid failures when the build directory contains '.s' in its path.
+// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}{{ }}
 // CHECK-COMPILE-SAME: -x pcm
 // CHECK-COMPILE-SAME: {{.*}}.pcm
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66176: Fix Driver/modules.cpp test to work when build directory name contains '.s'

2019-08-13 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 214960.
tstellar added a comment.

Another attempt to fix this that depends less on the build directory.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66176/new/

https://reviews.llvm.org/D66176

Files:
  clang/test/Driver/modules.cpp


Index: clang/test/Driver/modules.cpp
===
--- clang/test/Driver/modules.cpp
+++ clang/test/Driver/modules.cpp
@@ -15,7 +15,8 @@
 // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | 
FileCheck %s --check-prefix=CHECK-COMPILE
 //
 // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}}
-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}
+// CHECK-COMPILE-SAME: {{ -o }}
+// CHECK-COMPILE-SAME: module{{2*}}.{{pcm.o|s}}
 // CHECK-COMPILE-SAME: -x pcm
 // CHECK-COMPILE-SAME: {{.*}}.pcm
 


Index: clang/test/Driver/modules.cpp
===
--- clang/test/Driver/modules.cpp
+++ clang/test/Driver/modules.cpp
@@ -15,7 +15,8 @@
 // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-COMPILE
 //
 // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}}
-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}
+// CHECK-COMPILE-SAME: {{ -o }}
+// CHECK-COMPILE-SAME: module{{2*}}.{{pcm.o|s}}
 // CHECK-COMPILE-SAME: -x pcm
 // CHECK-COMPILE-SAME: {{.*}}.pcm
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D61909: Add Clang shared library with C++ exports

2019-07-01 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D61909#1563678 , @sylvestre.ledru 
wrote:

> For now, it isn't part of the debian packaging.
>  
> https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/blob/snapshot/debian/rules#L563
>  it is removed as packaging phase as I have been told it isn't ready.
>
> Anyway, the lib should not keep this name.
>  By definition, on linux, .so means shared. It should have a more explicit 
> name.
>
> @beanz Can you please rename it? thanks


I've filed a bug for this and marked it as a blocker for 9.0.0, because once we 
ship a release with this name, it will be harder to change: 
https://bugs.llvm.org/show_bug.cgi?id=42475


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61909/new/

https://reviews.llvm.org/D61909



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


[PATCH] D63503: cmake: Add CLANG_LINK_CLANG_DYLIB option

2019-07-01 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Ping.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63503/new/

https://reviews.llvm.org/D63503



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


[PATCH] D63503: cmake: Add CLANG_LINK_CLANG_DYLIB option

2019-07-03 Thread Tom Stellard via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL365092: cmake: Add CLANG_LINK_CLANG_DYLIB option (authored 
by tstellar, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D63503?vs=205394&id=207906#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63503/new/

https://reviews.llvm.org/D63503

Files:
  cfe/trunk/CMakeLists.txt
  cfe/trunk/cmake/modules/AddClang.cmake
  cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
  cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
  cfe/trunk/examples/clang-interpreter/CMakeLists.txt
  cfe/trunk/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
  cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
  cfe/trunk/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
  cfe/trunk/tools/arcmt-test/CMakeLists.txt
  cfe/trunk/tools/clang-check/CMakeLists.txt
  cfe/trunk/tools/clang-diff/CMakeLists.txt
  cfe/trunk/tools/clang-extdef-mapping/CMakeLists.txt
  cfe/trunk/tools/clang-format/CMakeLists.txt
  cfe/trunk/tools/clang-import-test/CMakeLists.txt
  cfe/trunk/tools/clang-offload-bundler/CMakeLists.txt
  cfe/trunk/tools/clang-refactor/CMakeLists.txt
  cfe/trunk/tools/clang-rename/CMakeLists.txt
  cfe/trunk/tools/clang-scan-deps/CMakeLists.txt
  cfe/trunk/tools/diagtool/CMakeLists.txt
  cfe/trunk/tools/driver/CMakeLists.txt
  cfe/trunk/unittests/AST/CMakeLists.txt
  cfe/trunk/unittests/ASTMatchers/CMakeLists.txt
  cfe/trunk/unittests/ASTMatchers/Dynamic/CMakeLists.txt
  cfe/trunk/unittests/Analysis/CMakeLists.txt
  cfe/trunk/unittests/Basic/CMakeLists.txt
  cfe/trunk/unittests/CodeGen/CMakeLists.txt
  cfe/trunk/unittests/CrossTU/CMakeLists.txt
  cfe/trunk/unittests/Driver/CMakeLists.txt
  cfe/trunk/unittests/Format/CMakeLists.txt
  cfe/trunk/unittests/Frontend/CMakeLists.txt
  cfe/trunk/unittests/Index/CMakeLists.txt
  cfe/trunk/unittests/Lex/CMakeLists.txt
  cfe/trunk/unittests/Rename/CMakeLists.txt
  cfe/trunk/unittests/Rewrite/CMakeLists.txt
  cfe/trunk/unittests/Sema/CMakeLists.txt
  cfe/trunk/unittests/Serialization/CMakeLists.txt
  cfe/trunk/unittests/StaticAnalyzer/CMakeLists.txt
  cfe/trunk/unittests/Tooling/CMakeLists.txt
  cfe/trunk/unittests/Tooling/Syntax/CMakeLists.txt

Index: cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
===
--- cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
+++ cfe/trunk/examples/PrintFunctionNames/CMakeLists.txt
@@ -12,10 +12,12 @@
 add_llvm_library(PrintFunctionNames MODULE PrintFunctionNames.cpp PLUGIN_TOOL clang)
 
 if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
-  target_link_libraries(PrintFunctionNames PRIVATE
+  set(LLVM_LINK_COMPONENTS
+Support
+  )
+  clang_target_link_libraries(PrintFunctionNames PRIVATE
 clangAST
 clangBasic
 clangFrontend
-LLVMSupport
 )
 endif()
Index: cfe/trunk/examples/clang-interpreter/CMakeLists.txt
===
--- cfe/trunk/examples/clang-interpreter/CMakeLists.txt
+++ cfe/trunk/examples/clang-interpreter/CMakeLists.txt
@@ -19,7 +19,7 @@
   clang-resource-headers
   )
 
-target_link_libraries(clang-interpreter
+clang_target_link_libraries(clang-interpreter
   PRIVATE
   clangBasic
   clangCodeGen
Index: cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
===
--- cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
+++ cfe/trunk/examples/AnnotateFunctions/CMakeLists.txt
@@ -1,11 +1,13 @@
 add_llvm_library(AnnotateFunctions MODULE AnnotateFunctions.cpp PLUGIN_TOOL clang)
 
 if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
-  target_link_libraries(AnnotateFunctions PRIVATE
+  set(LLVM_LINK_COMPONENTS
+Support
+  )
+  clang_target_link_libraries(AnnotateFunctions PRIVATE
 clangAST
 clangBasic
 clangFrontend
 clangLex
-LLVMSupport
 )
 endif()
Index: cfe/trunk/CMakeLists.txt
===
--- cfe/trunk/CMakeLists.txt
+++ cfe/trunk/CMakeLists.txt
@@ -323,6 +323,14 @@
 set(CLANG_PYTHON_BINDINGS_VERSIONS "" CACHE STRING
 "Python versions to install libclang python bindings for")
 
+set(CLANG_LINK_CLANG_DYLIB ${LLVM_LINK_LLVM_DYLIB} CACHE BOOL
+"Link tools against libclang_shared.so")
+
+if (NOT LLVM_LINK_LLVM_DYLIB AND CLANG_LINK_CLANG_DYLIB)
+  message(FATAL_ERROR "Cannot set CLANG_LINK_CLANG_DYLIB=ON when "
+  "LLVM_LINK_LLVM_DYLIB=OFF")
+endif()
+
 # The libdir suffix must exactly match whatever LLVM's configuration used.
 set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}")
 
Index: cfe/trunk/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
===
--- cfe/trunk/lib/Analysis/plugins/CheckerOptionHan

[PATCH] D64278: Rename libclang_shared to libclang-cpp

2019-07-08 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

I'm fine with this new name.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64278/new/

https://reviews.llvm.org/D64278



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


[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Not sure if this would be relevant for your use case, but it would be really 
nice to have a libCLANG.so with all the C++ symbols, like we do for llvm.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61804/new/

https://reviews.llvm.org/D61804



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


[PATCH] D61804: Support building shared and static libraries simultaneously

2019-05-13 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

> ! In D61804#149 , @beanz wrote:
>  I apologize that I missed your thread on the dev list, because that would 
> have been a much better place to have this conversation. Having gone back and 
> read it now, it sounds to me like what you really want is a clang equivalent 
> of libLLVM. That is a reasonable and viable thing to want. This patch 
> (https://reviews.llvm.org/P8147) is a first stab. I'm happy to prepare that 
> for landing in Clang if that meets your needs, and that is a viable way 
> forward.

I think this patch is missing the new clang-shlib directory.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61804/new/

https://reviews.llvm.org/D61804



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


[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-14 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Thanks for working on this, I have wanted something like this for a while.

It would also be nice to have a CLANG_LINK_CLANG_DYLIB option like we have for 
llvm, but this can be a follow on patch, and I would be happy to help with this 
if needed.




Comment at: clang/tools/clang-shlib/CMakeLists.txt:8
+
+add_clang_library(Clang_shared
+  SHARED

Is this capital 'C' to distinguish it from the other libclang.so ?  I would 
prfer to use lowercase 'c' here instead, so it fit the naming convention for 
the other libraries.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61909/new/

https://reviews.llvm.org/D61909



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


[PATCH] D61909: Add Clang shared library with C++ exports

2019-05-16 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

LGTM.  We can add CLANG_LINK_CLANG_DYLIB as a follow-up patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61909/new/

https://reviews.llvm.org/D61909



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


[PATCH] D66176: Fix Driver/modules.cpp test to work when build directory name contains '.s'

2019-09-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 05.
tstellar added a comment.

Don't check .s suffix.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66176/new/

https://reviews.llvm.org/D66176

Files:
  clang/test/Driver/modules.cpp


Index: clang/test/Driver/modules.cpp
===
--- clang/test/Driver/modules.cpp
+++ clang/test/Driver/modules.cpp
@@ -15,7 +15,7 @@
 // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | 
FileCheck %s --check-prefix=CHECK-COMPILE
 //
 // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}}
-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}
+// CHECK-COMPILE-SAME: -o {{.*}}module{{2*}}.pcm.o
 // CHECK-COMPILE-SAME: -x pcm
 // CHECK-COMPILE-SAME: {{.*}}.pcm
 


Index: clang/test/Driver/modules.cpp
===
--- clang/test/Driver/modules.cpp
+++ clang/test/Driver/modules.cpp
@@ -15,7 +15,7 @@
 // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-COMPILE
 //
 // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}}
-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}
+// CHECK-COMPILE-SAME: -o {{.*}}module{{2*}}.pcm.o
 // CHECK-COMPILE-SAME: -x pcm
 // CHECK-COMPILE-SAME: {{.*}}.pcm
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D66176: Fix Driver/modules.cpp test to work when build directory name contains '.s'

2019-09-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar marked an inline comment as done.
tstellar added inline comments.



Comment at: clang/test/Driver/modules.cpp:19
+// CHECK-COMPILE-SAME: {{ -o }}
+// CHECK-COMPILE-SAME: module{{2*}}.{{pcm.o|s}}
 // CHECK-COMPILE-SAME: -x pcm

dyung wrote:
> I'm not sure what the regex module{{2*}} is supposed to match, or prevent 
> from matching? Was this intentional?
> 
> It seems it would match "module", "module2", "module22", "module222", etc. 
> When would the compiler ever generate anything other than the first? Unless 
> you are trying to protect yourself against a build directory that contains 
> module in the name, but I'm not sure how this helps that...
This CHECK line is used by two different RUN lines, the first writes to 
module.pcm.o and the second writes to module2.pcm.o.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66176/new/

https://reviews.llvm.org/D66176



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


[PATCH] D66176: Fix Driver/modules.cpp test to work when build directory name contains '.s'

2019-09-30 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL373275: Fix Driver/modules.cpp test to work when build 
directory name contains '.s' (authored by tstellar, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66176?vs=05&id=222521#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66176/new/

https://reviews.llvm.org/D66176

Files:
  cfe/trunk/test/Driver/modules.cpp


Index: cfe/trunk/test/Driver/modules.cpp
===
--- cfe/trunk/test/Driver/modules.cpp
+++ cfe/trunk/test/Driver/modules.cpp
@@ -15,7 +15,7 @@
 // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | 
FileCheck %s --check-prefix=CHECK-COMPILE
 //
 // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}}
-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}
+// CHECK-COMPILE-SAME: -o {{.*}}module{{2*}}.pcm.o
 // CHECK-COMPILE-SAME: -x pcm
 // CHECK-COMPILE-SAME: {{.*}}.pcm
 


Index: cfe/trunk/test/Driver/modules.cpp
===
--- cfe/trunk/test/Driver/modules.cpp
+++ cfe/trunk/test/Driver/modules.cpp
@@ -15,7 +15,7 @@
 // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-COMPILE
 //
 // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}}
-// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}
+// CHECK-COMPILE-SAME: -o {{.*}}module{{2*}}.pcm.o
 // CHECK-COMPILE-SAME: -x pcm
 // CHECK-COMPILE-SAME: {{.*}}.pcm
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D44130: Driver: Add gcc search path for RHEL devtoolset-7

2018-04-11 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL329854: Driver:  Add gcc search path for RHEL devtoolset-7 
(authored by tstellar, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D44130

Files:
  cfe/trunk/lib/Driver/ToolChains/Gnu.cpp


Index: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
===
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
@@ -1785,6 +1785,7 @@
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-4/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-3/root/usr");


Index: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
===
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
@@ -1785,6 +1785,7 @@
   // Non-Solaris is much simpler - most systems just go with "/usr".
   if (SysRoot.empty() && TargetTriple.getOS() == llvm::Triple::Linux) {
 // Yet, still look for RHEL devtoolsets.
+Prefixes.push_back("/opt/rh/devtoolset-7/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-6/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-4/root/usr");
 Prefixes.push_back("/opt/rh/devtoolset-3/root/usr");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34848: Driver: Don't mix system tools with devtoolset tools on RHEL

2018-04-12 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 142294.
tstellar added a comment.

Replaced the if (Distro.isRedhat()) check with a string compare on the
GCC installation lib.  This narrows the scope of the fix and also makes
it possible to write a test case.  The code that detects distros ignores
sysroot and looks in /etc of the test system, which makes it impossible to
write a portable lit test to verify distro specific behavior.


Repository:
  rC Clang

https://reviews.llvm.org/D34848

Files:
  lib/Driver/ToolChains/Linux.cpp
  test/Driver/linux-ld.c


Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -1780,3 +1780,11 @@
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
 // CHECK-LD-GENTOO-X32: "-lc"
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: 
--gcc-toolchain="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr" \
+// RUN: --sysroot=%S/Inputs/rhel_7_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-RHEL7-DTS %s
+// CHECK-LD-RHLE7-DTS: Selected GCC installation: 
[[GCC_INSTALL:/home/tstellar/llvm-project/clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7]]
+// CHECK-LD-RHEL7-DTS-NOT: /usr/bin/ld
+// CHECK-LD-RHLE7-DTS: [[GCC_INSTALL]/../../../bin/ld
Index: lib/Driver/ToolChains/Linux.cpp
===
--- lib/Driver/ToolChains/Linux.cpp
+++ lib/Driver/ToolChains/Linux.cpp
@@ -237,6 +237,15 @@
 ExtraOpts.push_back("relro");
   }
 
+  if (GCCInstallation.getParentLibPath().find("opt/rh/devtoolset") !=
+  StringRef::npos)
+// With devtoolset on RHEL, we want to add a bin directory that is relative
+// to the detected gcc install, because if we are using devtoolset gcc then
+// we want to use other tools from devtoolset (e.g. ld) instead of the
+// standard system tools.
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() +
+ "/../bin").str());
+
   if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
 ExtraOpts.push_back("-X");
 


Index: test/Driver/linux-ld.c
===
--- test/Driver/linux-ld.c
+++ test/Driver/linux-ld.c
@@ -1780,3 +1780,11 @@
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
 // CHECK-LD-GENTOO-X32: "-lc"
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --gcc-toolchain="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr" \
+// RUN: --sysroot=%S/Inputs/rhel_7_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-RHEL7-DTS %s
+// CHECK-LD-RHLE7-DTS: Selected GCC installation: [[GCC_INSTALL:/home/tstellar/llvm-project/clang/test/Driver/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7]]
+// CHECK-LD-RHEL7-DTS-NOT: /usr/bin/ld
+// CHECK-LD-RHLE7-DTS: [[GCC_INSTALL]/../../../bin/ld
Index: lib/Driver/ToolChains/Linux.cpp
===
--- lib/Driver/ToolChains/Linux.cpp
+++ lib/Driver/ToolChains/Linux.cpp
@@ -237,6 +237,15 @@
 ExtraOpts.push_back("relro");
   }
 
+  if (GCCInstallation.getParentLibPath().find("opt/rh/devtoolset") !=
+  StringRef::npos)
+// With devtoolset on RHEL, we want to add a bin directory that is relative
+// to the detected gcc install, because if we are using devtoolset gcc then
+// we want to use other tools from devtoolset (e.g. ld) instead of the
+// standard system tools.
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() +
+ "/../bin").str());
+
   if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
 ExtraOpts.push_back("-X");
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34848: Driver: Don't mix system tools with devtoolset tools on RHEL

2018-06-29 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL336037: Driver: Don't mix system tools with devtoolset 
tools on RHEL (authored by tstellar, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D34848?vs=142294&id=153608#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D34848

Files:
  cfe/trunk/lib/Driver/ToolChains/Linux.cpp
  cfe/trunk/test/Driver/linux-ld.c


Index: cfe/trunk/test/Driver/linux-ld.c
===
--- cfe/trunk/test/Driver/linux-ld.c
+++ cfe/trunk/test/Driver/linux-ld.c
@@ -1782,3 +1782,12 @@
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
 // CHECK-LD-GENTOO-X32: "-lc"
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: 
--gcc-toolchain="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr" \
+// RUN: --sysroot=%S/Inputs/rhel_7_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-RHEL7-DTS %s
+// CHECK-LD-RHEL7-DTS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-RHLE7-DTS: Selected GCC installation: 
[[GCC_INSTALL:[[SYSROOT]]/lib/gcc/x86_64-redhat-linux/7]]
+// CHECK-LD-RHEL7-DTS-NOT: /usr/bin/ld
+// CHECK-LD-RHLE7-DTS: [[GCC_INSTALL]/../../../bin/ld
Index: cfe/trunk/lib/Driver/ToolChains/Linux.cpp
===
--- cfe/trunk/lib/Driver/ToolChains/Linux.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp
@@ -238,6 +238,15 @@
 ExtraOpts.push_back("relro");
   }
 
+  if (GCCInstallation.getParentLibPath().find("opt/rh/devtoolset") !=
+  StringRef::npos)
+// With devtoolset on RHEL, we want to add a bin directory that is relative
+// to the detected gcc install, because if we are using devtoolset gcc then
+// we want to use other tools from devtoolset (e.g. ld) instead of the
+// standard system tools.
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() +
+ "/../bin").str());
+
   if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
 ExtraOpts.push_back("-X");
 


Index: cfe/trunk/test/Driver/linux-ld.c
===
--- cfe/trunk/test/Driver/linux-ld.c
+++ cfe/trunk/test/Driver/linux-ld.c
@@ -1782,3 +1782,12 @@
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
 // CHECK-LD-GENTOO-X32: "-lc"
 // CHECK-LD-GENTOO-X32: "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
+
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: --gcc-toolchain="%S/Inputs/rhel_7_tree/opt/rh/devtoolset-7/root/usr" \
+// RUN: --sysroot=%S/Inputs/rhel_7_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LD-RHEL7-DTS %s
+// CHECK-LD-RHEL7-DTS: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
+// CHECK-LD-RHLE7-DTS: Selected GCC installation: [[GCC_INSTALL:[[SYSROOT]]/lib/gcc/x86_64-redhat-linux/7]]
+// CHECK-LD-RHEL7-DTS-NOT: /usr/bin/ld
+// CHECK-LD-RHLE7-DTS: [[GCC_INSTALL]/../../../bin/ld
Index: cfe/trunk/lib/Driver/ToolChains/Linux.cpp
===
--- cfe/trunk/lib/Driver/ToolChains/Linux.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Linux.cpp
@@ -238,6 +238,15 @@
 ExtraOpts.push_back("relro");
   }
 
+  if (GCCInstallation.getParentLibPath().find("opt/rh/devtoolset") !=
+  StringRef::npos)
+// With devtoolset on RHEL, we want to add a bin directory that is relative
+// to the detected gcc install, because if we are using devtoolset gcc then
+// we want to use other tools from devtoolset (e.g. ld) instead of the
+// standard system tools.
+PPaths.push_back(Twine(GCCInstallation.getParentLibPath() +
+ "/../bin").str());
+
   if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
 ExtraOpts.push_back("-X");
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D68520: [cmake] Fix clang builds with BUILD_SHARED=ON and CLANG_LINK_CLANG_DYLIB=ON

2019-10-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added a reviewer: beanz.
Herald added a subscriber: mgorny.
Herald added a project: clang.

We were linking all the clang objects and shared libraries into
libclang-cpp.so, which was causing the command line options to be
registered twice.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68520

Files:
  clang/tools/clang-shlib/CMakeLists.txt


Index: clang/tools/clang-shlib/CMakeLists.txt
===
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -8,9 +8,15 @@
 foreach (lib ${clang_libs})
   list(APPEND _OBJECTS $)
   list(APPEND _DEPS $)
-  list(APPEND _DEPS $)
+  get_target_property(interface ${lib} LINK_LIBRARIES)
+  list(APPEND _DEPS ${interface})
 endforeach ()
 
+# clang libraries are redundant since we are linking all the individual
+# object files into libclang-cpp.so, so filter them out from _DEPS.
+# This avoids problems with LLVM global data when building with
+# BUILD_SHARED_LIBS=ON
+list(FILTER _DEPS EXCLUDE REGEX "^clang")
 if (CLANG_LINK_CLANG_DYLIB)
   set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
 endif()


Index: clang/tools/clang-shlib/CMakeLists.txt
===
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -8,9 +8,15 @@
 foreach (lib ${clang_libs})
   list(APPEND _OBJECTS $)
   list(APPEND _DEPS $)
-  list(APPEND _DEPS $)
+  get_target_property(interface ${lib} LINK_LIBRARIES)
+  list(APPEND _DEPS ${interface})
 endforeach ()
 
+# clang libraries are redundant since we are linking all the individual
+# object files into libclang-cpp.so, so filter them out from _DEPS.
+# This avoids problems with LLVM global data when building with
+# BUILD_SHARED_LIBS=ON
+list(FILTER _DEPS EXCLUDE REGEX "^clang")
 if (CLANG_LINK_CLANG_DYLIB)
   set(INSTALL_WITH_TOOLCHAIN INSTALL_WITH_TOOLCHAIN)
 endif()
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D68720: Support -fstack-clash-protection for x86

2019-10-10 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/test/CodeGen/stack-clash-protection.c:3
+// RUN: %clang -target x86_64 -o %t.out %s -fstack-clash-protection && %t.out
+
+#include 

There were concerns[1] raised recently about adding clang tests that were 
codegen dependent.  Is something being tested here that can't be tested with an 
IR test?  If you only need to test that the frontend option work, I think 
checking the IR for the necessary function attributes might be enough.



[1] http://lists.llvm.org/pipermail/cfe-dev/2019-September/063309.html


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68720/new/

https://reviews.llvm.org/D68720



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


[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: vsk, efriedma.
Herald added a project: clang.

Add a special case for handling __builtin_mul_overflow with unsigned
inputs and a signed output to avoid emitting the __muloti4 library
call on x86_64.  __muloti4 is not implemented in libgcc, so avoiding
this call fixes compilation of some programs that call
__builtin_mul_overflow with these arguments.

For example, this fixes the build of cpio with clang, which includes code from
gnulib that calls __builtin_mul_overflow with these argument types.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84405

Files:
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/test/CodeGen/builtins-overflow.c


Index: clang/test/CodeGen/builtins-overflow.c
===
--- clang/test/CodeGen/builtins-overflow.c
+++ clang/test/CodeGen/builtins-overflow.c
@@ -111,6 +111,21 @@
   return r;
 }
 
+int test_mul_overflow_uint_uint_int(unsigned x, unsigned y) {
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_uint_uint_int
+  // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 
%{{.+}}, i32 %{{.+}})
+  // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
+  // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1
+  // CHECK: [[C1:%.+]] = icmp ugt i32 [[Q]], 2147483647
+  // CHECK: [[C2:%.+]] = or i1 [[C]], [[C1]]
+  // CHECK: store i32 [[Q]], i32*
+  // CHECK: br i1 [[C2]]
+  int r;
+  if (__builtin_mul_overflow(x, y, &r))
+overflowed();
+  return r;
+}
+
 int test_mul_overflow_int_int_int(int x, int y) {
   // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_int_int_int
   // CHECK-NOT: ext
Index: clang/lib/CodeGen/CGBuiltin.cpp
===
--- clang/lib/CodeGen/CGBuiltin.cpp
+++ clang/lib/CodeGen/CGBuiltin.cpp
@@ -1408,6 +1408,47 @@
   return RValue::get(BufAddr.getPointer());
 }
 
+static bool isSpecialUnsignedMultiplySignedResult(
+unsigned BuiltinID, WidthAndSignedness Op1Info, WidthAndSignedness Op2Info,
+WidthAndSignedness ResultInfo) {
+  return BuiltinID == Builtin::BI__builtin_mul_overflow &&
+ Op1Info.Width == Op2Info.Width && Op2Info.Width == ResultInfo.Width &&
+ !Op1Info.Signed && !Op2Info.Signed && ResultInfo.Signed;
+}
+
+static RValue EmitCheckedUnsignedMultiplySignedResult(
+CodeGenFunction &CGF, const clang::Expr *Op1, WidthAndSignedness Op1Info,
+const clang::Expr *Op2, WidthAndSignedness Op2Info,
+const clang::Expr *ResultArg, QualType ResultQTy,
+WidthAndSignedness ResultInfo) {
+  assert(isSpecialUnsignedMultiplySignedResult(
+ Builtin::BI__builtin_mul_overflow, Op1Info, Op2Info, ResultInfo) 
&&
+ "Cannot specialize this multiply");
+
+  llvm::Value *V1 = CGF.EmitScalarExpr(Op1);
+  llvm::Value *V2 = CGF.EmitScalarExpr(Op2);
+
+  llvm::Value *HasOverflow;
+  llvm::Value *Result = EmitOverflowIntrinsic(
+  CGF, llvm::Intrinsic::umul_with_overflow, V1, V2, HasOverflow);
+
+  // The intrinsic call will detect overflow when the value is > UINT_MAX,
+  // however, since the original builtin had a signed result, we need to report
+  // an overflow when the result is greater than INT_MAX.
+  auto IntMax = llvm::APInt::getSignedMaxValue(ResultInfo.Width);
+  llvm::Value *IntMaxValue = llvm::ConstantInt::get(Result->getType(), IntMax);
+
+  llvm::Value *IntMaxOverflow = CGF.Builder.CreateICmpUGT(Result, IntMaxValue);
+  HasOverflow = CGF.Builder.CreateOr(HasOverflow, IntMaxOverflow);
+
+  bool isVolatile =
+  ResultArg->getType()->getPointeeType().isVolatileQualified();
+  Address ResultPtr = CGF.EmitPointerWithAlignment(ResultArg);
+  CGF.Builder.CreateStore(CGF.EmitToMemory(Result, ResultQTy), ResultPtr,
+  isVolatile);
+  return RValue::get(HasOverflow);
+}
+
 /// Determine if a binop is a checked mixed-sign multiply we can specialize.
 static bool isSpecialMixedSignMultiply(unsigned BuiltinID,
WidthAndSignedness Op1Info,
@@ -3484,6 +3525,12 @@
   RightInfo, ResultArg, ResultQTy,
   ResultInfo);
 
+if (isSpecialUnsignedMultiplySignedResult(BuiltinID, LeftInfo, RightInfo,
+  ResultInfo))
+  return EmitCheckedUnsignedMultiplySignedResult(
+  *this, LeftArg, LeftInfo, RightArg, RightInfo, ResultArg, ResultQTy,
+  ResultInfo);
+
 WidthAndSignedness EncompassingInfo =
 EncompassingIntegerType({LeftInfo, RightInfo, ResultInfo});
 
@@ -3507,6 +3554,8 @@
 : llvm::Intrinsic::usub_with_overflow;
   break;
 case Builtin::BI__builtin_mul_overflow:
+  // It's OK to emit umul when the result type is signed, as long as the
+  // input types are both unsigned.
   IntrinsicId = EncompassingInfo.Signed
 

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 280104.
tstellar added a comment.

Remove stray comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84405/new/

https://reviews.llvm.org/D84405

Files:
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/test/CodeGen/builtins-overflow.c


Index: clang/test/CodeGen/builtins-overflow.c
===
--- clang/test/CodeGen/builtins-overflow.c
+++ clang/test/CodeGen/builtins-overflow.c
@@ -111,6 +111,21 @@
   return r;
 }
 
+int test_mul_overflow_uint_uint_int(unsigned x, unsigned y) {
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_uint_uint_int
+  // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 
%{{.+}}, i32 %{{.+}})
+  // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
+  // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1
+  // CHECK: [[C1:%.+]] = icmp ugt i32 [[Q]], 2147483647
+  // CHECK: [[C2:%.+]] = or i1 [[C]], [[C1]]
+  // CHECK: store i32 [[Q]], i32*
+  // CHECK: br i1 [[C2]]
+  int r;
+  if (__builtin_mul_overflow(x, y, &r))
+overflowed();
+  return r;
+}
+
 int test_mul_overflow_int_int_int(int x, int y) {
   // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_int_int_int
   // CHECK-NOT: ext
Index: clang/lib/CodeGen/CGBuiltin.cpp
===
--- clang/lib/CodeGen/CGBuiltin.cpp
+++ clang/lib/CodeGen/CGBuiltin.cpp
@@ -1408,6 +1408,47 @@
   return RValue::get(BufAddr.getPointer());
 }
 
+static bool isSpecialUnsignedMultiplySignedResult(
+unsigned BuiltinID, WidthAndSignedness Op1Info, WidthAndSignedness Op2Info,
+WidthAndSignedness ResultInfo) {
+  return BuiltinID == Builtin::BI__builtin_mul_overflow &&
+ Op1Info.Width == Op2Info.Width && Op2Info.Width == ResultInfo.Width &&
+ !Op1Info.Signed && !Op2Info.Signed && ResultInfo.Signed;
+}
+
+static RValue EmitCheckedUnsignedMultiplySignedResult(
+CodeGenFunction &CGF, const clang::Expr *Op1, WidthAndSignedness Op1Info,
+const clang::Expr *Op2, WidthAndSignedness Op2Info,
+const clang::Expr *ResultArg, QualType ResultQTy,
+WidthAndSignedness ResultInfo) {
+  assert(isSpecialUnsignedMultiplySignedResult(
+ Builtin::BI__builtin_mul_overflow, Op1Info, Op2Info, ResultInfo) 
&&
+ "Cannot specialize this multiply");
+
+  llvm::Value *V1 = CGF.EmitScalarExpr(Op1);
+  llvm::Value *V2 = CGF.EmitScalarExpr(Op2);
+
+  llvm::Value *HasOverflow;
+  llvm::Value *Result = EmitOverflowIntrinsic(
+  CGF, llvm::Intrinsic::umul_with_overflow, V1, V2, HasOverflow);
+
+  // The intrinsic call will detect overflow when the value is > UINT_MAX,
+  // however, since the original builtin had a signed result, we need to report
+  // an overflow when the result is greater than INT_MAX.
+  auto IntMax = llvm::APInt::getSignedMaxValue(ResultInfo.Width);
+  llvm::Value *IntMaxValue = llvm::ConstantInt::get(Result->getType(), IntMax);
+
+  llvm::Value *IntMaxOverflow = CGF.Builder.CreateICmpUGT(Result, IntMaxValue);
+  HasOverflow = CGF.Builder.CreateOr(HasOverflow, IntMaxOverflow);
+
+  bool isVolatile =
+  ResultArg->getType()->getPointeeType().isVolatileQualified();
+  Address ResultPtr = CGF.EmitPointerWithAlignment(ResultArg);
+  CGF.Builder.CreateStore(CGF.EmitToMemory(Result, ResultQTy), ResultPtr,
+  isVolatile);
+  return RValue::get(HasOverflow);
+}
+
 /// Determine if a binop is a checked mixed-sign multiply we can specialize.
 static bool isSpecialMixedSignMultiply(unsigned BuiltinID,
WidthAndSignedness Op1Info,
@@ -3484,6 +3525,12 @@
   RightInfo, ResultArg, ResultQTy,
   ResultInfo);
 
+if (isSpecialUnsignedMultiplySignedResult(BuiltinID, LeftInfo, RightInfo,
+  ResultInfo))
+  return EmitCheckedUnsignedMultiplySignedResult(
+  *this, LeftArg, LeftInfo, RightArg, RightInfo, ResultArg, ResultQTy,
+  ResultInfo);
+
 WidthAndSignedness EncompassingInfo =
 EncompassingIntegerType({LeftInfo, RightInfo, ResultInfo});
 


Index: clang/test/CodeGen/builtins-overflow.c
===
--- clang/test/CodeGen/builtins-overflow.c
+++ clang/test/CodeGen/builtins-overflow.c
@@ -111,6 +111,21 @@
   return r;
 }
 
+int test_mul_overflow_uint_uint_int(unsigned x, unsigned y) {
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_uint_uint_int
+  // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+  // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
+  // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1
+  // CHECK: [[C1:%.+]] = icmp ugt i32 [[Q]], 2147483647
+  // CHECK: [[C2:%.+]] = or i1 [[C]], [[C1]]
+  // CHECK:

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D84405#2170110 , @vsk wrote:

> How were you able to show that the specialized IRGen is equivalent to the 
> generic kind? I tried doing this with direct inspection 
> (https://godbolt.org/z/o5WEn3), but wasn't able to convince myself. In the 
> past I used a test driver to compare the before/after compiler output -- you 
> might find that useful 
> (https://gist.github.com/vedantk/3eb9c88f82e5c32f2e590555b4af5081).


I compared with what gcc was generating and it looked similar (although my x86 
assembly knowledge is not great), but I will give your test driver a try, 
thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84405/new/

https://reviews.llvm.org/D84405



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


[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 281092.
tstellar added a comment.
Herald added a subscriber: mstorsjo.

Add 64-bit test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84405/new/

https://reviews.llvm.org/D84405

Files:
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/test/CodeGen/builtins-overflow.c

Index: clang/test/CodeGen/builtins-overflow.c
===
--- clang/test/CodeGen/builtins-overflow.c
+++ clang/test/CodeGen/builtins-overflow.c
@@ -1,9 +1,9 @@
 // Test CodeGen for Security Check Overflow Builtins.
 // rdar://13421498
 
-// RUN: %clang_cc1 -triple "i686-unknown-unknown"   -emit-llvm -x c %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple "x86_64-unknown-unknown" -emit-llvm -x c %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple "x86_64-mingw32" -emit-llvm -x c %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple "i686-unknown-unknown"   -emit-llvm -x c %s -o - | FileCheck -DLONG_TYPE=i32 -DLONG_MAX=2147483647 %s
+// RUN: %clang_cc1 -triple "x86_64-unknown-unknown" -emit-llvm -x c %s -o - | FileCheck -DLONG_TYPE=i64 -DLONG_MAX=9223372036854775807 %s
+// RUN: %clang_cc1 -triple "x86_64-mingw32" -emit-llvm -x c %s -o - | FileCheck -DLONG_TYPE=i32 -DLONG_MAX=2147483647 %s
 
 extern unsigned UnsignedErrorCode;
 extern unsigned long UnsignedLongErrorCode;
@@ -111,6 +111,36 @@
   return r;
 }
 
+int test_mul_overflow_uint_uint_int(unsigned x, unsigned y) {
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_uint_uint_int
+  // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+  // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
+  // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1
+  // CHECK: [[C1:%.+]] = icmp ugt i32 [[Q]], 2147483647
+  // CHECK: [[C2:%.+]] = or i1 [[C]], [[C1]]
+  // CHECK: store i32 [[Q]], i32*
+  // CHECK: br i1 [[C2]]
+  int r;
+  if (__builtin_mul_overflow(x, y, &r))
+overflowed();
+  return r;
+}
+
+long test_mul_overflow_ulong_ulong_long(unsigned long x, unsigned long y) {
+  // CHECK-LABEL: @test_mul_overflow_ulong_ulong_long
+  // CHECK: [[S:%.+]] =  call { [[LONG_TYPE]], i1 } @llvm.umul.with.overflow.[[LONG_TYPE]]([[LONG_TYPE]] %{{.+}}, [[LONG_TYPE]] %{{.+}})
+  // CHECK-DAG: [[Q:%.+]] = extractvalue { [[LONG_TYPE]], i1 } [[S]], 0
+  // CHECK-DAG: [[C:%.+]] = extractvalue { [[LONG_TYPE]], i1 } [[S]], 1
+  // CHECK: [[C1:%.+]] = icmp ugt [[LONG_TYPE]] [[Q]], [[LONG_MAX]]
+  // CHECK: [[C2:%.+]] = or i1 [[C]], [[C1]]
+  // LONG64: store [[LONG_TYPE]] [[Q]], [[LONG_TYPE]]*
+  // LONG64: br i1 [[C2]]
+  long r;
+  if (__builtin_mul_overflow(x, y, &r))
+overflowed();
+  return r;
+}
+
 int test_mul_overflow_int_int_int(int x, int y) {
   // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_int_int_int
   // CHECK-NOT: ext
Index: clang/lib/CodeGen/CGBuiltin.cpp
===
--- clang/lib/CodeGen/CGBuiltin.cpp
+++ clang/lib/CodeGen/CGBuiltin.cpp
@@ -1408,6 +1408,47 @@
   return RValue::get(BufAddr.getPointer());
 }
 
+static bool isSpecialUnsignedMultiplySignedResult(
+unsigned BuiltinID, WidthAndSignedness Op1Info, WidthAndSignedness Op2Info,
+WidthAndSignedness ResultInfo) {
+  return BuiltinID == Builtin::BI__builtin_mul_overflow &&
+ Op1Info.Width == Op2Info.Width && Op2Info.Width == ResultInfo.Width &&
+ !Op1Info.Signed && !Op2Info.Signed && ResultInfo.Signed;
+}
+
+static RValue EmitCheckedUnsignedMultiplySignedResult(
+CodeGenFunction &CGF, const clang::Expr *Op1, WidthAndSignedness Op1Info,
+const clang::Expr *Op2, WidthAndSignedness Op2Info,
+const clang::Expr *ResultArg, QualType ResultQTy,
+WidthAndSignedness ResultInfo) {
+  assert(isSpecialUnsignedMultiplySignedResult(
+ Builtin::BI__builtin_mul_overflow, Op1Info, Op2Info, ResultInfo) &&
+ "Cannot specialize this multiply");
+
+  llvm::Value *V1 = CGF.EmitScalarExpr(Op1);
+  llvm::Value *V2 = CGF.EmitScalarExpr(Op2);
+
+  llvm::Value *HasOverflow;
+  llvm::Value *Result = EmitOverflowIntrinsic(
+  CGF, llvm::Intrinsic::umul_with_overflow, V1, V2, HasOverflow);
+
+  // The intrinsic call will detect overflow when the value is > UINT_MAX,
+  // however, since the original builtin had a signed result, we need to report
+  // an overflow when the result is greater than INT_MAX.
+  auto IntMax = llvm::APInt::getSignedMaxValue(ResultInfo.Width);
+  llvm::Value *IntMaxValue = llvm::ConstantInt::get(Result->getType(), IntMax);
+
+  llvm::Value *IntMaxOverflow = CGF.Builder.CreateICmpUGT(Result, IntMaxValue);
+  HasOverflow = CGF.Builder.CreateOr(HasOverflow, IntMaxOverflow);
+
+  bool isVolatile =
+  ResultArg->getType()->getPointeeType().isVolatileQualified();
+  Address ResultPtr = CGF.EmitPointerWithAlignment(ResultArg);
+  CGF.Builder.CreateStore(CGF.EmitToMemory(Result, ResultQTy), ResultPt

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

This is the test driver I used for testing.  I compared the clang 11 + this 
patch with gcc 10 and saw no differences: 
https://gist.github.com/tstellar/80dae2ab8a18d810b10b8e42777f4fe4


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84405/new/

https://reviews.llvm.org/D84405



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


[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Here is the assembly comparison for the 64-bit test I added between gcc and 
clang trunk + patch: https://reviews.llvm.org/P8227


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84405/new/

https://reviews.llvm.org/D84405



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


[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-28 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 281419.
tstellar added a comment.

Add volatile test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84405/new/

https://reviews.llvm.org/D84405

Files:
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/test/CodeGen/builtins-overflow.c

Index: clang/test/CodeGen/builtins-overflow.c
===
--- clang/test/CodeGen/builtins-overflow.c
+++ clang/test/CodeGen/builtins-overflow.c
@@ -1,9 +1,9 @@
 // Test CodeGen for Security Check Overflow Builtins.
 // rdar://13421498
 
-// RUN: %clang_cc1 -triple "i686-unknown-unknown"   -emit-llvm -x c %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple "x86_64-unknown-unknown" -emit-llvm -x c %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple "x86_64-mingw32" -emit-llvm -x c %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple "i686-unknown-unknown"   -emit-llvm -x c %s -o - | FileCheck -DLONG_TYPE=i32 -DLONG_MAX=2147483647 %s
+// RUN: %clang_cc1 -triple "x86_64-unknown-unknown" -emit-llvm -x c %s -o - | FileCheck -DLONG_TYPE=i64 -DLONG_MAX=9223372036854775807 %s
+// RUN: %clang_cc1 -triple "x86_64-mingw32" -emit-llvm -x c %s -o - | FileCheck -DLONG_TYPE=i32 -DLONG_MAX=2147483647 %s
 
 extern unsigned UnsignedErrorCode;
 extern unsigned long UnsignedLongErrorCode;
@@ -111,6 +111,51 @@
   return r;
 }
 
+int test_mul_overflow_uint_uint_int(unsigned x, unsigned y) {
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_uint_uint_int
+  // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+  // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
+  // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1
+  // CHECK: [[C1:%.+]] = icmp ugt i32 [[Q]], 2147483647
+  // CHECK: [[C2:%.+]] = or i1 [[C]], [[C1]]
+  // CHECK: store i32 [[Q]], i32*
+  // CHECK: br i1 [[C2]]
+  int r;
+  if (__builtin_mul_overflow(x, y, &r))
+overflowed();
+  return r;
+}
+
+int test_mul_overflow_uint_uint_int_volatile(unsigned x, unsigned y) {
+  // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_uint_uint_int_volatile
+  // CHECK: [[S:%.+]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %{{.+}}, i32 %{{.+}})
+  // CHECK-DAG: [[Q:%.+]] = extractvalue { i32, i1 } [[S]], 0
+  // CHECK-DAG: [[C:%.+]] = extractvalue { i32, i1 } [[S]], 1
+  // CHECK: [[C1:%.+]] = icmp ugt i32 [[Q]], 2147483647
+  // CHECK: [[C2:%.+]] = or i1 [[C]], [[C1]]
+  // CHECK: store volatile i32 [[Q]], i32*
+  // CHECK: br i1 [[C2]]
+  volatile int r;
+  if (__builtin_mul_overflow(x, y, &r))
+overflowed();
+  return r;
+}
+
+long test_mul_overflow_ulong_ulong_long(unsigned long x, unsigned long y) {
+  // CHECK-LABEL: @test_mul_overflow_ulong_ulong_long
+  // CHECK: [[S:%.+]] =  call { [[LONG_TYPE]], i1 } @llvm.umul.with.overflow.[[LONG_TYPE]]([[LONG_TYPE]] %{{.+}}, [[LONG_TYPE]] %{{.+}})
+  // CHECK-DAG: [[Q:%.+]] = extractvalue { [[LONG_TYPE]], i1 } [[S]], 0
+  // CHECK-DAG: [[C:%.+]] = extractvalue { [[LONG_TYPE]], i1 } [[S]], 1
+  // CHECK: [[C1:%.+]] = icmp ugt [[LONG_TYPE]] [[Q]], [[LONG_MAX]]
+  // CHECK: [[C2:%.+]] = or i1 [[C]], [[C1]]
+  // LONG64: store [[LONG_TYPE]] [[Q]], [[LONG_TYPE]]*
+  // LONG64: br i1 [[C2]]
+  long r;
+  if (__builtin_mul_overflow(x, y, &r))
+overflowed();
+  return r;
+}
+
 int test_mul_overflow_int_int_int(int x, int y) {
   // CHECK-LABEL: define {{(dso_local )?}}i32 @test_mul_overflow_int_int_int
   // CHECK-NOT: ext
Index: clang/lib/CodeGen/CGBuiltin.cpp
===
--- clang/lib/CodeGen/CGBuiltin.cpp
+++ clang/lib/CodeGen/CGBuiltin.cpp
@@ -1408,6 +1408,47 @@
   return RValue::get(BufAddr.getPointer());
 }
 
+static bool isSpecialUnsignedMultiplySignedResult(
+unsigned BuiltinID, WidthAndSignedness Op1Info, WidthAndSignedness Op2Info,
+WidthAndSignedness ResultInfo) {
+  return BuiltinID == Builtin::BI__builtin_mul_overflow &&
+ Op1Info.Width == Op2Info.Width && Op2Info.Width == ResultInfo.Width &&
+ !Op1Info.Signed && !Op2Info.Signed && ResultInfo.Signed;
+}
+
+static RValue EmitCheckedUnsignedMultiplySignedResult(
+CodeGenFunction &CGF, const clang::Expr *Op1, WidthAndSignedness Op1Info,
+const clang::Expr *Op2, WidthAndSignedness Op2Info,
+const clang::Expr *ResultArg, QualType ResultQTy,
+WidthAndSignedness ResultInfo) {
+  assert(isSpecialUnsignedMultiplySignedResult(
+ Builtin::BI__builtin_mul_overflow, Op1Info, Op2Info, ResultInfo) &&
+ "Cannot specialize this multiply");
+
+  llvm::Value *V1 = CGF.EmitScalarExpr(Op1);
+  llvm::Value *V2 = CGF.EmitScalarExpr(Op2);
+
+  llvm::Value *HasOverflow;
+  llvm::Value *Result = EmitOverflowIntrinsic(
+  CGF, llvm::Intrinsic::umul_with_overflow, V1, V2, HasOverflow);
+
+  // The intrinsic call will detect overflow when the value is > UINT_MAX,
+  // however, since the original builtin had a 

[PATCH] D84405: CodeGen: Improve generated IR for __builtin_mul_overflow(uint, uint, int)

2020-07-28 Thread Tom Stellard via Phabricator via cfe-commits
tstellar marked an inline comment as done.
tstellar added inline comments.



Comment at: clang/test/CodeGen/builtins-overflow.c:123
+  // CHECK: br i1 [[C2]]
+  int r;
+  if (__builtin_mul_overflow(x, y, &r))

vsk wrote:
> vsk wrote:
> > Could you add a test for the volatile result case?
> I think this is still missing?
Yes, I forgot to add this, there is one in the latest patch now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84405/new/

https://reviews.llvm.org/D84405

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


[PATCH] D81424: Driver: Accept multiple --config options if filenames are the same

2020-06-08 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: sepavloff, hfinkel.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

We're trying to use the --config options to pass distro specific
options for Fedora via the CFLAGS variable.  However, some projects
end up using the CFLAGS variable multiple times in their command line,
which leads to an error when --config is used.

This patch resolves this issue by allowing more than one --config option
on the command line as long as the file names are the same.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81424

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/config-file.c


Index: clang/test/Driver/config-file.c
===
--- clang/test/Driver/config-file.c
+++ clang/test/Driver/config-file.c
@@ -71,3 +71,8 @@
 // RUN: %clang --config-system-dir=%S/Inputs/config 
--config-user-dir=%S/Inputs/config2 --config config-4 -S %s -o /dev/null -v 
2>&1 | FileCheck %s -check-prefix CHECK-PRECEDENCE
 // CHECK-PRECEDENCE: Configuration file: 
{{.*}}Inputs{{.}}config2{{.}}config-4.cfg
 // CHECK-PRECEDENCE: -Wall
+
+
+//--- Duplicate --config options are allowed if the value is the same
+// RUN: %clang --config-system-dir=%S/Inputs/config 
--config-user-dir=%S/Inputs/config2 --config config-4 --config config-4 -S %s 
-o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-SAME-CONFIG
+// CHECK-SAME-CONFIG: Configuration file: 
{{.*}}Inputs{{.}}config2{{.}}config-4.cfg
Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -833,8 +833,12 @@
 std::vector ConfigFiles =
 CLOptions->getAllArgValues(options::OPT_config);
 if (ConfigFiles.size() > 1) {
-  Diag(diag::err_drv_duplicate_config);
-  return true;
+  if (!std::all_of(
+  ConfigFiles.begin(), ConfigFiles.end(),
+  [ConfigFiles](std::string s) { return s == ConfigFiles[0]; })) {
+Diag(diag::err_drv_duplicate_config);
+return true;
+  }
 }
 
 if (!ConfigFiles.empty()) {


Index: clang/test/Driver/config-file.c
===
--- clang/test/Driver/config-file.c
+++ clang/test/Driver/config-file.c
@@ -71,3 +71,8 @@
 // RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config config-4 -S %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-PRECEDENCE
 // CHECK-PRECEDENCE: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
 // CHECK-PRECEDENCE: -Wall
+
+
+//--- Duplicate --config options are allowed if the value is the same
+// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config config-4 --config config-4 -S %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-SAME-CONFIG
+// CHECK-SAME-CONFIG: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -833,8 +833,12 @@
 std::vector ConfigFiles =
 CLOptions->getAllArgValues(options::OPT_config);
 if (ConfigFiles.size() > 1) {
-  Diag(diag::err_drv_duplicate_config);
-  return true;
+  if (!std::all_of(
+  ConfigFiles.begin(), ConfigFiles.end(),
+  [ConfigFiles](std::string s) { return s == ConfigFiles[0]; })) {
+Diag(diag::err_drv_duplicate_config);
+return true;
+  }
 }
 
 if (!ConfigFiles.empty()) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81424: Driver: Accept multiple --config options if filenames are the same

2020-06-16 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd970ab63e22e: Driver: Accept multiple --config options if 
filenames are the same (authored by tstellar).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81424/new/

https://reviews.llvm.org/D81424

Files:
  clang/lib/Driver/Driver.cpp
  clang/test/Driver/config-file.c


Index: clang/test/Driver/config-file.c
===
--- clang/test/Driver/config-file.c
+++ clang/test/Driver/config-file.c
@@ -71,3 +71,8 @@
 // RUN: %clang --config-system-dir=%S/Inputs/config 
--config-user-dir=%S/Inputs/config2 --config config-4 -S %s -o /dev/null -v 
2>&1 | FileCheck %s -check-prefix CHECK-PRECEDENCE
 // CHECK-PRECEDENCE: Configuration file: 
{{.*}}Inputs{{.}}config2{{.}}config-4.cfg
 // CHECK-PRECEDENCE: -Wall
+
+
+//--- Duplicate --config options are allowed if the value is the same
+// RUN: %clang --config-system-dir=%S/Inputs/config 
--config-user-dir=%S/Inputs/config2 --config config-4 --config config-4 -S %s 
-o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-SAME-CONFIG
+// CHECK-SAME-CONFIG: Configuration file: 
{{.*}}Inputs{{.}}config2{{.}}config-4.cfg
Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -833,8 +833,12 @@
 std::vector ConfigFiles =
 CLOptions->getAllArgValues(options::OPT_config);
 if (ConfigFiles.size() > 1) {
-  Diag(diag::err_drv_duplicate_config);
-  return true;
+  if (!std::all_of(
+  ConfigFiles.begin(), ConfigFiles.end(),
+  [ConfigFiles](std::string s) { return s == ConfigFiles[0]; })) {
+Diag(diag::err_drv_duplicate_config);
+return true;
+  }
 }
 
 if (!ConfigFiles.empty()) {


Index: clang/test/Driver/config-file.c
===
--- clang/test/Driver/config-file.c
+++ clang/test/Driver/config-file.c
@@ -71,3 +71,8 @@
 // RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config config-4 -S %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-PRECEDENCE
 // CHECK-PRECEDENCE: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
 // CHECK-PRECEDENCE: -Wall
+
+
+//--- Duplicate --config options are allowed if the value is the same
+// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config config-4 --config config-4 -S %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-SAME-CONFIG
+// CHECK-SAME-CONFIG: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
Index: clang/lib/Driver/Driver.cpp
===
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -833,8 +833,12 @@
 std::vector ConfigFiles =
 CLOptions->getAllArgValues(options::OPT_config);
 if (ConfigFiles.size() > 1) {
-  Diag(diag::err_drv_duplicate_config);
-  return true;
+  if (!std::all_of(
+  ConfigFiles.begin(), ConfigFiles.end(),
+  [ConfigFiles](std::string s) { return s == ConfigFiles[0]; })) {
+Diag(diag::err_drv_duplicate_config);
+return true;
+  }
 }
 
 if (!ConfigFiles.empty()) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78190: Add Bfloat IR type

2020-06-17 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: llvm/include/llvm-c/Core.h:149
   LLVMHalfTypeKind,/**< 16 bit floating point type */
+  LLVMBFloatTypeKind,  /**< 16 bit brain floating point type */
   LLVMFloatTypeKind,   /**< 32 bit floating point type */

Can you move this new enum value to the end of enum definition?  Adding it here 
changes the C ABI.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78190/new/

https://reviews.llvm.org/D78190



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


[PATCH] D82694: [clang-shlib] Don't link with static clang libraries

2020-07-10 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1d68a780b34e: [clang-shlib] Don't link with static 
clang libraries (authored by tstellar).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82694/new/

https://reviews.llvm.org/D82694

Files:
  clang/tools/clang-shlib/CMakeLists.txt


Index: clang/tools/clang-shlib/CMakeLists.txt
===
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -13,7 +13,12 @@
   else()
 list(APPEND _OBJECTS $)
   endif()
-  list(APPEND _DEPS $)
+  if (BUILD_SHARED_LIBS)
+# If we are building static libraries, then we don't need to add the static
+# libraries as a depedency, because we are already linking against the
+# individual object files.
+list(APPEND _DEPS $)
+  endif()
 
   # clang libraries are redundant since we are linking all the individual
   # object files into libclang-cpp.so, so filter them out from _DEPS.


Index: clang/tools/clang-shlib/CMakeLists.txt
===
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -13,7 +13,12 @@
   else()
 list(APPEND _OBJECTS $)
   endif()
-  list(APPEND _DEPS $)
+  if (BUILD_SHARED_LIBS)
+# If we are building static libraries, then we don't need to add the static
+# libraries as a depedency, because we are already linking against the
+# individual object files.
+list(APPEND _DEPS $)
+  endif()
 
   # clang libraries are redundant since we are linking all the individual
   # object files into libclang-cpp.so, so filter them out from _DEPS.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82694: [clang-shlib] Don't link with static clang libraries

2020-06-26 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added a reviewer: smeenai.
Herald added subscribers: cfe-commits, mgorny.
Herald added a project: clang.

If we are building static libraries we don't need to link them into
clang-shlib, since clang-shlib already has all the individual object
files linked in.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82694

Files:
  clang/tools/clang-shlib/CMakeLists.txt


Index: clang/tools/clang-shlib/CMakeLists.txt
===
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -13,7 +13,12 @@
   else()
 list(APPEND _OBJECTS $)
   endif()
-  list(APPEND _DEPS $)
+  if (BUILD_SHARED_LIBS)
+# If we are building static libraries, then we don't need to add the static
+# libraries as a depedency, because we are already linking against the
+# individual object files.
+list(APPEND _DEPS $)
+  endif()
 
   # clang libraries are redundant since we are linking all the individual
   # object files into libclang-cpp.so, so filter them out from _DEPS.


Index: clang/tools/clang-shlib/CMakeLists.txt
===
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -13,7 +13,12 @@
   else()
 list(APPEND _OBJECTS $)
   endif()
-  list(APPEND _DEPS $)
+  if (BUILD_SHARED_LIBS)
+# If we are building static libraries, then we don't need to add the static
+# libraries as a depedency, because we are already linking against the
+# individual object files.
+list(APPEND _DEPS $)
+  endif()
 
   # clang libraries are redundant since we are linking all the individual
   # object files into libclang-cpp.so, so filter them out from _DEPS.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79279: Add overloaded versions of builtin mem* functions

2020-08-06 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D79279#2200916 , @rsmith wrote:

> In D79279#2197176 , @rjmccall wrote:
>
>> I thought part of the point of `__builtin_memcpy` was so that C library 
>> headers could do `#define memcpy(x, y, z) __builtin_memcpy(x, y, z)`.  If 
>> so, the conformance issue touches `__builtin_memcpy` as well, not just calls 
>> to the library builtin.
>
> They would have to declare it as well (because C code can `#undef memcpy` and 
> expect to then be able to call a real function), so the `#define` would be 
> pointless.  It doesn't look like glibc does anything like this; do you know 
> of a C standard library implementation that does?
>
> If we want to follow that path, then we'll presumably (eventually) want 
> address-space-`_overloaded` versions of all lib builtins that take pointers 
> -- looks like that's around 60 functions total. That said, I do wonder how 
> many of the functions in question that we're implicitly overloading on 
> address space actually support such overloading -- certainly any of them that 
> we lower to a call to a library function is going to go wrong at runtime.
>
> +@tstellar, who added this functionality in r233706 -- what was the intent 
> here?

The goal of this patch was to avoid having to overload all the builtin with 
address spaces, which would be a lot of new builtins, but this functionality 
was added for targets that do not have a memcpy lib call, so I didn't consider 
the case where a libcall would be emitted.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79279/new/

https://reviews.llvm.org/D79279

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


[PATCH] D74051: Move update_cc_test_checks.py tests to clang

2020-08-11 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D74051#2017115 , @mgorny wrote:

> Nevermind, I figured out good enough workaround.

What was the workaround?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74051/new/

https://reviews.llvm.org/D74051

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


[PATCH] D85844: [Driver] Change -fnostack-clash-protection to -fno-stack-clash-protection

2020-08-12 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

LGTM. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85844/new/

https://reviews.llvm.org/D85844

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


[PATCH] D79617: Add cet.h for writing CET-enabled assembly code

2020-05-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar reopened this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

Did @rsmith ever approve this patch?  I was following the discussion at 
llvm.org/PR45484 but did not see an explicit approval.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79617/new/

https://reviews.llvm.org/D79617



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


[PATCH] D34848: Driver: Don't mix system tools with devtoolset tools on RHEL

2017-12-12 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Ping.


https://reviews.llvm.org/D34848



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


[PATCH] D125624: [gold] Remove an external dependency to GNU binutils' header file

2022-06-28 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D125624#3614298 , @ruiu wrote:

> In D125624#3552770 , @tstellar 
> wrote:
>
>> In D125624#3552463 , @ruiu wrote:
>>
 OK, as I mentioned. I think we need an attorney to review this change and 
 confirm that it actually accomplishes this goal.
>>>
>>> Can you add an attorney as a reviewer of this change so that we can proceed?
>>
>> Yes, I've notified @tonic and she will reach out to the attorney.
>
> @tstellar @tonic Did you guys get any response from the attorney?

Yes, the header file will still be GPLv3 licensed even if it's copied into the 
LLVM tree, so even if we were to do this change, LLVMgold would still be GPLv3.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125624/new/

https://reviews.llvm.org/D125624

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


[PATCH] D123967: Disable update_cc_test_checks.py tests in stand-alone builds

2022-06-28 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

ping.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123967/new/

https://reviews.llvm.org/D123967

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


[PATCH] D128777: clang/cmake: Drop use of llvm-config for LLVM install discovery

2022-06-28 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
Herald added a subscriber: mgorny.
Herald added a project: All.
tstellar requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This has been deprecated for a while, remove it in favor of using
cmake's find_package() function.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128777

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -15,76 +15,16 @@
   set(CMAKE_CXX_STANDARD_REQUIRED YES)
   set(CMAKE_CXX_EXTENSIONS NO)
 
-  # Rely on llvm-config.
-  set(LLVM_CONFIG_OUTPUT)
-  if(LLVM_CONFIG)
-set (LLVM_CONFIG_FOUND 1)
-message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
-message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
-  deprecated.  The installed cmake files should be used \
-  instead.  CMake should be able to detect your LLVM install \
-  automatically, but you can also use LLVM_DIR to specify \
-  the path containing LLVMConfig.cmake.")
-set(CONFIG_COMMAND ${LLVM_CONFIG}
-  "--includedir"
-  "--prefix"
-  "--src-root"
-  "--cmakedir"
-  "--bindir"
-  "--libdir"
-  "--assertion-mode"
-  )
-execute_process(
-  COMMAND ${CONFIG_COMMAND}
-  RESULT_VARIABLE HAD_ERROR
-  OUTPUT_VARIABLE LLVM_CONFIG_OUTPUT
-)
-if(NOT HAD_ERROR)
-  string(REGEX REPLACE
-"[ \t]*[\r\n]+[ \t]*" ";"
-LLVM_CONFIG_OUTPUT ${LLVM_CONFIG_OUTPUT})
-else()
-  string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
-  message(STATUS "${CONFIG_COMMAND_STR}")
-  message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
-endif()
-
-list(GET LLVM_CONFIG_OUTPUT 0 MAIN_INCLUDE_DIR)
-list(GET LLVM_CONFIG_OUTPUT 1 LLVM_OBJ_ROOT)
-list(GET LLVM_CONFIG_OUTPUT 2 MAIN_SRC_DIR)
-list(GET LLVM_CONFIG_OUTPUT 3 LLVM_CONFIG_CMAKE_DIR)
-list(GET LLVM_CONFIG_OUTPUT 4 TOOLS_BINARY_DIR)
-list(GET LLVM_CONFIG_OUTPUT 5 LIBRARY_DIR)
-list(GET LLVM_CONFIG_OUTPUT 6 ENABLE_ASSERTIONS)
-
-# Normalize LLVM_CMAKE_DIR. --cmakedir might contain backslashes.
-# CMake assumes slashes as PATH.
-file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_DIR} LLVM_CMAKE_DIR)
-  endif()
-
-
-  if(NOT MSVC_IDE)
-set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
-  CACHE BOOL "Enable assertions")
-# Assertions should follow llvm-config's.
-mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
-  endif()
-
   find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
   list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
 
-  # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
-  # LLVM_CONFIG.
-  if (NOT LLVM_CONFIG_FOUND)
-# Pull values from LLVMConfig.cmake.  We can drop this once the llvm-config
-# path is removed.
-set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}")
-set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
-# N.B. this is just a default value, the CACHE PATHs below can be 
overriden.
-set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
-set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
-  endif()
+  # Pull values from LLVMConfig.cmake.
+  set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}")
+  set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
+  # N.B. this is just a default value, the CACHE PATHs below can be overriden.
+  set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
+  set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
+  set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
 
   set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to 
llvm/include")
   set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -15,76 +15,16 @@
   set(CMAKE_CXX_STANDARD_REQUIRED YES)
   set(CMAKE_CXX_EXTENSIONS NO)
 
-  # Rely on llvm-config.
-  set(LLVM_CONFIG_OUTPUT)
-  if(LLVM_CONFIG)
-set (LLVM_CONFIG_FOUND 1)
-message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
-message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
-  deprecated.  The installed cmake files should be used \
-  instead.  CMake should be able to detect your LLVM install \
-  automatically, but you can also use LLVM_DIR to specify \
-  the path containing LLVMConfig.cmake.")
-set(CONFIG_COMMAND ${LLVM_CONFIG}
-  "--includedir"
-  "--prefix"
-  "--src-root"
-  "--cmakedir"
-  "--bindir"
-  "--libdir"
-  "--assertion-mode"
-  )
-execute_process(
-  COMMAND ${CONFIG_COMMAND}
-  RESULT_VARIABLE HAD_ERROR
-  OUTPUT_VARIABLE LLVM_CONFIG_OUTPUT
-)
-if(NOT HAD_ERROR)
-  string(REGEX REPLACE
-"[ \t]*[\r\n]+[ \t]*" ";"
-L

[PATCH] D129160: libclang.so: Make SONAME the same as LLVM version

2022-07-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: MaskRay, h-vetinari.
Herald added subscribers: StephenFan, fedor.sergeev, mgorny.
Herald added a project: All.
tstellar requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This partially reverts c7b3a91017d26266d7556b1ac7c49b06f0109b91 
.  Having
libclang.so with a different SONAME than the other LLVM libraries was
causing a lot of confusion for users.  Also, this change did not really
acheive it's purpose of allowing apps to use newer versions of
libclang.so without rebuilding, because a new version of libclang.so
requires a new version of libLLVM.so, which does not have a stable ABI.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129160

Files:
  clang/tools/libclang/CMakeLists.txt
  clang/tools/libclang/libclang.exports
  clang/tools/libclang/libclang.map
  clang/tools/libclang/linker-script-to-export-list.py

Index: clang/tools/libclang/linker-script-to-export-list.py
===
--- clang/tools/libclang/linker-script-to-export-list.py
+++ /dev/null
@@ -1,11 +0,0 @@
-import re
-import os
-import sys
-
-input_file = open(sys.argv[1])
-output_file = open(sys.argv[2], 'w')
-
-for line in input_file:
-m = re.search('^\s+(clang_[^;]+)', line)
-if m:
-output_file.write(m.group(1) + "\n")
Index: clang/tools/libclang/libclang.map
===
--- clang/tools/libclang/libclang.map
+++ /dev/null
@@ -1,413 +0,0 @@
-# If you add a symbol to this file, make sure to add it with the correct
-# version.  For example, if the LLVM main branch is LLVM 14.0.0, add new
-# symbols with the version LLVM_14.
-# On platforms where versions scripts are not used, this file will be used to
-# generate a list of exports for libclang.so
-
-LLVM_13 {
-  global:
-clang_BlockCommandComment_getArgText;
-clang_BlockCommandComment_getCommandName;
-clang_BlockCommandComment_getNumArgs;
-clang_BlockCommandComment_getParagraph;
-clang_CXCursorSet_contains;
-clang_CXCursorSet_insert;
-clang_CXIndex_getGlobalOptions;
-clang_CXIndex_setGlobalOptions;
-clang_CXIndex_setInvocationEmissionPathOption;
-clang_CXRewriter_create;
-clang_CXRewriter_dispose;
-clang_CXRewriter_insertTextBefore;
-clang_CXRewriter_overwriteChangedFiles;
-clang_CXRewriter_removeText;
-clang_CXRewriter_replaceText;
-clang_CXRewriter_writeMainFileToStdOut;
-clang_CXXConstructor_isConvertingConstructor;
-clang_CXXConstructor_isCopyConstructor;
-clang_CXXConstructor_isDefaultConstructor;
-clang_CXXConstructor_isMoveConstructor;
-clang_CXXField_isMutable;
-clang_CXXMethod_isConst;
-clang_CXXMethod_isDefaulted;
-clang_CXXMethod_isPureVirtual;
-clang_CXXMethod_isStatic;
-clang_CXXMethod_isVirtual;
-clang_CXXRecord_isAbstract;
-clang_Comment_getChild;
-clang_Comment_getKind;
-clang_Comment_getNumChildren;
-clang_Comment_isWhitespace;
-clang_CompilationDatabase_dispose;
-clang_CompilationDatabase_fromDirectory;
-clang_CompilationDatabase_getAllCompileCommands;
-clang_CompilationDatabase_getCompileCommands;
-clang_CompileCommand_getArg;
-clang_CompileCommand_getDirectory;
-clang_CompileCommand_getFilename;
-clang_CompileCommand_getMappedSourceContent;
-clang_CompileCommand_getMappedSourcePath;
-clang_CompileCommand_getNumArgs;
-clang_CompileCommand_getNumMappedSources;
-clang_CompileCommands_dispose;
-clang_CompileCommands_getCommand;
-clang_CompileCommands_getSize;
-clang_Cursor_Evaluate;
-clang_Cursor_getArgument;
-clang_Cursor_getBriefCommentText;
-clang_Cursor_getCXXManglings;
-clang_Cursor_getCommentRange;
-clang_Cursor_getMangling;
-clang_Cursor_getModule;
-clang_Cursor_getNumArguments;
-clang_Cursor_getNumTemplateArguments;
-clang_Cursor_getObjCDeclQualifiers;
-clang_Cursor_getObjCManglings;
-clang_Cursor_getObjCPropertyAttributes;
-clang_Cursor_getObjCPropertyGetterName;
-clang_Cursor_getObjCPropertySetterName;
-clang_Cursor_getObjCSelectorIndex;
-clang_Cursor_getOffsetOfField;
-clang_Cursor_getParsedComment;
-clang_Cursor_getRawCommentText;
-clang_Cursor_getReceiverType;
-clang_Cursor_getSpellingNameRange;
-clang_Cursor_getStorageClass;
-clang_Cursor_getTemplateArgumentKind;
-clang_Cursor_getTemplateArgumentType;
-clang_Cursor_getTemplateArgumentUnsignedValue;
-clang_Cursor_getTemplateArgumentValue;
-clang_Cursor_getTranslationUnit;
-clang_Cursor_getVarDeclInitializer;
-clang_Cursor_hasAttrs;
-clang_Cursor_hasVarDeclExternalStorage;
-clang_Cursor_hasVarDeclGlobalStorage;
-clang_Cursor_isAnonymous;
-clang_Cursor_isAnonymousRecordDecl;
-clang_Curs

[PATCH] D109621: [clang][Driver] Default to loading clang.cfg if config file not specified

2022-07-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

I similar RFC for this was proposed here: 
https://discourse.llvm.org/t/rfc-adding-a-default-file-location-to-config-file-support/63606


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109621/new/

https://reviews.llvm.org/D109621

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


[PATCH] D122487: [ARM] Make testcase warning pattern match more specific

2022-03-25 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

The reason I used a minimal check string is because if the warning text changes 
at all, then the test becomes useful (this is the downside of using -NOT).  I 
wonder if there is another way to test this that might be robust?  If not, then 
I think this change is fine.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122487/new/

https://reviews.llvm.org/D122487

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


[PATCH] D122487: [ARM] Make testcase warning pattern match more specific

2022-03-25 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

In D122487#3408425 , @rs wrote:

> @tstellar thanks for the review. I can't really think of any other way to 
> test this. I'll wait till Monday if no one else has suggested anything else 
> then I'll commit it. Thanks again.

OK, sounds good.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122487/new/

https://reviews.llvm.org/D122487

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


  1   2   3   4   >