[PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-11 Thread don hinton via Phabricator via cfe-commits
hintonda closed this revision.
hintonda added a comment.

Committed in r305169.


https://reviews.llvm.org/D17143



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


[PATCH] D33478: [libclang] When getting platform availabilities, merge multiple declarations if possible

2017-06-11 Thread Ronald Wampler via Phabricator via cfe-commits
rdwampler updated this revision to Diff 102150.
rdwampler added a comment.

I was able to build and test this on a linux box. The issue was the whitespace 
surrounding the regex.

On Linux, `(unavailable)` is not present. I.e,
`FunctionDecl=foo:3:6  (ios, introduced=3.2, deprecated=4.1)  (macos, 
introduced=10.4, deprecated=10.5, obsoleted=10.7)`
vs on macOS
`FunctionDecl=foo:3:6 (unavailable)  (ios, introduced=3.2, deprecated=4.1) 
(unavailable)  (macos, introduced=10.4, deprecated=10.5, obsoleted=10.7)`

I changed it to just match any characters between the function declaration and 
the availabilities.

Sorry for the noise.


https://reviews.llvm.org/D33478

Files:
  test/Index/availability.c
  tools/libclang/CIndex.cpp

Index: tools/libclang/CIndex.cpp
===
--- tools/libclang/CIndex.cpp
+++ tools/libclang/CIndex.cpp
@@ -7216,15 +7216,11 @@
   return Out;
 }
 
-static int getCursorPlatformAvailabilityForDecl(const Decl *D,
-int *always_deprecated,
-CXString *deprecated_message,
-int *always_unavailable,
-CXString *unavailable_message,
-   CXPlatformAvailability *availability,
-int availability_size) {
+static void getCursorPlatformAvailabilityForDecl(
+const Decl *D, int *always_deprecated, CXString *deprecated_message,
+int *always_unavailable, CXString *unavailable_message,
+SmallVectorImpl ) {
   bool HadAvailAttr = false;
-  int N = 0;
   for (auto A : D->attrs()) {
 if (DeprecatedAttr *Deprecated = dyn_cast(A)) {
   HadAvailAttr = true;
@@ -7236,7 +7232,7 @@
   }
   continue;
 }
-
+
 if (UnavailableAttr *Unavailable = dyn_cast(A)) {
   HadAvailAttr = true;
   if (always_unavailable)
@@ -7247,38 +7243,71 @@
   }
   continue;
 }
-
+
 if (AvailabilityAttr *Avail = dyn_cast(A)) {
+  AvailabilityAttrs.push_back(Avail);
   HadAvailAttr = true;
-  if (N < availability_size) {
-availability[N].Platform
-  = cxstring::createDup(Avail->getPlatform()->getName());
-availability[N].Introduced = convertVersion(Avail->getIntroduced());
-availability[N].Deprecated = convertVersion(Avail->getDeprecated());
-availability[N].Obsoleted = convertVersion(Avail->getObsoleted());
-availability[N].Unavailable = Avail->getUnavailable();
-availability[N].Message = cxstring::createDup(Avail->getMessage());
-  }
-  ++N;
 }
   }
 
   if (!HadAvailAttr)
 if (const EnumConstantDecl *EnumConst = dyn_cast(D))
   return getCursorPlatformAvailabilityForDecl(
-cast(EnumConst->getDeclContext()),
-  always_deprecated,
-  deprecated_message,
-  always_unavailable,
-  unavailable_message,
-  availability,
-  availability_size);
-  
-  return N;
+  cast(EnumConst->getDeclContext()), always_deprecated,
+  deprecated_message, always_unavailable, unavailable_message,
+  AvailabilityAttrs);
+
+  if (AvailabilityAttrs.empty())
+return;
+
+  std::sort(AvailabilityAttrs.begin(), AvailabilityAttrs.end(),
+[](AvailabilityAttr *LHS, AvailabilityAttr *RHS) {
+  return LHS->getPlatform() > RHS->getPlatform();
+});
+  ASTContext  = D->getASTContext();
+  auto It = std::unique(
+  AvailabilityAttrs.begin(), AvailabilityAttrs.end(),
+  [](AvailabilityAttr *LHS, AvailabilityAttr *RHS) {
+if (LHS->getPlatform() != RHS->getPlatform())
+  return false;
+
+if (LHS->getIntroduced() == RHS->getIntroduced() &&
+LHS->getDeprecated() == RHS->getDeprecated() &&
+LHS->getObsoleted() == RHS->getObsoleted() &&
+LHS->getMessage() == RHS->getMessage() &&
+LHS->getReplacement() == RHS->getReplacement())
+  return true;
+
+if ((!LHS->getIntroduced().empty() && !RHS->getIntroduced().empty()) ||
+(!LHS->getDeprecated().empty() && !RHS->getDeprecated().empty()) ||
+(!LHS->getObsoleted().empty() && !RHS->getObsoleted().empty()))
+  return false;
+
+if (LHS->getIntroduced().empty() && !RHS->getIntroduced().empty())
+  LHS->setIntroduced(Ctx, RHS->getIntroduced());
+
+if (LHS->getDeprecated().empty() && !RHS->getDeprecated().empty()) {
+  LHS->setDeprecated(Ctx, RHS->getDeprecated());
+  if (LHS->getMessage().empty())
+

[PATCH] D34082: [Frontend 'Show hotness' can be used with a sampling profile

2017-06-11 Thread Brian Gesiak via Phabricator via cfe-commits
modocache updated this revision to Diff 102153.
modocache added a comment.

Thanks for the suggestions! I moved the sampling test close to the instrumented 
one, and adjusted bar and foo entry count in the hopes og getting the remarks 
to include hotness. No luck, however -- the test currently fails. I will look 
deeper into how hotness and sampling profiles work.


https://reviews.llvm.org/D34082

Files:
  lib/Frontend/CompilerInvocation.cpp
  test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
  test/Frontend/optimization-remark-with-hotness.c


Index: test/Frontend/optimization-remark-with-hotness.c
===
--- test/Frontend/optimization-remark-with-hotness.c
+++ test/Frontend/optimization-remark-with-hotness.c
@@ -1,11 +1,21 @@
+// Generate instrumentation and sampling profile data.
 // RUN: llvm-profdata merge \
-// RUN: %S/Inputs/optimization-remark-with-hotness.proftext   \
+// RUN: %S/Inputs/optimization-remark-with-hotness.proftext \
 // RUN: -o %t.profdata
+// RUN: llvm-profdata merge -sample \
+// RUN: %S/Inputs/optimization-remark-with-hotness-sample.proftext \
+// RUN: -o %t-sample.profdata
+//
 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \
 // RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \
 // RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \
 // RUN: -Rpass-analysis=inline -Rpass-missed=inline \
 // RUN: -fdiagnostics-show-hotness -verify
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \
+// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \
+// RUN: -fprofile-sample-use=%t-sample.profdata -Rpass=inline \
+// RUN: -Rpass-analysis=inline -Rpass-missed=inline \
+// RUN: -fdiagnostics-show-hotness -verify
 // The clang version of the previous test.
 // RUN: %clang -target x86_64-apple-macosx10.9 %s -c -emit-llvm -o /dev/null \
 // RUN: -fprofile-instr-use=%t.profdata -Rpass=inline \
Index: test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
===
--- /dev/null
+++ test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
@@ -0,0 +1,6 @@
+bar:10:10
+  1: foo:10:10
+1: 10
+main:10:0
+  1: 10
+
Index: lib/Frontend/CompilerInvocation.cpp
===
--- lib/Frontend/CompilerInvocation.cpp
+++ lib/Frontend/CompilerInvocation.cpp
@@ -884,14 +884,18 @@
 
   Opts.DiagnosticsWithHotness =
   Args.hasArg(options::OPT_fdiagnostics_show_hotness);
+  bool UsingSampleProfile = !Opts.SampleProfileFile.empty();
+
   if (Opts.DiagnosticsWithHotness &&
-  Opts.getProfileUse() == CodeGenOptions::ProfileNone)
+  Opts.getProfileUse() == CodeGenOptions::ProfileNone &&
+  !UsingSampleProfile) {
 Diags.Report(diag::warn_drv_fdiagnostics_show_hotness_requires_pgo);
+  }
 
   // If the user requested to use a sample profile for PGO, then the
   // backend will need to track source location information so the profile
   // can be incorporated into the IR.
-  if (!Opts.SampleProfileFile.empty())
+  if (UsingSampleProfile)
 NeedLocTracking = true;
 
   // If the user requested a flag that requires source locations available in


Index: test/Frontend/optimization-remark-with-hotness.c
===
--- test/Frontend/optimization-remark-with-hotness.c
+++ test/Frontend/optimization-remark-with-hotness.c
@@ -1,11 +1,21 @@
+// Generate instrumentation and sampling profile data.
 // RUN: llvm-profdata merge \
-// RUN: %S/Inputs/optimization-remark-with-hotness.proftext   \
+// RUN: %S/Inputs/optimization-remark-with-hotness.proftext \
 // RUN: -o %t.profdata
+// RUN: llvm-profdata merge -sample \
+// RUN: %S/Inputs/optimization-remark-with-hotness-sample.proftext \
+// RUN: -o %t-sample.profdata
+//
 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \
 // RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \
 // RUN: -fprofile-instrument-use-path=%t.profdata -Rpass=inline \
 // RUN: -Rpass-analysis=inline -Rpass-missed=inline \
 // RUN: -fdiagnostics-show-hotness -verify
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name \
+// RUN: optimization-remark-with-hotness.c %s -emit-llvm-only \
+// RUN: -fprofile-sample-use=%t-sample.profdata -Rpass=inline \
+// RUN: -Rpass-analysis=inline -Rpass-missed=inline \
+// RUN: -fdiagnostics-show-hotness -verify
 // The clang version of the previous test.
 // RUN: %clang -target x86_64-apple-macosx10.9 %s -c -emit-llvm -o /dev/null \
 // RUN: -fprofile-instr-use=%t.profdata -Rpass=inline \
Index: test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
===
--- /dev/null
+++ 

[PATCH] D34096: [Sema][C++1z] Ensure structured binding's bindings in dependent foreach have non-null type

2017-06-11 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

LGTM


https://reviews.llvm.org/D34096



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


[PATCH] D34096: [Sema][C++1z] Ensure structured binding's bindings in dependent foreach have non-null type

2017-06-11 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington created this revision.

A DecompositionDecls' bindings have a null type until the initializer is 
attached, if the initializer is dependent, then the bindings should be set to 
have dependent type. For non-foreach bindings, this is done in 
Sema::CheckCompleteDecompositionDeclaration(), this patch ensures that this is 
done to bindings in a foreach as well. Fixes PR32172.

Thanks for taking a look!
Erik


https://reviews.llvm.org/D34096

Files:
  lib/Sema/SemaStmt.cpp
  test/SemaCXX/cxx1z-decomposition.cpp


Index: test/SemaCXX/cxx1z-decomposition.cpp
===
--- test/SemaCXX/cxx1z-decomposition.cpp
+++ test/SemaCXX/cxx1z-decomposition.cpp
@@ -70,4 +70,10 @@
   return foobar_; // expected-error {{undeclared identifier 'foobar_'}}
 }
 
+// PR32172
+template  void dependent_foreach(T t) {
+  for (auto [a,b,c] : t)
+a,b,c;
+}
+
 // FIXME: by-value array copies
Index: lib/Sema/SemaStmt.cpp
===
--- lib/Sema/SemaStmt.cpp
+++ lib/Sema/SemaStmt.cpp
@@ -2206,8 +2206,12 @@
 
 // Deduce any 'auto's in the loop variable as 'DependentTy'. We'll fill
 // them in properly when we instantiate the loop.
-if (!LoopVar->isInvalidDecl() && Kind != BFRK_Check)
+if (!LoopVar->isInvalidDecl() && Kind != BFRK_Check) {
+  if (auto *DD = dyn_cast(LoopVar))
+for (auto *Binding : DD->bindings())
+  Binding->setType(Context.DependentTy);
   LoopVar->setType(SubstAutoType(LoopVar->getType(), Context.DependentTy));
+}
   } else if (!BeginDeclStmt.get()) {
 SourceLocation RangeLoc = RangeVar->getLocation();
 


Index: test/SemaCXX/cxx1z-decomposition.cpp
===
--- test/SemaCXX/cxx1z-decomposition.cpp
+++ test/SemaCXX/cxx1z-decomposition.cpp
@@ -70,4 +70,10 @@
   return foobar_; // expected-error {{undeclared identifier 'foobar_'}}
 }
 
+// PR32172
+template  void dependent_foreach(T t) {
+  for (auto [a,b,c] : t)
+a,b,c;
+}
+
 // FIXME: by-value array copies
Index: lib/Sema/SemaStmt.cpp
===
--- lib/Sema/SemaStmt.cpp
+++ lib/Sema/SemaStmt.cpp
@@ -2206,8 +2206,12 @@
 
 // Deduce any 'auto's in the loop variable as 'DependentTy'. We'll fill
 // them in properly when we instantiate the loop.
-if (!LoopVar->isInvalidDecl() && Kind != BFRK_Check)
+if (!LoopVar->isInvalidDecl() && Kind != BFRK_Check) {
+  if (auto *DD = dyn_cast(LoopVar))
+for (auto *Binding : DD->bindings())
+  Binding->setType(Context.DependentTy);
   LoopVar->setType(SubstAutoType(LoopVar->getType(), Context.DependentTy));
+}
   } else if (!BeginDeclStmt.get()) {
 SourceLocation RangeLoc = RangeVar->getLocation();
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34018: Support __float128 on NetBSD libstdc++ x86/x86_64

2017-06-11 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment.

Is this sufficient as a test:

  $NetBSD$
  
  --- test/Sema/128bitfloat.cpp.orig2017-05-29 10:06:54.0 +
  +++ test/Sema/128bitfloat.cpp
  @@ -4,6 +4,8 @@
   // RUN: %clang_cc1 -triple i686-windows-gnu -verify -std=c++11 %s
   // RUN: %clang_cc1 -triple x86_64-windows-gnu -verify -std=c++11 %s
   // RUN: %clang_cc1 -triple x86_64-windows-msvc -verify -std=c++11 %s
  +// RUN: %clang_cc1 -triple i386--netbsd -verify -std=c++11 %s
  +// RUN: %clang_cc1 -triple x86_64--netbsd -verify -std=c++11 %s
   
   #if defined(__FLOAT128__) || defined(__SIZEOF_FLOAT128__)
   __float128 f;
  ``


Repository:
  rL LLVM

https://reviews.llvm.org/D34018



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


[libcxxabi] r305175 - build: use cmake to pass -std=c++11

2017-06-11 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Jun 11 18:59:26 2017
New Revision: 305175

URL: http://llvm.org/viewvc/llvm-project?rev=305175=rev
Log:
build: use cmake to pass -std=c++11

Rather than manually checking for support for the spelling of the C++
standard, indicate to CMake that we require that the compiler support
C++11 and that we compile without the GNU extensions.  This simplifies
the flags handling in libc++abi itself by relying on CMake to translate
the flag and add it as appropriate.

Modified:
libcxxabi/trunk/cmake/config-ix.cmake
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/cmake/config-ix.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/cmake/config-ix.cmake?rev=305175=305174=305175=diff
==
--- libcxxabi/trunk/cmake/config-ix.cmake (original)
+++ libcxxabi/trunk/cmake/config-ix.cmake Sun Jun 11 18:59:26 2017
@@ -81,11 +81,6 @@ check_cxx_compiler_flag(/EHsc
 check_cxx_compiler_flag(/EHs- LIBCXXABI_HAS_NO_EHS_FLAG)
 check_cxx_compiler_flag(/EHa- LIBCXXABI_HAS_NO_EHA_FLAG)
 check_cxx_compiler_flag(/GR-  LIBCXXABI_HAS_NO_GR_FLAG)
-check_cxx_compiler_flag(-std=c++11LIBCXXABI_HAS_STD_CXX11)
-
-if(LIBCXXABI_HAS_STD_CXX11)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-endif()
 
 # Check libraries
 check_library_exists(dl dladdr "" LIBCXXABI_HAS_DL_LIB)

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=305175=305174=305175=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Sun Jun 11 18:59:26 2017
@@ -111,6 +111,12 @@ endif()
 add_library(cxxabi_objects OBJECT ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
 set_target_properties(cxxabi_objects
   PROPERTIES
+CXX_EXTENSIONS
+  OFF
+CXX_STANDARD
+  11
+CXX_STANDARD_REQUIRED
+  ON
 COMPILE_FLAGS
   "${LIBCXXABI_COMPILE_FLAGS}"
 POSITION_INDEPENDENT_CODE
@@ -124,6 +130,12 @@ if (LIBCXXABI_ENABLE_SHARED)
   target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})
   set_target_properties(cxxabi_shared
 PROPERTIES
+  CXX_EXTENSIONS
+OFF
+  CXX_STANDARD
+11
+  CXX_STANDARD_REQUIRED
+ON
   LINK_FLAGS
 "${LIBCXXABI_LINK_FLAGS} 
${LIBCXXABI_SHARED_LINK_FLAGS}"
   OUTPUT_NAME
@@ -143,6 +155,12 @@ if (LIBCXXABI_ENABLE_STATIC)
   target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES})
   set_target_properties(cxxabi_static
 PROPERTIES
+  CXX_EXTENSIONS
+OFF
+  CXX_STANDARD
+11
+  CXX_STANDARD_REQUIRED
+ON
   LINK_FLAGS
 "${LIBCXXABI_LINK_FLAGS}"
   OUTPUT_NAME


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


[libcxxabi] r305174 - build: use POSITION_INDEPENDENT_CODE CMake property

2017-06-11 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Jun 11 18:59:24 2017
New Revision: 305174

URL: http://llvm.org/viewvc/llvm-project?rev=305174=rev
Log:
build: use POSITION_INDEPENDENT_CODE CMake property

Use the POSITION_INDEPENDENT_CODE target property to indicate that we
should be building with -fPIC or the equivalent flag based on the
toolchain that we are using.  This makes the check more portable and
simplifies the flags management.  Because we don't want this setting to
propagate in the case of an in-tree build, set the property on the
targets we construct explicitly rather than setting
CMAKE_POSITION_INDEPENDENT_CODE to ON globally.

Modified:
libcxxabi/trunk/cmake/config-ix.cmake
libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/cmake/config-ix.cmake
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/cmake/config-ix.cmake?rev=305174=305173=305174=diff
==
--- libcxxabi/trunk/cmake/config-ix.cmake (original)
+++ libcxxabi/trunk/cmake/config-ix.cmake Sun Jun 11 18:59:24 2017
@@ -50,7 +50,6 @@ endif ()
 
 # Check compiler flags
 check_c_compiler_flag(-funwind-tables LIBCXXABI_HAS_FUNWIND_TABLES)
-check_cxx_compiler_flag(-fPIC LIBCXXABI_HAS_FPIC_FLAG)
 check_cxx_compiler_flag(-fno-exceptions   LIBCXXABI_HAS_NO_EXCEPTIONS_FLAG)
 check_cxx_compiler_flag(-fno-rtti LIBCXXABI_HAS_NO_RTTI_FLAG)
 check_cxx_compiler_flag(-fstrict-aliasing 
LIBCXXABI_HAS_FSTRICT_ALIASING_FLAG)

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=305174=305173=305174=diff
==
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Sun Jun 11 18:59:24 2017
@@ -77,7 +77,6 @@ if (MINGW)
 endif()
 
 # Setup flags.
-add_compile_flags_if_supported(-fPIC)
 add_link_flags_if_supported(-nodefaultlibs)
 
 set(LIBCXXABI_SHARED_LINK_FLAGS)
@@ -110,11 +109,12 @@ endif()
 
 # Add a object library that contains the compiled source files.
 add_library(cxxabi_objects OBJECT ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
-
 set_target_properties(cxxabi_objects
-  PROPERTIES
-COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}"
-  )
+  PROPERTIES
+COMPILE_FLAGS
+  "${LIBCXXABI_COMPILE_FLAGS}"
+POSITION_INDEPENDENT_CODE
+  ON)
 
 set(LIBCXXABI_TARGETS)
 
@@ -123,12 +123,17 @@ if (LIBCXXABI_ENABLE_SHARED)
   add_library(cxxabi_shared SHARED $)
   target_link_libraries(cxxabi_shared ${LIBCXXABI_LIBRARIES})
   set_target_properties(cxxabi_shared
-PROPERTIES
-  LINK_FLAGS"${LIBCXXABI_LINK_FLAGS} ${LIBCXXABI_SHARED_LINK_FLAGS}"
-  OUTPUT_NAME   "c++abi"
-  VERSION   "1.0"
-  SOVERSION "1"
-)
+PROPERTIES
+  LINK_FLAGS
+"${LIBCXXABI_LINK_FLAGS} 
${LIBCXXABI_SHARED_LINK_FLAGS}"
+  OUTPUT_NAME
+"c++abi"
+  POSITION_INDEPENDENT_CODE
+ON
+  SOVERSION
+"1"
+  VERSION
+"1.0")
   list(APPEND LIBCXXABI_TARGETS "cxxabi_shared")
 endif()
 
@@ -137,10 +142,13 @@ if (LIBCXXABI_ENABLE_STATIC)
   add_library(cxxabi_static STATIC $)
   target_link_libraries(cxxabi_static ${LIBCXXABI_LIBRARIES})
   set_target_properties(cxxabi_static
-PROPERTIES
-  LINK_FLAGS"${LIBCXXABI_LINK_FLAGS}"
-  OUTPUT_NAME   "c++abi"
-  )
+PROPERTIES
+  LINK_FLAGS
+"${LIBCXXABI_LINK_FLAGS}"
+  OUTPUT_NAME
+"c++abi"
+  POSITION_INDEPENDENT_CODE
+ON)
   list(APPEND LIBCXXABI_TARGETS "cxxabi_static")
 endif()
 


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


[libcxxabi] r305173 - cxa_demangle: fix -Wimplicit-fallthrough for GCC:7

2017-06-11 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Jun 11 17:57:31 2017
New Revision: 305173

URL: http://llvm.org/viewvc/llvm-project?rev=305173=rev
Log:
cxa_demangle: fix -Wimplicit-fallthrough for GCC:7

Use the C++11 (formalised in C++17) tag to indicate a fallthrough in the
switch case.  Silences a -Wimplicit-fallthrough warning with gcc:7

Modified:
libcxxabi/trunk/src/cxa_demangle.cpp

Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=305173=305172=305173=diff
==
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Sun Jun 11 17:57:31 2017
@@ -2258,7 +2258,7 @@ parse_type(const char* first, const char
 break;
 }
 }
-// drop through
+[[gnu::fallthrough]];
 default:
 // must check for builtin-types before 
class-enum-types to avoid
 // ambiguities with operator-names


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


[libcxxabi] r305172 - private_typeinfo: add missing field initializers

2017-06-11 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Jun 11 17:57:26 2017
New Revision: 305172

URL: http://llvm.org/viewvc/llvm-project?rev=305172=rev
Log:
private_typeinfo: add missing field initializers

Cleanup the -Wmissing-field-initializers warnings from gcc:7 builds.
NFC.

Modified:
libcxxabi/trunk/src/private_typeinfo.cpp

Modified: libcxxabi/trunk/src/private_typeinfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/private_typeinfo.cpp?rev=305172=305171=305172=diff
==
--- libcxxabi/trunk/src/private_typeinfo.cpp (original)
+++ libcxxabi/trunk/src/private_typeinfo.cpp Sun Jun 11 17:57:26 2017
@@ -229,7 +229,7 @@ __class_type_info::can_catch(const __shi
 if (thrown_class_type == 0)
 return false;
 // bullet 2
-__dynamic_cast_info info = {thrown_class_type, 0, this, -1, 0};
+__dynamic_cast_info info = {thrown_class_type, 0, this, -1, 0, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0,};
 info.number_of_dst_type = 1;
 thrown_class_type->has_unambiguous_public_base(, adjustedPtr, 
public_path);
 if (info.path_dst_ptr_to_static_ptr == public_path)
@@ -427,7 +427,7 @@ __pointer_type_info::can_catch(const __s
 dynamic_cast(thrown_pointer_type->__pointee);
 if (thrown_class_type == 0)
 return false;
-__dynamic_cast_info info = {thrown_class_type, 0, catch_class_type, -1, 0};
+__dynamic_cast_info info = {thrown_class_type, 0, catch_class_type, -1, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};
 info.number_of_dst_type = 1;
 thrown_class_type->has_unambiguous_public_base(, adjustedPtr, 
public_path);
 if (info.path_dst_ptr_to_static_ptr == public_path)
@@ -633,7 +633,7 @@ __dynamic_cast(const void *static_ptr, c
 //be returned.
 const void* dst_ptr = 0;
 // Initialize info struct for this search.
-__dynamic_cast_info info = {dst_type, static_ptr, static_type, 
src2dst_offset, 0};
+__dynamic_cast_info info = {dst_type, static_ptr, static_type, 
src2dst_offset, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};
 
 // Find out if we can use a giant short cut in the search
 if (is_equal(dynamic_type, dst_type, false))


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


[PATCH] D31697: Check for null before using TUScope

2017-06-11 Thread Kim Gräsman via Phabricator via cfe-commits
kimgr added a comment.

We'd love to see this addressed, either in our code or in Clang. But we're not 
sure what to do on our end, so... a gentle ping for help!


https://reviews.llvm.org/D31697



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


[PATCH] D34091: Support for querying the exception specification type through libclang

2017-06-11 Thread Andrew J. Bennieston via Phabricator via cfe-commits
ajbennieston created this revision.

This patch exposes the exception specification type (noexcept, etc.) of a C++ 
function through libclang and Python clang.cindex.


Repository:
  rL LLVM

https://reviews.llvm.org/D34091

Files:
  bindings/python/clang/cindex.py
  bindings/python/tests/cindex/test_exception_specification_kind.py
  include/clang-c/Index.h
  test/Index/get-cursor.cpp
  tools/c-index-test/c-index-test.c
  tools/libclang/CXType.cpp
  tools/libclang/libclang.exports

Index: tools/libclang/libclang.exports
===
--- tools/libclang/libclang.exports
+++ tools/libclang/libclang.exports
@@ -175,6 +175,7 @@
 clang_getCursorDefinition
 clang_getCursorDisplayName
 clang_getCursorExtent
+clang_getCursorExceptionSpecificationType
 clang_getCursorKind
 clang_getCursorKindSpelling
 clang_getCursorLanguage
@@ -210,6 +211,7 @@
 clang_getEnumConstantDeclUnsignedValue
 clang_getEnumConstantDeclValue
 clang_getEnumDeclIntegerType
+clang_getExceptionSpecificationType
 clang_getFieldDeclBitWidth
 clang_getExpansionLocation
 clang_getFile
Index: tools/libclang/CXType.cpp
===
--- tools/libclang/CXType.cpp
+++ tools/libclang/CXType.cpp
@@ -684,6 +684,27 @@
   return MakeCXType(QualType(), cxcursor::getCursorTU(C));
 }
 
+int clang_getExceptionSpecificationType(CXType X) {
+QualType T = GetQualType(X);
+if (T.isNull()) {
+return -1;
+}
+
+if (const FunctionProtoType* FD = T->getAs()) {
+return static_cast(FD->getExceptionSpecType());
+} else {
+return -1;
+}
+}
+
+int clang_getCursorExceptionSpecificationType(CXCursor C) {
+if (clang_isDeclaration(C.kind)) {
+return clang_getExceptionSpecificationType(clang_getCursorType(C));
+} else {
+return -1;
+}
+}
+
 unsigned clang_isPODType(CXType X) {
   QualType T = GetQualType(X);
   if (T.isNull())
Index: tools/c-index-test/c-index-test.c
===
--- tools/c-index-test/c-index-test.c
+++ tools/c-index-test/c-index-test.c
@@ -809,6 +809,37 @@
 if (clang_Cursor_isObjCOptional(Cursor))
   printf(" (@optional)");
 
+switch (clang_getCursorExceptionSpecificationType(Cursor))
+{
+  case CXCursor_ExceptionSpecificationKind_None:
+break;
+
+  case CXCursor_ExceptionSpecificationKind_DynamicNone:
+printf(" (noexcept dynamic none)");
+break;
+
+  case CXCursor_ExceptionSpecificationKind_Dynamic:
+printf(" (noexcept dynamic)");
+break;
+
+  case CXCursor_ExceptionSpecificationKind_MSAny:
+printf(" (noexcept dynamic any)");
+break;
+
+  case CXCursor_ExceptionSpecificationKind_BasicNoexcept:
+printf(" (noexcept)");
+break;
+
+  case CXCursor_ExceptionSpecificationKind_ComputedNoexcept:
+printf(" (computed-noexcept)");
+break;
+
+  case CXCursor_ExceptionSpecificationKind_Unevaluated:
+  case CXCursor_ExceptionSpecificationKind_Uninstantiated:
+  case CXCursor_ExceptionSpecificationKind_Unparsed:
+break;
+}
+
 {
   CXString language;
   CXString definedIn;
Index: test/Index/get-cursor.cpp
===
--- test/Index/get-cursor.cpp
+++ test/Index/get-cursor.cpp
@@ -145,6 +145,13 @@
 
 const int operator""_toint(unsigned long long val) { return int(val); }
 
+// noexcept specifications
+void f_noexcept() noexcept;
+template  void f_computed_noexcept(T t) noexcept(noexcept(t+t));
+void f_dynamic_noexcept_none() throw();
+void f_dynamic_noexcept() throw(int); // just for testing, throwing int is not ideal.
+void f_dynamic_noexcept_any() throw(...);
+
 // RUN: c-index-test -cursor-at=%s:6:4 %s | FileCheck -check-prefix=CHECK-COMPLETION-1 %s
 // CHECK-COMPLETION-1: CXXConstructor=X:6:3
 // CHECK-COMPLETION-1-NEXT: Completion string: {TypedText X}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{RightParen )}
@@ -209,11 +216,11 @@
 // RUN: c-index-test -cursor-at=%s:66:23 %s | FileCheck -check-prefix=CHECK-TEMPLSPEC %s
 // CHECK-TEMPLSPEC: 66:23 ClassDecl=TC:66:23 (Definition) [Specialization of TC:59:7] Extent=[66:1 - 66:31] Spelling=TC ([66:23 - 66:25])
 
-// RUN: c-index-test -cursor-at=%s:69:3 -cursor-at=%s:70:11 -cursor-at=%s:73:6 -cursor-at=%s:74:6 -cursor-at=%s:77:8 -cursor-at=%s:78:8 -cursor-at=%s:79:8 -cursor-at=%s:80:8 -cursor-at=%s:81:8 -cursor-at=%s:82:8 -cursor-at=%s:85:6 -cursor-at=%s:86:6 -cursor-at=%s:87:6 -cursor-at=%s:88:6 -cursor-at=%s:91:5 -cursor-at=%s:92:5 -cursor-at=%s:93:5 -cursor-at=%s:94:5 -cursor-at=%s:95:5 -cursor-at=%s:96:5 -cursor-at=%s:97:5 -cursor-at=%s:98:5 -cursor-at=%s:100:5 -cursor-at=%s:101:5 -cursor-at=%s:104:6 -cursor-at=%s:105:6 -cursor-at=%s:106:6 -cursor-at=%s:107:6 -cursor-at=%s:108:6 -cursor-at=%s:109:6 -cursor-at=%s:110:6 -cursor-at=%s:111:6 -cursor-at=%s:113:6 

r305169 - Don't crash when forming a destructor name on an incomplete type.

2017-06-11 Thread John McCall via cfe-commits
Author: rjmccall
Date: Sun Jun 11 15:33:00 2017
New Revision: 305169

URL: http://llvm.org/viewvc/llvm-project?rev=305169=rev
Log:
Don't crash when forming a destructor name on an incomplete type.

Fixes PR25156.

Patch by Don Hinton!

Modified:
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/test/SemaCXX/nested-name-spec.cpp

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=305169=305168=305169=diff
==
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Sun Jun 11 15:33:00 2017
@@ -189,12 +189,15 @@ ParsedType Sema::getDestructorName(Sourc
 // have one) and, if that fails to find a match, in the scope (if
 // we're allowed to look there).
 Found.clear();
-if (Step == 0 && LookupCtx)
+if (Step == 0 && LookupCtx) {
+  if (RequireCompleteDeclContext(SS, LookupCtx))
+return nullptr;
   LookupQualifiedName(Found, LookupCtx);
-else if (Step == 1 && LookInScope && S)
+} else if (Step == 1 && LookInScope && S) {
   LookupName(Found, S);
-else
+} else {
   continue;
+}
 
 // FIXME: Should we be suppressing ambiguities here?
 if (Found.isAmbiguous())

Modified: cfe/trunk/test/SemaCXX/nested-name-spec.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/nested-name-spec.cpp?rev=305169=305168=305169=diff
==
--- cfe/trunk/test/SemaCXX/nested-name-spec.cpp (original)
+++ cfe/trunk/test/SemaCXX/nested-name-spec.cpp Sun Jun 11 15:33:00 2017
@@ -169,6 +169,13 @@ void N::f() { } // okay
 struct Y;  // expected-note{{forward declaration of 'Y'}}
 Y::foo y; // expected-error{{incomplete type 'Y' named in nested name 
specifier}}
 
+namespace PR25156 {
+struct Y;  // expected-note{{forward declaration of 'PR25156::Y'}}
+void foo() {
+  Y::~Y(); // expected-error{{incomplete type 'PR25156::Y' named in nested 
name specifier}}
+}
+}
+
 X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}}
 
 struct foo_S {


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


Re: [PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-11 Thread John McCall via cfe-commits
On Sun, Jun 11, 2017 at 9:26 AM, don hinton  wrote:

> On Sat, Jun 10, 2017 at 8:55 PM John McCall via Phabricator <
> revi...@reviews.llvm.org> wrote:
>
>> rjmccall accepted this revision.
>> rjmccall added a comment.
>> This revision is now accepted and ready to land.
>>
>> Thanks, looks great.
>
>
> Great, thanks.
>
>>
>>
>> If you're going to be submitting multiple patches, you should really ask
>> for commit access; it's not an arduous process.
>
>
> Sure, I'll look into it this week.
>
> In the meantime, would you mind commiting this one for me?
>

Sure thing, r305169.

John.


>
> Thanks again...
> don
>
>
>>
>>
>> https://reviews.llvm.org/D17143
>>
>>
>>
>>


-- 
I suppose you'd like my real thoughts as well.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r305167 - test: attempt to repair build bots

2017-06-11 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Jun 11 13:55:17 2017
New Revision: 305167

URL: http://llvm.org/viewvc/llvm-project?rev=305167=rev
Log:
test: attempt to repair build bots

Split the no-ias tests and give them a target to ensure that they go
down the GNU toolchain path.  Adjust the no compression support tests.

Added:
cfe/trunk/test/Driver/compress-noias.c
Modified:
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/test/Driver/compress.c
cfe/trunk/test/Driver/nozlibcompress.c

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=305167=305166=305167=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Sun Jun 11 13:55:17 2017
@@ -918,7 +918,10 @@ static void RenderDebugInfoCompressionAr
 return;
 
   if (A->getOption().getID() == options::OPT_gz) {
-CmdArgs.push_back("-compress-debug-sections");
+if (llvm::zlib::isAvailable())
+  CmdArgs.push_back("-compress-debug-sections");
+else
+  D.Diag(diag::warn_debug_compression_unavailable);
 return;
   }
 
@@ -926,11 +929,11 @@ static void RenderDebugInfoCompressionAr
   if (Value == "none") {
 CmdArgs.push_back("-compress-debug-sections=none");
   } else if (Value == "zlib" || Value == "zlib-gnu") {
-if (!llvm::zlib::isAvailable()) {
-  D.Diag(diag::warn_debug_compression_unavailable);
-} else {
+if (llvm::zlib::isAvailable()) {
   CmdArgs.push_back(
   Args.MakeArgString("-compress-debug-sections=" + Twine(Value)));
+} else {
+  D.Diag(diag::warn_debug_compression_unavailable);
 }
   } else {
 D.Diag(diag::err_drv_unsupported_option_argument)

Added: cfe/trunk/test/Driver/compress-noias.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/compress-noias.c?rev=305167=auto
==
--- cfe/trunk/test/Driver/compress-noias.c (added)
+++ cfe/trunk/test/Driver/compress-noias.c Sun Jun 11 13:55:17 2017
@@ -0,0 +1,37 @@
+// REQUIRES: zlib
+// REQUIRES: x86-registered-target
+
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as 
-Wa,-compress-debug-sections -c %s 2>&1 | FileCheck -check-prefix 
CHECK-_COMPRESS_DEBUG_SECTIONS %s
+// CHECK-_COMPRESS_DEBUG_SECTIONS: "-compress-debug-sections"
+
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as 
-Wa,--compress-debug-sections -c %s 2>&1 | FileCheck -check-prefix 
CHECK-__COMPRESS_DEBUG_SECTIONS %s
+// CHECK-__COMPRESS_DEBUG_SECTIONS: "--compress-debug-sections"
+
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as 
-Wa,--compress-debug-sections -Wa,--nocompress-debug-sections -c %s 2>&1 | 
FileCheck -check-prefix CHECK-POSNEG %s
+// CHECK-POSNEG: "--compress-debug-sections"
+// CHECK-POSNEG: "--nocompress-debug-sections"
+
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as 
-Wa,-compress-debug-sections -Wa,--compress-debug-sections -c %s 2>&1 | 
FileCheck -check-prefix CHECK-MULTIPLE %s
+// CHECK-MULTIPLE: "-compress-debug-sections"
+// CHECK-MULTIPLE: "--compress-debug-sections"
+
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as -gz -x 
assembler -c %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ %s
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as -gz -c 
%s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ %s
+// CHECK-OPT_GZ: "-compress-debug-sections"
+
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as -gz=none 
-x assembler -c %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_NONE %s
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as -gz=none 
-c %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_NONE %s
+// CHECK-OPT_GZ_EQ_NONE: "-compress-debug-sections=none"
+
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as -gz=zlib 
-x assembler -c %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as -gz=zlib 
-c %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB %s
+// CHECK-OPT_GZ_EQ_ZLIB: "-compress-debug-sections=zlib"
+
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as 
-gz=zlib-gnu -x assembler -c %s 2>&1 | FileCheck -check-prefix 
CHECK-OPT_GZ_EQ_ZLIB_GNU %s
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as 
-gz=zlib-gnu -c %s 2>&1 | FileCheck -check-prefix CHECK-OPT_GZ_EQ_ZLIB_GNU %s
+// CHECK-OPT_GZ_EQ_ZLIB_GNU: "-compress-debug-sections=zlib-gnu"
+
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as 
-gz=invalid -x assembler -c %s 2>&1 | FileCheck -check-prefix 
CHECK-OPT_GZ_EQ_INVALID %s
+// RUN: %clang -### -target i686-unknown-linux-gnu -fno-integrated-as 
-gz=invalid -c %s 2>&1 | FileCheck -check-prefix 

r305164 - Driver: pass along [-]-[no]compress-debug-sections unfiltered

2017-06-11 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Jun 11 12:49:17 2017
New Revision: 305164

URL: http://llvm.org/viewvc/llvm-project?rev=305164=rev
Log:
Driver: pass along [-]-[no]compress-debug-sections unfiltered

Rather than validating the flags, pass them through without any
validation.  Arguments passed via -Wa or -Xassembler are passed directly
to the assembler without validation.  The validation was previously
required since we did not provide proper driver level support for
controlling the debug compression on ELF targets.  A subsequent change
will add support for the `-gz` and `-gz=` flags which provide proper
driver level control of the ELF compressed debug sections.

Modified:
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/test/Driver/compress.c

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=305164=305163=305164=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Sun Jun 11 12:49:17 2017
@@ -1744,10 +1744,6 @@ static void CollectArgsForIntegratedAsse
   // arg after parsing the '-I' arg.
   bool TakeNextArg = false;
 
-  // When using an integrated assembler, translate -Wa, and -Xassembler
-  // options.
-  bool CompressDebugSections = false;
-
   bool UseRelaxRelocations = ENABLE_X86_RELAX_RELOCATIONS;
   const char *MipsTargetFeature = nullptr;
   for (const Arg *A :
@@ -1822,12 +1818,11 @@ static void CollectArgsForIntegratedAsse
 CmdArgs.push_back("-massembler-fatal-warnings");
   } else if (Value == "--noexecstack") {
 CmdArgs.push_back("-mnoexecstack");
-  } else if (Value == "-compress-debug-sections" ||
- Value == "--compress-debug-sections") {
-CompressDebugSections = true;
-  } else if (Value == "-nocompress-debug-sections" ||
+  } else if (Value.startswith("-compress-debug-sections") ||
+ Value.startswith("--compress-debug-sections") ||
+ Value == "-nocompress-debug-sections" ||
  Value == "--nocompress-debug-sections") {
-CompressDebugSections = false;
+CmdArgs.push_back(Value.data());
   } else if (Value == "-mrelax-relocations=yes" ||
  Value == "--mrelax-relocations=yes") {
 UseRelaxRelocations = true;
@@ -1880,12 +1875,6 @@ static void CollectArgsForIntegratedAsse
   }
 }
   }
-  if (CompressDebugSections) {
-if (llvm::zlib::isAvailable())
-  CmdArgs.push_back("-compress-debug-sections");
-else
-  D.Diag(diag::warn_debug_compression_unavailable);
-  }
   if (UseRelaxRelocations)
 CmdArgs.push_back("--mrelax-relocations");
   if (MipsTargetFeature != nullptr) {

Modified: cfe/trunk/test/Driver/compress.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/compress.c?rev=305164=305163=305164=diff
==
--- cfe/trunk/test/Driver/compress.c (original)
+++ cfe/trunk/test/Driver/compress.c Sun Jun 11 12:49:17 2017
@@ -1,8 +1,20 @@
-// RUN: %clang -### -c -integrated-as -Wa,-compress-debug-sections %s 2>&1 | 
FileCheck --check-prefix=COMPRESS_DEBUG %s
-// RUN: %clang -### -c -integrated-as -Wa,--compress-debug-sections %s 2>&1 | 
FileCheck --check-prefix=COMPRESS_DEBUG %s
 // REQUIRES: zlib
 
-// COMPRESS_DEBUG: "-compress-debug-sections"
+// RUN: %clang -### -fintegrated-as -Wa,-compress-debug-sections -c %s 2>&1 | 
FileCheck -check-prefix CHECK-_COMPRESS_DEBUG_SECTIONS %s
+// RUN: %clang -### -fno-integrated-as -Wa,-compress-debug-sections -c %s 2>&1 
| FileCheck -check-prefix CHECK-_COMPRESS_DEBUG_SECTIONS %s
+// CHECK-_COMPRESS_DEBUG_SECTIONS: "-compress-debug-sections"
+
+// RUN: %clang -### -fintegrated-as -Wa,--compress-debug-sections -c %s 2>&1 | 
FileCheck -check-prefix CHECK-__COMPRESS_DEBUG_SECTIONS %s
+// RUN: %clang -### -fno-integrated-as -Wa,--compress-debug-sections -c %s 
2>&1 | FileCheck -check-prefix CHECK-__COMPRESS_DEBUG_SECTIONS %s
+// CHECK-__COMPRESS_DEBUG_SECTIONS: "--compress-debug-sections"
+
+// RUN: %clang -### -fintegrated-as -Wa,--compress-debug-sections 
-Wa,--nocompress-debug-sections -c %s 2>&1 | FileCheck -check-prefix 
CHECK-POSNEG %s
+// RUN: %clang -### -fno-integrated-as -Wa,--compress-debug-sections 
-Wa,--nocompress-debug-sections -c %s 2>&1 | FileCheck -check-prefix 
CHECK-POSNEG %s
+// CHECK-POSNEG: "--compress-debug-sections"
+// CHECK-POSNEG: "--nocompress-debug-sections"
+
+// RUN: %clang -### -fintegrated-as -Wa,-compress-debug-sections 
-Wa,--compress-debug-sections -c %s 2>&1 | FileCheck -check-prefix 
CHECK-MULTIPLE %s
+// RUN: %clang -### -fno-integrated-as -Wa,-compress-debug-sections 
-Wa,--compress-debug-sections -c %s 2>&1 | FileCheck -check-prefix 
CHECK-MULTIPLE %s
+// CHECK-MULTIPLE: "-compress-debug-sections"
+// CHECK-MULTIPLE: "--compress-debug-sections"

r305165 - Driver: add support for `-gz` and `-gz=`

2017-06-11 Thread Saleem Abdulrasool via cfe-commits
Author: compnerd
Date: Sun Jun 11 12:49:23 2017
New Revision: 305165

URL: http://llvm.org/viewvc/llvm-project?rev=305165=rev
Log:
Driver: add support for `-gz` and `-gz=`

These options control the behaviour of the compression of debug info
sections on ELF targets.  Our behaviour slightly diverges from the
behaviour of GCC.  `-gz` maps to the `-compress-debug-sections` rather
than `-compress-debug-sections=zlib` or
`-compress-debug-sections=zlib-gnu`.  This small divergence allows us to
be compatible across versions of binutils (=zlib support was introduced
in 2.26, while earlier versions only support =zlib-gnu).  This also
allows users to not have to worry about the version of the assembler
they may be using if they are not using the IAS.  Previously, users
would have had to go through the internal option
`-compress-debug-sectionss` and pass that through to the assembler,
which is no longer needed.

Modified:
cfe/trunk/include/clang/Driver/CC1Options.td
cfe/trunk/include/clang/Driver/Options.td
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/test/Driver/compress.c
cfe/trunk/tools/driver/cc1as_main.cpp

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=305165=305164=305165=diff
==
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Sun Jun 11 12:49:23 2017
@@ -134,7 +134,6 @@ def migrator_no_finalize_removal : Flag<
 
//===--===//
 
 let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
-
 def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">;
 def debug_info_macro : Flag<["-"], "debug-info-macro">,
   HelpText<"Emit macro debug information">;
@@ -144,14 +143,16 @@ def fdebug_compilation_dir : Separate<["
   HelpText<"The compilation directory to embed in the debug info.">;
 def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">,
   HelpText<"The string to embed in the Dwarf debug flags record.">;
+def compress_debug_sections : Flag<["-"], "compress-debug-sections">,
+HelpText<"DWARF debug sections compression">;
+def compress_debug_sections_EQ : Flag<["-"], "compress-debug-sections=">,
+HelpText<"DWARF debug sections compression type">;
 def mno_exec_stack : Flag<["-"], "mnoexecstack">,
   HelpText<"Mark the file as not needing an executable stack">;
 def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">,
   HelpText<"Make assembler warnings fatal">;
 def mrelax_relocations : Flag<["--"], "mrelax-relocations">,
 HelpText<"Use relaxable elf relocations">;
-def compress_debug_sections : Flag<["-"], "compress-debug-sections">,
-HelpText<"Compress DWARF debug sections using zlib">;
 def msave_temp_labels : Flag<["-"], "msave-temp-labels">,
   HelpText<"Save temporary labels in the symbol table. "
"Note this may change .s semantics and shouldn't generally be used "

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=305165=305164=305165=diff
==
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Sun Jun 11 12:49:23 2017
@@ -1563,6 +1563,10 @@ def gdwarf_aranges : Flag<["-"], "gdwarf
 def gmodules : Flag <["-"], "gmodules">, Group,
   HelpText<"Generate debug info with external references to clang modules"
" or precompiled headers">;
+def gz : Flag<["-"], "gz">, Group,
+HelpText<"DWARF debug sections compression type">;
+def gz_EQ : Joined<["-"], "gz=">, Group,
+HelpText<"DWARF debug sections compression type">;
 def headerpad__max__install__names : Joined<["-"], 
"headerpad_max_install_names">;
 def help : Flag<["-", "--"], "help">, Flags<[CC1Option,CC1AsOption]>,
   HelpText<"Display available options">;

Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=305165=305164=305165=diff
==
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Sun Jun 11 12:49:23 2017
@@ -910,6 +910,34 @@ static void RenderDebugEnablingArgs(cons
   }
 }
 
+static void RenderDebugInfoCompressionArgs(const ArgList ,
+   ArgStringList ,
+   const Driver ) {
+  const Arg *A = Args.getLastArg(options::OPT_gz, options::OPT_gz_EQ);
+  if (!A)
+return;
+
+  if (A->getOption().getID() == options::OPT_gz) {
+

Re: [PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-11 Thread don hinton via cfe-commits
On Sat, Jun 10, 2017 at 8:55 PM John McCall via Phabricator <
revi...@reviews.llvm.org> wrote:

> rjmccall accepted this revision.
> rjmccall added a comment.
> This revision is now accepted and ready to land.
>
> Thanks, looks great.


Great, thanks.

>
>
> If you're going to be submitting multiple patches, you should really ask
> for commit access; it's not an arduous process.


Sure, I'll look into it this week.

In the meantime, would you mind commiting this one for me?

Thanks again...
don


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