[clang] [analyzer] Fix zext assertion failure in loop unrolling (PR #121203)

2024-12-28 Thread Balazs Benics via cfe-commits

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

Looks wonderful now.
I had recommended one simplification, but other than that we can merge this.

Thanks again!

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


[clang] [analyzer] Fix zext assertion failure in loop unrolling (PR #121203)

2024-12-28 Thread Balazs Benics via cfe-commits

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


[clang] [analyzer] Fix zext assertion failure in loop unrolling (PR #121203)

2024-12-28 Thread Balazs Benics via cfe-commits


@@ -283,10 +283,12 @@ static bool shouldCompletelyUnroll(const Stmt *LoopStmt, 
ASTContext &ASTCtx,
   llvm::APInt InitNum =
   Matches[0].getNodeAs("initNum")->getValue();
   auto CondOp = Matches[0].getNodeAs("conditionOperator");
-  if (InitNum.getBitWidth() != BoundNum.getBitWidth()) {
-InitNum = InitNum.zext(BoundNum.getBitWidth());
-BoundNum = BoundNum.zext(InitNum.getBitWidth());
-  }
+  unsigned MaxWidth = std::max(InitNum.getBitWidth(), BoundNum.getBitWidth());

steakhal wrote:

Your reasoning sounds solid!

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


[clang] [analyzer] Fix zext assertion failure in loop unrolling (PR #121203)

2024-12-28 Thread Balazs Benics via cfe-commits


@@ -283,10 +283,12 @@ static bool shouldCompletelyUnroll(const Stmt *LoopStmt, 
ASTContext &ASTCtx,
   llvm::APInt InitNum =
   Matches[0].getNodeAs("initNum")->getValue();
   auto CondOp = Matches[0].getNodeAs("conditionOperator");
-  if (InitNum.getBitWidth() != BoundNum.getBitWidth()) {
-InitNum = InitNum.zext(BoundNum.getBitWidth());
-BoundNum = BoundNum.zext(InitNum.getBitWidth());
-  }
+  unsigned MaxWidth = std::max(InitNum.getBitWidth(), BoundNum.getBitWidth());
+
+  if (InitNum.getBitWidth() != MaxWidth)
+InitNum = InitNum.zext(MaxWidth);
+  if (BoundNum.getBitWidth() != MaxWidth)
+BoundNum = BoundNum.zext(MaxWidth);

steakhal wrote:

I wonder if we need these ifs here. Maybe we could just apply the zext 
unconditionally.
```suggestion
  InitNum = InitNum.zext(MaxWidth);
  BoundNum = BoundNum.zext(MaxWidth);
```

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


[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-12-28 Thread via cfe-commits


@@ -1961,7 +1961,8 @@ namespace ConstexprConstructorRecovery {
 
 namespace Lifetime {
   void f() {
-constexpr int &n = n; // expected-error {{constant expression}} 
expected-note {{use of reference outside its lifetime}} expected-warning {{not 
yet bound to a value}}
+constexpr int &n = n; // expected-error {{constant expression}} cxx23-note 
{{reference to 'n' is not a constant expression}} cxx23-note {{address of 
non-static constexpr variable 'n' may differ}} expected-warning {{not yet bound 
to a value}}
+  // cxx11_20-note@-1 {{use of reference outside its 
lifetime is not allowed in a constant expression}}

cor3ntin wrote:

@shafik 

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


[clang] [Clang][P1061] Fix template arguments in local classes (PR #121225)

2024-12-28 Thread via cfe-commits


@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only %s -verify
+// expected-no-diagnostics
+
+template 
+int g() {
+  return [] (auto) -> int {
+struct L {
+  int m = i;
+};
+return 0;
+  } (42);

cor3ntin wrote:

That seems about right. 
But the fix is probably fine? Maybe we can add a FIXME in the comment for now.

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


[clang] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2024-12-28 Thread via cfe-commits

cor3ntin wrote:

Did you try creduce/cvise (although using that with modules might be a bit 
challenging)
It would be really nice to have a repro so that we have a test case

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


[clang] [analyzer] Fix zext assertion failure in loop unrolling (PR #121203)

2024-12-28 Thread via cfe-commits

https://github.com/shenjunjiekoda updated 
https://github.com/llvm/llvm-project/pull/121203

>From 2cee5fc2abd0cf2979c9ba975906e659adcd4463 Mon Sep 17 00:00:00 2001
From: shenjunjie 
Date: Fri, 27 Dec 2024 14:08:55 +
Subject: [PATCH 1/7] [analyzer] Fix zext assertion failure in loop unrolling

---
 clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp 
b/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
index 96f5d7c44baf89..9227a7876c0b2f 100644
--- a/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
+++ b/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
@@ -283,10 +283,12 @@ static bool shouldCompletelyUnroll(const Stmt *LoopStmt, 
ASTContext &ASTCtx,
   llvm::APInt InitNum =
   Matches[0].getNodeAs("initNum")->getValue();
   auto CondOp = Matches[0].getNodeAs("conditionOperator");
-  if (InitNum.getBitWidth() != BoundNum.getBitWidth()) {
-InitNum = InitNum.zext(BoundNum.getBitWidth());
-BoundNum = BoundNum.zext(InitNum.getBitWidth());
-  }
+  unsigned MaxWidth = std::max(InitNum.getBitWidth(), BoundNum.getBitWidth());
+
+  if (InitNum.getBitWidth() != MaxWidth)
+InitNum = InitNum.zext(MaxWidth);
+  if (BoundNum.getBitWidth() != MaxWidth)
+BoundNum = BoundNum.zext(MaxWidth);
 
   if (CondOp->getOpcode() == BO_GE || CondOp->getOpcode() == BO_LE)
 maxStep = (BoundNum - InitNum + 1).abs().getZExtValue();

>From a4d3a24ea797c5f53c5171e05f7172434096bd65 Mon Sep 17 00:00:00 2001
From: shenjunjie 
Date: Fri, 27 Dec 2024 14:20:23 +
Subject: [PATCH 2/7] add testcase

---
 clang/test/Analysis/PR121201.cpp | 50 
 1 file changed, 50 insertions(+)
 create mode 100644 clang/test/Analysis/PR121201.cpp

diff --git a/clang/test/Analysis/PR121201.cpp b/clang/test/Analysis/PR121201.cpp
new file mode 100644
index 00..a2cea89dc10b79
--- /dev/null
+++ b/clang/test/Analysis/PR121201.cpp
@@ -0,0 +1,50 @@
+
+template < bool, typename T, typename > using conditional_t = T;
+class basic_format_arg;
+template < typename > struct formatter;
+template < typename Context > struct value {
+  template < typename T > value(T) {
+using value_type = T;
+format_custom_arg<
+value_type, typename Context::template formatter_type< value_type > >;
+  }
+  template < typename, typename Formatter > static void format_custom_arg() {
+Context ctx;
+auto f = Formatter();
+f.format(0, ctx);
+  }
+};
+struct context {
+  template < typename T > using formatter_type = formatter< T >;
+};
+enum { max_packed_args };
+template < typename Context, long >
+using arg_t =
+conditional_t< max_packed_args, value< Context >, basic_format_arg >;
+template < int NUM_ARGS > struct format_arg_store {
+  arg_t< context, NUM_ARGS > args;
+};
+template < typename... T, long NUM_ARGS = sizeof...(T) >
+auto make_format_args(T... args) -> format_arg_store< NUM_ARGS > {
+  return {args...};
+}
+template < typename F > void write_padded(F write) { write(0); }
+template < typename... T > void format(T... args) { make_format_args(args...); 
}
+template < int > struct bitset {
+  bitset(long);
+};
+template < long N > struct formatter< bitset< N > > {
+  struct writer {
+bitset< N > bs;
+template < typename OutputIt > void operator()(OutputIt) {
+  for (auto pos = N; pos > 0; --pos)
+;
+}
+  };
+  template < typename FormatContext >
+  void format(bitset< N > bs, FormatContext) {
+write_padded(writer{bs});
+  }
+};
+bitset< 6 > TestBody_bs(2);
+void TestBody() { format(TestBody_bs); }
\ No newline at end of file

>From ee331f6f1e257c7636913616c4f223de49d10641 Mon Sep 17 00:00:00 2001
From: shenjunjie 
Date: Fri, 27 Dec 2024 14:35:12 +
Subject: [PATCH 3/7] fix testcase

---
 clang/test/Analysis/PR121201.cpp | 67 
 1 file changed, 42 insertions(+), 25 deletions(-)

diff --git a/clang/test/Analysis/PR121201.cpp b/clang/test/Analysis/PR121201.cpp
index a2cea89dc10b79..49ce92957ad8a8 100644
--- a/clang/test/Analysis/PR121201.cpp
+++ b/clang/test/Analysis/PR121201.cpp
@@ -1,50 +1,67 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-config
+// unroll-loops=true -verify %s
 
-template < bool, typename T, typename > using conditional_t = T;
+// expected-no-diagnostics
+
+template  using conditional_t = T;
 class basic_format_arg;
-template < typename > struct formatter;
-template < typename Context > struct value {
-  template < typename T > value(T) {
+template  struct formatter;
+
+template  struct value {
+  template  value(T) {
 using value_type = T;
-format_custom_arg<
-value_type, typename Context::template formatter_type< value_type > >;
+format_custom_arg>;
   }
-  template < typename, typename Formatter > static void format_custom_arg() {
+
+  template  static void format_custom_arg() {
 Context ctx;
 auto f = Formatter();
 f.format(0, ctx);
   }
 

[clang] [analyzer] Fix zext assertion failure in loop unrolling (PR #121203)

2024-12-28 Thread via cfe-commits

shenjunjiekoda wrote:

> Looks wonderful now. I had recommended one simplification, but other than 
> that we can merge this.
> 
> Thanks again!

Thank you for your patient and careful response!

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


[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

2024-12-28 Thread Owen Pan via cfe-commits


@@ -361,9 +361,19 @@ class LineJoiner {
 const auto *FirstNonComment = TheLine->getFirstNonComment();
 if (!FirstNonComment)
   return 0;
+
 // FIXME: There are probably cases where we should use FirstNonComment
 // instead of TheLine->First.
 
+if (TheLine->Last->is(tok::l_brace)) {
+  if (Style.AllowShortNamespacesOnASingleLine &&
+  TheLine->First->is(tok::kw_namespace)) {
+unsigned result = tryMergeNamespace(I, E, Limit);
+if (result > 0)
+  return result;
+  }
+}

owenca wrote:

```suggestion
if (Style.AllowShortNamespacesOnASingleLine &&
TheLine->First->is(tok::kw_namespace) &&
TheLine->Last->is(tok::l_brace)) {
  const auto result = tryMergeNamespace(I, E, Limit);
  if (result > 0)
return result;
}
```

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


[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

2024-12-28 Thread Owen Pan via cfe-commits

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


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


[clang] [llvm] [tysan] Convert TySan from function+module pass to just module pass (PR #120667)

2024-12-28 Thread Florian Hahn via cfe-commits

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

LGTM, thanks!

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


[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-s390x-linux-lnt` 
running on `systemz-1` while building `clang-tools-extra` at step 7 "ninja 
check 1".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/136/builds/2164


Here is the relevant piece of the build log for the reference

```
Step 7 (ninja check 1) failure: stage 1 checked (failure)
 TEST 'Clang Tools :: 
clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp' FAILED 

Exit Code: 1

Command Output (stdout):
--
Running ['clang-tidy', 
'/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp',
 '-fix', '--checks=-*,readability-implicit-bool-conversion', 
'-config={CheckOptions: {  
readability-implicit-bool-conversion.CheckConversionsToBool: false,  
readability-implicit-bool-conversion.CheckConversionsFromBool: true  }}', 
'--', '-std=c23', '-std=c++11', '-nostdinc++']...
 clang-tidy output ---
3 warnings generated.
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 warning: implicit conversion 'bool' -> 'int' 
[readability-implicit-bool-conversion]
   49 | int intFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 note: FIX-IT applied suggested code changes
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:32:
 note: FIX-IT applied suggested code changes
   49 | int intFromBool = boolValue; //
  |^
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 warning: implicit conversion 'bool' -> 'float' 
[readability-implicit-bool-conversion]
   52 | float floatFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 note: FIX-IT applied suggested code changes
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:36:
 note: FIX-IT applied suggested code changes
   52 | float floatFromBool = boolValue; //
  |^
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 warning: implicit conversion 'bool' -> 'char' 
[readability-implicit-bool-conversion]
   55 | char charFromBool = boolValue; //
  | ^
  | static_cast( )
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 note: FIX-IT applied suggested code changes
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:34:
 note: FIX-IT applied suggested code changes
   55 | char charFromBool = boolValue; //
  |  ^
clang-tidy applied 6 of 6 suggested fixes.

--
diff -u 
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
 failed:
--- 
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
2024-12-28 10:21:36.702389431 +0100
+++ 
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
 2024-12-28 10:21:36.772389431 +0100
@@ -46,12 +46,12 @@
 
 // Conversions from bool to other types
 bool boolValue = true;
-i

[clang] 8e965d8 - [analyzer] Fix zext assertion failure in loop unrolling (#121203)

2024-12-28 Thread via cfe-commits

Author: JOSTAR
Date: 2024-12-28T11:09:29+01:00
New Revision: 8e965d89c9624c184c48806dc39d50209265f0f8

URL: 
https://github.com/llvm/llvm-project/commit/8e965d89c9624c184c48806dc39d50209265f0f8
DIFF: 
https://github.com/llvm/llvm-project/commit/8e965d89c9624c184c48806dc39d50209265f0f8.diff

LOG: [analyzer] Fix zext assertion failure in loop unrolling (#121203)

The current implementation of APInt extension in the code can trigger an
assertion failure when the `zext` function is called with a target width
smaller than the current bit width. For example:
```cpp
if (InitNum.getBitWidth() != BoundNum.getBitWidth()) {
InitNum = InitNum.zext(BoundNum.getBitWidth());
BoundNum = BoundNum.zext(InitNum.getBitWidth());
}
```

This logic does not guarantee that the `zext` target width is always
greater than or equal to the current bit width, leading to potential
crashes.

Expected Behavior:
- Ensure InitNum and BoundNum are extended to the maximum of their respective 
widths.
- Prevent assertion failures by enforcing correct `zext` usage.

Fixes #121201

Added: 
clang/test/Analysis/PR121201.cpp

Modified: 
clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp

Removed: 




diff  --git a/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp 
b/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
index 96f5d7c44baf89..01d87b02fcdbd0 100644
--- a/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
+++ b/clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp
@@ -283,10 +283,10 @@ static bool shouldCompletelyUnroll(const Stmt *LoopStmt, 
ASTContext &ASTCtx,
   llvm::APInt InitNum =
   Matches[0].getNodeAs("initNum")->getValue();
   auto CondOp = Matches[0].getNodeAs("conditionOperator");
-  if (InitNum.getBitWidth() != BoundNum.getBitWidth()) {
-InitNum = InitNum.zext(BoundNum.getBitWidth());
-BoundNum = BoundNum.zext(InitNum.getBitWidth());
-  }
+  unsigned MaxWidth = std::max(InitNum.getBitWidth(), BoundNum.getBitWidth());
+
+  InitNum = InitNum.zext(MaxWidth);
+  BoundNum = BoundNum.zext(MaxWidth);
 
   if (CondOp->getOpcode() == BO_GE || CondOp->getOpcode() == BO_LE)
 maxStep = (BoundNum - InitNum + 1).abs().getZExtValue();

diff  --git a/clang/test/Analysis/PR121201.cpp 
b/clang/test/Analysis/PR121201.cpp
new file mode 100644
index 00..acd2492d011fad
--- /dev/null
+++ b/clang/test/Analysis/PR121201.cpp
@@ -0,0 +1,67 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s \
+// RUN:-analyzer-config unroll-loops=true
+
+// expected-no-diagnostics
+
+template  using conditional_t = T;
+class basic_format_arg;
+template  struct formatter;
+
+template  struct value {
+  template  value(T) {
+using value_type = T;
+(void)format_custom_arg>;
+  }
+
+  template  static void format_custom_arg() {
+Context ctx;
+auto f = Formatter();
+f.format(0, ctx);
+  }
+};
+
+struct context {
+  template  using formatter_type = formatter;
+};
+
+enum { max_packed_args };
+
+template 
+using arg_t = conditional_t, basic_format_arg>;
+
+template  struct format_arg_store {
+  arg_t args;
+};
+
+template 
+auto make_format_args(T... args) -> format_arg_store {
+  return {args...};
+}
+
+template  void write_padded(F write) { write(0); }
+
+template  void format(T... args) { make_format_args(args...); }
+
+template  struct bitset {
+  bitset(long);
+};
+
+template  struct formatter> {
+  struct writer {
+bitset bs;
+
+template  void operator()(OutputIt) {
+  for (auto pos = N; pos > 0; --pos) // no-crash
+;
+}
+  };
+
+  template  void format(bitset bs, FormatContext) {
+write_padded(writer{bs});
+  }
+};
+
+bitset<6> TestBody_bs(2);
+
+void TestBody() { format(TestBody_bs); }



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


[clang] [analyzer] Fix zext assertion failure in loop unrolling (PR #121203)

2024-12-28 Thread Balazs Benics via cfe-commits

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


[clang] Add -fuse-lipo option (PR #121231)

2024-12-28 Thread Ashley Hauck via cfe-commits

https://github.com/khyperia updated 
https://github.com/llvm/llvm-project/pull/121231

>From 33b542152876b9ccbf42cc3d070d582c32145477 Mon Sep 17 00:00:00 2001
From: khyperia 
Date: Fri, 27 Dec 2024 23:03:58 +0100
Subject: [PATCH 1/2] Add -fuse-lipo option

---
 clang/include/clang/Driver/Options.td  | 1 +
 clang/lib/Driver/ToolChains/Darwin.cpp | 5 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index d922709db17786..6cd23de87bacde 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -6654,6 +6654,7 @@ def fbinutils_version_EQ : Joined<["-"], 
"fbinutils-version=">,
 def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group,
   Flags<[LinkOption]>, Visibility<[ClangOption, FlangOption, CLOption]>;
 def ld_path_EQ : Joined<["--"], "ld-path=">, Group;
+def fuse_lipo_EQ : Joined<["-"], "fuse-lipo=">, Group, 
Flags<[LinkOption]>;
 
 defm align_labels : BooleanFFlag<"align-labels">, 
Group;
 def falign_labels_EQ : Joined<["-"], "falign-labels=">, 
Group;
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp 
b/clang/lib/Driver/ToolChains/Darwin.cpp
index 4105d38d15d7d8..0d3cbb57362164 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -910,7 +910,10 @@ void darwin::Lipo::ConstructJob(Compilation &C, const 
JobAction &JA,
 CmdArgs.push_back(II.getFilename());
   }
 
-  const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("lipo"));
+  std::string LipoName =
+  std::string(Args.getLastArgValue(options::OPT_fuse_lipo_EQ, "lipo"));
+  const char *Exec =
+  Args.MakeArgString(getToolChain().GetProgramPath(LipoName.c_str()));
   C.addCommand(std::make_unique(JA, *this, 
ResponseFileSupport::None(),
  Exec, CmdArgs, Inputs, Output));
 }

>From fed315be5a6b2b5d898f92872782ec5f85dd8215 Mon Sep 17 00:00:00 2001
From: khyperia 
Date: Sat, 28 Dec 2024 11:11:35 +0100
Subject: [PATCH 2/2] Add basic fuse-lipo.c tests

---
 clang/lib/Driver/ToolChains/Darwin.cpp |  5 ++---
 clang/test/Driver/fuse-lipo.c  | 11 +++
 2 files changed, 13 insertions(+), 3 deletions(-)
 create mode 100644 clang/test/Driver/fuse-lipo.c

diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp 
b/clang/lib/Driver/ToolChains/Darwin.cpp
index 0d3cbb57362164..e5f28fd0a49124 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -910,10 +910,9 @@ void darwin::Lipo::ConstructJob(Compilation &C, const 
JobAction &JA,
 CmdArgs.push_back(II.getFilename());
   }
 
-  std::string LipoName =
-  std::string(Args.getLastArgValue(options::OPT_fuse_lipo_EQ, "lipo"));
+  StringRef LipoName = Args.getLastArgValue(options::OPT_fuse_lipo_EQ, "lipo");
   const char *Exec =
-  Args.MakeArgString(getToolChain().GetProgramPath(LipoName.c_str()));
+  Args.MakeArgString(getToolChain().GetProgramPath(LipoName.data()));
   C.addCommand(std::make_unique(JA, *this, 
ResponseFileSupport::None(),
  Exec, CmdArgs, Inputs, Output));
 }
diff --git a/clang/test/Driver/fuse-lipo.c b/clang/test/Driver/fuse-lipo.c
new file mode 100644
index 00..2cf478482be03f
--- /dev/null
+++ b/clang/test/Driver/fuse-lipo.c
@@ -0,0 +1,11 @@
+// RUN: %clang %s -### --target=arm64-apple-darwin -arch x86_64 -arch arm64 
-fuse-lipo=llvm-lipo 2>&1 | FileCheck -check-prefix=TEST1 %s
+// TEST1: llvm-lipo
+
+// RUN: %clang %s -### --target=arm64-apple-darwin -arch x86_64 -arch arm64 
-fuse-lipo=nonexistant-lipo 2>&1 | FileCheck -check-prefix=TEST2 %s
+// TEST2: nonexistant-lipo
+
+// RUN: %clang %s -### --target=arm64-apple-darwin -fuse-lipo=llvm-lipo 2>&1 | 
FileCheck -check-prefix=TEST3 %s
+// TEST3: clang: warning: argument unused during compilation: 
'-fuse-lipo=llvm-lipo'
+
+// RUN: %clang %s -### --target=arm64-apple-darwin 
-Wno-unused-command-line-argument -fuse-lipo=llvm-lipo 2>&1 | FileCheck 
-check-prefix=TEST4 %s
+// TEST4-NOT: llvm-lipo

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


[clang] Add -fuse-lipo option (PR #121231)

2024-12-28 Thread Ashley Hauck via cfe-commits

khyperia wrote:

@carlocab I've removed the temporary std::string and added a guess at basic 
tests. Let me know if there's additional tests in particular that you're 
thinking of!

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


[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-ppc64le-rhel` 
running on `ppc64le-clang-rhel-test` while building `clang-tools-extra` at step 
7 "test-build-unified-tree-check-all".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/145/builds/4098


Here is the relevant piece of the build log for the reference

```
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
 TEST 'Clang Tools :: 
clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp' FAILED 

Exit Code: 1

Command Output (stdout):
--
Running ['clang-tidy', 
'/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp',
 '-fix', '--checks=-*,readability-implicit-bool-conversion', 
'-config={CheckOptions: {  
readability-implicit-bool-conversion.CheckConversionsToBool: false,  
readability-implicit-bool-conversion.CheckConversionsFromBool: true  }}', 
'--', '-std=c23', '-std=c++11', '-nostdinc++']...
 clang-tidy output ---
3 warnings generated.
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 warning: implicit conversion 'bool' -> 'int' 
[readability-implicit-bool-conversion]
   49 | int intFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 note: FIX-IT applied suggested code changes
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:32:
 note: FIX-IT applied suggested code changes
   49 | int intFromBool = boolValue; //
  |^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 warning: implicit conversion 'bool' -> 'float' 
[readability-implicit-bool-conversion]
   52 | float floatFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 note: FIX-IT applied suggested code changes
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:36:
 note: FIX-IT applied suggested code changes
   52 | float floatFromBool = boolValue; //
  |^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 warning: implicit conversion 'bool' -> 'char' 
[readability-implicit-bool-conversion]
   55 | char charFromBool = boolValue; //
  | ^
  | static_cast( )
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 note: FIX-IT applied suggested code changes
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:34:
 note: FIX-IT applied suggested code changes
   55 | char charFromBool = boolValue; //
  |  ^
clang-tidy applied 6 of 6 suggested fixes.

--
diff -u 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
 failed:
--- 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clan

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-s390x-linux` running 
on `systemz-1` while building `clang-tools-extra` at step 5 "ninja check 1".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/42/builds/2535


Here is the relevant piece of the build log for the reference

```
Step 5 (ninja check 1) failure: stage 1 checked (failure)
 TEST 'Clang Tools :: 
clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp' FAILED 

Exit Code: 1

Command Output (stdout):
--
Running ['clang-tidy', 
'/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp',
 '-fix', '--checks=-*,readability-implicit-bool-conversion', 
'-config={CheckOptions: {  
readability-implicit-bool-conversion.CheckConversionsToBool: false,  
readability-implicit-bool-conversion.CheckConversionsFromBool: true  }}', 
'--', '-std=c23', '-std=c++11', '-nostdinc++']...
 clang-tidy output ---
3 warnings generated.
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 warning: implicit conversion 'bool' -> 'int' 
[readability-implicit-bool-conversion]
   49 | int intFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 note: FIX-IT applied suggested code changes
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:32:
 note: FIX-IT applied suggested code changes
   49 | int intFromBool = boolValue; //
  |^
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 warning: implicit conversion 'bool' -> 'float' 
[readability-implicit-bool-conversion]
   52 | float floatFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 note: FIX-IT applied suggested code changes
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:36:
 note: FIX-IT applied suggested code changes
   52 | float floatFromBool = boolValue; //
  |^
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 warning: implicit conversion 'bool' -> 'char' 
[readability-implicit-bool-conversion]
   55 | char charFromBool = boolValue; //
  | ^
  | static_cast( )
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 note: FIX-IT applied suggested code changes
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:34:
 note: FIX-IT applied suggested code changes
   55 | char charFromBool = boolValue; //
  |  ^
clang-tidy applied 6 of 6 suggested fixes.

--
diff -u 
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
 failed:
--- 
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
2024-12-28 10:03:38.142479375 +0100
+++ 
/home/uweigand/sandbox/buildbot/clang-s390x-linux/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
 2024-12-28 10:03:38.382479375 +0100
@@ -46,12 +46,12 @@
 
 // Conversions from bool to other types
 bool boolValue = true;
-int intFromBool = boolValue; //
+int intFromBool = static_c

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread via cfe-commits

4m4n-x-B4w4ne wrote:

> Excuse me, I've reverted this.

Can you help on what thing , It went wrong and like ,What shall I need to do to 
make it done?

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


[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread NAKAMURA Takumi via cfe-commits

chapuni wrote:

Excuse me, I've reverted this.

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


[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

2024-12-28 Thread Owen Pan via cfe-commits

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


[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder 
`clang-aarch64-sve2-vla-2stage` running on `linaro-g4-01` while building 
`clang-tools-extra` at step 12 "ninja check 2".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/199/builds/482


Here is the relevant piece of the build log for the reference

```
Step 12 (ninja check 2) failure: stage 2 checked (failure)
 TEST 'Clang Tools :: 
clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp' FAILED 

Exit Code: 1

Command Output (stdout):
--
Running ['clang-tidy', 
'/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp',
 '-fix', '--checks=-*,readability-implicit-bool-conversion', 
'-config={CheckOptions: {  
readability-implicit-bool-conversion.CheckConversionsToBool: false,  
readability-implicit-bool-conversion.CheckConversionsFromBool: true  }}', 
'--', '-std=c23', '-std=c++11', '-nostdinc++']...
 clang-tidy output ---
3 warnings generated.
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 warning: implicit conversion 'bool' -> 'int' 
[readability-implicit-bool-conversion]
   49 | int intFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 note: FIX-IT applied suggested code changes
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:32:
 note: FIX-IT applied suggested code changes
   49 | int intFromBool = boolValue; //
  |^
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 warning: implicit conversion 'bool' -> 'float' 
[readability-implicit-bool-conversion]
   52 | float floatFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 note: FIX-IT applied suggested code changes
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:36:
 note: FIX-IT applied suggested code changes
   52 | float floatFromBool = boolValue; //
  |^
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 warning: implicit conversion 'bool' -> 'char' 
[readability-implicit-bool-conversion]
   55 | char charFromBool = boolValue; //
  | ^
  | static_cast( )
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 note: FIX-IT applied suggested code changes
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:34:
 note: FIX-IT applied suggested code changes
   55 | char charFromBool = boolValue; //
  |  ^
clang-tidy applied 6 of 6 suggested fixes.

--
diff -u 
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
 failed:
--- 
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 2024-12-28 08:09:29.943050854 +
+++ 
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
  2024-12-28 08:09:29.959050385 +
@@ -46,12 +46,12 @@
 
 // Conversions fro

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder 
`clang-ppc64le-linux-multistage` running on `ppc64le-clang-multistage-test` 
while building `clang-tools-extra` at step 5 "ninja check 1".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/76/builds/5676


Here is the relevant piece of the build log for the reference

```
Step 5 (ninja check 1) failure: stage 1 checked (failure)
 TEST 'Clang Tools :: 
clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp' FAILED 

Exit Code: 1

Command Output (stdout):
--
Running ['clang-tidy', 
'/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp',
 '-fix', '--checks=-*,readability-implicit-bool-conversion', 
'-config={CheckOptions: {  
readability-implicit-bool-conversion.CheckConversionsToBool: false,  
readability-implicit-bool-conversion.CheckConversionsFromBool: true  }}', 
'--', '-std=c23', '-std=c++11', '-nostdinc++']...
 clang-tidy output ---
3 warnings generated.
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 warning: implicit conversion 'bool' -> 'int' 
[readability-implicit-bool-conversion]
   49 | int intFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 note: FIX-IT applied suggested code changes
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:32:
 note: FIX-IT applied suggested code changes
   49 | int intFromBool = boolValue; //
  |^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 warning: implicit conversion 'bool' -> 'float' 
[readability-implicit-bool-conversion]
   52 | float floatFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 note: FIX-IT applied suggested code changes
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:36:
 note: FIX-IT applied suggested code changes
   52 | float floatFromBool = boolValue; //
  |^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 warning: implicit conversion 'bool' -> 'char' 
[readability-implicit-bool-conversion]
   55 | char charFromBool = boolValue; //
  | ^
  | static_cast( )
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 note: FIX-IT applied suggested code changes
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:34:
 note: FIX-IT applied suggested code changes
   55 | char charFromBool = boolValue; //
  |  ^
clang-tidy applied 6 of 6 suggested fixes.

--
diff -u 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/tools/clang/tools/extra/test/clang-tidy/c

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-aarch64-global-isel` 
running on `linaro-clang-aarch64-global-isel` while building 
`clang-tools-extra` at step 7 "ninja check 1".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/125/builds/4518


Here is the relevant piece of the build log for the reference

```
Step 7 (ninja check 1) failure: stage 1 checked (failure)
 TEST 'Clang Tools :: 
clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp' FAILED 

Exit Code: 1

Command Output (stdout):
--
Running ['clang-tidy', 
'/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp',
 '-fix', '--checks=-*,readability-implicit-bool-conversion', 
'-config={CheckOptions: {  
readability-implicit-bool-conversion.CheckConversionsToBool: false,  
readability-implicit-bool-conversion.CheckConversionsFromBool: true  }}', 
'--', '-std=c23', '-std=c++11', '-nostdinc++']...
 clang-tidy output ---
3 warnings generated.
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 warning: implicit conversion 'bool' -> 'int' 
[readability-implicit-bool-conversion]
   49 | int intFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 note: FIX-IT applied suggested code changes
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:32:
 note: FIX-IT applied suggested code changes
   49 | int intFromBool = boolValue; //
  |^
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 warning: implicit conversion 'bool' -> 'float' 
[readability-implicit-bool-conversion]
   52 | float floatFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 note: FIX-IT applied suggested code changes
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:36:
 note: FIX-IT applied suggested code changes
   52 | float floatFromBool = boolValue; //
  |^
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 warning: implicit conversion 'bool' -> 'char' 
[readability-implicit-bool-conversion]
   55 | char charFromBool = boolValue; //
  | ^
  | static_cast( )
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 note: FIX-IT applied suggested code changes
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:34:
 note: FIX-IT applied suggested code changes
   55 | char charFromBool = boolValue; //
  |  ^
clang-tidy applied 6 of 6 suggested fixes.

--
diff -u 
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
 failed:
--- 
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 2024-12-28 08:01:51.255505569 +
+++ 
/home/tcwg-buildbot/worker/clang-aarch64-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
  2024-12-28 08:01:51.323505921 +
@@ -46,12 +46,12 @@
 
 // Conversions from bool to other types
 bool boolValue = true;

[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-armv7-global-isel` 
running on `linaro-clang-armv7-global-isel` while building `clang-tools-extra` 
at step 7 "ninja check 1".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/39/builds/3628


Here is the relevant piece of the build log for the reference

```
Step 7 (ninja check 1) failure: stage 1 checked (failure)
 TEST 'Clang Tools :: 
clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp' FAILED 

Exit Code: 1

Command Output (stdout):
--
Running ['clang-tidy', 
'/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp',
 '-fix', '--checks=-*,readability-implicit-bool-conversion', 
'-config={CheckOptions: {  
readability-implicit-bool-conversion.CheckConversionsToBool: false,  
readability-implicit-bool-conversion.CheckConversionsFromBool: true  }}', 
'--', '-std=c23', '-std=c++11', '-nostdinc++']...
 clang-tidy output ---
3 warnings generated.
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 warning: implicit conversion 'bool' -> 'int' 
[readability-implicit-bool-conversion]
   49 | int intFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 note: FIX-IT applied suggested code changes
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:32:
 note: FIX-IT applied suggested code changes
   49 | int intFromBool = boolValue; //
  |^
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 warning: implicit conversion 'bool' -> 'float' 
[readability-implicit-bool-conversion]
   52 | float floatFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 note: FIX-IT applied suggested code changes
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:36:
 note: FIX-IT applied suggested code changes
   52 | float floatFromBool = boolValue; //
  |^
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 warning: implicit conversion 'bool' -> 'char' 
[readability-implicit-bool-conversion]
   55 | char charFromBool = boolValue; //
  | ^
  | static_cast( )
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 note: FIX-IT applied suggested code changes
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:34:
 note: FIX-IT applied suggested code changes
   55 | char charFromBool = boolValue; //
  |  ^
clang-tidy applied 6 of 6 suggested fixes.

--
diff -u 
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
 failed:
--- 
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
   2024-12-28 08:09:23.877844194 +
+++ 
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp
2024-12-28 08:09:23.949844566 +
@@ -46,12 +46,12 @@
 
 // Conversions from bool to other types
 bool boolValue = true;
-int intFromBool = boolV

[clang] Add -fuse-lipo option (PR #121231)

2024-12-28 Thread Carlo Cabrera via cfe-commits

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


[clang] Add -fuse-lipo option (PR #121231)

2024-12-28 Thread Carlo Cabrera via cfe-commits

https://github.com/carlocab commented:

Thanks for the PR! This change needs new tests to be added.

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


[clang] Add -fuse-lipo option (PR #121231)

2024-12-28 Thread Carlo Cabrera via cfe-commits


@@ -910,7 +910,10 @@ void darwin::Lipo::ConstructJob(Compilation &C, const 
JobAction &JA,
 CmdArgs.push_back(II.getFilename());
   }
 
-  const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("lipo"));
+  std::string LipoName =
+  std::string(Args.getLastArgValue(options::OPT_fuse_lipo_EQ, "lipo"));
+  const char *Exec =
+  Args.MakeArgString(getToolChain().GetProgramPath(LipoName.c_str()));

carlocab wrote:

Seems a bit much to create a throwaway `std::string` here. Something like this 
should work:
```suggestion
  StringRef LipoName =
  Args.getLastArgValue(options::OPT_fuse_lipo_EQ, "lipo");
  const char *Exec =
  Args.MakeArgString(getToolChain().GetProgramPath(LipoName.data()));
```


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


[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `lldb-remote-linux-ubuntu` 
running on `as-builder-9` while building `clang` at step 16 
"test-check-lldb-api".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/195/builds/2861


Here is the relevant piece of the build log for the reference

```
Step 16 (test-check-lldb-api) failure: Test just built components: 
check-lldb-api completed (failure)
...
PASS: lldb-api :: types/TestIntegerType.py (1209 of 1218)
PASS: lldb-api :: types/TestIntegerTypeExpr.py (1210 of 1218)
PASS: lldb-api :: types/TestRecursiveTypes.py (1211 of 1218)
PASS: lldb-api :: types/TestShortType.py (1212 of 1218)
PASS: lldb-api :: types/TestLongTypes.py (1213 of 1218)
PASS: lldb-api :: types/TestShortTypeExpr.py (1214 of 1218)
PASS: lldb-api :: types/TestLongTypesExpr.py (1215 of 1218)
PASS: lldb-api :: tools/lldb-server/TestNonStop.py (1216 of 1218)
PASS: lldb-api :: tools/lldb-server/TestLldbGdbServer.py (1217 of 1218)
TIMEOUT: lldb-api :: python_api/process/cancel_attach/TestCancelAttach.py (1218 
of 1218)
 TEST 'lldb-api :: 
python_api/process/cancel_attach/TestCancelAttach.py' FAILED 

Script:
--
/usr/bin/python3.12 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/dotest.py
 -u CXXFLAGS -u CFLAGS --env 
LLVM_LIBS_DIR=/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./lib
 --env 
LLVM_INCLUDE_DIR=/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include
 --env 
LLVM_TOOLS_DIR=/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin
 --libcxx-include-dir 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include/c++/v1
 --libcxx-include-target-dir 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/include/aarch64-unknown-linux-gnu/c++/v1
 --libcxx-library-dir 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./lib/aarch64-unknown-linux-gnu
 --arch aarch64 --build-dir 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lldb-test-build.noindex
 --lldb-module-cache-dir 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api
 --clang-module-cache-dir 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api
 --executable 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin/lldb 
--compiler 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang 
--dsymutil 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin/dsymutil
 --make /usr/bin/gmake --llvm-tools-dir 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./bin 
--lldb-obj-root 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/tools/lldb 
--lldb-libs-dir 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/./lib 
--platform-url connect://jetson-agx-2198.lab.llvm.org:1234 
--platform-working-dir /home/ubuntu/lldb-tests --sysroot 
/mnt/fs/jetson-agx-ubuntu --env ARCH_CFLAGS=-mcpu=cortex-a78 --platform-name 
remote-linux 
/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/llvm-project/lldb/test/API/python_api/process/cancel_attach
 -p TestCancelAttach.py
--
Exit Code: -9
Timeout: Reached timeout of 600 seconds

Command Output (stdout):
--
lldb version 20.0.0git (https://github.com/llvm/llvm-project.git revision 
e86b68ff560aaf5fc723eaa8d8418892b2456e12)
  clang revision e86b68ff560aaf5fc723eaa8d8418892b2456e12
  llvm revision e86b68ff560aaf5fc723eaa8d8418892b2456e12

--
Command Output (stderr):
--
WARNING:root:Custom libc++ is not supported for remote runs: ignoring --libcxx 
arguments
FAIL: LLDB 
(/home/buildbot/worker/as-builder-9/lldb-remote-linux-ubuntu/build/bin/clang-aarch64)
 :: test_scripted_implementation 
(TestCancelAttach.AttachCancelTestCase.test_scripted_implementation)

--


Slowest Tests:
--
600.04s: lldb-api :: python_api/process/cancel_attach/TestCancelAttach.py
181.00s: lldb-api :: commands/command/script_alias/TestCommandScriptAlias.py
79.55s: lldb-api :: tools/lldb-server/TestLldbGdbServer.py
70.35s: lldb-api :: commands/process/attach/TestProcessAttach.py
39.97s: lldb-api :: 
functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
35.50s: lldb-api :: 
functionalities/single-thread-step/TestSingleThreadStepTimeout.py
35.00s: lldb-api :: functionalities/completion/TestCompletion.py
31.63s: lldb-api :: tools/lldb-server/TestNonStop.py
20.75s: lldb-api :: functionalities/gdb_remote_client/TestPlatformClient.py
20.43s: lldb-api :: commands/statistics/basic/TestStats.py
19.00s: lldb-api :: functionalities/thread/state/TestThreadStates.py
18.22s: lldb-api :: commands/dwim-print/TestDWIMPrint.py
16.42s: lldb-api

[clang-tools-extra] [clang-tidy] bugprone-unhandled-self-assignment: fix smart pointer check against std::unique_ptr type (PR #121266)

2024-12-28 Thread via cfe-commits

github-actions[bot] wrote:



Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this 
page.

If this is not working for you, it is probably because you do not have write 
permissions for the repository. In which case you can instead tag reviewers by 
name in a comment by using `@` followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a 
review by "ping"ing the PR by adding a comment “Ping”. The common courtesy 
"ping" rate is once a week. Please remember that you are asking for valuable 
time from other developers.

If you have further questions, they may be answered by the [LLVM GitHub User 
Guide](https://llvm.org/docs/GitHub.html).

You can also ask questions in a comment on this PR, on the [LLVM 
Discord](https://discord.com/invite/xS7Z362) or on the 
[forums](https://discourse.llvm.org/).

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


[clang-tools-extra] [clang-tidy] bugprone-unhandled-self-assignment: fix smart pointer check against std::unique_ptr type (PR #121266)

2024-12-28 Thread via cfe-commits

llvmbot wrote:



@llvm/pr-subscribers-clang-tidy

@llvm/pr-subscribers-clang-tools-extra

Author: None (flovent)


Changes

Unlike other standard smart pointer types, std::unique_ptr has two template 
arguments.
testcase need to be updated too.

---
Full diff: https://github.com/llvm/llvm-project/pull/121266.diff


2 Files Affected:

- (modified) 
clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp (+5-3) 
- (modified) 
clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-self-assignment.cpp
 (+3-1) 


``diff
diff --git 
a/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp 
b/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp
index 8121a36f803460..1f432c4ccc5f00 100644
--- a/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp
@@ -74,9 +74,11 @@ void 
UnhandledSelfAssignmentCheck::registerMatchers(MatchFinder *Finder) {
 // Matcher for standard smart pointers.
 const auto SmartPointerType = qualType(hasUnqualifiedDesugaredType(
 recordType(hasDeclaration(classTemplateSpecializationDecl(
-hasAnyName("::std::shared_ptr", "::std::unique_ptr",
-   "::std::weak_ptr", "::std::auto_ptr"),
-templateArgumentCountIs(1));
+anyOf(allOf(hasAnyName("::std::shared_ptr", "::std::weak_ptr",
+   "::std::auto_ptr"),
+templateArgumentCountIs(1)),
+  allOf(hasName("::std::unique_ptr"),
+templateArgumentCountIs(2;
 
 // We will warn only if the class has a pointer or a C array field which
 // probably causes a problem during self-assignment (e.g. first resetting
diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-self-assignment.cpp
 
b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-self-assignment.cpp
index 14d27855d7c5a6..8610393449f97f 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-self-assignment.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-self-assignment.cpp
@@ -10,7 +10,9 @@ template 
 T &&move(T &x) {
 }
 
-template 
+template  class default_delete {};
+
+template >
 class unique_ptr {
 };
 

``




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


[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder 
`ppc64le-lld-multistage-test` running on `ppc64le-lld-multistage-test` while 
building `clang` at step 12 "build-stage2-unified-tree".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/168/builds/6991


Here is the relevant piece of the build log for the reference

```
Step 12 (build-stage2-unified-tree) failure: build (failure)
...
415.975 [961/892/4527] Building CXX object 
lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonBitSimplify.cpp.o
415.980 [961/891/4528] Building CXX object 
lib/Target/SystemZ/CMakeFiles/LLVMSystemZCodeGen.dir/SystemZFrameLowering.cpp.o
416.000 [961/890/4529] Building CXX object 
tools/clang/lib/CodeGen/CMakeFiles/obj.clangCodeGen.dir/CGCleanup.cpp.o
416.165 [961/889/4530] Building CXX object 
tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/WebKit/RawPtrRefMemberChecker.cpp.o
416.227 [961/888/4531] Building CXX object 
tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/obj.clangStaticAnalyzerCheckers.dir/InnerPointerChecker.cpp.o
416.301 [961/887/4532] Building CXX object 
tools/clang/lib/StaticAnalyzer/Core/CMakeFiles/obj.clangStaticAnalyzerCore.dir/LoopWidening.cpp.o
416.391 [961/886/4533] Building CXX object 
lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86PadShortFunction.cpp.o
416.400 [961/885/4534] Building CXX object 
lib/ExecutionEngine/Orc/CMakeFiles/LLVMOrcJIT.dir/COFFPlatform.cpp.o
416.432 [961/884/4535] Building CXX object 
lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/MVEGatherScatterLowering.cpp.o
416.443 [961/883/4536] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o
FAILED: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o 
ccache 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/install/stage1/bin/clang++
 -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS 
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 
-D__STDC_LIMIT_MACROS 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/tools/clang/lib/AST
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/lib/AST
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/include
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/tools/clang/include
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/include
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include
 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror 
-Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra 
-Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers 
-pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough 
-Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor 
-Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion 
-Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color 
-ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual 
-Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables 
-fno-rtti -UNDEBUG -MD -MT 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -MF 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o.d -o 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -c 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 error: unannotated fall-through between switch labels 
[-Werror,-Wimplicit-fallthrough]
  319 |   case Storage::Typeid:
  |   ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'LLVM_FALLTHROUGH;' to silence this warning
  319 |   case Storage::Typeid:
  |   ^
  |   LLVM_FALLTHROUGH; 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'break;' to avoid fall-through
  319 |   case Storage::Typeid:
  |   ^
  |   break; 
1 error generated.
416.459 [961/882/4537] Building CXX object 
lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86SpeculativeExecutionSideEffectSuppression.cpp.o
416.502 [961/881/4538] Building

[clang-tools-extra] [clang-tidy][clangd] Fixed removeFunctionArgs don't remove comma for use-ranges check (PR #118568)

2024-12-28 Thread Julian Schmidt via cfe-commits


@@ -164,6 +164,33 @@ void UseRangesCheck::registerMatchers(MatchFinder *Finder) 
{
 static void removeFunctionArgs(DiagnosticBuilder &Diag, const CallExpr &Call,
ArrayRef Indexes,
const ASTContext &Ctx) {
+  auto GetCommaLoc =
+  [&](SourceLocation BeginLoc,
+  SourceLocation EndLoc) -> std::optional {
+auto Invalid = false;
+auto SourceText = Lexer::getSourceText(

5chmidti wrote:

Doing all of this with strings is error-prone, which is why you are removing 
the comma inside a comment by accident, as you've noted.
Instead, use the Lexer through one of the utility functions here: 
https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/utils/LexerUtils.h

This can probably look something like:

```c++
auto RemovalRange = Arg->getSourceRange();
if (/*not first arg*/) { // so we can extend the range backward to the 
preceeding comma
  
RemovalRange.setBegin(utils::lexer::findPreviousAnyTokenKind(RemovalRange.getBegin(),
 SM, LO, tok::TokenKind::comma));
} else if (/*not the only arg*/) { // so we can extend the range forwards to 
the next comma
  RemovalRange.setEnd(findNextAnyTokenKind(RemovalRange.getEnd(), SM, LO, 
tok::TokenKind::comma));
}
```

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


[clang-tools-extra] [clang-tidy] swap cppcoreguidelines-narrowing-conversions and bugprone-narrowing-conversions (PR #120245)

2024-12-28 Thread Julian Schmidt via cfe-commits

https://github.com/5chmidti approved this pull request.

LGTM, thanks

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


[clang-tools-extra] [clang-tidy] Mention std::forward_list in container-size-empty doc (PR #120701)

2024-12-28 Thread Julian Schmidt via cfe-commits

https://github.com/5chmidti approved this pull request.


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


[clang] [llvm] [RISCV] Add Qualcomm uC Xqciac (Load-Store Adress calculation) extension (PR #121037)

2024-12-28 Thread Craig Topper via cfe-commits

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

LGTM 

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


[clang] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2024-12-28 Thread Michael Park via cfe-commits

mpark wrote:

> Did you try creduce/cvise (although using that with modules might be a bit 
> challenging) It would be really nice to have a repro so that we have a test 
> case

I did. It did help me reduce it significantly, but it still involves a few 
modules that are difficult to reduce. I still can make progress by running it 
on the modules themselves though. I agree it'd be really nice to have a test 
case.

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


[clang] Reapply "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test (#121160)" (PR #121162)

2024-12-28 Thread Justin Bogner via cfe-commits

bogner wrote:

These tests are failing for me locally on windows now. Why are you removing 
this?

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


[clang] Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test" again (PR #121280)

2024-12-28 Thread Justin Bogner via cfe-commits

https://github.com/bogner created 
https://github.com/llvm/llvm-project/pull/121280

This reverts #121162, which was a reapply of the previous revert earlier in 
#121160 - The change blatantly breaks tests on windows and it isn't clear why 
it's being made.

This reverts commit 8e9fda1c1140e067c5344c61df56c34167296f17.

>From 650dd5a50a6228124dc40676ea08a963ecdf3bb0 Mon Sep 17 00:00:00 2001
From: Justin Bogner 
Date: Sat, 28 Dec 2024 21:35:03 -0700
Subject: [PATCH] Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test"
 again

This reverts #121162, which was a reapply of the previous revert earlier
in #121160 - The change blatantly breaks tests on windows and it isn't
clear why it's being made.

This reverts commit 8e9fda1c1140e067c5344c61df56c34167296f17.
---
 clang/test/Driver/sanitizer-ld.c | 106 +++
 1 file changed, 53 insertions(+), 53 deletions(-)

diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c
index 17766cef86d2a8..f870eff8a4cc5c 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -15,7 +15,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX
 //
-// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOT: "-lc"
 // CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
@@ -80,7 +80,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-SHARED-ASAN-LINUX
 //
-// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-SHARED-ASAN-LINUX-NOT: "-lc"
 // CHECK-SHARED-ASAN-LINUX: libclang_rt.asan.so"
 // CHECK-SHARED-ASAN-LINUX: "--whole-archive" 
"{{.*}}libclang_rt.asan-preinit.a" "--no-whole-archive"
@@ -98,7 +98,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-DSO-SHARED-ASAN-LINUX
 //
-// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lc"
 // CHECK-DSO-SHARED-ASAN-LINUX: libclang_rt.asan.so"
 // CHECK-DSO-SHARED-ASAN-LINUX: "--whole-archive" 
"{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
@@ -115,7 +115,7 @@
 // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD
 //
-// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-NOT: "-lc"
 // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan_static.a"
 // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan.a"
@@ -130,7 +130,7 @@
 // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD-LDL
 //
-// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-LDL-NOT: "-ldl"
 // CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" 
"--no-whole-archive"
 // CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
@@ -148,7 +148,7 @@
 // RUN: -fsanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CXX
 
-// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CXX-NOT: "--dynamic-list"
@@ -167,7 +167,7 @@
 // RUN: -fno-sanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CNOCXX
 
-// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CNOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CNOCXX-SAME: "--export-dynamic"
 // CHECK-ASAN-LINUX-CNOCXX-NOT: stdc++
@@ -184,7 +184,7 @@
 // RUN: -fno-sanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-NOCXX
 
-// CHECK-ASAN-LINUX-NOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-NOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "--export-dynamic"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "-lstdc++"
@@ -201,7 +201,7 @@
 // RUN: -nostdlib++ \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-NOSTDCXX
 
-// CHECK-ASAN-LINUX-NOSTDCXX: "{{(.*[^-.0-9A-Z_a-z])

[clang] Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test" again (PR #121280)

2024-12-28 Thread Justin Bogner via cfe-commits

https://github.com/bogner updated 
https://github.com/llvm/llvm-project/pull/121280

>From 650dd5a50a6228124dc40676ea08a963ecdf3bb0 Mon Sep 17 00:00:00 2001
From: Justin Bogner 
Date: Sat, 28 Dec 2024 21:35:03 -0700
Subject: [PATCH 1/2] Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer
 test" again

This reverts #121162, which was a reapply of the previous revert earlier
in #121160 - The change blatantly breaks tests on windows and it isn't
clear why it's being made.

This reverts commit 8e9fda1c1140e067c5344c61df56c34167296f17.
---
 clang/test/Driver/sanitizer-ld.c | 106 +++
 1 file changed, 53 insertions(+), 53 deletions(-)

diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c
index 17766cef86d2a8..f870eff8a4cc5c 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -15,7 +15,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX
 //
-// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOT: "-lc"
 // CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
@@ -80,7 +80,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-SHARED-ASAN-LINUX
 //
-// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-SHARED-ASAN-LINUX-NOT: "-lc"
 // CHECK-SHARED-ASAN-LINUX: libclang_rt.asan.so"
 // CHECK-SHARED-ASAN-LINUX: "--whole-archive" 
"{{.*}}libclang_rt.asan-preinit.a" "--no-whole-archive"
@@ -98,7 +98,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-DSO-SHARED-ASAN-LINUX
 //
-// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lc"
 // CHECK-DSO-SHARED-ASAN-LINUX: libclang_rt.asan.so"
 // CHECK-DSO-SHARED-ASAN-LINUX: "--whole-archive" 
"{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
@@ -115,7 +115,7 @@
 // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD
 //
-// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-NOT: "-lc"
 // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan_static.a"
 // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan.a"
@@ -130,7 +130,7 @@
 // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD-LDL
 //
-// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-LDL-NOT: "-ldl"
 // CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" 
"--no-whole-archive"
 // CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
@@ -148,7 +148,7 @@
 // RUN: -fsanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CXX
 
-// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CXX-NOT: "--dynamic-list"
@@ -167,7 +167,7 @@
 // RUN: -fno-sanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CNOCXX
 
-// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CNOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CNOCXX-SAME: "--export-dynamic"
 // CHECK-ASAN-LINUX-CNOCXX-NOT: stdc++
@@ -184,7 +184,7 @@
 // RUN: -fno-sanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-NOCXX
 
-// CHECK-ASAN-LINUX-NOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-NOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "--export-dynamic"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "-lstdc++"
@@ -201,7 +201,7 @@
 // RUN: -nostdlib++ \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-NOSTDCXX
 
-// CHECK-ASAN-LINUX-NOSTDCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-NOSTDCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--whole-archive" 
"{{.*}}libclang_rt.asan.a" "--no-whole-archive"
 // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--whole-archive

[clang] Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test" again (PR #121280)

2024-12-28 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Justin Bogner (bogner)


Changes

This reverts #121162, which was a reapply of the previous revert 
earlier in #121160 - The change blatantly breaks tests on windows and 
it isn't clear why it's being made.

This reverts commit 8e9fda1c1140e067c5344c61df56c34167296f17.

---

Patch is 23.55 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/121280.diff


1 Files Affected:

- (modified) clang/test/Driver/sanitizer-ld.c (+53-53) 


``diff
diff --git a/clang/test/Driver/sanitizer-ld.c b/clang/test/Driver/sanitizer-ld.c
index 17766cef86d2a8..f870eff8a4cc5c 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -15,7 +15,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX
 //
-// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOT: "-lc"
 // CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
@@ -80,7 +80,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-SHARED-ASAN-LINUX
 //
-// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-SHARED-ASAN-LINUX-NOT: "-lc"
 // CHECK-SHARED-ASAN-LINUX: libclang_rt.asan.so"
 // CHECK-SHARED-ASAN-LINUX: "--whole-archive" 
"{{.*}}libclang_rt.asan-preinit.a" "--no-whole-archive"
@@ -98,7 +98,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-DSO-SHARED-ASAN-LINUX
 //
-// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lc"
 // CHECK-DSO-SHARED-ASAN-LINUX: libclang_rt.asan.so"
 // CHECK-DSO-SHARED-ASAN-LINUX: "--whole-archive" 
"{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
@@ -115,7 +115,7 @@
 // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD
 //
-// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-NOT: "-lc"
 // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan_static.a"
 // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan.a"
@@ -130,7 +130,7 @@
 // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD-LDL
 //
-// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-LDL-NOT: "-ldl"
 // CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" 
"--no-whole-archive"
 // CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
@@ -148,7 +148,7 @@
 // RUN: -fsanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CXX
 
-// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CXX-NOT: "--dynamic-list"
@@ -167,7 +167,7 @@
 // RUN: -fno-sanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CNOCXX
 
-// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CNOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CNOCXX-SAME: "--export-dynamic"
 // CHECK-ASAN-LINUX-CNOCXX-NOT: stdc++
@@ -184,7 +184,7 @@
 // RUN: -fno-sanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-NOCXX
 
-// CHECK-ASAN-LINUX-NOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-NOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "--export-dynamic"
 // CHECK-ASAN-LINUX-NOCXX-SAME: "-lstdc++"
@@ -201,7 +201,7 @@
 // RUN: -nostdlib++ \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-NOSTDCXX
 
-// CHECK-ASAN-LINUX-NOSTDCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-NOSTDCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--whole-archive" 
"{{.*}}libclang_rt.asan.a" "--no-whole-archive"
 // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--whole-archive" 
"{{.*}}libclang_rt.asan_cxx.a" "--no-whole-archive"
 // CHECK-ASAN-LINUX-NOSTDCXX-SAME: "--export-dynamic"
@@ -217,7 +217,

[clang] 02e8972 - Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test" again (#121280)

2024-12-28 Thread via cfe-commits

Author: Justin Bogner
Date: 2024-12-28T21:48:25-07:00
New Revision: 02e8972c378bf60cc16a85815d29faafdbad7180

URL: 
https://github.com/llvm/llvm-project/commit/02e8972c378bf60cc16a85815d29faafdbad7180
DIFF: 
https://github.com/llvm/llvm-project/commit/02e8972c378bf60cc16a85815d29faafdbad7180.diff

LOG: Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test" again 
(#121280)

This reverts #121162, which was a reapply of the previous revert earlier
in #121160 - The change blatantly breaks tests on windows and it isn't
clear why it's being made.

Note that I needed to add the optional .exe suffix to a few more check
lines that were added as a follow up.

This reverts commit 8e9fda1c1140e067c5344c61df56c34167296f17.

Added: 


Modified: 
clang/test/Driver/sanitizer-ld.c

Removed: 




diff  --git a/clang/test/Driver/sanitizer-ld.c 
b/clang/test/Driver/sanitizer-ld.c
index 17766cef86d2a8..a82c45136d7bf4 100644
--- a/clang/test/Driver/sanitizer-ld.c
+++ b/clang/test/Driver/sanitizer-ld.c
@@ -15,7 +15,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX
 //
-// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-NOT: "-lc"
 // CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
@@ -33,7 +33,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-LINUX
 //
-// CHECK-ASAN-NO-LINK-RUNTIME-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-NO-LINK-RUNTIME-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=address -fno-sanitize-link-runtime -### %s 2>&1 \
 // RUN: --target=arm64e-apple-macosx -fuse-ld=ld \
@@ -41,7 +41,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-NO-LINK-RUNTIME-DARWIN
 //
-// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld"
+// CHECK-ASAN-NO-LINK-RUNTIME-DARWIN: "{{.*}}ld{{(.exe)?}}"
 
 // RUN: %clang -fsanitize=address -### %s 2>&1 \
 // RUN: --target=x86_64-unknown-linux -fuse-ld=ld \
@@ -80,7 +80,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-SHARED-ASAN-LINUX
 //
-// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-SHARED-ASAN-LINUX-NOT: "-lc"
 // CHECK-SHARED-ASAN-LINUX: libclang_rt.asan.so"
 // CHECK-SHARED-ASAN-LINUX: "--whole-archive" 
"{{.*}}libclang_rt.asan-preinit.a" "--no-whole-archive"
@@ -98,7 +98,7 @@
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-DSO-SHARED-ASAN-LINUX
 //
-// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-DSO-SHARED-ASAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-DSO-SHARED-ASAN-LINUX-NOT: "-lc"
 // CHECK-DSO-SHARED-ASAN-LINUX: libclang_rt.asan.so"
 // CHECK-DSO-SHARED-ASAN-LINUX: "--whole-archive" 
"{{.*}}libclang_rt.asan_static.a" "--no-whole-archive"
@@ -115,7 +115,7 @@
 // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD
 //
-// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-FREEBSD: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-NOT: "-lc"
 // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan_static.a"
 // CHECK-ASAN-FREEBSD: freebsd{{/|\\+}}libclang_rt.asan.a"
@@ -130,7 +130,7 @@
 // RUN: --sysroot=%S/Inputs/basic_freebsd_tree \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-FREEBSD-LDL
 //
-// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-FREEBSD-LDL: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-FREEBSD-LDL-NOT: "-ldl"
 // CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan_static.a" 
"--no-whole-archive"
 // CHECK-ASAN-FREEBSD-LDL: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
@@ -148,7 +148,7 @@
 // RUN: -fsanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CXX
 
-// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-CXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CXX-SAME: "--whole-archive" "{{.*}}libclang_rt.asan_cxx.a" 
"--no-whole-archive"
 // CHECK-ASAN-LINUX-CXX-NOT: "--dynamic-list"
@@ -167,7 +167,7 @@
 // RUN: -fno-sanitize-link-c++-runtime \
 // RUN:   | %{filecheck} --check-prefix=CHECK-ASAN-LINUX-CNOCXX
 
-// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld"
+// CHECK-ASAN-LINUX-CNOCXX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-ASAN-LINUX-CNOCXX-S

[clang] Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test" again (PR #121280)

2024-12-28 Thread Justin Bogner via cfe-commits

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


[clang] Reapply "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test (#121160)" (PR #121162)

2024-12-28 Thread Justin Bogner via cfe-commits

bogner wrote:

I've gone ahead and reverted it.

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


[clang] Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test" again (PR #121280)

2024-12-28 Thread Justin Bogner via cfe-commits

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


[clang] [clang] Absoultify paths in dependency file output (PR #117458)

2024-12-28 Thread via cfe-commits

xtexChooser wrote:

cc @MaskRay 

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


[clang] 3496e96 - [clang][bytecode] Add a missing break

2024-12-28 Thread Timm Bäder via cfe-commits

Author: Timm Bäder
Date: 2024-12-28T14:17:06+01:00
New Revision: 3496e96f78c46f5b94c1892f97c470fd89293795

URL: 
https://github.com/llvm/llvm-project/commit/3496e96f78c46f5b94c1892f97c470fd89293795
DIFF: 
https://github.com/llvm/llvm-project/commit/3496e96f78c46f5b94c1892f97c470fd89293795.diff

LOG: [clang][bytecode] Add a missing break

Added: 


Modified: 
clang/lib/AST/ByteCode/Pointer.cpp

Removed: 




diff  --git a/clang/lib/AST/ByteCode/Pointer.cpp 
b/clang/lib/AST/ByteCode/Pointer.cpp
index da202598b363ad..ec4756fe4f87dc 100644
--- a/clang/lib/AST/ByteCode/Pointer.cpp
+++ b/clang/lib/AST/ByteCode/Pointer.cpp
@@ -316,6 +316,7 @@ void Pointer::print(llvm::raw_ostream &OS) const {
   case Storage::Fn:
 OS << "(Fn) { " << asFunctionPointer().getFunction() << " + " << Offset
<< " }";
+break;
   case Storage::Typeid:
 OS << "(Typeid)";
   }



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


[clang-tools-extra] [clang-tidy] add depercation warning for non-whitelisted global options (PR #121057)

2024-12-28 Thread Julian Schmidt via cfe-commits

5chmidti wrote:

> Good point, maybe we can use more smart way to do warning: only warn the 
> global option is set but local option is not.
> 
> Have some redundant options is not the aim for this deprecation things, we 
> only want to avoid user suddenly find the behaviors of lots of check are 
> changed. So we only need to warn for config which rely on global option and 
> no local option.

Your implementation of this looks good.

>  I wonder however how it will work for people who are stuck in old clang-tidy 
> files for whatever reason - this warning can be very noisy if running 
> clang-tidy in CI with lots of files. Do we need some CLI option to allow 
> users to silence the warnings?

Adding a flag would either entail deprecating it again, or deciding that it is 
kept for future deprecations (and would therefore need to be general enough). 
Maybe something like `--[quiet/no]-config-warnings`? There are 11 `StrictMode` 
options, and 21 `IgnoreMacros` options, so there could be potentially 32 
warnings for each checked file of a project, which is a lot. IMO, we don't 
*need* a flag, but it would make for a better user experience.
On the other hand, configs could be easily adjusted. Unless someone is in the 
position that you've described, that they have no control over the 
`.clang-tidy` file. While most projects would probably welcome those changes, 
some users may just want things to work without drowning in config warnings, 
and so they may prefer having the flag.

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


[clang] [llvm] [RISCV] Add Qualcomm uC Xqciac (Load-Store Adress calculation) extension (PR #121037)

2024-12-28 Thread Sam Elliott via cfe-commits


@@ -184,6 +191,37 @@ let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
 } // hasSideEffects = 0, mayLoad = 0, mayStore = 0
 } // Predicates = [HasVendorXqcia, IsRV32], DecoderNamespace = "Xqcia"
 
+let Predicates = [HasVendorXqciac, IsRV32], DecoderNamespace = "Xqciac" in {
+let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
+  def QC_C_MULADDI : RVInst16CL<0b001, 0b10, (outs GPRC:$rd_wb),
+   (ins GPRC:$rd, GPRC:$rs1, uimm5:$uimm),
+   "qc.c.muladdi", "$rd, $rs1, $uimm"> {
+let Constraints = "$rd = $rd_wb";
+bits<5> uimm;
+
+let Inst{12-10} = uimm{3-1};
+let Inst{6} = uimm{0};
+let Inst{5} = uimm{4};
+  }

lenary wrote:

Unlike the main RISC-V ISA, the Xqci architects did not want to split 
instructions into (sub-)extensions by size (as you can see, they have been 
split by functionality). To make the ABI much easier, they agreed that all of 
the sub-extensions with any 16- or 48-bit instructions would require Zca, as 
the compiler will need to be able to insert `c.nop` when aligning etc etc.

Not splitting instructions into extensions by size does mean that existing 
assumptions used by `CompressPat` no longer quite hold. At the moment, it is 
enough to do `.option norvc` (or an equivalent with `.option arch`) for the `C` 
extension to prevent compression, but you cannot disable `qc.c.muladdi` without 
disabling `qc.muladdi`, so we cannot just use architecture features to gate 
compression patterns (There are even more issues around our 48-bit 
instructions, which I don't want to write out here). As I said, I have been 
thinking about an approach for this, but I haven't had time to work through the 
patch, test it, and present it for review. This is why none of our `Xqci*` 
patches so far have had `CompressPat`s, and we do not intend to add them for 
the moment. Most of these issues are reasonably orthogonal to the issue that 
@svs-quic mentioned in the actual tablegen code for `CompressPat`s.

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


[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread Julian Schmidt via cfe-commits


@@ -218,6 +218,7 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(cxxTryStmt);
   REGISTER_MATCHER(cxxUnresolvedConstructExpr);
   REGISTER_MATCHER(decayedType);
+  REGISTER_MATCHER(dependentNameType);

5chmidti wrote:

Please sort this in alphabetically

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


[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread Julian Schmidt via cfe-commits


@@ -7711,6 +7711,16 @@ AST_MATCHER_P(DecayedType, hasDecayedType, 
internal::Matcher,
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);
 }
 
+/// Matches dependent name type

5chmidti wrote:

nit: `a dependent name type` (+1 in release notes)

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


[clang-tools-extra] [clang-tidy] bugprone-unhandled-self-assignment: fix smart pointer check against std::unique_ptr type (PR #121266)

2024-12-28 Thread via cfe-commits

https://github.com/flovent created 
https://github.com/llvm/llvm-project/pull/121266

Unlike other standard smart pointer types, std::unique_ptr has two template 
arguments.
testcase need to be updated too.

>From 009178ad073cd76630418e74092907e1d9dc0d85 Mon Sep 17 00:00:00 2001
From: flovent 
Date: Sat, 28 Dec 2024 21:52:53 +0800
Subject: [PATCH] [clang-tidy] bugprone-unhandled-self-assignment: fix smart
 pointer check against std::unique_ptr type

---
 .../clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp  | 8 +---
 .../checkers/bugprone/unhandled-self-assignment.cpp   | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp 
b/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp
index 8121a36f803460..1f432c4ccc5f00 100644
--- a/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp
@@ -74,9 +74,11 @@ void 
UnhandledSelfAssignmentCheck::registerMatchers(MatchFinder *Finder) {
 // Matcher for standard smart pointers.
 const auto SmartPointerType = qualType(hasUnqualifiedDesugaredType(
 recordType(hasDeclaration(classTemplateSpecializationDecl(
-hasAnyName("::std::shared_ptr", "::std::unique_ptr",
-   "::std::weak_ptr", "::std::auto_ptr"),
-templateArgumentCountIs(1));
+anyOf(allOf(hasAnyName("::std::shared_ptr", "::std::weak_ptr",
+   "::std::auto_ptr"),
+templateArgumentCountIs(1)),
+  allOf(hasName("::std::unique_ptr"),
+templateArgumentCountIs(2;
 
 // We will warn only if the class has a pointer or a C array field which
 // probably causes a problem during self-assignment (e.g. first resetting
diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-self-assignment.cpp
 
b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-self-assignment.cpp
index 14d27855d7c5a6..8610393449f97f 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-self-assignment.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-self-assignment.cpp
@@ -10,7 +10,9 @@ template 
 T &&move(T &x) {
 }
 
-template 
+template  class default_delete {};
+
+template >
 class unique_ptr {
 };
 

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


[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread Amr Hesham via cfe-commits

https://github.com/AmrDeveloper updated 
https://github.com/llvm/llvm-project/pull/121263

>From bdbd11db849506c4d99036dd674f03d1eda815cc Mon Sep 17 00:00:00 2001
From: AmrDeveloper 
Date: Sat, 28 Dec 2024 13:23:33 +0100
Subject: [PATCH 1/2] [Clang][ASTMatcher] Add `dependentNameType` Matcher

---
 clang/docs/LibASTMatchersReference.html   |  9 +
 clang/docs/ReleaseNotes.rst   |  2 ++
 clang/include/clang/ASTMatchers/ASTMatchers.h | 10 ++
 clang/lib/ASTMatchers/ASTMatchersInternal.cpp |  1 +
 clang/lib/ASTMatchers/Dynamic/Registry.cpp|  1 +
 clang/unittests/AST/ASTImporterTest.cpp   |  3 ---
 .../unittests/ASTMatchers/ASTMatchersNodeTest.cpp | 15 +++
 7 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/clang/docs/LibASTMatchersReference.html 
b/clang/docs/LibASTMatchersReference.html
index ddc99020604c94..69fd43b2114723 100644
--- a/clang/docs/LibASTMatchersReference.html
+++ b/clang/docs/LibASTMatchersReference.html
@@ -2536,6 +2536,15 @@ Node Matchers
   matches "decltype(i + j)"
 
 
+MatcherStmt>dependentNameTypeMatcherDependentNameType>...
+Matches dependent 
name type.
+
+Example matches T::type
+
+  template  struct declToImport {
+typedef typename T::type dependent_name;
+  };
+
 
 MatcherType>deducedTemplateSpecializationTypeMatcherDeducedTemplateSpecializationType>...
 Matches C++17 deduced template 
specialization types, e.g. deduced class
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 983c1da20ed4c8..7446aaf57a02dc 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1110,6 +1110,8 @@ AST Matchers
 
 - Add ``dependentScopeDeclRefExpr`` matcher to match expressions that refer to 
dependent scope declarations.
 
+- Add ``dependentNameType`` matcher to match dependent name type.
+
 clang-format
 
 
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h 
b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 22e2546ab81e0a..b27914306b8270 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -7711,6 +7711,16 @@ AST_MATCHER_P(DecayedType, hasDecayedType, 
internal::Matcher,
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);
 }
 
+/// Matches dependent name type
+///
+/// Example matches  T::type
+/// \code
+///  template  struct declToImport {
+///typedef typename T::type dependent_name;
+///  };
+/// \endcode
+extern const AstTypeMatcher dependentNameType;
+
 /// Matches declarations whose declaration context, interpreted as a
 /// Decl, matches \c InnerMatcher.
 ///
diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp 
b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
index 8c744eebbdfb50..a47633bf4bae24 100644
--- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
@@ -1108,6 +1108,7 @@ const AstTypeMatcher 
substTemplateTypeParmType;
 const AstTypeMatcher templateTypeParmType;
 const AstTypeMatcher injectedClassNameType;
 const AstTypeMatcher decayedType;
+const AstTypeMatcher dependentNameType;
 AST_TYPELOC_TRAVERSE_MATCHER_DEF(hasElementType,
  AST_POLYMORPHIC_SUPPORTED_TYPES(ArrayType,
  ComplexType));
diff --git a/clang/lib/ASTMatchers/Dynamic/Registry.cpp 
b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
index 685d626d2978bf..674129aee59241 100644
--- a/clang/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -218,6 +218,7 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(cxxTryStmt);
   REGISTER_MATCHER(cxxUnresolvedConstructExpr);
   REGISTER_MATCHER(decayedType);
+  REGISTER_MATCHER(dependentNameType);
   REGISTER_MATCHER(decl);
   REGISTER_MATCHER(decompositionDecl);
   REGISTER_MATCHER(declCountIs);
diff --git a/clang/unittests/AST/ASTImporterTest.cpp 
b/clang/unittests/AST/ASTImporterTest.cpp
index ec062a5cc953b8..ee1d896f1ca6dc 100644
--- a/clang/unittests/AST/ASTImporterTest.cpp
+++ b/clang/unittests/AST/ASTImporterTest.cpp
@@ -3196,9 +3196,6 @@ TEST_P(ImportExpr, DependentScopeDeclRefExpr) {
  has(callExpr(has(dependentScopeDeclRefExpr());
 }
 
-const internal::VariadicDynCastAllOfMatcher
-dependentNameType;
-
 TEST_P(ImportExpr, DependentNameType) {
   MatchVerifier Verifier;
   testImport("template  struct declToImport {"
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp 
b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index a3baad367a27b1..6dfa3d9c0992f0 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/clang/unitt

[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread Amr Hesham via cfe-commits


@@ -218,6 +218,7 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(cxxTryStmt);
   REGISTER_MATCHER(cxxUnresolvedConstructExpr);
   REGISTER_MATCHER(decayedType);
+  REGISTER_MATCHER(dependentNameType);

AmrDeveloper wrote:

Done, thank you

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


[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread Amr Hesham via cfe-commits


@@ -7711,6 +7711,16 @@ AST_MATCHER_P(DecayedType, hasDecayedType, 
internal::Matcher,
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);
 }
 
+/// Matches dependent name type

AmrDeveloper wrote:

Done

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


[clang] Reapply "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test (#121160)" (PR #121162)

2024-12-28 Thread Carlo Cabrera via cfe-commits

carlocab wrote:

I don't really understand why this is needed either. Should we revert?

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


[clang] Revert "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test" again (PR #121280)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder 
`clang-cmake-x86_64-avx512-win` running on `avx512-intel64-win` while building 
`clang` at step 4 "cmake stage 1".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/81/builds/3419


Here is the relevant piece of the build log for the reference

```
Step 4 (cmake stage 1) failure: 'cmake -G ...' (failure)
'cmake' is not recognized as an internal or external command,
operable program or batch file.

```



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


[clang] Reapply "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test (#121160)" (PR #121162)

2024-12-28 Thread Fangrui Song via cfe-commits

MaskRay wrote:

This is not correct. Windows GetLinkerPath does append `.exe`. For certain 
tests where Windows's .exe and backslashes are annoying, we could employ 
`UNSUPPORTED: system-windows`. I am puzzled by the description about Android.

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


[clang] Reapply "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test (#121160)" (PR #121162)

2024-12-28 Thread Vitaly Buka via cfe-commits

vitalybuka wrote:

> I've gone ahead and reverted it.

Thanks for reverting.

Could you please provide some information on how it fails? Error output would 
be enough. Upstream windows bot are OK.

>Windows GetLinkerPath does append .exe
How upstream bots pass?
E.g. the one above is unrelated flake, and subsequent runs are green. 

> UNSUPPORTED: system-windows
It's not worth it. The idea was just to simplify the test. So I'll just give up 
on the patch.

 

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


[clang] 1557eed - [RISCV] Add Qualcomm uC Xqciac (Load-Store Adress calculation) extension (#121037)

2024-12-28 Thread via cfe-commits

Author: quic_hchandel
Date: 2024-12-29T11:14:12+05:30
New Revision: 1557eeda738d7dbe51d2f52fce28a1fd6f5844ce

URL: 
https://github.com/llvm/llvm-project/commit/1557eeda738d7dbe51d2f52fce28a1fd6f5844ce
DIFF: 
https://github.com/llvm/llvm-project/commit/1557eeda738d7dbe51d2f52fce28a1fd6f5844ce.diff

LOG: [RISCV] Add Qualcomm uC Xqciac (Load-Store Adress calculation) extension 
(#121037)

This extension adds 3 instructions that perform load-store address
calculation.

The current spec can be found at:
https://github.com/quic/riscv-unified-db/releases/latest

This patch adds assembler only support.

-

Co-authored-by: Harsh Chandel 
Co-authored-by: Sudharsan Veeravalli 

Added: 
llvm/test/MC/RISCV/xqciac-invalid.s
llvm/test/MC/RISCV/xqciac-valid.s

Modified: 
clang/test/Driver/print-supported-extensions-riscv.c
llvm/docs/RISCVUsage.rst
llvm/docs/ReleaseNotes.md
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
llvm/lib/Target/RISCV/RISCVFeatures.td
llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td
llvm/lib/TargetParser/RISCVISAInfo.cpp
llvm/test/CodeGen/RISCV/attributes.ll
llvm/unittests/TargetParser/RISCVISAInfoTest.cpp

Removed: 




diff  --git a/clang/test/Driver/print-supported-extensions-riscv.c 
b/clang/test/Driver/print-supported-extensions-riscv.c
index 8344c1aa399737..8e46690cce5a63 100644
--- a/clang/test/Driver/print-supported-extensions-riscv.c
+++ b/clang/test/Driver/print-supported-extensions-riscv.c
@@ -189,6 +189,7 @@
 // CHECK-NEXT: ssctr1.0   'Ssctr' (Control Transfer 
Records Supervisor Level)
 // CHECK-NEXT: svukte   0.3   'Svukte' 
(Address-Independent Latency of User-Mode Faults to Supervisor Addresses)
 // CHECK-NEXT: xqcia0.2   'Xqcia' (Qualcomm uC 
Arithmetic Extension)
+// CHECK-NEXT: xqciac   0.2   'Xqciac' (Qualcomm uC 
Load-Store Address Calculation Extension)
 // CHECK-NEXT: xqcics   0.2   'Xqcics' (Qualcomm uC 
Conditional Select Extension)
 // CHECK-NEXT: xqcicsr  0.2   'Xqcicsr' (Qualcomm uC CSR 
Extension)
 // CHECK-NEXT: xqcilsm  0.2   'Xqcilsm' (Qualcomm uC Load 
Store Multiple Extension)

diff  --git a/llvm/docs/RISCVUsage.rst b/llvm/docs/RISCVUsage.rst
index f6a0dd4bf2383c..22600f5720553e 100644
--- a/llvm/docs/RISCVUsage.rst
+++ b/llvm/docs/RISCVUsage.rst
@@ -429,6 +429,9 @@ The current vendor extensions supported are:
 ``experimental-Xqcia``
   LLVM implements `version 0.2 of the Qualcomm uC Arithmetic extension 
specification `__ by 
Qualcomm.  All instructions are prefixed with `qc.` as described in the 
specification. These instructions are only available for riscv32.
 
+``experimental-Xqciac``
+  LLVM implements `version 0.2 of the Qualcomm uC Load-Store Address 
Calculation extension specification 
`__ by Qualcomm.  All 
instructions are prefixed with `qc.` as described in the specification. These 
instructions are only available for riscv32.
+
 ``experimental-Xqcics``
   LLVM implements `version 0.2 of the Qualcomm uC Conditional Select extension 
specification `__ by 
Qualcomm.  All instructions are prefixed with `qc.` as described in the 
specification. These instructions are only available for riscv32.
 

diff  --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index 5999f78f7e067e..99a93b0467602d 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -224,6 +224,8 @@ Changes to the RISC-V Backend
   extension.
 * Adds experimental assembler support for the Qualcomm uC 'Xqcia` (Arithmetic)
   extension.
+* Adds experimental assembler support for the Qualcomm uC 'Xqciac` (Load-Store 
Address Calculation)
+  extension.
 * Adds experimental assembler support for the Qualcomm uC 'Xqcics` (Conditonal 
Select)
   extension.
 * Adds experimental assembler support for the Qualcomm uC 'Xqcilsm` (Load 
Store Multiple)

diff  --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp 
b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
index 9dcf2e973e6c58..4c1fd5aa41e2b7 100644
--- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -734,6 +734,16 @@ struct RISCVOperand final : public MCParsedAsmOperand {
VK == RISCVMCExpr::VK_RISCV_None;
   }
 
+  bool isUImm5GT3() const {
+if (!isImm())
+  return false;
+RISCVMCExpr::VariantKind VK = RISCVMCExpr::VK_RISCV_None;
+int64_t Imm;
+bool IsConstantImm = evaluateConstantImm(getImm(), Imm, VK);
+return IsConstantImm && isUInt<5>(Imm) && (Imm >

[clang] [llvm] [RISCV] Add Qualcomm uC Xqciac (Load-Store Adress calculation) extension (PR #121037)

2024-12-28 Thread Sudharsan Veeravalli via cfe-commits

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


[clang] Reapply "[nfc][Driver] Remove {{(.exe)?}} from sanitizer test (#121160)" (PR #121162)

2024-12-28 Thread Vitaly Buka via cfe-commits

vitalybuka wrote:

> I am puzzled by the description about Android.

There is this configured buildkite 
https://buildkite.com/llvm-project/github-pull-requests/builds/132244

It's Windows, but only Android lines of the test fail. 


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


[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread Nathan Ridge via cfe-commits


@@ -2536,6 +2536,15 @@ Node Matchers
   matches "decltype(i + j)"
 
 
+MatcherStmt>dependentNameTypeMatcherDependentNameType>...

HighCommander4 wrote:

The first column here should be `Matcher`, not `Matcher`

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


[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread Nathan Ridge via cfe-commits


@@ -1912,6 +1912,21 @@ TEST_P(ASTMatchersTest, 
DeducedTemplateSpecializationType) {
   deducedTemplateSpecializationType()));
 }
 
+TEST_P(ASTMatchersTest, DependentNameType) {
+  if (!GetParam().isCXX()) {
+// FIXME: Add a test for `dependentNameType()` that does not depend on C++.

HighCommander4 wrote:

Similar to `DependentScopeDeclRefExpr`, `DependentNameType` only exists in C++, 
so this FIXME comment can be removed.

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


[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

2024-12-28 Thread Galen Elias via cfe-commits

https://github.com/galenelias updated 
https://github.com/llvm/llvm-project/pull/105597

>From 93eb3d89652607173f4f68fce7dcc5b2bd33f266 Mon Sep 17 00:00:00 2001
From: Galen Elias 
Date: Wed, 21 Aug 2024 16:33:42 -0700
Subject: [PATCH 01/15] clang-format: Add "AllowShortNamespacesOnASingleLine"
 option

This addresses: https://github.com/llvm/llvm-project/issues/101363
which is a resurrection of a previously opened but never completed
review: https://reviews.llvm.org/D11851

The feature is to allow code like the following not to be broken across
multiple lines:

```
namespace foo { class bar; }
namespace foo { namespace bar { class baz; } }
```

Code like this is commonly used for forward declarations, which are
ideally kept compact. This is also apparently the format that
include-what-you-use will insert for forward declarations.
---
 clang/include/clang/Format/Format.h |   5 +
 clang/lib/Format/Format.cpp |   3 +
 clang/lib/Format/UnwrappedLineFormatter.cpp |  82 ++
 clang/unittests/Format/FormatTest.cpp   | 112 
 4 files changed, 202 insertions(+)

diff --git a/clang/include/clang/Format/Format.h 
b/clang/include/clang/Format/Format.h
index 6383934afa2c40..26cd673685942e 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -988,6 +988,11 @@ struct FormatStyle {
   /// \version 3.7
   bool AllowShortLoopsOnASingleLine;
 
+  /// If ``true``, ``namespace a { class b; }`` can be put on a single a single
+  /// line.
+  /// \version 19
+  bool AllowShortNamespacesOnASingleLine;
+
   /// Different ways to break after the function definition return type.
   /// This option is **deprecated** and is retained for backwards 
compatibility.
   enum DefinitionReturnTypeBreakingStyle : int8_t {
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 95129a8fe9240c..8f44e9f00212cf 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -975,6 +975,8 @@ template <> struct MappingTraits {
Style.AllowShortLambdasOnASingleLine);
 IO.mapOptional("AllowShortLoopsOnASingleLine",
Style.AllowShortLoopsOnASingleLine);
+IO.mapOptional("AllowShortNamespacesOnASingleLine",
+   Style.AllowShortNamespacesOnASingleLine);
 IO.mapOptional("AlwaysBreakAfterDefinitionReturnType",
Style.AlwaysBreakAfterDefinitionReturnType);
 IO.mapOptional("AlwaysBreakBeforeMultilineStrings",
@@ -1480,6 +1482,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind 
Language) {
   LLVMStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
   LLVMStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All;
   LLVMStyle.AllowShortLoopsOnASingleLine = false;
+  LLVMStyle.AllowShortNamespacesOnASingleLine = false;
   LLVMStyle.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None;
   LLVMStyle.AlwaysBreakBeforeMultilineStrings = false;
   LLVMStyle.AttributeMacros.push_back("__capability");
diff --git a/clang/lib/Format/UnwrappedLineFormatter.cpp 
b/clang/lib/Format/UnwrappedLineFormatter.cpp
index 1804c1437fd41d..971eac1978bb71 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -420,6 +420,15 @@ class LineJoiner {
 TheLine->First != LastNonComment) {
   return MergeShortFunctions ? tryMergeSimpleBlock(I, E, Limit) : 0;
 }
+
+if (TheLine->Last->is(tok::l_brace)) {
+  if (Style.AllowShortNamespacesOnASingleLine &&
+  TheLine->First->is(tok::kw_namespace)) {
+if (unsigned result = tryMergeNamespace(I, E, Limit))
+  return result;
+  }
+}
+
 // Try to merge a control statement block with left brace unwrapped.
 if (TheLine->Last->is(tok::l_brace) && FirstNonComment != TheLine->Last &&
 FirstNonComment->isOneOf(tok::kw_if, tok::kw_while, tok::kw_for,
@@ -616,6 +625,62 @@ class LineJoiner {
 return 1;
   }
 
+  unsigned tryMergeNamespace(SmallVectorImpl::const_iterator 
I,
+ SmallVectorImpl::const_iterator 
E,
+ unsigned Limit) {
+if (Limit == 0)
+  return 0;
+if (I[1]->InPPDirective != (*I)->InPPDirective ||
+(I[1]->InPPDirective && I[1]->First->HasUnescapedNewline)) {
+  return 0;
+}
+if (I + 2 == E || I[2]->Type == LT_Invalid)
+  return 0;
+
+Limit = limitConsideringMacros(I + 1, E, Limit);
+
+if (!nextTwoLinesFitInto(I, Limit))
+  return 0;
+
+// Check if it's a namespace inside a namespace, and call recursively if so
+// '3' is the sizes of the whitespace and closing brace for " _inner_ }"
+if (I[1]->First->is(tok::kw_namespace)) {
+  if (I[1]->Last->is(TT_LineComment))
+return 0;
+
+  unsigned inner_limit = Limit - I[1]->Last->TotalLength - 3;
+  unsigned inner_result = tryMergeNamespace(I + 1, E, inner_limit);
+  if (!inner_result)
+  

[clang] 8e32959 - [CIR] Upstream initial attribute support (#121069)

2024-12-28 Thread via cfe-commits

Author: David Olsen
Date: 2024-12-28T14:02:15-08:00
New Revision: 8e329593313bb792592529ee825a52683108df99

URL: 
https://github.com/llvm/llvm-project/commit/8e329593313bb792592529ee825a52683108df99
DIFF: 
https://github.com/llvm/llvm-project/commit/8e329593313bb792592529ee825a52683108df99.diff

LOG: [CIR] Upstream initial attribute support (#121069)

Upstream several ClangIR-specific MLIR attributes, in particular
attributes for integer, floating-point, and null pointer constants.
These are the first ClangIR attributes to be upstreamed, so
infrastructure changes are included, such as the table-gen file
`CIRAttrs.td`.

Attributes can be used as the initial values for global variables. The
existing automated test global-var-simple.cpp includes initial values
for some of the global variables in the test.

Added: 
clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
clang/include/clang/CIR/Dialect/IR/CIRAttrs.td

Modified: 
clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
clang/include/clang/CIR/Dialect/IR/CIRDialect.h
clang/include/clang/CIR/Dialect/IR/CIROps.td
clang/include/clang/CIR/Dialect/IR/CIRTypes.td
clang/include/clang/CIR/Dialect/IR/CMakeLists.txt
clang/lib/CIR/CodeGen/CIRGenModule.cpp
clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
clang/lib/CIR/Dialect/IR/CIRDialect.cpp
clang/lib/CIR/Dialect/IR/CMakeLists.txt
clang/lib/CIR/Interfaces/CMakeLists.txt
clang/test/CIR/global-var-simple.cpp

Removed: 




diff  --git a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h 
b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
index 0e414921324b7f..b4a961de224aa0 100644
--- a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+++ b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
@@ -9,7 +9,11 @@
 #ifndef LLVM_CLANG_CIR_DIALECT_BUILDER_CIRBASEBUILDER_H
 #define LLVM_CLANG_CIR_DIALECT_BUILDER_CIRBASEBUILDER_H
 
+#include "clang/CIR/Dialect/IR/CIRAttrs.h"
+
 #include "mlir/IR/Builders.h"
+#include "mlir/IR/BuiltinTypes.h"
+#include "mlir/IR/Types.h"
 
 namespace cir {
 
@@ -26,6 +30,13 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
   cir::PointerType getVoidPtrTy() {
 return getPointerTo(cir::VoidType::get(getContext()));
   }
+
+  mlir::TypedAttr getConstPtrAttr(mlir::Type type, int64_t value) {
+auto valueAttr = mlir::IntegerAttr::get(
+mlir::IntegerType::get(type.getContext(), 64), value);
+return cir::ConstPtrAttr::get(
+getContext(), mlir::cast(type), valueAttr);
+  }
 };
 
 } // namespace cir

diff  --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h 
b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
new file mode 100644
index 00..438fb7d09608db
--- /dev/null
+++ b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
@@ -0,0 +1,36 @@
+//===--===//
+//
+// 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 declares the attributes in the CIR dialect.
+//
+//===--===//
+
+#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
+#define LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
+
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
+
+#include "mlir/IR/Attributes.h"
+#include "mlir/IR/BuiltinAttributeInterfaces.h"
+
+#include "llvm/ADT/SmallVector.h"
+
+//===--===//
+// CIR Dialect Attrs
+//===--===//
+
+namespace clang {
+class FunctionDecl;
+class VarDecl;
+class RecordDecl;
+} // namespace clang
+
+#define GET_ATTRDEF_CLASSES
+#include "clang/CIR/Dialect/IR/CIROpsAttributes.h.inc"
+
+#endif // LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H

diff  --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td 
b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
new file mode 100644
index 00..bd1665e1ac1a06
--- /dev/null
+++ b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
@@ -0,0 +1,142 @@
+//===--===//
+//
+// 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 declares the CIR dialect attributes.
+//
+//===--===//
+
+#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_TD
+#define LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_TD
+
+include "mlir/IR/BuiltinAttributeInter

[clang] [CIR] Upstream initial attribute support (PR #121069)

2024-12-28 Thread David Olsen via cfe-commits

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


[clang-tools-extra] 537d4e9 - Revert "Added options to readability-implicit-bool-conversion (#120087)"

2024-12-28 Thread NAKAMURA Takumi via cfe-commits

Author: NAKAMURA Takumi
Date: 2024-12-28T17:47:00+09:00
New Revision: 537d4e9d21be1f5e40a780f570663b04572765af

URL: 
https://github.com/llvm/llvm-project/commit/537d4e9d21be1f5e40a780f570663b04572765af
DIFF: 
https://github.com/llvm/llvm-project/commit/537d4e9d21be1f5e40a780f570663b04572765af.diff

LOG: Revert "Added options to readability-implicit-bool-conversion  (#120087)"

This reverts commit 5bec2b71b44ddff44aa4d8534b58a5561389bb1d.
(llvmorg-20-init-16425-g5bec2b71b44d)

This broke tests.

Added: 


Modified: 
clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.h
clang-tools-extra/docs/ReleaseNotes.rst

clang-tools-extra/docs/clang-tidy/checks/readability/implicit-bool-conversion.rst

Removed: 

clang-tools-extra/test/clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp



diff  --git 
a/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp 
b/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
index 48851da143068f..f9fd1d903e231e 100644
--- a/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
@@ -259,17 +259,13 @@ ImplicitBoolConversionCheck::ImplicitBoolConversionCheck(
   AllowIntegerConditions(Options.get("AllowIntegerConditions", false)),
   AllowPointerConditions(Options.get("AllowPointerConditions", false)),
   UseUpperCaseLiteralSuffix(
-  Options.get("UseUpperCaseLiteralSuffix", false)),
-  CheckConversionsToBool(Options.get("CheckConversionsToBool", true)),
-  CheckConversionsFromBool(Options.get("CheckConversionsFromBool", true)) 
{}
+  Options.get("UseUpperCaseLiteralSuffix", false)) {}
 
 void ImplicitBoolConversionCheck::storeOptions(
 ClangTidyOptions::OptionMap &Opts) {
   Options.store(Opts, "AllowIntegerConditions", AllowIntegerConditions);
   Options.store(Opts, "AllowPointerConditions", AllowPointerConditions);
   Options.store(Opts, "UseUpperCaseLiteralSuffix", UseUpperCaseLiteralSuffix);
-  Options.store(Opts, "CheckConversionsToBool", CheckConversionsToBool);
-  Options.store(Opts, "CheckConversionsFromBool", CheckConversionsFromBool);
 }
 
 void ImplicitBoolConversionCheck::registerMatchers(MatchFinder *Finder) {
@@ -281,7 +277,6 @@ void 
ImplicitBoolConversionCheck::registerMatchers(MatchFinder *Finder) {
  expr(hasType(qualType().bind("type")),
   hasParent(initListExpr(hasParent(explicitCastExpr(
   hasType(qualType(equalsBoundNode("type"));
-
   auto ImplicitCastFromBool = implicitCastExpr(
   anyOf(hasCastKind(CK_IntegralCast), hasCastKind(CK_IntegralToFloating),
 // Prior to C++11 cast from bool literal to pointer was allowed.
@@ -292,84 +287,72 @@ void 
ImplicitBoolConversionCheck::registerMatchers(MatchFinder *Finder) {
   auto BoolXor =
   binaryOperator(hasOperatorName("^"), hasLHS(ImplicitCastFromBool),
  hasRHS(ImplicitCastFromBool));
+  auto ComparisonInCall = allOf(
+  hasParent(callExpr()),
+  hasSourceExpression(binaryOperator(hasAnyOperatorName("==", "!=";
+
   auto IsInCompilerGeneratedFunction = hasAncestor(namedDecl(anyOf(
   isImplicit(), functionDecl(isDefaulted()), functionTemplateDecl(;
 
-  if (CheckConversionsToBool) {
-auto ComparisonInCall = allOf(
-hasParent(callExpr()),
-hasSourceExpression(binaryOperator(hasAnyOperatorName("==", "!=";
-
-Finder->addMatcher(
-traverse(
-TK_AsIs,
-implicitCastExpr(
-anyOf(hasCastKind(CK_IntegralToBoolean),
-  hasCastKind(CK_FloatingToBoolean),
-  hasCastKind(CK_PointerToBoolean),
-  hasCastKind(CK_MemberPointerToBoolean)),
-// Exclude cases of C23 comparison result.
-unless(allOf(isC23(),
- hasSourceExpression(ignoringParens(
- binaryOperator(hasAnyOperatorName(
- ">", ">=", "==", "!=", "<", "<=")),
-// Exclude case of using if or while statements with variable
-// declaration, e.g.:
-//   if (int var = functionCall()) {}
-unless(hasParent(
-stmt(anyOf(ifStmt(), whileStmt()), has(declStmt(),
-// Exclude cases common to implicit cast to and from bool.
-unless(ExceptionCases), unless(has(BoolXor)),
-// Exclude C23 cases common to implicit cast to bool.
-unless(ComparisonInCall),
-// Retrieve also parent statement, to check if we need
-// additional parens in replace

[clang] 811e1f4 - clang/test/CoverageMapping/single-byte-counters.cpp: Align to the final form to fill linefeeds.

2024-12-28 Thread NAKAMURA Takumi via cfe-commits

Author: NAKAMURA Takumi
Date: 2024-12-28T17:47:09+09:00
New Revision: 811e1f4661bca4a2b5c93d30f54c3aa338f175e9

URL: 
https://github.com/llvm/llvm-project/commit/811e1f4661bca4a2b5c93d30f54c3aa338f175e9
DIFF: 
https://github.com/llvm/llvm-project/commit/811e1f4661bca4a2b5c93d30f54c3aa338f175e9.diff

LOG: clang/test/CoverageMapping/single-byte-counters.cpp: Align to the final 
form to fill linefeeds.

Added: 


Modified: 
clang/test/CoverageMapping/single-byte-counters.cpp

Removed: 




diff  --git a/clang/test/CoverageMapping/single-byte-counters.cpp 
b/clang/test/CoverageMapping/single-byte-counters.cpp
index 4c0987eea4b981..f09e13038d900f 100644
--- a/clang/test/CoverageMapping/single-byte-counters.cpp
+++ b/clang/test/CoverageMapping/single-byte-counters.cpp
@@ -1,20 +1,22 @@
 // RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -mllvm 
-enable-single-byte-coverage=true -fprofile-instrument=clang -fcoverage-mapping 
-dump-coverage-mapping -emit-llvm-only -main-file-name single-byte-counters.cpp 
%s | FileCheck %s
 
 // CHECK: testIf
-int testIf(int x) { // CHECK-NEXT: File 0, [[@LINE]]:19 -> [[@LINE+7]]:2 = 
[[C00:#0]]
+int testIf(int x) { // CHECK-NEXT: File 0, [[@LINE]]:19 -> [[@LINE+8]]:2 = 
[[C00:#0]]
   int result = 0;
   if (x == 0)   // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:13 = 
[[C00]]
-// CHECK-NEXT: Gap,File 0, [[@LINE-1]]:14 -> [[@LINE+1]]:5 
= [[C0T:#1]]
+
+// CHECK-NEXT: Gap,File 0, [[@LINE-2]]:14 -> [[@LINE+1]]:5 
= [[C0T:#1]]
 result = -1;// CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:16 = 
[[C0T]]
 
   return result;// CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE]]:16 = 
[[C0E:#2]]
 }
 
 // CHECK-NEXT: testIfElse
-int testIfElse(int x) { // CHECK-NEXT: File 0, [[@LINE]]:23 -> [[@LINE+8]]:2 = 
[[C10:#0]]
+int testIfElse(int x) { // CHECK-NEXT: File 0, [[@LINE]]:23 -> [[@LINE+9]]:2 = 
[[C10:#0]]
   int result = 0;
   if (x < 0)// CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE]]:12 = 
[[C10]]
-// CHECK-NEXT: Gap,File 0, [[@LINE-1]]:13 -> 
[[@LINE+1]]:5 = [[C1T:#1]]
+
+// CHECK-NEXT: Gap,File 0, [[@LINE-2]]:13 -> 
[[@LINE+1]]:5 = [[C1T:#1]]
 result = 0; // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:15 = 
[[C1T]]
   else  // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:16 -> 
[[@LINE+1]]:5 = [[C1F:#2]]
 result = x * x; // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:19 = 
[[C1F]]
@@ -22,10 +24,11 @@ int testIfElse(int x) { // CHECK-NEXT: File 0, [[@LINE]]:23 
-> [[@LINE+8]]:2 = [
 }
 
 // CHECK-NEXT: testIfElseReturn
-int testIfElseReturn(int x) { // CHECK-NEXT: File 0, [[@LINE]]:29 -> 
[[@LINE+9]]:2 = [[C20:#0]]
+int testIfElseReturn(int x) { // CHECK-NEXT: File 0, [[@LINE]]:29 -> 
[[@LINE+10]]:2 = [[C20:#0]]
   int result = 0;
   if (x > 0)  // CHECK-NEXT: File 0, [[@LINE]]:7 -> 
[[@LINE]]:12 = [[C20]]
-  // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:13 -> 
[[@LINE+1]]:5 = [[C2T:#1]]
+
+  // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:13 -> 
[[@LINE+1]]:5 = [[C2T:#1]]
 result = x * x;   // CHECK-NEXT: File 0, [[@LINE]]:5 -> 
[[@LINE]]:19 = [[C2T]]
   else// CHECK-NEXT: Gap,File 0, [[@LINE-1]]:20 -> 
[[@LINE+1]]:5 = [[C2F:#2]]
 return 0; // CHECK-NEXT: File 0, [[@LINE]]:5 -> 
[[@LINE]]:13 = [[C2F]]
@@ -34,10 +37,11 @@ int testIfElseReturn(int x) { // CHECK-NEXT: File 0, 
[[@LINE]]:29 -> [[@LINE+9]]
 }
 
 // CHECK-NEXT: testIfBothReturn
-int testIfBothReturn(int x) { // CHECK-NEXT: File 0, [[@LINE]]:29 -> 
[[@LINE+9]]:2 = [[C20:#0]]
+int testIfBothReturn(int x) { // CHECK-NEXT: File 0, [[@LINE]]:29 -> 
[[@LINE+10]]:2 = [[C20:#0]]
   int result = 0;
   if (x > 0)  // CHECK-NEXT: File 0, [[@LINE]]:7 -> 
[[@LINE]]:12 = [[C20]]
-  // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:13 -> 
[[@LINE+1]]:5 = [[C2T:#1]]
+
+  // CHECK-NEXT: Gap,File 0, [[@LINE-2]]:13 -> 
[[@LINE+1]]:5 = [[C2T:#1]]
 return 42;// CHECK-NEXT: File 0, [[@LINE]]:5 -> 
[[@LINE]]:14 = [[C2T]]
   else// CHECK-NEXT: Gap,File 0, [[@LINE-1]]:15 -> 
[[@LINE+1]]:5 = [[C2F:#2]]
 return 0; // CHECK-NEXT: File 0, [[@LINE]]:5 -> 
[[@LINE]]:13 = [[C2F]]
@@ -46,19 +50,22 @@ int testIfBothReturn(int x) { // CHECK-NEXT: File 0, 
[[@LINE]]:29 -> [[@LINE+9]]
 }
 
 // CHECK-NEXT: testSwitch
-int testSwitch(int x) { // CHECK-NEXT: File 0, [[@LINE]]:23 -> [[@LINE+17]]:2 
= [[C30:#0]]
+int testSwitch(int x) { // CHECK-NEXT: File 0, [[@LINE]]:23 -> [[@LINE+20]]:2 
= [[C30:#0]]
   int result;
   switch (x) {
-// CHECK-NEXT: Gap,File 0, [[@LINE-1]]:14 -> 
[[@LINE+10]]:15 = 0
-  case 1:   // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+2]]:

[clang] Add -fuse-lipo option (PR #121231)

2024-12-28 Thread Ashley Hauck via cfe-commits


@@ -910,7 +910,10 @@ void darwin::Lipo::ConstructJob(Compilation &C, const 
JobAction &JA,
 CmdArgs.push_back(II.getFilename());
   }
 
-  const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("lipo"));
+  std::string LipoName =
+  std::string(Args.getLastArgValue(options::OPT_fuse_lipo_EQ, "lipo"));
+  const char *Exec =
+  Args.MakeArgString(getToolChain().GetProgramPath(LipoName.c_str()));

khyperia wrote:

Ah, StringRef::data() is documented as "data - Get a pointer to the start of 
the string (which may not be null terminated)". Because we're using it as a 
null-terminated string, I thought that making a copy is necessary to ensure 
it's null terminated, in case getLastArgValue ever changes to not return a 
null-terminated string. Depending on it always returning a null terminated 
string seems like what a lot of other code does already, though, I'll make that 
change.

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


[clang-tools-extra] Added options to readability-implicit-bool-conversion (PR #120087)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder 
`clang-ppc64le-linux-test-suite` running on `ppc64le-clang-test-suite` while 
building `clang-tools-extra` at step 6 "test-build-unified-tree-check-all".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/95/builds/7820


Here is the relevant piece of the build log for the reference

```
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
 TEST 'Clang Tools :: 
clang-tidy/checkers/readability/implicit-bool-conversion-check.cpp' FAILED 

Exit Code: 1

Command Output (stdout):
--
Running ['clang-tidy', 
'/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp',
 '-fix', '--checks=-*,readability-implicit-bool-conversion', 
'-config={CheckOptions: {  
readability-implicit-bool-conversion.CheckConversionsToBool: false,  
readability-implicit-bool-conversion.CheckConversionsFromBool: true  }}', 
'--', '-std=c23', '-std=c++11', '-nostdinc++']...
 clang-tidy output ---
3 warnings generated.
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 warning: implicit conversion 'bool' -> 'int' 
[readability-implicit-bool-conversion]
   49 | int intFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:23:
 note: FIX-IT applied suggested code changes
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:49:32:
 note: FIX-IT applied suggested code changes
   49 | int intFromBool = boolValue; //
  |^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 warning: implicit conversion 'bool' -> 'float' 
[readability-implicit-bool-conversion]
   52 | float floatFromBool = boolValue; //
  |   ^
  |   static_cast( )
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:27:
 note: FIX-IT applied suggested code changes
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:52:36:
 note: FIX-IT applied suggested code changes
   52 | float floatFromBool = boolValue; //
  |^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 warning: implicit conversion 'bool' -> 'char' 
[readability-implicit-bool-conversion]
   55 | char charFromBool = boolValue; //
  | ^
  | static_cast( )
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:25:
 note: FIX-IT applied suggested code changes
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.cpp:55:34:
 note: FIX-IT applied suggested code changes
   55 | char charFromBool = boolValue; //
  |  ^
clang-tidy applied 6 of 6 suggested fixes.

--
diff -u 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-conversion-check.cpp.tmp.orig
 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/tools/clang/tools/extra/test/clang-tidy/checkers/readability/Output/implicit-bool-convers

[clang] [Clang][P1061] Fix template arguments in local classes (PR #121225)

2024-12-28 Thread Younan Zhang via cfe-commits


@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -fsyntax-only %s -verify
+// expected-no-diagnostics
+
+template 
+int g() {
+  return [] (auto) -> int {
+struct L {
+  int m = i;
+};
+return 0;
+  } (42);

zyn0217 wrote:

Yeah, probably also worth an assertion for which we’re within a lambda.

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


[clang] [lld] [llvm] [clang][MIPS] Add support for mipsel-windows-* targets (PR #107744)

2024-12-28 Thread Hervé Poussineau via cfe-commits

hpoussin wrote:

Current list of PRs to have a usable toolchain (except linker):
- #120876 [MC][Mips] Generate required IMAGE_REL_MIPS_PAIR relocation
- #120877 [MC][CodeGen][Mips] Add CodeView mapping
- #120912 [Mips] Handle declspec(dllimport) on mipsel-windows-* triples
- #121041 [Clang][MIPS] Create correct linker arguments for Windows toolchains
- #121042 [Clang][MIPS] Send correct architecture for MinGW toolchains
- #121254 [llvm-lib] Handle MIPS architecture

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


[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Amr Hesham (AmrDeveloper)


Changes

Add AST Matcher for `DependentNameType`

Fixes: https://github.com/llvm/llvm-project/issues/121240

---
Full diff: https://github.com/llvm/llvm-project/pull/121263.diff


7 Files Affected:

- (modified) clang/docs/LibASTMatchersReference.html (+9) 
- (modified) clang/docs/ReleaseNotes.rst (+2) 
- (modified) clang/include/clang/ASTMatchers/ASTMatchers.h (+10) 
- (modified) clang/lib/ASTMatchers/ASTMatchersInternal.cpp (+1) 
- (modified) clang/lib/ASTMatchers/Dynamic/Registry.cpp (+1) 
- (modified) clang/unittests/AST/ASTImporterTest.cpp (-3) 
- (modified) clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp (+15) 


``diff
diff --git a/clang/docs/LibASTMatchersReference.html 
b/clang/docs/LibASTMatchersReference.html
index ddc99020604c94..69fd43b2114723 100644
--- a/clang/docs/LibASTMatchersReference.html
+++ b/clang/docs/LibASTMatchersReference.html
@@ -2536,6 +2536,15 @@ Node Matchers
   matches "decltype(i + j)"
 
 
+MatcherStmt>dependentNameTypeMatcherDependentNameType>...
+Matches dependent 
name type.
+
+Example matches T::type
+
+  template  struct declToImport {
+typedef typename T::type dependent_name;
+  };
+
 
 MatcherType>deducedTemplateSpecializationTypeMatcherDeducedTemplateSpecializationType>...
 Matches C++17 deduced template 
specialization types, e.g. deduced class
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 983c1da20ed4c8..7446aaf57a02dc 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1110,6 +1110,8 @@ AST Matchers
 
 - Add ``dependentScopeDeclRefExpr`` matcher to match expressions that refer to 
dependent scope declarations.
 
+- Add ``dependentNameType`` matcher to match dependent name type.
+
 clang-format
 
 
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h 
b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 22e2546ab81e0a..b27914306b8270 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -7711,6 +7711,16 @@ AST_MATCHER_P(DecayedType, hasDecayedType, 
internal::Matcher,
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);
 }
 
+/// Matches dependent name type
+///
+/// Example matches  T::type
+/// \code
+///  template  struct declToImport {
+///typedef typename T::type dependent_name;
+///  };
+/// \endcode
+extern const AstTypeMatcher dependentNameType;
+
 /// Matches declarations whose declaration context, interpreted as a
 /// Decl, matches \c InnerMatcher.
 ///
diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp 
b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
index 8c744eebbdfb50..a47633bf4bae24 100644
--- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
@@ -1108,6 +1108,7 @@ const AstTypeMatcher 
substTemplateTypeParmType;
 const AstTypeMatcher templateTypeParmType;
 const AstTypeMatcher injectedClassNameType;
 const AstTypeMatcher decayedType;
+const AstTypeMatcher dependentNameType;
 AST_TYPELOC_TRAVERSE_MATCHER_DEF(hasElementType,
  AST_POLYMORPHIC_SUPPORTED_TYPES(ArrayType,
  ComplexType));
diff --git a/clang/lib/ASTMatchers/Dynamic/Registry.cpp 
b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
index 685d626d2978bf..674129aee59241 100644
--- a/clang/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -218,6 +218,7 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(cxxTryStmt);
   REGISTER_MATCHER(cxxUnresolvedConstructExpr);
   REGISTER_MATCHER(decayedType);
+  REGISTER_MATCHER(dependentNameType);
   REGISTER_MATCHER(decl);
   REGISTER_MATCHER(decompositionDecl);
   REGISTER_MATCHER(declCountIs);
diff --git a/clang/unittests/AST/ASTImporterTest.cpp 
b/clang/unittests/AST/ASTImporterTest.cpp
index ec062a5cc953b8..ee1d896f1ca6dc 100644
--- a/clang/unittests/AST/ASTImporterTest.cpp
+++ b/clang/unittests/AST/ASTImporterTest.cpp
@@ -3196,9 +3196,6 @@ TEST_P(ImportExpr, DependentScopeDeclRefExpr) {
  has(callExpr(has(dependentScopeDeclRefExpr());
 }
 
-const internal::VariadicDynCastAllOfMatcher
-dependentNameType;
-
 TEST_P(ImportExpr, DependentNameType) {
   MatchVerifier Verifier;
   testImport("template  struct declToImport {"
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp 
b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index a3baad367a27b1..0a5ecd29432c5f 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
@@ -1912,6 +1912,21 @

[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread Amr Hesham via cfe-commits

https://github.com/AmrDeveloper created 
https://github.com/llvm/llvm-project/pull/121263

Add AST Matcher for `DependentNameType`

Fixes: https://github.com/llvm/llvm-project/issues/121240

>From 21873d01238f8da0eb0f19656801347400afae65 Mon Sep 17 00:00:00 2001
From: AmrDeveloper 
Date: Sat, 28 Dec 2024 13:23:33 +0100
Subject: [PATCH] [Clang][ASTMatcher] Add `dependentNameType` Matcher

---
 clang/docs/LibASTMatchersReference.html   |  9 +
 clang/docs/ReleaseNotes.rst   |  2 ++
 clang/include/clang/ASTMatchers/ASTMatchers.h | 10 ++
 clang/lib/ASTMatchers/ASTMatchersInternal.cpp |  1 +
 clang/lib/ASTMatchers/Dynamic/Registry.cpp|  1 +
 clang/unittests/AST/ASTImporterTest.cpp   |  3 ---
 .../unittests/ASTMatchers/ASTMatchersNodeTest.cpp | 15 +++
 7 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/clang/docs/LibASTMatchersReference.html 
b/clang/docs/LibASTMatchersReference.html
index ddc99020604c94..69fd43b2114723 100644
--- a/clang/docs/LibASTMatchersReference.html
+++ b/clang/docs/LibASTMatchersReference.html
@@ -2536,6 +2536,15 @@ Node Matchers
   matches "decltype(i + j)"
 
 
+MatcherStmt>dependentNameTypeMatcherDependentNameType>...
+Matches dependent 
name type.
+
+Example matches T::type
+
+  template  struct declToImport {
+typedef typename T::type dependent_name;
+  };
+
 
 MatcherType>deducedTemplateSpecializationTypeMatcherDeducedTemplateSpecializationType>...
 Matches C++17 deduced template 
specialization types, e.g. deduced class
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 983c1da20ed4c8..7446aaf57a02dc 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1110,6 +1110,8 @@ AST Matchers
 
 - Add ``dependentScopeDeclRefExpr`` matcher to match expressions that refer to 
dependent scope declarations.
 
+- Add ``dependentNameType`` matcher to match dependent name type.
+
 clang-format
 
 
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h 
b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 22e2546ab81e0a..b27914306b8270 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -7711,6 +7711,16 @@ AST_MATCHER_P(DecayedType, hasDecayedType, 
internal::Matcher,
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);
 }
 
+/// Matches dependent name type
+///
+/// Example matches  T::type
+/// \code
+///  template  struct declToImport {
+///typedef typename T::type dependent_name;
+///  };
+/// \endcode
+extern const AstTypeMatcher dependentNameType;
+
 /// Matches declarations whose declaration context, interpreted as a
 /// Decl, matches \c InnerMatcher.
 ///
diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp 
b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
index 8c744eebbdfb50..a47633bf4bae24 100644
--- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
@@ -1108,6 +1108,7 @@ const AstTypeMatcher 
substTemplateTypeParmType;
 const AstTypeMatcher templateTypeParmType;
 const AstTypeMatcher injectedClassNameType;
 const AstTypeMatcher decayedType;
+const AstTypeMatcher dependentNameType;
 AST_TYPELOC_TRAVERSE_MATCHER_DEF(hasElementType,
  AST_POLYMORPHIC_SUPPORTED_TYPES(ArrayType,
  ComplexType));
diff --git a/clang/lib/ASTMatchers/Dynamic/Registry.cpp 
b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
index 685d626d2978bf..674129aee59241 100644
--- a/clang/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -218,6 +218,7 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(cxxTryStmt);
   REGISTER_MATCHER(cxxUnresolvedConstructExpr);
   REGISTER_MATCHER(decayedType);
+  REGISTER_MATCHER(dependentNameType);
   REGISTER_MATCHER(decl);
   REGISTER_MATCHER(decompositionDecl);
   REGISTER_MATCHER(declCountIs);
diff --git a/clang/unittests/AST/ASTImporterTest.cpp 
b/clang/unittests/AST/ASTImporterTest.cpp
index ec062a5cc953b8..ee1d896f1ca6dc 100644
--- a/clang/unittests/AST/ASTImporterTest.cpp
+++ b/clang/unittests/AST/ASTImporterTest.cpp
@@ -3196,9 +3196,6 @@ TEST_P(ImportExpr, DependentScopeDeclRefExpr) {
  has(callExpr(has(dependentScopeDeclRefExpr());
 }
 
-const internal::VariadicDynCastAllOfMatcher
-dependentNameType;
-
 TEST_P(ImportExpr, DependentNameType) {
   MatchVerifier Verifier;
   testImport("template  struct declToImport {"
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp 
b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index a3baad367a27b1..0

[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread Amr Hesham via cfe-commits

https://github.com/AmrDeveloper updated 
https://github.com/llvm/llvm-project/pull/121263

>From bdbd11db849506c4d99036dd674f03d1eda815cc Mon Sep 17 00:00:00 2001
From: AmrDeveloper 
Date: Sat, 28 Dec 2024 13:23:33 +0100
Subject: [PATCH] [Clang][ASTMatcher] Add `dependentNameType` Matcher

---
 clang/docs/LibASTMatchersReference.html   |  9 +
 clang/docs/ReleaseNotes.rst   |  2 ++
 clang/include/clang/ASTMatchers/ASTMatchers.h | 10 ++
 clang/lib/ASTMatchers/ASTMatchersInternal.cpp |  1 +
 clang/lib/ASTMatchers/Dynamic/Registry.cpp|  1 +
 clang/unittests/AST/ASTImporterTest.cpp   |  3 ---
 .../unittests/ASTMatchers/ASTMatchersNodeTest.cpp | 15 +++
 7 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/clang/docs/LibASTMatchersReference.html 
b/clang/docs/LibASTMatchersReference.html
index ddc99020604c94..69fd43b2114723 100644
--- a/clang/docs/LibASTMatchersReference.html
+++ b/clang/docs/LibASTMatchersReference.html
@@ -2536,6 +2536,15 @@ Node Matchers
   matches "decltype(i + j)"
 
 
+MatcherStmt>dependentNameTypeMatcherDependentNameType>...
+Matches dependent 
name type.
+
+Example matches T::type
+
+  template  struct declToImport {
+typedef typename T::type dependent_name;
+  };
+
 
 MatcherType>deducedTemplateSpecializationTypeMatcherDeducedTemplateSpecializationType>...
 Matches C++17 deduced template 
specialization types, e.g. deduced class
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 983c1da20ed4c8..7446aaf57a02dc 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1110,6 +1110,8 @@ AST Matchers
 
 - Add ``dependentScopeDeclRefExpr`` matcher to match expressions that refer to 
dependent scope declarations.
 
+- Add ``dependentNameType`` matcher to match dependent name type.
+
 clang-format
 
 
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h 
b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 22e2546ab81e0a..b27914306b8270 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -7711,6 +7711,16 @@ AST_MATCHER_P(DecayedType, hasDecayedType, 
internal::Matcher,
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);
 }
 
+/// Matches dependent name type
+///
+/// Example matches  T::type
+/// \code
+///  template  struct declToImport {
+///typedef typename T::type dependent_name;
+///  };
+/// \endcode
+extern const AstTypeMatcher dependentNameType;
+
 /// Matches declarations whose declaration context, interpreted as a
 /// Decl, matches \c InnerMatcher.
 ///
diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp 
b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
index 8c744eebbdfb50..a47633bf4bae24 100644
--- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
@@ -1108,6 +1108,7 @@ const AstTypeMatcher 
substTemplateTypeParmType;
 const AstTypeMatcher templateTypeParmType;
 const AstTypeMatcher injectedClassNameType;
 const AstTypeMatcher decayedType;
+const AstTypeMatcher dependentNameType;
 AST_TYPELOC_TRAVERSE_MATCHER_DEF(hasElementType,
  AST_POLYMORPHIC_SUPPORTED_TYPES(ArrayType,
  ComplexType));
diff --git a/clang/lib/ASTMatchers/Dynamic/Registry.cpp 
b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
index 685d626d2978bf..674129aee59241 100644
--- a/clang/lib/ASTMatchers/Dynamic/Registry.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Registry.cpp
@@ -218,6 +218,7 @@ RegistryMaps::RegistryMaps() {
   REGISTER_MATCHER(cxxTryStmt);
   REGISTER_MATCHER(cxxUnresolvedConstructExpr);
   REGISTER_MATCHER(decayedType);
+  REGISTER_MATCHER(dependentNameType);
   REGISTER_MATCHER(decl);
   REGISTER_MATCHER(decompositionDecl);
   REGISTER_MATCHER(declCountIs);
diff --git a/clang/unittests/AST/ASTImporterTest.cpp 
b/clang/unittests/AST/ASTImporterTest.cpp
index ec062a5cc953b8..ee1d896f1ca6dc 100644
--- a/clang/unittests/AST/ASTImporterTest.cpp
+++ b/clang/unittests/AST/ASTImporterTest.cpp
@@ -3196,9 +3196,6 @@ TEST_P(ImportExpr, DependentScopeDeclRefExpr) {
  has(callExpr(has(dependentScopeDeclRefExpr());
 }
 
-const internal::VariadicDynCastAllOfMatcher
-dependentNameType;
-
 TEST_P(ImportExpr, DependentNameType) {
   MatchVerifier Verifier;
   testImport("template  struct declToImport {"
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp 
b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index a3baad367a27b1..6dfa3d9c0992f0 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/clang/unittests

[clang] [Clang][ASTMatcher] Add `dependentNameType` Matcher (PR #121263)

2024-12-28 Thread via cfe-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff 48bf0a9457fd60d0872d9b9b4804a95c833a72e1 
21873d01238f8da0eb0f19656801347400afae65 --extensions h,cpp -- 
clang/include/clang/ASTMatchers/ASTMatchers.h 
clang/lib/ASTMatchers/ASTMatchersInternal.cpp 
clang/lib/ASTMatchers/Dynamic/Registry.cpp 
clang/unittests/AST/ASTImporterTest.cpp 
clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
``





View the diff from clang-format here.


``diff
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp 
b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index 0a5ecd2943..6dfa3d9c09 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
@@ -1913,7 +1913,7 @@ TEST_P(ASTMatchersTest, 
DeducedTemplateSpecializationType) {
 }
 
 TEST_P(ASTMatchersTest, DependentNameType) {
-   if (!GetParam().isCXX()) {
+  if (!GetParam().isCXX()) {
 // FIXME: Add a test for `dependentNameType()` that does not depend on C++.
 return;
   }
@@ -1924,7 +1924,7 @@ TEST_P(ASTMatchersTest, DependentNameType) {
   typedef typename T::type dependent_name;
 };
   )",
-   dependentNameType()));
+  dependentNameType()));
 }
 
 TEST_P(ASTMatchersTest, RecordType) {

``




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


[clang] e86b68f - [clang][bytecode] Add support for typeid pointers (#121251)

2024-12-28 Thread via cfe-commits

Author: Timm Baeder
Date: 2024-12-28T14:07:01+01:00
New Revision: e86b68ff560aaf5fc723eaa8d8418892b2456e12

URL: 
https://github.com/llvm/llvm-project/commit/e86b68ff560aaf5fc723eaa8d8418892b2456e12
DIFF: 
https://github.com/llvm/llvm-project/commit/e86b68ff560aaf5fc723eaa8d8418892b2456e12.diff

LOG: [clang][bytecode] Add support for typeid pointers (#121251)

Add it as another kind of pointer, saving both a `Type*` for the result
of the typeid() expression as well as one for the type of the typeid
expression.

Added: 


Modified: 
clang/lib/AST/ByteCode/Compiler.cpp
clang/lib/AST/ByteCode/Compiler.h
clang/lib/AST/ByteCode/Interp.cpp
clang/lib/AST/ByteCode/Interp.h
clang/lib/AST/ByteCode/Opcodes.td
clang/lib/AST/ByteCode/Pointer.cpp
clang/lib/AST/ByteCode/Pointer.h
clang/test/AST/ByteCode/cxx2a.cpp

Removed: 




diff  --git a/clang/lib/AST/ByteCode/Compiler.cpp 
b/clang/lib/AST/ByteCode/Compiler.cpp
index 68c75b01e6f6df..036f9608bf3ca1 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -3426,6 +3426,38 @@ bool Compiler::VisitBlockExpr(const BlockExpr 
*E) {
   return this->emitGetFnPtr(Func, E);
 }
 
+template 
+bool Compiler::VisitCXXTypeidExpr(const CXXTypeidExpr *E) {
+  const Type *TypeInfoType = E->getType().getTypePtr();
+
+  if (!E->isPotentiallyEvaluated()) {
+if (DiscardResult)
+  return true;
+
+if (E->isTypeOperand())
+  return this->emitGetTypeid(
+  E->getTypeOperand(Ctx.getASTContext()).getTypePtr(), TypeInfoType, 
E);
+return this->emitGetTypeid(E->getExprOperand()->getType().getTypePtr(),
+   TypeInfoType, E);
+  }
+
+  // Otherwise, we need to evaluate the expression operand.
+  assert(E->getExprOperand());
+  assert(E->getExprOperand()->isLValue());
+
+  if (!Ctx.getLangOpts().CPlusPlus20 && !this->emitDiagTypeid(E))
+return false;
+
+  if (!this->visit(E->getExprOperand()))
+return false;
+
+  if (!this->emitGetTypeidPtr(TypeInfoType, E))
+return false;
+  if (DiscardResult)
+return this->emitPopPtr(E);
+  return true;
+}
+
 template 
 bool Compiler::VisitExpressionTraitExpr(const ExpressionTraitExpr *E) 
{
   assert(Ctx.getLangOpts().CPlusPlus);

diff  --git a/clang/lib/AST/ByteCode/Compiler.h 
b/clang/lib/AST/ByteCode/Compiler.h
index 2a94f5ec76b6c5..71765b18cb1a90 100644
--- a/clang/lib/AST/ByteCode/Compiler.h
+++ b/clang/lib/AST/ByteCode/Compiler.h
@@ -205,6 +205,7 @@ class Compiler : public ConstStmtVisitor, 
bool>,
   bool VisitCXXNewExpr(const CXXNewExpr *E);
   bool VisitCXXDeleteExpr(const CXXDeleteExpr *E);
   bool VisitBlockExpr(const BlockExpr *E);
+  bool VisitCXXTypeidExpr(const CXXTypeidExpr *E);
 
   // Statements.
   bool visitCompoundStmt(const CompoundStmt *S);

diff  --git a/clang/lib/AST/ByteCode/Interp.cpp 
b/clang/lib/AST/ByteCode/Interp.cpp
index 7c7752080746e9..cb0ce886f66809 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1154,6 +1154,53 @@ bool CheckLiteralType(InterpState &S, CodePtr OpPC, 
const Type *T) {
   return false;
 }
 
+static bool getField(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
+ uint32_t Off) {
+  if (S.getLangOpts().CPlusPlus && S.inConstantContext() &&
+  !CheckNull(S, OpPC, Ptr, CSK_Field))
+return false;
+
+  if (!CheckExtern(S, OpPC, Ptr))
+return false;
+  if (!CheckRange(S, OpPC, Ptr, CSK_Field))
+return false;
+  if (!CheckArray(S, OpPC, Ptr))
+return false;
+  if (!CheckSubobject(S, OpPC, Ptr, CSK_Field))
+return false;
+
+  if (Ptr.isIntegralPointer()) {
+S.Stk.push(Ptr.asIntPointer().atOffset(S.getASTContext(), Off));
+return true;
+  }
+
+  if (!Ptr.isBlockPointer()) {
+// FIXME: The only time we (seem to) get here is when trying to access a
+// field of a typeid pointer. In that case, we're supposed to diagnose e.g.
+// `typeid(int).name`, but we currently diagnose `&typeid(int)`.
+S.FFDiag(S.Current->getSource(OpPC),
+ diag::note_constexpr_access_unreadable_object)
+<< AK_Read << Ptr.toDiagnosticString(S.getASTContext());
+return false;
+  }
+
+  if (Off > Ptr.block()->getSize())
+return false;
+
+  S.Stk.push(Ptr.atField(Off));
+  return true;
+}
+
+bool GetPtrField(InterpState &S, CodePtr OpPC, uint32_t Off) {
+  const auto &Ptr = S.Stk.peek();
+  return getField(S, OpPC, Ptr, Off);
+}
+
+bool GetPtrFieldPop(InterpState &S, CodePtr OpPC, uint32_t Off) {
+  const auto &Ptr = S.Stk.pop();
+  return getField(S, OpPC, Ptr, Off);
+}
+
 static bool checkConstructor(InterpState &S, CodePtr OpPC, const Function 
*Func,
  const Pointer &ThisPtr) {
   assert(Func->isConstructor());
@@ -1595,6 +1642,41 @@ bool CheckBitCast(InterpState &S, CodePtr OpPC, bool 
HasIndeterminateBits,
   return false;
 }
 
+bool GetTypeid(InterpState &S, Cod

[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-28 Thread Timm Baeder via cfe-commits

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


[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-ppc64le-rhel` 
running on `ppc64le-clang-rhel-test` while building `clang` at step 5 
"build-unified-tree".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/145/builds/4101


Here is the relevant piece of the build log for the reference

```
Step 5 (build-unified-tree) failure: build (failure)
1.580 [527/4/1] Building Opcodes.inc...
1.591 [504/26/2] Building CXX object 
tools/llvm-config/CMakeFiles/llvm-config.dir/llvm-config.cpp.o
1.660 [503/26/3] Linking CXX executable bin/llvm-config
1.669 [503/25/4] Generating VCSRevision.h
1.716 [500/27/5] Generating VCSVersion.inc
4.338 [499/27/6] Building CXX object 
tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Version.cpp.o
11.069 [499/26/7] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Function.cpp.o
11.250 [499/25/8] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o
FAILED: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o 
ccache /home/docker/llvm-external-buildbots/clang.17.0.6/bin/clang++ 
--gcc-toolchain=/gcc-toolchain/usr -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG 
-D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS 
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/lib/AST
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/lib/AST
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/include
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/tools/clang/include
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/include
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include
 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror 
-Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra 
-Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers 
-pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough 
-Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor 
-Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion 
-Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color 
-ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual 
-Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables 
-fno-rtti -UNDEBUG -MD -MT 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -MF 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o.d -o 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -c 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 error: unannotated fall-through between switch labels 
[-Werror,-Wimplicit-fallthrough]
  319 |   case Storage::Typeid:
  |   ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'LLVM_FALLTHROUGH;' to silence this warning
  319 |   case Storage::Typeid:
  |   ^
  |   LLVM_FALLTHROUGH; 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'break;' to avoid fall-through
  319 |   case Storage::Typeid:
  |   ^
  |   break; 
1 error generated.
12.214 [499/24/9] Building CXX object 
lib/Object/CMakeFiles/LLVMObject.dir/IRSymtab.cpp.o
12.335 [499/23/10] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpBlock.cpp.o
12.423 [499/22/11] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Descriptor.cpp.o
13.117 [499/21/12] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/EvaluationResult.cpp.o
13.700 [499/20/13] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/PrimType.cpp.o
13.908 [499/19/14] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpStack.cpp.o
14.455 [499/18/15] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Program.cpp.o
14.511 [499/17/16] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpState.cpp.o
14.692 [499/16/17] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/DynamicAllocator.cpp.o
14.997 [499/15/18] Building CXX object 
tools/clang/lib/AST/C

[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-ppc64-aix` running 
on `aix-ppc64` while building `clang` at step 5 "build-unified-tree".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/64/builds/1803


Here is the relevant piece of the build log for the reference

```
Step 5 (build-unified-tree) failure: build (failure)
...
28.039 [39/10/10] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/EvaluationResult.cpp.o
28.272 [38/10/11] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpBuiltinBitCast.cpp.o
33.607 [37/10/12] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/DynamicAllocator.cpp.o
36.057 [36/10/13] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpBuiltin.cpp.o
37.919 [35/10/14] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpBlock.cpp.o
40.482 [34/10/15] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpFrame.cpp.o
40.709 [33/10/16] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Compiler.cpp.o
44.044 [32/10/17] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpStack.cpp.o
46.943 [31/10/18] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpState.cpp.o
48.398 [30/10/19] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o
FAILED: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o 
/usr/local/clang-17.0.2/bin/clang++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG 
-D_GLIBCXX_ASSERTIONS -D_LARGE_FILE_API -D_XOPEN_SOURCE=700 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/lib/AST
 
-I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/lib/AST
 
-I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/include
 
-I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/tools/clang/include
 -I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/include 
-I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/include
 -mcmodel=large -fPIC -Werror -Werror=date-time 
-Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter 
-Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic 
-Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough 
-Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor 
-Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion 
-Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color 
-ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual 
-Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables 
-fno-rtti -UNDEBUG -MD -MT 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -MF 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o.d -o 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -c 
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 error: unannotated fall-through between switch labels 
[-Werror,-Wimplicit-fallthrough]
  319 |   case Storage::Typeid:
  |   ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'LLVM_FALLTHROUGH;' to silence this warning
  319 |   case Storage::Typeid:
  |   ^
  |   LLVM_FALLTHROUGH; 
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'break;' to avoid fall-through
  319 |   case Storage::Typeid:
  |   ^
  |   break; 
1 error generated.
50.356 [30/9/20] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/PrimType.cpp.o
53.488 [30/8/21] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Program.cpp.o
55.350 [30/7/22] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/State.cpp.o
57.392 [30/6/23] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/MemberPointer.cpp.o
69.022 [30/5/24] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ExprConstant.cpp.o
75.070 [30/4/25] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/EvalEmitter.cpp.o
78.297 [30/3/26] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTContext.cpp.o
91.165 [30/2/27] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Disasm.cpp.o
99.926 [30/1/28] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Interp.cpp.o
ni

[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `sanitizer-ppc64le-linux` 
running on `ppc64le-sanitizer` while building `clang` at step 2 "annotate".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/72/builds/6693


Here is the relevant piece of the build log for the reference

```
Step 2 (annotate) failure: 'python 
../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py'
 (failure)
...
[3737/4122] Linking CXX executable bin/llvm-dis
[3738/4122] Building CXX object 
tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXCursor.cpp.o
[3739/4122] Linking CXX executable bin/llvm-diff
[3740/4122] Building CXX object 
tools/clang/tools/c-index-test/CMakeFiles/c-index-test.dir/core_main.cpp.o
[3741/4122] Building CXX object 
tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o
[3742/4122] Building CXX object 
tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexCodeCompletion.cpp.o
[3743/4122] Building CXX object 
tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndex.cpp.o
[3744/4122] Building CXX object 
tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexInclusionStack.cpp.o
[3745/4122] Building CXX object 
tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXExtractAPI.cpp.o
[3746/4122] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o
FAILED: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm_build0/bin/clang++
 -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS 
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 
-D__STDC_LIMIT_MACROS 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/lib/AST
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/AST
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/include
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/tools/clang/include
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/build_default/include
 
-I/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/llvm/include
 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror 
-Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra 
-Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers 
-pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough 
-Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor 
-Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion 
-Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color 
-ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual 
-Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables 
-fno-rtti -UNDEBUG -MD -MT 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -MF 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o.d -o 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -c 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 error: unannotated fall-through between switch labels 
[-Werror,-Wimplicit-fallthrough]
  319 |   case Storage::Typeid:
  |   ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'LLVM_FALLTHROUGH;' to silence this warning
  319 |   case Storage::Typeid:
  |   ^
  |   LLVM_FALLTHROUGH; 
/home/buildbots/llvm-external-buildbots/workers/ppc64le-sanitizer/sanitizer-ppc64le/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'break;' to avoid fall-through
  319 |   case Storage::Typeid:
  |   ^
  |   break; 
1 error generated.
[3747/4122] Building CXX object 
tools/clang/tools/clang-scan-deps/CMakeFiles/clang-scan-deps.dir/ClangScanDeps.cpp.o
[3748/4122] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/State.cpp.o
[3749/4122] Building CXX object 
tools/clang/tools/libclang/CMakeFiles/libclang.dir/Indexing.cpp.o
[3750/4122] Building CXX object 
tools/clang/tools/clang-repl/CMakeFiles/clang-repl.dir/ClangRepl.cpp.o
[3751/4122] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpFrame.cpp.o
[3752/4122] Building CXX object 
tools/clang/tools/clang-instal

[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder 
`sanitizer-x86_64-linux-android` running on `sanitizer-buildbot-android` while 
building `clang` at step 2 "annotate".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/186/builds/5214


Here is the relevant piece of the build log for the reference

```
Step 2 (annotate) failure: 'python 
../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py'
 (failure)
...
[3895/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVAsmPrinter.cpp.o
[3896/5341] Building CXX object 
tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/Sema.cpp.o
[3897/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVCallingConv.cpp.o
[3898/5341] Building CXX object 
tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaAttr.cpp.o
[3899/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVConstantPoolValue.cpp.o
[3900/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVCodeGenPrepare.cpp.o
[3901/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVExpandAtomicPseudoInsts.cpp.o
[3902/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVDeadRegisterDefinitions.cpp.o
[3903/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVMakeCompressible.cpp.o
[3904/5341] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o
FAILED: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache 
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build0/bin/clang++
 -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS 
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 
-D__STDC_LIMIT_MACROS 
-I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/tools/clang/lib/AST
 
-I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/AST
 
-I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/include
 
-I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/tools/clang/include
 
-I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/include
 
-I/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/llvm/include
 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror 
-Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra 
-Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers 
-pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough 
-Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor 
-Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion 
-Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color 
-ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual 
-Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables 
-fno-rtti -UNDEBUG -MD -MT 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -MF 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o.d -o 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -c 
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 error: unannotated fall-through between switch labels 
[-Werror,-Wimplicit-fallthrough]
  319 |   case Storage::Typeid:
  |   ^
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'LLVM_FALLTHROUGH;' to silence this warning
  319 |   case Storage::Typeid:
  |   ^
  |   LLVM_FALLTHROUGH; 
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'break;' to avoid fall-through
  319 |   case Storage::Typeid:
  |   ^
  |   break; 
1 error generated.
[3905/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVExpandPseudoInsts.cpp.o
[3906/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVFrameLowering.cpp.o
[3907/5341] Building CXX object 
tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaAvailability.cpp.o
[3908/5341] Building CXX object 
lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/RISCVGatherScatterLowering.cpp.o
[3909/5341] Building CXX object 
tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaCast.cpp.o
[3910/5341] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST

[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux` 
running on `sanitizer-buildbot8` while building `clang` at step 2 "annotate".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/51/builds/8284


Here is the relevant piece of the build log for the reference

```
Step 2 (annotate) failure: 'python 
../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py'
 (failure)
...
[3890/5366] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/State.cpp.o
[3891/5366] Building CXX object 
tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/VEToolchain.cpp.o
[3892/5366] Building CXX object 
tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/ToolChains/ZOS.cpp.o
[3893/5366] Building CXX object 
tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteModernObjC.cpp.o
[3894/5366] Building CXX object 
tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteObjC.cpp.o
[3895/5366] Building CXX object 
tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/ArgumentsAdjusters.cpp.o
[3896/5366] Building CXX object 
tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/FileMatchTrie.cpp.o
[3897/5366] Building CXX object 
tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/FixIt.cpp.o
[3898/5366] Building CXX object 
tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/DependencyGraph.cpp.o
[3899/5366] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o
FAILED: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache 
/home/b/sanitizer-aarch64-linux/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS 
-DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-I/home/b/sanitizer-aarch64-linux/build/build_default/tools/clang/lib/AST 
-I/home/b/sanitizer-aarch64-linux/build/llvm-project/clang/lib/AST 
-I/home/b/sanitizer-aarch64-linux/build/llvm-project/clang/include 
-I/home/b/sanitizer-aarch64-linux/build/build_default/tools/clang/include 
-I/home/b/sanitizer-aarch64-linux/build/build_default/include 
-I/home/b/sanitizer-aarch64-linux/build/llvm-project/llvm/include -fPIC 
-fno-semantic-interposition -fvisibility-inlines-hidden -Werror 
-Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra 
-Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers 
-pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough 
-Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor 
-Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion 
-Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color 
-ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual 
-Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables 
-fno-rtti -UNDEBUG -MD -MT 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -MF 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o.d -o 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -c 
/home/b/sanitizer-aarch64-linux/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp
/home/b/sanitizer-aarch64-linux/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 error: unannotated fall-through between switch labels 
[-Werror,-Wimplicit-fallthrough]
  319 |   case Storage::Typeid:
  |   ^
/home/b/sanitizer-aarch64-linux/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'LLVM_FALLTHROUGH;' to silence this warning
  319 |   case Storage::Typeid:
  |   ^
  |   LLVM_FALLTHROUGH; 
/home/b/sanitizer-aarch64-linux/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'break;' to avoid fall-through
  319 |   case Storage::Typeid:
  |   ^
  |   break; 
1 error generated.
[3900/5366] Building CXX object 
tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/HeaderIncludeGen.cpp.o
[3901/5366] Building CXX object 
tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/InclusionRewriter.cpp.o
[3902/5366] Building CXX object 
tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/VerifyDiagnosticConsumer.cpp.o
[3903/5366] Building CXX object 
tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/ASTMerge.cpp.o
[3904/5366] Building CXX object 
tools/clang/lib/Frontend/Rewrite/CMakeFiles/obj.clangRewriteFrontend.dir/RewriteMacros.cpp.o
[3905/5366] Building CXX object 
tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/GeneratePCH.cpp.o
[3906/5366] Building CXX object 
tools/clang/lib/Frontend/CMakeFiles/obj.clangFrontend.dir/PrintPreprocessedOutput.cpp.o
[3907/5366] Building CXX object 
tools/clang/lib/Serialization/CMakeFiles/obj.clangSerialization.dir/ASTWriter.cpp.o
[3908/5366] Building CXX object

[clang] [clang][bytecode] Add support for typeid pointers (PR #121251)

2024-12-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux` 
running on `sanitizer-buildbot2` while building `clang` at step 2 "annotate".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/66/builds/8030


Here is the relevant piece of the build log for the reference

```
Step 2 (annotate) failure: 'python 
../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py'
 (failure)
...
[2622/5370] Building SystemZGenAsmMatcher.inc...
[2623/5370] Building SystemZGenDisassemblerTables.inc...
[2624/5370] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Function.cpp.o
[2625/5370] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/InterpState.cpp.o
[2626/5370] Building SystemZGenGNUAsmWriter.inc...
[2627/5370] Building SystemZGenHLASMAsmWriter.inc...
[2628/5370] Building SystemZGenRegisterInfo.inc...
[2629/5370] Building VEGenCallingConv.inc...
[2630/5370] Building SystemZGenMCCodeEmitter.inc...
[2631/5370] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o
FAILED: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache 
/home/b/sanitizer-x86_64-linux/build/llvm_build0/bin/clang++ -DCLANG_EXPORTS 
-DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-I/home/b/sanitizer-x86_64-linux/build/build_default/tools/clang/lib/AST 
-I/home/b/sanitizer-x86_64-linux/build/llvm-project/clang/lib/AST 
-I/home/b/sanitizer-x86_64-linux/build/llvm-project/clang/include 
-I/home/b/sanitizer-x86_64-linux/build/build_default/tools/clang/include 
-I/home/b/sanitizer-x86_64-linux/build/build_default/include 
-I/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -fPIC 
-fno-semantic-interposition -fvisibility-inlines-hidden -Werror 
-Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra 
-Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers 
-pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough 
-Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor 
-Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion 
-Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color 
-ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual 
-Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables 
-fno-rtti -UNDEBUG -MD -MT 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -MF 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o.d -o 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Pointer.cpp.o -c 
/home/b/sanitizer-x86_64-linux/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 error: unannotated fall-through between switch labels 
[-Werror,-Wimplicit-fallthrough]
  319 |   case Storage::Typeid:
  |   ^
/home/b/sanitizer-x86_64-linux/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'LLVM_FALLTHROUGH;' to silence this warning
  319 |   case Storage::Typeid:
  |   ^
  |   LLVM_FALLTHROUGH; 
/home/b/sanitizer-x86_64-linux/build/llvm-project/clang/lib/AST/ByteCode/Pointer.cpp:319:3:
 note: insert 'break;' to avoid fall-through
  319 |   case Storage::Typeid:
  |   ^
  |   break; 
1 error generated.
[2632/5370] Building SystemZGenDAGISel.inc...
[2633/5370] Building PPCGenDAGISel.inc...
[2634/5370] Building PPCGenGlobalISel.inc...
[2635/5370] Building PPCGenInstrInfo.inc...
[2636/5370] Building NVPTXGenDAGISel.inc...
[2637/5370] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/DynamicAllocator.cpp.o
[2638/5370] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/MemberPointer.cpp.o
[2639/5370] Building VEGenRegisterInfo.inc...
[2640/5370] Building VEGenAsmWriter.inc...
[2641/5370] Building VEGenAsmMatcher.inc...
[2642/5370] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Descriptor.cpp.o
[2643/5370] Building XCoreGenDisassemblerTables.inc...
[2644/5370] Building VEGenDisassemblerTables.inc...
[2645/5370] Building XCoreGenAsmWriter.inc...
[2646/5370] Building XCoreGenCallingConv.inc...
[2647/5370] Building VEGenSubtargetInfo.inc...
[2648/5370] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/State.cpp.o
[2649/5370] Building VEGenMCCodeEmitter.inc...
[2650/5370] Building XCoreGenRegisterInfo.inc...
[2651/5370] Building XCoreGenDAGISel.inc...
[2652/5370] Building NVPTXGenInstrInfo.inc...
[2653/5370] Building XCoreGenInstrInfo.inc...
[2654/5370] Building CXX object 
tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ByteCode/Program.cpp.o
[2655/5370] Building SystemZGenSubtargetInfo.inc...
[2656/5370] Building V