[PATCH] D69129: [AMDGPU] Fix assertion due to initializer list

2019-10-19 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

Minor change, but otherwise LGTM.




Comment at: lib/CodeGen/CodeGenModule.cpp:3898
+Entry = CE->stripPointerCasts();
   }
 

You can just make this whole thing `Entry = Entry->stripPointerCasts()`.


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

https://reviews.llvm.org/D69129



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


[PATCH] D69181: [clang-tidy] Adding misc-signal-terminated-thread check

2019-10-19 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments.



Comment at: clang-tools-extra/clang-tidy/misc/BadSignalToKillThreadCheck.cpp:31
+void BadSignalToKillThreadCheck::check(const MatchFinder::MatchResult ) 
{
+  Preprocessor::macro_iterator It = PP->macro_begin();
+  while (It != PP->macro_end() && !SigtermValue.hasValue()) {

In this case auto is reasonable, because this is iterator.



Comment at: clang-tools-extra/docs/ReleaseNotes.rst:121
+
+  Finds function calls when an uncaught signal try to kill a thread and
+  the signal kills the entire process, not just the individual thread. 

Please synchronize with first statement in documentation.



Comment at: clang-tools-extra/docs/ReleaseNotes.rst:123
+  the signal kills the entire process, not just the individual thread. 
+  To learn more about this rule please visit the following page:
+  
https://wiki.sei.cmu.edu/confluence/display/c/POS44-C.+Do+not+use+signals+to+terminate+threads

Please move this statement at the end of documentation.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69181



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


LLVM buildmaster will be updated and restarted tonight

2019-10-19 Thread Galina Kistanova via cfe-commits
 Hello everyone,

LLVM buildmaster will be updated and restarted after 7PM Pacific time today.

Thanks

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


[PATCH] D69221: [clang][darwin] Fix search path logic for C_INCLUDE_DIRS

2019-10-19 Thread Marco Hinz via Phabricator via cfe-commits
mhinz created this revision.
mhinz added reviewers: ldionne, rsmith.
mhinz added a project: clang.
Herald added subscribers: cfe-commits, dexonsmith.

For each absolute path given to C_INCLUDE_DIRS, we want it to be added as-is to
the include search path. Relative paths should be prefixed with the sysroot.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69221

Files:
  clang/lib/Driver/ToolChains/Darwin.cpp


Index: clang/lib/Driver/ToolChains/Darwin.cpp
===
--- clang/lib/Driver/ToolChains/Darwin.cpp
+++ clang/lib/Driver/ToolChains/Darwin.cpp
@@ -1859,7 +1859,7 @@
 CIncludeDirs.split(dirs, ":");
 for (llvm::StringRef dir : dirs) {
   llvm::StringRef Prefix =
-  llvm::sys::path::is_absolute(dir) ? llvm::StringRef(Sysroot) : "";
+  llvm::sys::path::is_absolute(dir) ? "" : llvm::StringRef(Sysroot);
   addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
 }
   } else {


Index: clang/lib/Driver/ToolChains/Darwin.cpp
===
--- clang/lib/Driver/ToolChains/Darwin.cpp
+++ clang/lib/Driver/ToolChains/Darwin.cpp
@@ -1859,7 +1859,7 @@
 CIncludeDirs.split(dirs, ":");
 for (llvm::StringRef dir : dirs) {
   llvm::StringRef Prefix =
-  llvm::sys::path::is_absolute(dir) ? llvm::StringRef(Sysroot) : "";
+  llvm::sys::path::is_absolute(dir) ? "" : llvm::StringRef(Sysroot);
   addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
 }
   } else {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D69194: build: add clang-cl and clang++ symlinks in the build tree

2019-10-19 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd abandoned this revision.
compnerd added a comment.

I think I must have had something else in my tree, cause a clean build does 
build them.


Repository:
  rC Clang

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

https://reviews.llvm.org/D69194



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


[PATCH] D69181: [clang-tidy] Adding misc-signal-terminated-thread check

2019-10-19 Thread Kocsis Ábel via Phabricator via cfe-commits
abelkocsis updated this revision to Diff 225769.
abelkocsis added a comment.

Auto types replaced on checker files. New lines added when necessary. 
Reordered ReleaseNotes by alphabetical order. Checker name is 
updated on ReleaseNotes, compliant solution is wrote to the 
documentation. Another two test is written.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69181

Files:
  clang-tools-extra/clang-tidy/misc/BadSignalToKillThreadCheck.cpp
  clang-tools-extra/clang-tidy/misc/BadSignalToKillThreadCheck.h
  clang-tools-extra/clang-tidy/misc/CMakeLists.txt
  clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/misc-bad-signal-to-kill-thread.rst
  clang-tools-extra/test/clang-tidy/misc-bad-signal-to-kill-thread.cpp

Index: clang-tools-extra/test/clang-tidy/misc-bad-signal-to-kill-thread.cpp
===
--- /dev/null
+++ clang-tools-extra/test/clang-tidy/misc-bad-signal-to-kill-thread.cpp
@@ -0,0 +1,39 @@
+// RUN: %check_clang_tidy %s misc-bad-signal-to-kill-thread %t
+
+#define SIGTERM 15
+#define SIGINT 2
+using pthread_t = int;
+using pthread_attr_t = int;
+
+int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
+   void *(*start_routine)(void *), void *arg);
+
+int pthread_kill(pthread_t thread, int sig);
+
+int pthread_cancel(pthread_t thread);
+
+void *test_func_return_a_pointer(void *foo);
+
+int main() {
+  int result;
+  pthread_t thread;
+
+  if ((result = pthread_create(, nullptr, test_func_return_a_pointer, 0)) != 0) {
+  }
+  if ((result = pthread_kill(thread, SIGTERM)) != 0) {
+// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: Thread should not be terminated by SIGTERM signal. [misc-bad-signal-to-kill-thread]
+  }
+
+  //compliant solution
+  if ((result = pthread_cancel(thread)) != 0) {
+  }
+
+  if ((result = pthread_kill(thread, SIGINT)) != 0) {
+  }
+  if ((result = pthread_kill(thread, 0xF)) != 0) {
+// CHECK-MESSAGES: :[[@LINE-1]]:17: warning: Thread should not be terminated by SIGTERM signal. [misc-bad-signal-to-kill-thread]
+  }
+  
+
+  return 0;
+}
Index: clang-tools-extra/docs/clang-tidy/checks/misc-bad-signal-to-kill-thread.rst
===
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/misc-bad-signal-to-kill-thread.rst
@@ -0,0 +1,12 @@
+.. title:: clang-tidy - misc-bad-signal-to-kill-thread
+
+misc-bad-signal-to-kill-thread
+==
+
+Warn on uses of the ``pthread_kill`` function when thread is 
+terminated by ``SIGTERM`` signal. Use any signal except
+``SIGTERM`` or ``SIGKILL``.
+
+.. code-block: c++
+
+pthread_kill(thread, SIGTERM);
Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -282,6 +282,7 @@
llvm-prefer-isa-or-dyn-cast-in-conditionals
llvm-prefer-register-over-unsigned
llvm-twine-local
+   misc-bad-signal-to-kill-thread
misc-definitions-in-headers
misc-misplaced-const
misc-new-delete-overloads
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- clang-tools-extra/docs/ReleaseNotes.rst
+++ clang-tools-extra/docs/ReleaseNotes.rst
@@ -115,6 +115,14 @@
   Finds historical use of ``unsigned`` to hold vregs and physregs and rewrites
   them to use ``Register``
 
+- New :doc:`misc-bad-signal-to-kill-thread
+  ` check.
+
+  Finds function calls when an uncaught signal try to kill a thread and
+  the signal kills the entire process, not just the individual thread. 
+  To learn more about this rule please visit the following page:
+  https://wiki.sei.cmu.edu/confluence/display/c/POS44-C.+Do+not+use+signals+to+terminate+threads
+
 - New :doc:`objc-missing-hash
   ` check.
 
Index: clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
===
--- clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
+++ clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
@@ -9,6 +9,7 @@
 #include "../ClangTidy.h"
 #include "../ClangTidyModule.h"
 #include "../ClangTidyModuleRegistry.h"
+#include "BadSignalToKillThreadCheck.h"
 #include "DefinitionsInHeadersCheck.h"
 #include "MisplacedConstCheck.h"
 #include "NewDeleteOverloadsCheck.h"
@@ -30,6 +31,8 @@
 class MiscModule : public ClangTidyModule {
 public:
   void addCheckFactories(ClangTidyCheckFactories ) override {
+CheckFactories.registerCheck(
+"misc-bad-signal-to-kill-thread");
 CheckFactories.registerCheck(
 "misc-definitions-in-headers");
 

[PATCH] D69218: [clang][AST] Add `CXXBaseSpecifier` matcher support

2019-10-19 Thread Nikita Kniazev via Phabricator via cfe-commits
nick updated this revision to Diff 225770.
nick added a comment.

Regenerated the docs, added more tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69218

Files:
  clang/docs/LibASTMatchersReference.html
  clang/include/clang/AST/ASTTypeTraits.h
  clang/include/clang/ASTMatchers/ASTMatchers.h
  clang/include/clang/ASTMatchers/ASTMatchersInternal.h
  clang/lib/AST/ASTTypeTraits.cpp
  clang/unittests/AST/ASTTypeTraitsTest.cpp
  clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
  clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

Index: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
===
--- clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
+++ clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
@@ -320,6 +320,14 @@
 varDecl(hasType(pointsTo(ClassX);
 }
 
+TEST(HasType, TakesQualTypeMatcherAndMatchesCXXBaseSpecifier) {
+  DeclarationMatcher ClassX = recordDecl(hasName("X"));
+  CXXBaseSpecifierMatcher BaseClassX = cxxBaseSpecifier(hasType(ClassX));
+  DeclarationMatcher ClassHasBaseClassX = cxxRecordDecl(hasBase(BaseClassX));
+  EXPECT_TRUE(matches("class X {}; class Y : X {};", ClassHasBaseClassX));
+  EXPECT_TRUE(notMatches("class Z {}; class Y : Z {};", ClassHasBaseClassX));
+}
+
 TEST(HasType, TakesDeclMatcherAndMatchesExpr) {
   DeclarationMatcher ClassX = recordDecl(hasName("X"));
   EXPECT_TRUE(
@@ -337,6 +345,14 @@
 notMatches("class X {}; void y() { X *x; }", varDecl(hasType(ClassX;
 }
 
+TEST(HasType, TakesDeclMatcherAndMatchesCXXBaseSpecifier) {
+  TypeMatcher ClassX = hasDeclaration(recordDecl(hasName("X")));
+  CXXBaseSpecifierMatcher BaseClassX = cxxBaseSpecifier(hasType(ClassX));
+  DeclarationMatcher ClassHasBaseClassX = cxxRecordDecl(hasBase(BaseClassX));
+  EXPECT_TRUE(matches("class X {}; class Y : X {};", ClassHasBaseClassX));
+  EXPECT_TRUE(notMatches("class Z {}; class Y : Z {};", ClassHasBaseClassX));
+}
+
 TEST(HasType, MatchesTypedefDecl) {
   EXPECT_TRUE(matches("typedef int X;", typedefDecl(hasType(asString("int");
   EXPECT_TRUE(matches("typedef const int T;",
Index: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
===
--- clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -678,6 +678,29 @@
   "@interface Z : A @end", ZIsDirectlyDerivedFromX));
 }
 
+TEST(DeclarationMatcher, ClassHasBase) {
+  DeclarationMatcher ClassHasAnyBase =
+  cxxRecordDecl(hasBase(cxxBaseSpecifier()));
+  EXPECT_TRUE(notMatches("class X {};", ClassHasAnyBase));
+  EXPECT_TRUE(matches("class X {}; class Y : X {};", ClassHasAnyBase));
+
+  TypeMatcher ClassX = asString("class X");
+  CXXBaseSpecifierMatcher BaseClassX = cxxBaseSpecifier(hasType(ClassX));
+  DeclarationMatcher ClassHasBaseClassX = cxxRecordDecl(hasBase(BaseClassX));
+  EXPECT_TRUE(matches("class X {}; class Y {}; class Z : X, Y {};",
+  ClassHasBaseClassX));
+  EXPECT_TRUE(matches("class X {}; class Y {}; class Z : Y, X {};",
+  ClassHasBaseClassX));
+  EXPECT_TRUE(notMatches("class W {}; class Y {}; class Z : W, Y {};",
+ ClassHasBaseClassX));
+  DeclarationMatcher ClassZHasBaseClassX =
+  cxxRecordDecl(hasName("Z"), hasBase(BaseClassX));
+  EXPECT_TRUE(matches("class X {}; class Y : X {}; class Z : X {};",
+  ClassZHasBaseClassX));
+  EXPECT_TRUE(notMatches("class X {}; class Y : X {}; class Z : Y {};",
+ ClassZHasBaseClassX));
+}
+
 TEST(DeclarationMatcher, IsLambda) {
   const auto IsLambda = cxxMethodDecl(ofClass(cxxRecordDecl(isLambda(;
   EXPECT_TRUE(matches("auto x = []{};", IsLambda));
Index: clang/unittests/AST/ASTTypeTraitsTest.cpp
===
--- clang/unittests/AST/ASTTypeTraitsTest.cpp
+++ clang/unittests/AST/ASTTypeTraitsTest.cpp
@@ -112,6 +112,7 @@
   VERIFY_NAME(NestedNameSpecifierLoc);
   VERIFY_NAME(QualType);
   VERIFY_NAME(TypeLoc);
+  VERIFY_NAME(CXXBaseSpecifier);
   VERIFY_NAME(CXXCtorInitializer);
   VERIFY_NAME(NestedNameSpecifier);
   VERIFY_NAME(Decl);
@@ -141,6 +142,15 @@
   EXPECT_TRUE(Verifier.match("void f() {}", typeLoc(loc(functionType();
 }
 
+#if 0 // Cannot be used as a top level matcher at the time
+TEST(DynTypedNode, CXXBaseSpecifierSourceRange) {
+  RangeVerifier Verifier;
+  Verifier.expectRange(1, 23, 1, 39);
+  EXPECT_TRUE(Verifier.match("class B {}; class C : public virtual B {};",
+ cxxBaseSpecifier()));
+}
+#endif
+
 TEST(DynTypedNode, NNSLocSourceRange) {
   RangeVerifier Verifier;
   Verifier.expectRange(1, 33, 1, 34);
Index: clang/lib/AST/ASTTypeTraits.cpp
===
--- 

[PATCH] D69218: [clang][AST] Add `CXXBaseSpecifier` matcher support

2019-10-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment.

Needs more tests - what happens with multiple inheritance, what about 
inheriting from inherited?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69218



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


[PATCH] D69218: [clang][AST] Add `CXXBaseSpecifier` matcher support

2019-10-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment.

Missing docs regeneration (`clang/docs/tools/dump_ast_matchers.py` i think)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69218



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


[PATCH] D69218: [clang][AST] Add `CXXBaseSpecifier` matcher support

2019-10-19 Thread Nikita Kniazev via Phabricator via cfe-commits
nick created this revision.
nick added a reviewer: klimek.
nick added a project: clang.
Herald added a subscriber: cfe-commits.

Required for capturing base specifier in matchers:

  `cxxRecordDecl(hasBase(cxxBaseSpecifier().bind("base")))`

Will make implementation of D69000  much 
clearer and simpler.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69218

Files:
  clang/include/clang/AST/ASTTypeTraits.h
  clang/include/clang/ASTMatchers/ASTMatchers.h
  clang/include/clang/ASTMatchers/ASTMatchersInternal.h
  clang/lib/AST/ASTTypeTraits.cpp
  clang/unittests/AST/ASTTypeTraitsTest.cpp
  clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

Index: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
===
--- clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -678,6 +678,17 @@
   "@interface Z : A @end", ZIsDirectlyDerivedFromX));
 }
 
+TEST(DeclarationMatcher, ClassHasBase) {
+  DeclarationMatcher HasAnyBase = cxxRecordDecl(hasBase(cxxBaseSpecifier()));
+  EXPECT_TRUE(matches("class X {}; class Y : X {};", HasAnyBase));
+  EXPECT_TRUE(notMatches("class X {};", HasAnyBase));
+
+  DeclarationMatcher HasBaseX =
+  cxxRecordDecl(hasBase(cxxBaseSpecifier(hasType(asString("class X");
+  EXPECT_TRUE(matches("class X {}; class Y : X {};", HasBaseX));
+  EXPECT_TRUE(notMatches("class Z {}; class Y : Z {};", HasBaseX));
+}
+
 TEST(DeclarationMatcher, IsLambda) {
   const auto IsLambda = cxxMethodDecl(ofClass(cxxRecordDecl(isLambda(;
   EXPECT_TRUE(matches("auto x = []{};", IsLambda));
Index: clang/unittests/AST/ASTTypeTraitsTest.cpp
===
--- clang/unittests/AST/ASTTypeTraitsTest.cpp
+++ clang/unittests/AST/ASTTypeTraitsTest.cpp
@@ -112,6 +112,7 @@
   VERIFY_NAME(NestedNameSpecifierLoc);
   VERIFY_NAME(QualType);
   VERIFY_NAME(TypeLoc);
+  VERIFY_NAME(CXXBaseSpecifier);
   VERIFY_NAME(CXXCtorInitializer);
   VERIFY_NAME(NestedNameSpecifier);
   VERIFY_NAME(Decl);
@@ -141,6 +142,15 @@
   EXPECT_TRUE(Verifier.match("void f() {}", typeLoc(loc(functionType();
 }
 
+#if 0 // Cannot be used as a top level matcher at the time
+TEST(DynTypedNode, CXXBaseSpecifierSourceRange) {
+  RangeVerifier Verifier;
+  Verifier.expectRange(1, 23, 1, 39);
+  EXPECT_TRUE(Verifier.match("class B {}; class C : public virtual B {};",
+ cxxBaseSpecifier()));
+}
+#endif
+
 TEST(DynTypedNode, NNSLocSourceRange) {
   RangeVerifier Verifier;
   Verifier.expectRange(1, 33, 1, 34);
Index: clang/lib/AST/ASTTypeTraits.cpp
===
--- clang/lib/AST/ASTTypeTraits.cpp
+++ clang/lib/AST/ASTTypeTraits.cpp
@@ -27,6 +27,7 @@
   { NKI_None, "NestedNameSpecifierLoc" },
   { NKI_None, "QualType" },
   { NKI_None, "TypeLoc" },
+  { NKI_None, "CXXBaseSpecifier" },
   { NKI_None, "CXXCtorInitializer" },
   { NKI_None, "NestedNameSpecifier" },
   { NKI_None, "Decl" },
@@ -163,6 +164,8 @@
 }
 
 SourceRange DynTypedNode::getSourceRange() const {
+  if (const CXXBaseSpecifier *CBS = get())
+return CBS->getSourceRange();
   if (const CXXCtorInitializer *CCI = get())
 return CCI->getSourceRange();
   if (const NestedNameSpecifierLoc *NNSL = get())
Index: clang/include/clang/ASTMatchers/ASTMatchersInternal.h
===
--- clang/include/clang/ASTMatchers/ASTMatchersInternal.h
+++ clang/include/clang/ASTMatchers/ASTMatchersInternal.h
@@ -130,6 +130,9 @@
 return TSI->getType();
   return QualType();
 }
+inline QualType getUnderlyingType(const CXXBaseSpecifier ) {
+  return Node.getType();
+}
 
 /// Unifies obtaining the FunctionProtoType pointer from both
 /// FunctionProtoType and FunctionDecl nodes..
@@ -926,6 +929,7 @@
   std::is_same::value ||
   std::is_same::value ||
   std::is_same::value ||
+  std::is_same::value ||
   std::is_same::value;
 };
 template 
@@ -1094,7 +1098,7 @@
 /// Useful for matchers like \c anything and \c unless.
 using AllNodeBaseTypes =
 TypeList;
+ Type, TypeLoc, CXXBaseSpecifier, CXXCtorInitializer>;
 
 /// Helper meta-function to extract the argument out of a function of
 ///   type void(Arg).
Index: clang/include/clang/ASTMatchers/ASTMatchers.h
===
--- clang/include/clang/ASTMatchers/ASTMatchers.h
+++ clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -140,6 +140,7 @@
 using TypeLocMatcher = internal::Matcher;
 using NestedNameSpecifierMatcher = internal::Matcher;
 using NestedNameSpecifierLocMatcher = internal::Matcher;
+using CXXBaseSpecifierMatcher = internal::Matcher;
 using CXXCtorInitializerMatcher = internal::Matcher;
 /// @}
 
@@ -468,6 +469,16 @@
 extern const internal::VariadicDynCastAllOfMatcher
 

[PATCH] D69145: Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra

2019-10-19 Thread Conrad Poelman via Phabricator via cfe-commits
poelmanc added a comment.

In D69145#1715614 , @lebedev.ri wrote:

> So https://godbolt.org/z/qzjU-C
>  This feels like gcc being overly zealous, i'm not sure what it says with 
> that warning.


I'd agree, while copy constructors //usually// need to copy base class 
information as well, and forgetting to do so //may// indicate a programming 
error, this warning may be more appropriate as a linter suggestion than a 
compiler warning. (Usually you'd want `: BaseClass(other)`; `: BaseClass()` is 
really just silencing the warning so you can handle `BaseClass` in the body of 
the copy constructor.)

That said, the warning appears to have been introduced in gcc 4.0 

 in 2005  so every modern version of gcc will 
produce this warning. So in practical terms the concerns raised by @mgehre are 
why I feel this option is needed.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69145



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


[PATCH] D69145: Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra

2019-10-19 Thread Conrad Poelman via Phabricator via cfe-commits
poelmanc updated this revision to Diff 225764.
poelmanc added a comment.

Addressed @mgehre's feedback:

- Ran clang-format
- Included gcc, -Wextra, -Werror=extra, and the full text of the warning/error 
message to aid in searchability, so people can find this option when they 
encounter the problem. Also added example code to the documentation.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69145

Files:
  clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp
  clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.h
  clang-tools-extra/docs/clang-tidy/checks/readability-redundant-member-init.rst
  clang-tools-extra/test/clang-tidy/readability-redundant-member-init.cpp

Index: clang-tools-extra/test/clang-tidy/readability-redundant-member-init.cpp
===
--- clang-tools-extra/test/clang-tidy/readability-redundant-member-init.cpp
+++ clang-tools-extra/test/clang-tidy/readability-redundant-member-init.cpp
@@ -1,4 +1,8 @@
 // RUN: %check_clang_tidy %s readability-redundant-member-init %t
+// RUN:   -config="{CheckOptions: \
+// RUN: [{key: readability-redundant-member-init.IgnoreBaseInCopyConstructors, \
+// RUN:   value: 1}] \
+// RUN: }"
 
 struct S {
   S() = default;
@@ -116,6 +120,35 @@
   };
 };
 
+// struct whose inline copy constructor default-initializes its base class
+struct WithCopyConstructor1 : public T {
+  WithCopyConstructor1(const WithCopyConstructor1& other) : T(),
+f(),
+g()
+  {}
+  S f, g;
+};
+// No warning in copy constructor about T since IgnoreBaseInCopyConstructors=1
+// CHECK-MESSAGES: :[[@LINE-6]]:5: warning: initializer for member 'f' is redundant
+// CHECK-MESSAGES: :[[@LINE-6]]:5: warning: initializer for member 'g' is redundant
+// CHECK-FIXES: WithCopyConstructor1(const WithCopyConstructor1& other) : T()
+// CHECK-NEXT: 
+// CHECK-NEXT: 
+// CHECK-NEXT: {}
+
+// struct whose copy constructor default-initializes its base class
+struct WithCopyConstructor2 : public T {
+  WithCopyConstructor2(const WithCopyConstructor2& other);
+  S a;
+};
+WithCopyConstructor2::WithCopyConstructor2(const WithCopyConstructor2& other)
+  : T(), a()
+{}
+// No warning in copy constructor about T since IgnoreBaseInCopyConstructors=1
+// CHECK-MESSAGES: :[[@LINE-3]]:10: warning: initializer for member 'a' is redundant
+// CHECK-FIXES: {{^}}  : T() {{$}}
+// CHECK-NEXT: {}
+
 // Initializer not written
 struct NF1 {
   NF1() {}
Index: clang-tools-extra/docs/clang-tidy/checks/readability-redundant-member-init.rst
===
--- clang-tools-extra/docs/clang-tidy/checks/readability-redundant-member-init.rst
+++ clang-tools-extra/docs/clang-tidy/checks/readability-redundant-member-init.rst
@@ -6,7 +6,8 @@
 Finds member initializations that are unnecessary because the same default
 constructor would be called if they were not present.
 
-Example:
+Example
+---
 
 .. code-block:: c++
 
@@ -18,3 +19,27 @@
   private:
 std::string s;
   };
+
+Options
+---
+
+.. option:: IgnoreBaseInCopyConstructors
+
+Default is ``0``.
+
+When non-zero, the check will ignore unnecessary base class initializations
+within copy constructors, since some compilers issue warnings/errors when
+base classes are not explicitly intialized in copy constructors. For example,
+``gcc`` with ``-Wextra`` or ``-Werror=extra`` issues warning or error
+``base class ‘Bar’ should be explicitly initialized in the copy constructor``
+if ``Bar()`` were removed in the following example:
+
+.. code-block:: c++
+
+  // Explicitly initializing member s and base class Bar is unnecessary.
+  struct Foo : public Bar {
+// Remove s() below. If IgnoreBaseInCopyConstructors!=0, keep Bar().
+Foo(const Foo& foo) : Bar(), s() {}
+std::string s;
+  };
+
Index: clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.h
===
--- clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.h
+++ clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.h
@@ -23,9 +23,15 @@
 class RedundantMemberInitCheck : public ClangTidyCheck {
 public:
   RedundantMemberInitCheck(StringRef Name, ClangTidyContext *Context)
-  : ClangTidyCheck(Name, Context) {}
+  : ClangTidyCheck(Name, Context),
+IgnoreBaseInCopyConstructors(
+Options.get("IgnoreBaseInCopyConstructors", 0)) {}
+  void storeOptions(ClangTidyOptions::OptionMap ) override;
   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
   void check(const ast_matchers::MatchFinder::MatchResult ) override;
+
+private:
+  bool IgnoreBaseInCopyConstructors;
 };
 
 } // namespace readability
Index: clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp

[PATCH] D69164: [clang-format] fix regression recognizing casts in Obj-C calls

2019-10-19 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

rC373922: [clang-format] [PR27004] omits leading space for noexcept when 
formatting…  was to fix 
https://bugs.llvm.org/show_bug.cgi?id=27004 which wasn't just related to 
`delete` it occurred in other cases. (operator++) and there could be other 
cases i guess.

I think the check for delete above the code that was added was checking for 
`delete` being on the left i.e.  `delete()` and `delete(x)` is not a cast  
(sorry I wasn't the author for that part, so might not be correct)

However, I appreciate this patch (or any patch for that matter) that 
strengthens our tests in this way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69164



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


[PATCH] D69145: Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra

2019-10-19 Thread Conrad Poelman via Phabricator via cfe-commits
poelmanc added a comment.

In D69145#1715611 , @mgehre wrote:

> Exactly due to the issue you are fixing here, we ended up disabling the 
> complete check because we didn't want to live with the warnings it produced 
> on -Wextra.
>  Therefore, I'm actually strongly in favor to enable the option by default.
>
> When others see that clang-tidy fixits introduce warnings (with -Wextra) or 
> even break their build (with -Werror), they might not look into check 
> options, but just disable the check directly.


Thank you for the feedback! I certainly like your suggestion to enable this by 
default but will await a collective conclusion before changing that.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69145



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


[PATCH] D68346: [clang-format] Add new option to add spaces around conditions

2019-10-19 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

Thank you for the patch.

If you plan to continue to submit patches I think it would be worthwhile if you 
applied for commit access, This is not the first revision from you and we need 
more people who are willing to help with clang-format to fix bug and do code 
reviews of other peoples work.

You clearly have an interested and an understanding of how clang-format works 
and a desire to help make it EVEN better. It is also good to get access in 
order to maintain the work you do,

As the cut over to github I believe is tomorrow at the LLVM meeting it might be 
worth waiting until after that point to work out what the procedure to obtain 
access will be as I'm unclear if getting permission will be the same as 
outlined here

https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68346



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


[PATCH] D69181: [clang-tidy] Adding misc-signal-terminated-thread check

2019-10-19 Thread Kocsis Ábel via Phabricator via cfe-commits
abelkocsis added a comment.

Thank you for the reviews!


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69181



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


[PATCH] D69145: Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra

2019-10-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment.

So https://godbolt.org/z/qzjU-C
This feels like gcc being overly zealous, i'm not sure what it says with that 
warning.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69145



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


[PATCH] D69145: Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra

2019-10-19 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added a comment.

Exactly due to the issue you are fixing here, we ended up disabling the 
complete check because we didn't want to live with the warnings it produced on 
-Wextra.
Therefore, I'm actually strongly in favor to enable the option by default.

When others see that clang-tidy fixits introduce warnings (with -Wextra) or 
even break their build (with -Werror), they might not look into check options, 
but just disable the check directly.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69145



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


[PATCH] D69145: Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra

2019-10-19 Thread Matthias Gehre via Phabricator via cfe-commits
mgehre added inline comments.



Comment at: 
clang-tools-extra/clang-tidy/readability/RedundantMemberInitCheck.cpp:55
   const auto *Construct = 
Result.Nodes.getNodeAs("construct");
+  const auto* ConstructorDecl = Result.Nodes.getNodeAs( 
"constructor" );
+

Extra space around string literal - did you run clang-format on your changes?



Comment at: 
clang-tools-extra/docs/clang-tidy/checks/readability-redundant-member-init.rst:30
+within copy constructors. Some compilers issue warnings requiring copy
+constructors to explicitly initialize their base classes.
+

I'd might be helpful to mention `gcc` and `-Wextra` here so users can easily 
identify whether this case applies to them.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69145



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


[PATCH] D69181: [clang-tidy] Adding misc-signal-terminated-thread check

2019-10-19 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added inline comments.



Comment at: 
clang-tools-extra/clang-tidy/misc/BadSignalToKillThreadCheck.cpp:34-48
+  Preprocessor::macro_iterator It = PP->macro_begin();
+  while (It != PP->macro_end() && !SigtermValue.hasValue()) {
+if (It->first->getName() == "SIGTERM") {
+  const auto *MI = PP->getMacroInfo(It->first);
+  const auto  = MI->tokens().back();
+  StringRef ValueStr = StringRef(T.getLiteralData(), T.getLength());
+  llvm::APInt IntValue;

I think using `while` loop here makes this less readable compared to using an 
algorithm like `llvm::find_if`.

I think a more declarative approach would help here.
- Handles properly if the definition of `SIGTERM` uses other than decimal base.
- Checks if `ValueStr.getAsInteger()` succeeded.
Like.:
```
  const auto IsSigterm = [](const auto ) -> bool {
return KeyValue.first->getName() == "SIGTERM";
  };
  const auto TryExpandAsInteger =
  [PP = PP](Preprocessor::macro_iterator It) -> Optional {
if (It == PP->macro_end())
  return llvm::None;
const MacroInfo *MI = PP->getMacroInfo(It->first);
const Token  = MI->tokens().back();
StringRef ValueStr = StringRef(T.getLiteralData(), T.getLength());

llvm::APInt IntValue;
constexpr unsigned AutoSenseRadix = 0;
if (ValueStr.getAsInteger(AutoSenseRadix, IntValue))
  return llvm::None;
return IntValue.getZExtValue();
  };

  const auto SigtermMacro = llvm::find_if(PP->macros(), IsSigterm);

  if (!SigtermValue && !(SigtermValue = TryExpandAsInteger(SigtermMacro)))
return;
```



Comment at: clang-tools-extra/clang-tidy/misc/BadSignalToKillThreadCheck.cpp:55
+diag(MatchedExpr->getBeginLoc(),
+ "Thread should not be terminated by signal.");
+  }

I think it would be valuable to mention the name of the signal.



Comment at: clang-tools-extra/docs/ReleaseNotes.rst:76-77
 
+- New :doc:`misc-signal-terminated-thread
+  ` check.
+

Eugene.Zelenko wrote:
> Please keep alphabetical order in new checks list.
Your checker's name is different from these. Could you check these two lines 
please?



Comment at: 
clang-tools-extra/docs/clang-tidy/checks/misc-bad-signal-to-kill-thread.rst:7
+Warn on uses of the ``pthread_kill`` function when thread is 
+terminated by ``SIGTERM`` signal.
+.. code-block: c++

It would be kind to offer a compliant solution for fixing the warning.



Comment at: 
clang-tools-extra/test/clang-tidy/misc-bad-signal-to-kill-thread.cpp:26
+
+  if ((result = pthread_cancel(thread)) != 0) {
+  }

Maybe worth to note here that this would be the compliant solution.

Also check if it doesn't warn for different signals, but warns for the 
`pthread_kill(thread, 0xF))`


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D69181



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


[PATCH] D68346: [clang-format] Add new option to add spaces around conditions

2019-10-19 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision.
MyDeveloperDay 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/D68346/new/

https://reviews.llvm.org/D68346



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


Re: [PATCH] D68528: [Implicit Modules] Add -cc1 option -fmodules-strict-hash which includes search paths and diagnostics.

2019-10-19 Thread Michael Spencer via cfe-commits
On Fri, Oct 18, 2019 at 7:38 PM Nico Weber via Phabricator <
revi...@reviews.llvm.org> wrote:

> thakis added a comment.
>
> Looks like this fails on win: http://45.33.8.238/win/841/step_6.txt
>
> Ptal!
>
> Maybe just cat'ing all files instead of echoing the first and piping into
> cat works?
>
>
Reverted in r375338. I'll fix it locally and recommit.

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


r375338 - Revert "[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which includes search paths and diagnostics." and "[Docs] Fix header level."

2019-10-19 Thread Michael J. Spencer via cfe-commits
Author: mspencer
Date: Sat Oct 19 02:45:28 2019
New Revision: 375338

URL: http://llvm.org/viewvc/llvm-project?rev=375338=rev
Log:
Revert "[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which 
includes search paths and diagnostics." and "[Docs] Fix header level."

The test doesn't work on Windows. I'll fix it and recommit later.

Removed:
cfe/trunk/test/Modules/context-hash.c
Modified:
cfe/trunk/docs/Modules.rst
cfe/trunk/include/clang/Driver/CC1Options.td
cfe/trunk/include/clang/Lex/HeaderSearchOptions.h
cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/docs/Modules.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/Modules.rst?rev=375338=375337=375338=diff
==
--- cfe/trunk/docs/Modules.rst (original)
+++ cfe/trunk/docs/Modules.rst Sat Oct 19 02:45:28 2019
@@ -225,16 +225,6 @@ Command-line parameters
 ``-fprebuilt-module-path=``
   Specify the path to the prebuilt modules. If specified, we will look for 
modules in this directory for a given top-level module name. We don't need a 
module map for loading prebuilt modules in this directory and the compiler will 
not try to rebuild these modules. This can be specified multiple times.
 
--cc1 Options
-
-
-``-fmodules-strict-context-hash``
-  Enables hashing of all compiler options that could impact the semantics of a
-  module in an implicit build. This includes things such as header search paths
-  and diagnostics. Using this option may lead to an excessive number of modules
-  being built if the command line arguments are not homogeneous across your
-  build.
-
 Module Semantics
 
 

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=375338=375337=375338=diff
==
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Sat Oct 19 02:45:28 2019
@@ -815,9 +815,6 @@ def fdisable_module_hash : Flag<["-"], "
   HelpText<"Disable the module hash">;
 def fmodules_hash_content : Flag<["-"], "fmodules-hash-content">,
   HelpText<"Enable hashing the content of a module file">;
-def fmodules_strict_context_hash : Flag<["-"], "fmodules-strict-context-hash">,
-  HelpText<"Enable hashing of all compiler options that could impact the "
-   "semantics of a module in an implicit build">;
 def c_isystem : JoinedOrSeparate<["-"], "c-isystem">, 
MetaVarName<"">,
   HelpText<"Add directory to the C SYSTEM include search path">;
 def objc_isystem : JoinedOrSeparate<["-"], "objc-isystem">,

Modified: cfe/trunk/include/clang/Lex/HeaderSearchOptions.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/HeaderSearchOptions.h?rev=375338=375337=375338=diff
==
--- cfe/trunk/include/clang/Lex/HeaderSearchOptions.h (original)
+++ cfe/trunk/include/clang/Lex/HeaderSearchOptions.h Sat Oct 19 02:45:28 2019
@@ -11,7 +11,6 @@
 
 #include "clang/Basic/LLVM.h"
 #include "llvm/ADT/CachedHashString.h"
-#include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/StringRef.h"
 #include 
@@ -207,13 +206,6 @@ public:
 
   unsigned ModulesHashContent : 1;
 
-  /// Whether we should include all things that could impact the module in the
-  /// hash.
-  ///
-  /// This includes things like the full header search path, and enabled
-  /// diagnostics.
-  unsigned ModulesStrictContextHash : 1;
-
   HeaderSearchOptions(StringRef _Sysroot = "/")
   : Sysroot(_Sysroot), ModuleFormat("raw"), DisableModuleHash(false),
 ImplicitModuleMaps(false), ModuleMapFileHomeIsCwd(false),
@@ -222,8 +214,7 @@ public:
 ModulesValidateOncePerBuildSession(false),
 ModulesValidateSystemHeaders(false),
 ValidateASTInputFilesContent(false), UseDebugInfo(false),
-ModulesValidateDiagnosticOptions(true), ModulesHashContent(false),
-ModulesStrictContextHash(false) {}
+ModulesValidateDiagnosticOptions(true), ModulesHashContent(false) {}
 
   /// AddPath - Add the \p Path path to the specified \p Group list.
   void AddPath(StringRef Path, frontend::IncludeDirGroup Group,
@@ -247,15 +238,6 @@ public:
   }
 };
 
-inline llvm::hash_code hash_value(const HeaderSearchOptions::Entry ) {
-  return llvm::hash_combine(E.Path, E.Group, E.IsFramework, E.IgnoreSysRoot);
-}
-
-inline llvm::hash_code
-hash_value(const HeaderSearchOptions::SystemHeaderPrefix ) {
-  return llvm::hash_combine(SHP.Prefix, SHP.IsSystemHeader);
-}
-
 } // namespace clang
 
 #endif // LLVM_CLANG_LEX_HEADERSEARCHOPTIONS_H

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=375338=375337=375338=diff

Re: Zorg migration to GitHub/monorepo

2019-10-19 Thread Galina Kistanova via cfe-commits
Hello everyone,

The staging master is ready to accept bots from the list I have sent
yesterday. Don't wait too long.

The master has been updated and works with both SVN and Github monorepo now.

The following builders are already listening for changes in monorepo and
building monorepo. More are coming.

* clang-sphinx-docs
* clang-tools-sphinx-docs
* clang-x86_64-linux-abi-test
* clang-lld-x86_64-2stage
* libcxx-libcxxabi-singlethreaded-x86_64-linux-debian
* libcxx-sphinx-docs
* libunwind-sphinx-docs
* lld-sphinx-docs
* lld-x86_64-darwin13
* lld-x86_64-ubuntu-fast
* lldb-sphinx-docs
* llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
* llvm-clang-x86_64-win-fast <<-- ?
* llvm-sphinx-docs
* clang-x86_64-debian-fast
* libcxx-libcxxabi-libunwind-x86_64-linux-debian
* libcxx-libcxxabi-singlethreaded-x86_64-linux-debian
* libcxx-libcxxabi-x86_64-linux-debian
* libcxx-libcxxabi-x86_64-linux-debian-noexceptions

A friendly reminder. If your bots are using one of these build factories,
you would need either update your build configurations to use one of the
currently supported build factories, or port that factory to work with
github and monorepo.

* LLVMBuilder (3 bots)
* PollyBuilder (3 bots)
* LLDBBuilder (6 bots)
* SanitizerBuilder (10 bots)
* CUDATestsuiteBuilder (1 bot) - depends on
ClangBuilder.getClangBuildFactory
* AOSPBuilder (1 bot) - depends on PollyBuilder
* AnnotatedBuilder (2 bots)
* OpenMPBuilder (2 bots)
* FuchsiaBuilder (1 bot)

Thanks

Galina


On Fri, Oct 18, 2019 at 12:05 AM Galina Kistanova 
wrote:

> Hello build bot owners!
>
> The staging master is ready. Please feel free to use it to make sure your
> bots would work well with the monorepo and github.
>
> The following builders could be configured to build monorepo:
>
> * clang-atom-d525-fedora-rel
> * clang-native-arm-lnt-perf
> * clang-cmake-armv7-lnt
> * clang-cmake-armv7-selfhost-neon
> * clang-cmake-armv7-quick
> * clang-cmake-armv7-global-isel
> * clang-cmake-armv7-selfhost
> * clang-cmake-aarch64-quick
> * clang-cmake-aarch64-lld
> * clang-cmake-aarch64-global-isel
> * clang-ppc64be-linux-lnt
> * clang-ppc64be-linux-multistage
> * clang-ppc64le-linux-lnt
> * clang-ppc64le-linux-multistage
> * clang-ppc64be-linux
> * clang-ppc64le-linux
> * clang-s390x-linux
> * clang-s390x-linux-multistage
> * clang-s390x-linux-lnt
> * clang-hexagon-elf
> * clang-cmake-x86_64-avx2-linux
> * clang-cmake-x86_64-avx2-linux-perf
> * clang-cmake-x86_64-sde-avx512-linux
> * clang-solaris11-amd64
> * clang-x64-ninja-win7
> * clang-solaris11-sparcv9
> * clang-cmake-armv7-full
> * clang-cmake-thumbv7-full-sh
> * clang-cmake-armv8-lld
> * clang-cmake-aarch64-full
> * clang-armv7-linux-build-cache
> * clang-aarch64-linux-build-cache
> * libcxx-libcxxabi-x86_64-linux-debian
> * libcxx-libcxxabi-x86_64-linux-debian-noexceptions
> * libcxx-libcxxabi-libunwind-x86_64-linux-debian
> * libcxx-libcxxabi-singlethreaded-x86_64-linux-debian
> * libcxx-libcxxabi-x86_64-linux-ubuntu-cxx03
> * libcxx-libcxxabi-x86_64-linux-ubuntu-cxx11
> * libcxx-libcxxabi-x86_64-linux-ubuntu-cxx14
> * libcxx-libcxxabi-x86_64-linux-ubuntu-cxx17
> * libcxx-libcxxabi-x86_64-linux-ubuntu-cxx2a
> * libcxx-libcxxabi-x86_64-linux-ubuntu-32bit
> * libcxx-libcxxabi-x86_64-linux-ubuntu-asan
> * libcxx-libcxxabi-x86_64-linux-ubuntu-ubsan
> * libcxx-libcxxabi-x86_64-linux-ubuntu-msan
> * libcxx-libcxxabi-libunwind-x86_64-linux-ubuntu
> * libcxx-libcxxabi-x86_64-linux-ubuntu-tsan
> * libcxx-libcxxabi-x86_64-linux-ubuntu-gcc5-cxx11
> * libcxx-libcxxabi-x86_64-linux-ubuntu-gcc-tot-latest-std
> * libcxx-libcxxabi-libunwind-armv7-linux
> * libcxx-libcxxabi-libunwind-armv8-linux
> * libcxx-libcxxabi-libunwind-armv7-linux-noexceptions
> * libcxx-libcxxabi-libunwind-armv8-linux-noexceptions
> * libcxx-libcxxabi-libunwind-aarch64-linux
> * libcxx-libcxxabi-libunwind-aarch64-linux-noexceptions
> * ppc64le-lld-multistage-test
>
> These builders are already on the staging master. So, please ping me if
> you would like to configure any of them to work with monorepo:
>
> * clang-freebsd11-amd64
>
> These builders have been already tested and could be reconfigured without
> staging as soon as public master is ready:
>
> * llvm-sphinx-docs
> * clang-sphinx-docs
> * clang-tools-sphinx-docs
> * lld-sphinx-docs
> * lldb-sphinx-docs
> * libcxx-sphinx-docs
> * libunwind-sphinx-docs
> * clang-x86_64-debian-fast
> * libcxx-libcxxabi-x86_64-linux-debian
> * libcxx-libcxxabi-x86_64-linux-debian-noexceptions
> * libcxx-libcxxabi-libunwind-x86_64-linux-debian
> * libcxx-libcxxabi-singlethreaded-x86_64-linux-debian
> * lld-x86_64-darwin13
> * lld-x86_64-win7
> * llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
> * llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast
> * clang-x86_64-linux-abi-test
> * clang-with-lto-ubuntu
> * clang-with-thin-lto-ubuntu
> * llvm-clang-x86_64-expensive-checks-win
> * llvm-clang-x86_64-win-fast
> * lld-x86_64-ubuntu-fast
> * clang-lld-x86_64-2stage
> * lld-perf-testsuite
>
> Thanks for your patience and help!
>

[PATCH] D69215: [DWARF5] Added support for deleted C++ special member functions.

2019-10-19 Thread Sourabh Singh Tomar via Phabricator via cfe-commits
SouraVX updated this revision to Diff 225749.
SouraVX added a comment.

Corrected typo in test case.


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

https://reviews.llvm.org/D69215

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/test/CodeGenCXX/debug-info-deleted.cpp
  llvm/include/llvm/BinaryFormat/Dwarf.h
  llvm/include/llvm/IR/DebugInfoFlags.def
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/lib/BinaryFormat/Dwarf.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  llvm/test/DebugInfo/X86/DW_AT_deleted.ll

Index: llvm/test/DebugInfo/X86/DW_AT_deleted.ll
===
--- /dev/null
+++ llvm/test/DebugInfo/X86/DW_AT_deleted.ll
@@ -0,0 +1,110 @@
+; RUN: llc < %s -filetype=obj -o %t
+; RUN: llvm-dwarfdump -v %t | FileCheck %s
+
+; C++ source to regenerate:
+; class deleted {
+; public:
+;   // Defaulted on purpose, so as to facilitate object creation
+;deleted() = default;
+; 
+;   deleted(const deleted &) = delete;
+;   deleted =(const deleted &) = delete;
+; 
+;   deleted(deleted &&) = delete;
+;   deleted =(deleted &&) = delete;
+; 
+;   ~deleted() = default;
+; };
+; 
+; void foo() {
+;   deleted obj1;
+; }
+; $ clang++ -O0 -g -gdwarf-5 debug-info-deleted.cpp -c
+
+
+; CHECK: .debug_abbrev contents:
+
+; CHECK: [7] DW_TAG_subprogram   DW_CHILDREN_yes
+; CHECK: DW_AT_deleted   DW_FORM_flag_present
+; CHECK: [9] DW_TAG_subprogram   DW_CHILDREN_yes
+; CHECK: DW_AT_deleted   DW_FORM_flag_present
+
+; CHECK: .debug_info contents:
+
+; CHECK: DW_TAG_subprogram [7]
+; CHECK-NEXT: DW_AT_name [DW_FORM_strx1](indexed (0006) string = "deleted") 
+; CHECK:  DW_AT_deleted [DW_FORM_flag_present]  (true)
+
+; CHECK: DW_TAG_subprogram [9]
+; CHECK-NEXT: DW_AT_linkage_name [DW_FORM_strx1](indexed (0007) string = "_ZN7deletedaSERKS_") 
+; CHECK:  DW_AT_deleted [DW_FORM_flag_present]  (true)
+
+; CHECK: DW_TAG_subprogram [7]
+; CHECK-NEXT: DW_AT_name [DW_FORM_strx1](indexed (0006) string = "deleted") 
+; CHECK:  DW_AT_deleted [DW_FORM_flag_present]  (true)
+
+; CHECK: DW_TAG_subprogram [9]
+; CHECK-NEXT: DW_AT_linkage_name [DW_FORM_strx1](indexed (0009) string = "_ZN7deletedaSEOS_")
+; CHECK-NEXT: DW_AT_name [DW_FORM_strx1](indexed (0008) string = "operator=")
+; CHECK:  DW_AT_deleted [DW_FORM_flag_present]  (true)
+
+; ModuleID = 'debug-info-deleted.cpp'
+source_filename = "debug-info-deleted.cpp"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+%class.deleted = type { i8 }
+
+; Function Attrs: noinline nounwind optnone uwtable
+define dso_local void @_Z3foov() #0 !dbg !7 {
+  %1 = alloca %class.deleted, align 1
+  call void @llvm.dbg.declare(metadata %class.deleted* %1, metadata !10, metadata !DIExpression()), !dbg !34
+  ret void, !dbg !35
+}
+
+; Function Attrs: nounwind readnone speculatable willreturn
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+
+attributes #0 = { noinline nounwind optnone uwtable }
+attributes #1 = { nounwind readnone speculatable willreturn }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!llvm.ident = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 10.0.0 (https://github.com/llvm/llvm-project.git 715c47d5de9aa8860050992a7aaf27dca53f7f4a)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
+!1 = !DIFile(filename: "debug-info-deleted.cpp", directory: "/home/sourabh/work/dwarf/c_c++/c++11", checksumkind: CSK_MD5, checksum: "49dc56907586479c64634558b060292d")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 5}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{!"clang version 10.0.0 (https://github.com/llvm/llvm-project.git 715c47d5de9aa8860050992a7aaf27dca53f7f4a)"}
+!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 14, type: !8, scopeLine: 14, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null}
+!10 = !DILocalVariable(name: "obj1", scope: !7, file: !1, line: 15, type: !11)
+!11 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "deleted", file: !1, line: 1, size: 8, flags: DIFlagTypePassByReference, elements: !12, identifier: "_ZTS7deleted")
+!12 = !{!13, !17, !22, !26, !30, !33}
+!13 = !DISubprogram(name: "deleted", scope: !11, file: !1, line: 3, type: !14, scopeLine: 3, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)
+!14 = !DISubroutineType(types: !15)
+!15 = !{null, !16}
+!16 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!17 = !DISubprogram(name: "deleted", scope: !11, file: !1, line: 5, type: !18, scopeLine: 5, flags: DIFlagPublic | DIFlagPrototyped, spFlags: DISPFlagDeleted)
+!18 = !DISubroutineType(types: 

[PATCH] D69215: [DWARF5] Added support for deleted C++ special member functions.

2019-10-19 Thread Sourabh Singh Tomar via Phabricator via cfe-commits
SouraVX created this revision.
SouraVX added reviewers: probinson, dblaikie, aprantl.
SouraVX added a project: debug-info.
Herald added subscribers: llvm-commits, cfe-commits, hiraditya.
Herald added projects: clang, LLVM.
SouraVX marked an inline comment as done.
SouraVX added inline comments.



Comment at: llvm/test/DebugInfo/X86/DW_AT_deleted.ll:68
+
+attributes #0 = { noinline nounwind optnone uwtable }
+attributes #1 = { nounwind readnone speculatable willreturn }

Removed all stringified attributes that aren't strictly necessary -- as 
mentioned by @aprantl in noreturn patch review.


This patch adds support for deleted C++ special member functions in clang and 
llvm. Also added Defaulted member encodings for future support for defaulted 
member functions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69215

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/test/CodeGenCXX/debug-info-deleted.cpp
  llvm/include/llvm/BinaryFormat/Dwarf.h
  llvm/include/llvm/IR/DebugInfoFlags.def
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/lib/BinaryFormat/Dwarf.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
  llvm/test/DebugInfo/X86/DW_AT_deleted.ll

Index: llvm/test/DebugInfo/X86/DW_AT_deleted.ll
===
--- /dev/null
+++ llvm/test/DebugInfo/X86/DW_AT_deleted.ll
@@ -0,0 +1,110 @@
+; RUN: llc < %s -filetype=obj -o %t
+; RUN: llvm-dwarfdump -v %t | FileCheck %s
+
+; C++ source to regenerate:
+; class deleted {
+; public:
+;   // Defaulted on purpose, so as to facilitate object creation
+deleted() = default;
+; 
+;   deleted(const deleted &) = delete;
+;   deleted =(const deleted &) = delete;
+; 
+;   deleted(deleted &&) = delete;
+;   deleted =(deleted &&) = delete;
+; 
+;   ~deleted() = default;
+; };
+; 
+; void foo() {
+;   deleted obj1;
+; }
+; $ clang++ -O0 -g -gdwarf-5 debug-info-deleted.cpp -c
+
+
+; CHECK: .debug_abbrev contents:
+
+; CHECK: [7] DW_TAG_subprogram   DW_CHILDREN_yes
+; CHECK: DW_AT_deleted   DW_FORM_flag_present
+; CHECK: [9] DW_TAG_subprogram   DW_CHILDREN_yes
+; CHECK: DW_AT_deleted   DW_FORM_flag_present
+
+; CHECK: .debug_info contents:
+
+; CHECK: DW_TAG_subprogram [7]
+; CHECK-NEXT: DW_AT_name [DW_FORM_strx1](indexed (0006) string = "deleted") 
+; CHECK:  DW_AT_deleted [DW_FORM_flag_present]  (true)
+
+; CHECK: DW_TAG_subprogram [9]
+; CHECK-NEXT: DW_AT_linkage_name [DW_FORM_strx1](indexed (0007) string = "_ZN7deletedaSERKS_") 
+; CHECK:  DW_AT_deleted [DW_FORM_flag_present]  (true)
+
+; CHECK: DW_TAG_subprogram [7]
+; CHECK-NEXT: DW_AT_name [DW_FORM_strx1](indexed (0006) string = "deleted") 
+; CHECK:  DW_AT_deleted [DW_FORM_flag_present]  (true)
+
+; CHECK: DW_TAG_subprogram [9]
+; CHECK-NEXT: DW_AT_linkage_name [DW_FORM_strx1](indexed (0009) string = "_ZN7deletedaSEOS_")
+; CHECK-NEXT: DW_AT_name [DW_FORM_strx1](indexed (0008) string = "operator=")
+; CHECK:  DW_AT_deleted [DW_FORM_flag_present]  (true)
+
+; ModuleID = 'debug-info-deleted.cpp'
+source_filename = "debug-info-deleted.cpp"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+%class.deleted = type { i8 }
+
+; Function Attrs: noinline nounwind optnone uwtable
+define dso_local void @_Z3foov() #0 !dbg !7 {
+  %1 = alloca %class.deleted, align 1
+  call void @llvm.dbg.declare(metadata %class.deleted* %1, metadata !10, metadata !DIExpression()), !dbg !34
+  ret void, !dbg !35
+}
+
+; Function Attrs: nounwind readnone speculatable willreturn
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+
+attributes #0 = { noinline nounwind optnone uwtable }
+attributes #1 = { nounwind readnone speculatable willreturn }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!llvm.ident = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 10.0.0 (https://github.com/llvm/llvm-project.git c6b9c226edb6d74cd9cc381b1ce4727e2dc2d3be)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
+!1 = !DIFile(filename: "debug-info-deleted.cpp", directory: "/home/sourabh/work/dwarf/c_c++/c++11", checksumkind: CSK_MD5, checksum: "3fb251939a9ffddac1e3e76216af5c6a")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 5}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{!"clang version 10.0.0 (https://github.com/llvm/llvm-project.git c6b9c226edb6d74cd9cc381b1ce4727e2dc2d3be)"}
+!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 28, type: !8, scopeLine: 28, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null}
+!10 = !DILocalVariable(name: "obj1", scope: !7, file: !1, line: 29, type: !11)
+!11 = distinct !DICompositeType(tag: DW_TAG_class_type, 

[PATCH] D69215: [DWARF5] Added support for deleted C++ special member functions.

2019-10-19 Thread Sourabh Singh Tomar via Phabricator via cfe-commits
SouraVX marked an inline comment as done.
SouraVX added inline comments.



Comment at: llvm/test/DebugInfo/X86/DW_AT_deleted.ll:68
+
+attributes #0 = { noinline nounwind optnone uwtable }
+attributes #1 = { nounwind readnone speculatable willreturn }

Removed all stringified attributes that aren't strictly necessary -- as 
mentioned by @aprantl in noreturn patch review.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69215



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