[PATCH] D151963: [clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

2023-06-30 Thread Eduard Zingerman via Phabricator via cfe-commits
eddyz87 added inline comments.



Comment at: libcxx/utils/ci/buildkite-pipeline-clang.yml:20-31
+  - label: "Format"
+commands:
+  - "! grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs || 
false"
+
+agents:
+  queue: "libcxx-builders"
+  os: "linux"

ldionne wrote:
> Something in here broke the Clang CI. See for example 
> https://buildkite.com/llvm-project/libcxx-ci/builds/27050#0188fe23-c359-4a1d-8d10-f0fb966f142e.
> 
> It's actually interesting, now the libc++ CI is lightning fast since we're 
> not sharing our resources anymore. I'll follow-up on that, I never expected 
> it to make such a huge difference.
I believe it's the following line:

```
commands:
  - "! grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs || false"
```

buildkite-agent interpolates variables in commands and reacts to `$`, so it 
should be:

```
commands:
  - "! grep -rnI '[[:blank:]]$$' clang/lib clang/include clang/docs || 
false"
```

Instead (note `$$`).

It is possible to test this locally using the following commands:

```
$ ./libcxx/utils/ci/generate-buildkite-pipeline > 1.ym
$ docker run -v `realpath 1.yml`:`realpath 1.yml` \
  --rm buildkite/agent:3 pipeline upload --dry-run \
  --agent-access-token xx `realpath 1.yml`
2023-06-30 14:36:35 INFO   Reading pipeline config from 
"/home/eddy/work/llvm-project/1.yml"
2023-06-30 14:36:35 FATAL  Pipeline parsing of "1.yml" failed (Expected 
identifier to start with a letter, got ')
```

The error is gone if '$$' change is applied. (But I have not tested if 
semantics of the command is preserved).
As far as I understand [[ 
https://github.com/buildkite/agent/issues/584#issuecomment-343809421 | this 
link ]] applies here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151963

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


[PATCH] D151963: [clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

2023-06-27 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added inline comments.



Comment at: libcxx/utils/ci/buildkite-pipeline-clang.yml:20-31
+  - label: "Format"
+commands:
+  - "! grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs || 
false"
+
+agents:
+  queue: "libcxx-builders"
+  os: "linux"

Something in here broke the Clang CI. See for example 
https://buildkite.com/llvm-project/libcxx-ci/builds/27050#0188fe23-c359-4a1d-8d10-f0fb966f142e.

It's actually interesting, now the libc++ CI is lightning fast since we're not 
sharing our resources anymore. I'll follow-up on that, I never expected it to 
make such a huge difference.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151963

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


[PATCH] D151963: [clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

2023-06-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment.

In D151963#4449346 , @aaron.ballman 
wrote:

> In D151963#4390675 , @erichkeane 
> wrote:
>
>> This looks fine to me.  HOWEVER, please make sure to add this commit to 
>> `https://github.com/llvm/llvm-project/blob/main/.git-blame-ignore-revs` in a 
>> follow-up NFC commit.
>
> Please be sure to do this.

This did get handled, thanks! Today I learned that changes to the top level in 
the monorepo don't make it to either of the llvm-commits or cfe-commits mailing 
lists.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151963

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


[PATCH] D151963: [clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

2023-06-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment.

In D151963#4390675 , @erichkeane 
wrote:

> This looks fine to me.  HOWEVER, please make sure to add this commit to 
> `https://github.com/llvm/llvm-project/blob/main/.git-blame-ignore-revs` in a 
> follow-up NFC commit.

Please be sure to do this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151963

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


[PATCH] D151963: [clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

2023-06-26 Thread Nikolas Klauser via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf6d557ee34b6: [clang][NFC] Remove trailing whitespaces and 
enforce it in lib, include and docs (authored by philnik).

Changed prior to commit:
  https://reviews.llvm.org/D151963?vs=527706=534608#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151963

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/docs/ClangLinkerWrapper.rst
  clang/docs/ClangOffloadPackager.rst
  clang/docs/ClangTransformerTutorial.rst
  clang/docs/DebuggingCoroutines.rst
  clang/docs/ExternalClangExamples.rst
  clang/docs/JSONCompilationDatabase.rst
  clang/docs/LanguageExtensions.rst
  clang/docs/MisExpect.rst
  clang/docs/SourceBasedCodeCoverage.rst
  clang/docs/StandardCPlusPlusModules.rst
  clang/docs/UndefinedBehaviorSanitizer.rst
  clang/docs/analyzer/checkers.rst
  clang/docs/analyzer/developer-docs/DebugChecks.rst
  clang/docs/tools/dump_ast_matchers.py
  clang/docs/tools/dump_format_style.py
  clang/include/clang/AST/DeclCXX.h
  clang/include/clang/AST/DeclObjC.h
  clang/include/clang/AST/TypeProperties.td
  clang/include/clang/Analysis/AnalysisDeclContext.h
  clang/include/clang/Analysis/CallGraph.h
  clang/include/clang/Basic/AttrDocs.td
  clang/include/clang/Basic/DiagnosticGroups.td
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Basic/OpenCLExtensions.def
  clang/include/clang/Basic/TypeNodes.td
  clang/include/clang/Basic/riscv_vector.td
  clang/include/clang/Driver/Options.td
  clang/include/clang/Sema/CMakeLists.txt
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/lib/Analysis/FlowSensitive/CMakeLists.txt
  clang/lib/Analysis/UninitializedValues.cpp
  clang/lib/Analysis/UnsafeBufferUsage.cpp
  clang/lib/Basic/Targets/PPC.cpp
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Sema/AnalysisBasedWarnings.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Sema/SemaTemplateDeduction.cpp
  clang/lib/Serialization/ASTReaderStmt.cpp
  clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp
  clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
  libcxx/utils/ci/buildkite-pipeline-clang.yml

Index: libcxx/utils/ci/buildkite-pipeline-clang.yml
===
--- libcxx/utils/ci/buildkite-pipeline-clang.yml
+++ libcxx/utils/ci/buildkite-pipeline-clang.yml
@@ -17,6 +17,21 @@
 # LLVM RELEASE bump version
 LLVM_HEAD_VERSION: "17"
 steps:
+  - label: "Format"
+commands:
+  - "! grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs || false"
+
+agents:
+  queue: "libcxx-builders"
+  os: "linux"
+retry:
+  automatic:
+- exit_status: -1  # Agent was lost
+  limit: 2
+timeout_in_minutes: 120
+
+  - wait
+
   - label: "Building clang"
 commands:
   - "mkdir install"
Index: clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
===
--- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -1242,7 +1242,7 @@
 const QualType ,
 const LocationContext *LCtx,
 SVal *ElementCountVal) {
-  assert(Region != nullptr && "Not-null region expected");	
+  assert(Region != nullptr && "Not-null region expected");
 
   QualType Ty = ElementTy.getDesugaredType(getContext());
   while (const auto *NTy = dyn_cast(Ty))
Index: clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
===
--- clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
@@ -80,7 +80,7 @@
   mgr.registerChecker();
 }
 
-bool ento::shouldRegisterNSAutoreleasePoolChecker(const CheckerManager ) { 
+bool ento::shouldRegisterNSAutoreleasePoolChecker(const CheckerManager ) {
   const LangOptions  = mgr.getLangOpts();
   return LO.getGC() != LangOptions::NonGC;
 }
Index: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp
===
--- clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp
+++ clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp
@@ -227,7 +227,7 @@
  CheckerContext ) const {
   // Cleanup
   auto State = C.getState();
-  
+
   auto ContMap = State->get();
   for (const auto  : ContMap) {
 if (!SR.isLiveRegion(Cont.first)) {
@@ -1021,7 +1021,7 @@
SymbolRef NewSym) {
   auto  = SVB.getSymbolManager();
   auto Diff = 

[PATCH] D151963: [clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

2023-06-20 Thread Paul Kirth via Phabricator via cfe-commits
paulkirth accepted this revision.
paulkirth added a comment.
Herald added a subscriber: wangpc.

Also LGTM for the changes in MisExpect.rst, modulo feedback from @erichkeane.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151963

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


[PATCH] D151963: [clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

2023-06-02 Thread Erich Keane via Phabricator via cfe-commits
erichkeane accepted this revision.
erichkeane added a comment.

This looks fine to me.  HOWEVER, please make sure to add this commit to 
`https://github.com/llvm/llvm-project/blob/main/.git-blame-ignore-revs` in a 
follow-up NFC commit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151963

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


[PATCH] D151963: [clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs

2023-06-01 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik created this revision.
philnik added reviewers: erichkeane, aaron.ballman.
Herald added subscribers: luke, steakhal, frasercrmck, martong, luismarques, 
apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, 
MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, 
simoncook, johnrusso, rbar, asb, kbarton, arichardson, nemanjai, dschuff.
Herald added a reviewer: paulkirth.
Herald added a reviewer: NoQ.
Herald added a project: All.
Herald added a comment.
philnik requested review of this revision.
Herald added subscribers: libcxx-commits, cfe-commits, pcwang-thead, MaskRay, 
aheejin.
Herald added projects: clang, libc++.
Herald added a reviewer: libc++.

NOTE: Clang-Format Team Automated Review Comment

Your review contains a change to ClangFormatStyleOptions.rst but not a change 
to clang/include/clang/Format/Format.h

ClangFormatStyleOptions.rst is auto generated from Format.h via 
clang/docs/tools/dump_format_style.py,  please run this to regenerate the .rst

You can validate that the rst is valid by running.

  ./docs/tools/dump_format_style.py
  mkdir -p html
  /usr/bin/sphinx-build -n ./docs ./html


A lot of editors remove trailing whitespaces. This patch removes any trailing 
whitespaces and makes sure that no new ones are added.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151963

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/docs/ClangLinkerWrapper.rst
  clang/docs/ClangOffloadPackager.rst
  clang/docs/ClangTransformerTutorial.rst
  clang/docs/DebuggingCoroutines.rst
  clang/docs/ExternalClangExamples.rst
  clang/docs/JSONCompilationDatabase.rst
  clang/docs/MisExpect.rst
  clang/docs/ReleaseNotes.rst
  clang/docs/SourceBasedCodeCoverage.rst
  clang/docs/StandardCPlusPlusModules.rst
  clang/docs/UndefinedBehaviorSanitizer.rst
  clang/docs/analyzer/checkers.rst
  clang/docs/analyzer/developer-docs/DebugChecks.rst
  clang/docs/tools/dump_ast_matchers.py
  clang/include/clang/AST/DeclCXX.h
  clang/include/clang/AST/DeclObjC.h
  clang/include/clang/AST/TypeProperties.td
  clang/include/clang/Analysis/AnalysisDeclContext.h
  clang/include/clang/Analysis/CallGraph.h
  clang/include/clang/Basic/AttrDocs.td
  clang/include/clang/Basic/DiagnosticGroups.td
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Basic/OpenCLExtensions.def
  clang/include/clang/Basic/TypeNodes.td
  clang/include/clang/Basic/riscv_vector.td
  clang/include/clang/Driver/Options.td
  clang/include/clang/Sema/CMakeLists.txt
  clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
  clang/lib/Analysis/FlowSensitive/CMakeLists.txt
  clang/lib/Analysis/UninitializedValues.cpp
  clang/lib/Analysis/UnsafeBufferUsage.cpp
  clang/lib/Basic/Targets/PPC.cpp
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Sema/AnalysisBasedWarnings.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Sema/SemaTemplateDeduction.cpp
  clang/lib/Serialization/ASTReaderStmt.cpp
  clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp
  clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
  clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
  libcxx/utils/ci/buildkite-pipeline-clang.yml

Index: libcxx/utils/ci/buildkite-pipeline-clang.yml
===
--- libcxx/utils/ci/buildkite-pipeline-clang.yml
+++ libcxx/utils/ci/buildkite-pipeline-clang.yml
@@ -17,6 +17,21 @@
 # LLVM RELEASE bump version
 LLVM_HEAD_VERSION: "17"
 steps:
+  - label: "Format"
+commands:
+  - "! grep -rn '[[:blank:]]$' clang/lib clang/include clang/docs || false"
+
+agents:
+  queue: "libcxx-builders"
+  os: "linux"
+retry:
+  automatic:
+- exit_status: -1  # Agent was lost
+  limit: 2
+timeout_in_minutes: 120
+
+  - wait
+
   - label: "Building clang"
 commands:
   - "mkdir install"
Index: clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
===
--- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -1242,7 +1242,7 @@
 const QualType ,
 const LocationContext *LCtx,
 SVal *ElementCountVal) {
-  assert(Region != nullptr && "Not-null region expected");	
+  assert(Region != nullptr && "Not-null region expected");
 
   QualType Ty = ElementTy.getDesugaredType(getContext());
   while (const auto *NTy = dyn_cast(Ty))
Index: clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
===
--- clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp
@@ -80,7 +80,7 @@
   mgr.registerChecker();
 }
 
-bool