[PATCH] D12036: We shouldn't need to pass -fno-strict-aliasing when building clang with clang.
Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 18 09:16:40 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL245304: We shouldn't need to pass -fno-strict-aliasing when building clang with clang. (authored by cbieneman).
Changed prior to commit:
http://reviews.llvm.org/D12036?vs=32349&id=32420#toc
Repository:
rL LLVM
http://reviews.llvm.org/D12036
Files:
cfe/trunk/CMakeLists.txt
cfe/trunk/Makefile
Index: cfe/trunk/Makefile
===================================================================
--- cfe/trunk/Makefile
+++ cfe/trunk/Makefile
@@ -67,8 +67,11 @@
# http://gcc.gnu.org/PR41874
# http://gcc.gnu.org/PR41838
#
-# We can revisit this when LLVM/Clang support it.
+# We don't need to do this if the host compiler is clang.
+ifeq ($(CXX_COMPILER), "clang")
CXX.Flags += -fno-strict-aliasing
+endif
+
# Set up Clang's tblgen.
ifndef CLANG_TBLGEN
Index: cfe/trunk/CMakeLists.txt
===================================================================
--- cfe/trunk/CMakeLists.txt
+++ cfe/trunk/CMakeLists.txt
@@ -253,7 +253,10 @@
# Add appropriate flags for GCC
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -fno-strict-aliasing")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual")
+ if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
+ endif ()
# Enable -pedantic for Clang even if it's not enabled for LLVM.
if (NOT LLVM_ENABLE_PEDANTIC)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12036.32420.patch
Type: text/x-patch
Size: 1128 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150818/6a3a9379/attachment.bin>
More information about the cfe-commits
mailing list