[clang-tools-extra] r264531 - Add clang-tools-extra release notes

2016-03-26 Thread Richard Thomson via cfe-commits
Author: legalize
Date: Sun Mar 27 00:06:57 2016
New Revision: 264531

URL: http://llvm.org/viewvc/llvm-project?rev=264531&view=rev
Log:
Add clang-tools-extra release notes

Added:
clang-tools-extra/trunk/docs/ReleaseNotes.rst
Modified:
clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst
clang-tools-extra/trunk/docs/index.rst

Added: clang-tools-extra/trunk/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/ReleaseNotes.rst?rev=264531&view=auto
==
--- clang-tools-extra/trunk/docs/ReleaseNotes.rst (added)
+++ clang-tools-extra/trunk/docs/ReleaseNotes.rst Sun Mar 27 00:06:57 2016
@@ -0,0 +1,71 @@
+=
+Extra Clang Tools 3.9 (In-Progress) Release Notes
+=
+
+.. contents::
+   :local:
+   :depth: 2
+
+Written by the `LLVM Team `_
+
+.. warning::
+
+   These are in-progress notes for the upcoming Clang 3.9 release. You may
+   prefer the `Clang 3.8 Release Notes
+   `_.
+
+Introduction
+
+
+This document contains the release notes for the Extra Clang Tools, part of the
+Clang release 3.9.  Here we describe the status of the Extra Clang Tools in 
some
+detail, including major improvements from the previous release and new feature
+work. For the general Clang release notes, see `the Clang documentation
+`_.  All 
LLVM
+releases may be downloaded from the `LLVM releases web
+site `_.
+
+For more information about Clang or LLVM, including information about
+the latest release, please see the `Clang Web Site `_ or
+the `LLVM Web Site `_.
+
+Note that if you are reading this file from a Subversion checkout or the
+main Clang web page, this document applies to the *next* release, not
+the current one. To see the release notes for a specific release, please
+see the `releases page `_.
+
+What's New in Extra Clang Tools 3.9?
+
+
+Some of the major new features and improvements to Extra Clang Tools are listed
+here. Generic improvements to Extra Clang Tools as a whole or to its underlying
+infrastructure are described first, followed by tool-specific sections.
+
+Major New Features
+--
+
+- Feature1...
+
+Improvements to ``clang-query``
+^^^
+
+The improvements are...
+
+Improvements to ``clang-rename``
+
+
+The improvements are...
+
+Improvements to ``clang-tidy``
+^^
+
+``clang-tidy``'s checks are constantly being improved to catch more issues,
+explain them more clearly, and provide more accurate fix-its for the issues
+identified.  The improvements since the 3.8 release include:
+
+-  ...
+
+Improvements to ``modularize``
+^^
+
+The improvements are...

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst?rev=264531&r1=264530&r2=264531&view=diff
==
--- clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst Sun Mar 27 00:06:57 
2016
@@ -88,6 +88,7 @@ Clang-Tidy Checks
performance-faster-string-find
performance-for-range-copy
performance-implicit-cast-in-loop
+   performance-unnecessary-copy-initialization
readability-braces-around-statements
readability-container-size-empty
readability-else-after-return

Modified: clang-tools-extra/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/index.rst?rev=264531&r1=264530&r2=264531&view=diff
==
--- clang-tools-extra/trunk/docs/index.rst (original)
+++ clang-tools-extra/trunk/docs/index.rst Sun Mar 27 00:06:57 2016
@@ -10,6 +10,10 @@ Introduction
 Welcome to the clang-tools-extra project which contains extra tools built using
 Clang's tooling API's.
 
+.. toctree::
+   :maxdepth: 1
+
+   ReleaseNotes
 
 Contents
 


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


[clang-tools-extra] r264539 - clang-tidy: Add check modernize-raw-string-literal

2016-03-27 Thread Richard Thomson via cfe-commits
Author: legalize
Date: Sun Mar 27 11:43:44 2016
New Revision: 264539

URL: http://llvm.org/viewvc/llvm-project?rev=264539&view=rev
Log:
clang-tidy: Add check modernize-raw-string-literal

Added:
clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp
clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.h

clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-raw-string-literal.rst

clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal-delimiter.cpp
clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal.cpp
Modified:
clang-tools-extra/trunk/clang-tidy/modernize/CMakeLists.txt
clang-tools-extra/trunk/clang-tidy/modernize/ModernizeTidyModule.cpp
clang-tools-extra/trunk/docs/ReleaseNotes.rst
clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst

Modified: clang-tools-extra/trunk/clang-tidy/modernize/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/CMakeLists.txt?rev=264539&r1=264538&r2=264539&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/modernize/CMakeLists.txt (original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/CMakeLists.txt Sun Mar 27 
11:43:44 2016
@@ -7,6 +7,7 @@ add_clang_library(clangTidyModernizeModu
   MakeUniqueCheck.cpp
   ModernizeTidyModule.cpp
   PassByValueCheck.cpp
+  RawStringLiteralCheck.cpp
   RedundantVoidArgCheck.cpp
   ReplaceAutoPtrCheck.cpp
   ShrinkToFitCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/modernize/ModernizeTidyModule.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/ModernizeTidyModule.cpp?rev=264539&r1=264538&r2=264539&view=diff
==
--- clang-tools-extra/trunk/clang-tidy/modernize/ModernizeTidyModule.cpp 
(original)
+++ clang-tools-extra/trunk/clang-tidy/modernize/ModernizeTidyModule.cpp Sun 
Mar 27 11:43:44 2016
@@ -14,6 +14,7 @@
 #include "LoopConvertCheck.h"
 #include "MakeUniqueCheck.h"
 #include "PassByValueCheck.h"
+#include "RawStringLiteralCheck.h"
 #include "RedundantVoidArgCheck.h"
 #include "ReplaceAutoPtrCheck.h"
 #include "ShrinkToFitCheck.h"
@@ -36,6 +37,8 @@ public:
 CheckFactories.registerCheck("modernize-loop-convert");
 CheckFactories.registerCheck("modernize-make-unique");
 CheckFactories.registerCheck("modernize-pass-by-value");
+CheckFactories.registerCheck(
+"modernize-raw-string-literal");
 CheckFactories.registerCheck(
 "modernize-redundant-void-arg");
 CheckFactories.registerCheck(

Added: clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp?rev=264539&view=auto
==
--- clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp 
(added)
+++ clang-tools-extra/trunk/clang-tidy/modernize/RawStringLiteralCheck.cpp Sun 
Mar 27 11:43:44 2016
@@ -0,0 +1,140 @@
+//===--- RawStringLiteralCheck.cpp - 
clang-tidy===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "RawStringLiteralCheck.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/Lex/Lexer.h"
+
+using namespace clang::ast_matchers;
+
+namespace clang {
+namespace tidy {
+namespace modernize {
+
+namespace {
+
+bool containsEscapes(StringRef HayStack, StringRef Escapes) {
+  size_t BackSlash = HayStack.find('\\');
+  if (BackSlash == StringRef::npos)
+return false;
+
+  while (BackSlash != StringRef::npos) {
+if (Escapes.find(HayStack[BackSlash + 1]) == StringRef::npos)
+  return false;
+BackSlash = HayStack.find('\\', BackSlash + 2);
+  }
+
+  return true;
+}
+
+bool isRawStringLiteral(StringRef Text) {
+  // Already a raw string literal if R comes before ".
+  const size_t QuotePos = Text.find('"');
+  assert(QuotePos != StringRef::npos);
+  return (QuotePos > 0) && (Text[QuotePos - 1] == 'R');
+}
+
+bool containsEscapedCharacters(const MatchFinder::MatchResult &Result,
+   const StringLiteral *Literal) {
+  // FIXME: Handle L"", u8"", u"" and U"" literals.
+  if (!Literal->isAscii())
+return false;
+
+  StringRef Bytes = Literal->getBytes();
+  // Non-printing characters disqualify this literal:
+  // \007 = \a bell
+  // \010 = \b backspace
+  // \011 = \t horizontal tab
+  // \012 = \n new line
+  // \013 = \v vertical tab
+  // \014 = \f form feed
+  // \015 = \r carriage return
+  // \177 = delete
+  if (Bytes.find_first_of(String

[clang-tools-extra] r264563 - clang-tidy: Fix broken buildbot

2016-03-27 Thread Richard Thomson via cfe-commits
Author: legalize
Date: Sun Mar 27 23:15:41 2016
New Revision: 264563

URL: http://llvm.org/viewvc/llvm-project?rev=264563&view=rev
Log:
clang-tidy: Fix broken buildbot

VS 2013 does not support char16_t or char32_t

Modified:
clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal.cpp

Modified: 
clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal.cpp?rev=264563&r1=264562&r2=264563&view=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-raw-string-literal.cpp 
Sun Mar 27 23:15:41 2016
@@ -46,10 +46,12 @@ char const *const TrailingNewLine("A sin
 char const *const AlreadyRaw(R"(foobie\\bletch)");
 char const *const UTF8Literal(u8"foobie\\bletch");
 char const *const UTF8RawLiteral(u8R"(foobie\\bletch)");
-char16_t const *const UTF16Literal(u"foobie\\bletch");
-char16_t const *const UTF16RawLiteral(uR"(foobie\\bletch)");
-char32_t const *const UTF32Literal(U"foobie\\bletch");
-char32_t const *const UTF32RawLiteral(UR"(foobie\\bletch)");
+// TODO: enable these tests once all supported compilers
+// support char16_t and char32_t (VS2013 does not)
+// char16_t const *const UTF16Literal(u"foobie\\bletch");
+// char16_t const *const UTF16RawLiteral(uR"(foobie\\bletch)");
+// char32_t const *const UTF32Literal(U"foobie\\bletch");
+// char32_t const *const UTF32RawLiteral(UR"(foobie\\bletch)");
 wchar_t const *const WideLiteral(L"foobie\\bletch");
 wchar_t const *const WideRawLiteral(LR"(foobie\\bletch)");
 


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


[clang-tools-extra] Update clang tidy Contributing guide (PR #106672)

2024-09-02 Thread Richard Thomson via cfe-commits

LegalizeAdulthood wrote:

> Alternatively, pressing the tab key after a previous matcher's open 
> parentheses would also

Did you try this on Windows?  Because in my experience all these TAB-complete 
actions depend on GNU readline which doesn't work on Windows.

https://github.com/llvm/llvm-project/pull/106672
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy] Detect string literals in macros in modernize-raw-string… (PR #133636)

2025-03-30 Thread Richard Thomson via cfe-commits


@@ -58,7 +58,7 @@ bool containsEscapedCharacters(const MatchFinder::MatchResult 
&Result,
   *Result.SourceManager, Result.Context->getLangOpts());
   StringRef Text = Lexer::getSourceText(CharRange, *Result.SourceManager,
 Result.Context->getLangOpts());
-  if (Text.empty() || isRawStringLiteral(Text))
+  if (Text.empty() || !Text.contains('"') || isRawStringLiteral(Text))

LegalizeAdulthood wrote:

Why is this necessary?

https://github.com/llvm/llvm-project/pull/133636
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy] Detect string literals in macros in modernize-raw-string… (PR #133636)

2025-04-02 Thread Richard Thomson via cfe-commits


@@ -58,7 +58,7 @@ bool containsEscapedCharacters(const MatchFinder::MatchResult 
&Result,
   *Result.SourceManager, Result.Context->getLangOpts());
   StringRef Text = Lexer::getSourceText(CharRange, *Result.SourceManager,
 Result.Context->getLangOpts());
-  if (Text.empty() || isRawStringLiteral(Text))
+  if (Text.empty() || !Text.contains('"') || isRawStringLiteral(Text))

LegalizeAdulthood wrote:

I mean this is a blanket-wide check to see if the text contains a double quote 
character (`"`), but isn't contextualized to the specific case that matters -- 
when the text is supplied as an macro argument to the preprocessor string-ize 
operator `#`.  I don't see how adding this condition applies _only_ to that 
situation.

https://github.com/llvm/llvm-project/pull/133636
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [clang-tidy] Detect string literals in macros in modernize-raw-string… (PR #133636)

2025-04-02 Thread Richard Thomson via cfe-commits

https://github.com/LegalizeAdulthood edited 
https://github.com/llvm/llvm-project/pull/133636
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits