[clang-tools-extra] [llvm] [llvm] Remove the Legacy PM Hello example (PR #95708)

2024-06-16 Thread Andrzej Warzyński via cfe-commits

https://github.com/banach-space updated 
https://github.com/llvm/llvm-project/pull/95708

From d75a05030447e8bcb1dd0b575ff5e7aa5c89f0bb Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski 
Date: Sun, 16 Jun 2024 13:58:41 +0100
Subject: [PATCH 1/3] [llvm] Remove the Legacy PM Hello example

The Legacy PM was deprecated for the optimization pipeline in LLVM 14
[1] (the support was removed altogether in the following release). This
patch removes the original Hello example that was introduced to
illustrate the Legacy PM. The Hello example no longer works and hence is
deleted. The corresponding documentation is also removed.

Note, Hello example for new PM is located in
  * llvm/lib/Transforms/Utils/HelloWorld.cpp
and documented in
  * WritingAnLLVMNewPMPass.rst.

[1] 
https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html#changes-to-the-llvm-ir
---
 llvm/lib/Transforms/CMakeLists.txt   |  1 -
 llvm/lib/Transforms/Hello/CMakeLists.txt | 20 
 llvm/lib/Transforms/Hello/Hello.cpp  | 64 
 llvm/lib/Transforms/Hello/Hello.exports  |  0
 4 files changed, 85 deletions(-)
 delete mode 100644 llvm/lib/Transforms/Hello/CMakeLists.txt
 delete mode 100644 llvm/lib/Transforms/Hello/Hello.cpp
 delete mode 100644 llvm/lib/Transforms/Hello/Hello.exports

diff --git a/llvm/lib/Transforms/CMakeLists.txt 
b/llvm/lib/Transforms/CMakeLists.txt
index 84a7e34147d08..7046f2f4b1d2c 100644
--- a/llvm/lib/Transforms/CMakeLists.txt
+++ b/llvm/lib/Transforms/CMakeLists.txt
@@ -5,7 +5,6 @@ add_subdirectory(InstCombine)
 add_subdirectory(Scalar)
 add_subdirectory(IPO)
 add_subdirectory(Vectorize)
-add_subdirectory(Hello)
 add_subdirectory(ObjCARC)
 add_subdirectory(Coroutines)
 add_subdirectory(CFGuard)
diff --git a/llvm/lib/Transforms/Hello/CMakeLists.txt 
b/llvm/lib/Transforms/Hello/CMakeLists.txt
deleted file mode 100644
index 9510c31f633fe..0
--- a/llvm/lib/Transforms/Hello/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# If we don't need RTTI or EH, there's no reason to export anything
-# from the hello plugin.
-if( NOT LLVM_REQUIRES_RTTI )
-  if( NOT LLVM_REQUIRES_EH )
-set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Hello.exports)
-  endif()
-endif()
-
-if(WIN32 OR CYGWIN OR ZOS)
-  set(LLVM_LINK_COMPONENTS Core Support)
-endif()
-
-add_llvm_library( LLVMHello MODULE BUILDTREE_ONLY
-  Hello.cpp
-
-  DEPENDS
-  intrinsics_gen
-  PLUGIN_TOOL
-  opt
-  )
diff --git a/llvm/lib/Transforms/Hello/Hello.cpp 
b/llvm/lib/Transforms/Hello/Hello.cpp
deleted file mode 100644
index b0adb5401f891..0
--- a/llvm/lib/Transforms/Hello/Hello.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//===- Hello.cpp - Example code from "Writing an LLVM Pass" 
---===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-//
-// This file implements two versions of the LLVM "Hello World" pass described
-// in docs/WritingAnLLVMPass.html
-//
-//===--===//
-
-#include "llvm/ADT/Statistic.h"
-#include "llvm/IR/Function.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace llvm;
-
-#define DEBUG_TYPE "hello"
-
-STATISTIC(HelloCounter, "Counts number of functions greeted");
-
-namespace {
-  // Hello - The first implementation, without getAnalysisUsage.
-  struct Hello : public FunctionPass {
-static char ID; // Pass identification, replacement for typeid
-Hello() : FunctionPass(ID) {}
-
-bool runOnFunction(Function &F) override {
-  ++HelloCounter;
-  errs() << "Hello: ";
-  errs().write_escaped(F.getName()) << '\n';
-  return false;
-}
-  };
-}
-
-char Hello::ID = 0;
-static RegisterPass X("hello", "Hello World Pass");
-
-namespace {
-  // Hello2 - The second implementation with getAnalysisUsage implemented.
-  struct Hello2 : public FunctionPass {
-static char ID; // Pass identification, replacement for typeid
-Hello2() : FunctionPass(ID) {}
-
-bool runOnFunction(Function &F) override {
-  ++HelloCounter;
-  errs() << "Hello: ";
-  errs().write_escaped(F.getName()) << '\n';
-  return false;
-}
-
-// We don't modify the program, so we preserve all analyses.
-void getAnalysisUsage(AnalysisUsage &AU) const override {
-  AU.setPreservesAll();
-}
-  };
-}
-
-char Hello2::ID = 0;
-static RegisterPass
-Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)");
diff --git a/llvm/lib/Transforms/Hello/Hello.exports 
b/llvm/lib/Transforms/Hello/Hello.exports
deleted file mode 100644
index e69de29bb2d1d..0

From bed0a86befc6f6b88a28a0eec53499e02b8bddad Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski 
Date: Sun, 16 Jun 2024 17:10:37 +0100
Subject: [PATCH 2/3] fixup! [llvm]

[clang-tools-extra] [llvm] [llvm] Remove the Legacy PM Hello example (PR #95708)

2024-06-16 Thread Andrzej Warzyński via cfe-commits

banach-space wrote:

> You also need to remove the use of this pass (for testing purposes) from 
> clang-tools-extra.

Done, thanks!

I don't understand why CI still fails:
```bash
Total Discovered Tests: 60135
--
  | Skipped  :15 (0.02%)
  | Unsupported  :  1005 (1.67%)
  | Passed   : 58946 (98.02%)
  | Expectedly Failed:   169 (0.28%)
  | ninja: build stopped: cannot make progress due to previous errors.
  | + show-stats
  | + mkdir -p artifacts
  | + ccache --print-stats
  | 🚨 Error: The command exited with status 1
```

Can you see the actual failure? Looks like all tests passed, right?

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


[clang-tools-extra] [llvm] [llvm] Remove the Legacy PM Hello example (PR #95708)

2024-06-16 Thread Yingwei Zheng via cfe-commits

dtcxzyw wrote:

> > You also need to remove the use of this pass (for testing purposes) from 
> > clang-tools-extra.
> 
> Done, thanks!
> 
> I don't understand why CI still fails:
> 
> ```shell
> Total Discovered Tests: 60135
> --
>   | Skipped  :15 (0.02%)
>   | Unsupported  :  1005 (1.67%)
>   | Passed   : 58946 (98.02%)
>   | Expectedly Failed:   169 (0.28%)
>   | ninja: build stopped: cannot make progress due to previous errors.
>   | + show-stats
>   | + mkdir -p artifacts
>   | + ccache --print-stats
>   | 🚨 Error: The command exited with status 1
> ```
> 
> Can you see the actual failure? Looks like all tests passed, right?

It is caused by libc/lldb test failures. Don't worry :)


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


[clang-tools-extra] [llvm] [llvm] Remove the Legacy PM Hello example (PR #95708)

2024-06-17 Thread Nikita Popov via cfe-commits

https://github.com/nikic approved this pull request.

LGTM

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


[clang-tools-extra] [llvm] [llvm] Remove the Legacy PM Hello example (PR #95708)

2024-06-18 Thread Andrzej Warzyński via cfe-commits

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


[clang-tools-extra] [llvm] [llvm] Remove the Legacy PM Hello example (PR #95708)

2024-06-18 Thread Andrzej Warzyński via cfe-commits

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