Re: [PATCH] D81408: [builtins] Improve compatibility with 16 bit targets

2020-06-23 Thread Mikhail Goncharov via cfe-commits
Yes, that seems to be strange that 'compiler-rt' was dropped. Will check
why.

On Tue, Jun 23, 2020 at 10:32 AM Anatoly Trosinenko via Phabricator <
revi...@reviews.llvm.org> wrote:

> atrosinenko added a comment.
>
> > could you please clarify what exactly is wrong? Windows not building
> 'compiler-rt'?
>
> Yes. Maybe I misunderstood the intention. It just looked quite strange to
> me that when only the `compiler-rt/` subtree of the repository was changed,
> pre-merge check was optimizing build by dropping all unrelated subprojects
> - and compiler-rt was dropped as well.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D81408/new/
>
> https://reviews.llvm.org/D81408
>
>
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 0f95b2b - [clang] update pr27699 test to make headers different (NFC)

2022-08-31 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2022-08-31T13:12:28+02:00
New Revision: 0f95b2b0606317ba048ff39da7a1d65c3bdc8fb5

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

LOG: [clang] update pr27699 test to make headers different (NFC)

some build systems treat those headers as identical, causing a warning

Added: 


Modified: 
clang/test/Modules/Inputs/PR27699/Subdir/b.h

Removed: 




diff  --git a/clang/test/Modules/Inputs/PR27699/Subdir/b.h 
b/clang/test/Modules/Inputs/PR27699/Subdir/b.h
index 6c36a1a100be7..76e62a61a5234 100644
--- a/clang/test/Modules/Inputs/PR27699/Subdir/b.h
+++ b/clang/test/Modules/Inputs/PR27699/Subdir/b.h
@@ -1 +1,2 @@
+// Identical to a.h.
 #include "streambuf"



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


[clang] [clang] Substitute alias templates from correct context (PR #74335)

2023-12-06 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

This started to give errors to code previously considere valid with 
"out-of-line definition of X differs from that in".
Don't have a repro yet.

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


[clang] [llvm] [ValueTracking] Add dominating condition support in computeKnownBits() (PR #73662)

2023-12-07 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

heads up - we see a much larger regression for one of the cases in TensorFlow 
(trying to confirm it)

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


[clang] [llvm] [ValueTracking] Add dominating condition support in computeKnownBits() (PR #73662)

2023-12-07 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

looks like we just had a pathological case that was on a threshold. Thank you!

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


[clang] 8a2a966 - Return -no-canonical-prefixes for riskv32/64 test

2022-03-28 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2022-03-28T11:23:14+02:00
New Revision: 8a2a966520023cd7d424e89b730c054f1f06f496

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

LOG: Return -no-canonical-prefixes for riskv32/64 test

W/o -no-canonical-prefixes CC1: clang{{.*}} "-cc1" "-triple" "riscv32"
does not match clang output for some setups.

See da62a5c6610dd2087ce2f527ca84ba43e93d5e30.

Added: 


Modified: 
clang/test/Driver/riscv32-toolchain.c
clang/test/Driver/riscv64-toolchain.c

Removed: 




diff  --git a/clang/test/Driver/riscv32-toolchain.c 
b/clang/test/Driver/riscv32-toolchain.c
index 7ab07563661c9..4eefa006c129f 100644
--- a/clang/test/Driver/riscv32-toolchain.c
+++ b/clang/test/Driver/riscv32-toolchain.c
@@ -1,6 +1,6 @@
 // A basic clang -cc1 command-line, and simple environment check.
 
-// RUN: %clang %s -### --target=riscv32 \
+// RUN: %clang %s -### -no-canonical-prefixes --target=riscv32 \
 // RUN:   --gcc-toolchain=%S/Inputs/basic_riscv32_tree 2>&1 \
 // RUN:   | FileCheck -check-prefix=CC1 %s
 // CC1: clang{{.*}} "-cc1" "-triple" "riscv32"

diff  --git a/clang/test/Driver/riscv64-toolchain.c 
b/clang/test/Driver/riscv64-toolchain.c
index 371dcfda4311a..d35e194031857 100644
--- a/clang/test/Driver/riscv64-toolchain.c
+++ b/clang/test/Driver/riscv64-toolchain.c
@@ -1,6 +1,6 @@
 // A basic clang -cc1 command-line, and simple environment check.
 
-// RUN: %clang %s -### --target=riscv64 \
+// RUN: %clang %s -### -no-canonical-prefixes --target=riscv64 \
 // RUN:   --gcc-toolchain=%S/Inputs/basic_riscv64_tree 2>&1 \
 // RUN:   | FileCheck -check-prefix=CC1 %s
 // CC1: clang{{.*}} "-cc1" "-triple" "riscv64"



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


[clang] 8006ac7 - fix test for symlinked clang c1ee4fb5af49a

2021-05-31 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2021-05-31T13:29:33+02:00
New Revision: 8006ac7fe449e272385b85db80d22c924ab61d3a

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

LOG: fix test for symlinked clang c1ee4fb5af49a

Added: 


Modified: 
clang/test/Driver/avr-toolchain.c

Removed: 




diff  --git a/clang/test/Driver/avr-toolchain.c 
b/clang/test/Driver/avr-toolchain.c
index b9ca1777a7d6..692063dc2c34 100644
--- a/clang/test/Driver/avr-toolchain.c
+++ b/clang/test/Driver/avr-toolchain.c
@@ -3,7 +3,7 @@
 // RUN: %clang %s -### -no-canonical-prefixes -target avr 2>&1 | FileCheck 
-check-prefix=CC1 %s
 // CC1: clang{{.*}} "-cc1" "-triple" "avr"
 
-// RUN: %clang %s -### -target avr --sysroot %S/Inputs/basic_avr_tree 2>&1 | 
FileCheck -check-prefix CC1A %s
+// RUN: %clang %s -### -no-canonical-prefixes -target avr --sysroot 
%S/Inputs/basic_avr_tree 2>&1 | FileCheck -check-prefix CC1A %s
 // CC1A: clang{{.*}} "-cc1" "-triple" "avr" {{.*}} "-internal-isystem" 
{{".*avr/include"}}
 
 // RUN: %clang %s -### -target avr --sysroot %S/Inputs/basic_avr_tree 2>&1 
-nostdinc | FileCheck -check-prefix CC1B %s



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


[clang] c36ff64 - Revert "[clang] Add support for the "abstract" contextual keyword of MSVC"

2021-05-31 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2021-05-31T15:34:20+02:00
New Revision: c36ff6424f249d3e2005fb0589337452cd7ddad3

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

LOG: Revert "[clang] Add support for the "abstract" contextual keyword of MSVC"

This reverts commit 818338add77411f5e9713247ea66142f332ef350.

Tests fail under sanitizer: 
https://lab.llvm.org/buildbot/#/builders/5/builds/8150

Added: 


Modified: 
clang/include/clang/AST/DeclCXX.h
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/DeclSpec.h
clang/include/clang/Sema/Sema.h
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Sema/DeclSpec.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaCXX/MicrosoftExtensions.cpp

Removed: 




diff  --git a/clang/include/clang/AST/DeclCXX.h 
b/clang/include/clang/AST/DeclCXX.h
index c9efc4b454968..07c4eb261aac1 100644
--- a/clang/include/clang/AST/DeclCXX.h
+++ b/clang/include/clang/AST/DeclCXX.h
@@ -1786,7 +1786,6 @@ class CXXRecordDecl : public RecordDecl {
   static bool classofKind(Kind K) {
 return K >= firstCXXRecord && K <= lastCXXRecord;
   }
-  void markAbstract() { data().Abstract = true; }
 };
 
 /// Store information needed for an explicit specifier.

diff  --git a/clang/include/clang/Basic/DiagnosticGroups.td 
b/clang/include/clang/Basic/DiagnosticGroups.td
index 8544607673c3e..f6a4fbb1e04c8 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -1086,7 +1086,6 @@ def MicrosoftInclude : DiagGroup<"microsoft-include">;
 def MicrosoftCppMacro : DiagGroup<"microsoft-cpp-macro">;
 def MicrosoftFixedEnum : DiagGroup<"microsoft-fixed-enum">;
 def MicrosoftSealed : DiagGroup<"microsoft-sealed">;
-def MicrosoftAbstract : DiagGroup<"microsoft-abstract">;
 def MicrosoftUnqualifiedFriend : DiagGroup<"microsoft-unqualified-friend">;
 def MicrosoftExceptionSpec : DiagGroup<"microsoft-exception-spec">;
 def MicrosoftUsingDecl : DiagGroup<"microsoft-using-decl">;
@@ -1124,7 +1123,7 @@ def : DiagGroup<"msvc-include", [MicrosoftInclude]>;
 // Warnings group for warnings about Microsoft extensions.
 def Microsoft : DiagGroup<"microsoft",
 [MicrosoftCharize, MicrosoftDrectveSection, MicrosoftInclude,
- MicrosoftCppMacro, MicrosoftFixedEnum, MicrosoftSealed, MicrosoftAbstract,
+ MicrosoftCppMacro, MicrosoftFixedEnum, MicrosoftSealed,
  MicrosoftUnqualifiedFriend, MicrosoftExceptionSpec, MicrosoftUsingDecl,
  MicrosoftMutableReference, MicrosoftPureDefinition,
  MicrosoftUnionMemberReference, MicrosoftExplicitConstructorCall,

diff  --git a/clang/include/clang/Basic/DiagnosticParseKinds.td 
b/clang/include/clang/Basic/DiagnosticParseKinds.td
index b13c382c16ebc..97cb7020f3452 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -922,16 +922,10 @@ def err_override_control_interface : Error<
 def ext_ms_sealed_keyword : ExtWarn<
   "'sealed' keyword is a Microsoft extension">,
   InGroup;
-def ext_ms_abstract_keyword : ExtWarn<
-  "'abstract' keyword is a Microsoft extension">,
-  InGroup;
 
 def err_access_specifier_interface : Error<
   "interface types cannot specify '%select{private|protected}0' access">;
 
-def err_duplicate_class_virt_specifier : Error<
-  "class already marked '%0'">;
-
 def err_duplicate_virt_specifier : Error<
   "class member already marked '%0'">;
 

diff  --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index c32ae6d2cf406..e3e6509b025e5 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -114,7 +114,6 @@ class Parser : public CodeCompletionHandler {
   /// Contextual keywords for Microsoft extensions.
   IdentifierInfo *Ident__except;
   mutable IdentifierInfo *Ident_sealed;
-  mutable IdentifierInfo *Ident_abstract;
 
   /// Ident_super - IdentifierInfo for "super", to support fast
   /// comparison.
@@ -2914,7 +2913,6 @@ class Parser : public CodeCompletionHandler {
   SourceLocation FriendLoc);
 
   bool isCXX11FinalKeyword() const;
-  bool isClassCompatibleKeyword() const;
 
   /// DeclaratorScopeObj - RAII object used in Parser::ParseDirectDeclarator to
   /// enter a new C++ declarator scope and exit it when the function is

diff  --git a/clang/include/clang/Sema/DeclSpec.h 
b/clang/include/clang/Sema/DeclSpec.h
index 423f4f4ee7b7c..3b16295941e48 100644
--- a/clang/include/clang/Sema/DeclSpec.h
+++ b/clang/include/clang/Sema/DeclSpec.h
@@ -2620,8 +2620,7 @@ class VirtSpecifiers {
 VS_Final = 2,
 VS_Sealed = 4,
 // Represents the __final keyword, which is

[clang] ba1d954 - Revert "Revert "Implement nullPointerConstant() using a better API.""

2021-02-22 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2021-02-22T13:43:42+01:00
New Revision: ba1d9546ee389ce1d2e8f353ae777a65f647d508

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

LOG: Revert "Revert "Implement nullPointerConstant() using a better API.""

This reverts commit 6984e0d4398592a20055cb12842fc72462ce01a5.

While change by itself seems to be consistent with nullPointerConstant
docs of not matching "int i = 0;" but it's not clear why it's wrong and
9148302a2ae5ac6e5d69ae84042361889247ce64 author just forgot to update
the doc.

Added: 


Modified: 
clang/include/clang/ASTMatchers/ASTMatchers.h
clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

Removed: 




diff  --git a/clang/include/clang/ASTMatchers/ASTMatchers.h 
b/clang/include/clang/ASTMatchers/ASTMatchers.h
index b82929019f6c..6cd4d26768b5 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -7384,10 +7384,9 @@ extern const internal::VariadicDynCastAllOfMatcher
 /// expr(nullPointerConstant())
 ///   matches the initializer for v1, v2, v3, cp, and ip. Does not match the
 ///   initializer for i.
-AST_MATCHER_FUNCTION(internal::Matcher, nullPointerConstant) {
-  return anyOf(
-  gnuNullExpr(), cxxNullPtrLiteralExpr(),
-  integerLiteral(equals(0), hasParent(expr(hasType(pointerType());
+AST_MATCHER(Expr, nullPointerConstant) {
+  return Node.isNullPointerConstant(Finder->getASTContext(),
+Expr::NPC_ValueDependentIsNull);
 }
 
 /// Matches the DecompositionDecl the binding belongs to.

diff  --git a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp 
b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
index c26e8f8d4d22..1c6947acf0ab 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -3663,7 +3663,7 @@ TEST_P(ASTMatchersTest, NullPointerConstant) {
   expr(nullPointerConstant(;
   EXPECT_TRUE(matches("char *cp = (char *)0;", expr(nullPointerConstant(;
   EXPECT_TRUE(matches("int *ip = 0;", expr(nullPointerConstant(;
-  EXPECT_FALSE(matches("int i = 0;", expr(nullPointerConstant(;
+  EXPECT_TRUE(matches("int i = 0;", expr(nullPointerConstant(;
 }
 
 TEST_P(ASTMatchersTest, NullPointerConstant_GNUNull) {



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


[clang] 3b148d6 - Revert "Revert "Revert "Implement nullPointerConstant() using a better API."""

2021-02-22 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2021-02-22T14:37:03+01:00
New Revision: 3b148d6f991181a1b8f089c4bc2126e1a6c1212d

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

LOG: Revert "Revert "Revert "Implement nullPointerConstant() using a better 
API."""

This reverts commit ba1d9546ee389ce1d2e8f353ae777a65f647d508.

Added: 


Modified: 
clang/include/clang/ASTMatchers/ASTMatchers.h
clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

Removed: 




diff  --git a/clang/include/clang/ASTMatchers/ASTMatchers.h 
b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 6cd4d26768b5..b82929019f6c 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -7384,9 +7384,10 @@ extern const internal::VariadicDynCastAllOfMatcher
 /// expr(nullPointerConstant())
 ///   matches the initializer for v1, v2, v3, cp, and ip. Does not match the
 ///   initializer for i.
-AST_MATCHER(Expr, nullPointerConstant) {
-  return Node.isNullPointerConstant(Finder->getASTContext(),
-Expr::NPC_ValueDependentIsNull);
+AST_MATCHER_FUNCTION(internal::Matcher, nullPointerConstant) {
+  return anyOf(
+  gnuNullExpr(), cxxNullPtrLiteralExpr(),
+  integerLiteral(equals(0), hasParent(expr(hasType(pointerType());
 }
 
 /// Matches the DecompositionDecl the binding belongs to.

diff  --git a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp 
b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
index 1c6947acf0ab..c26e8f8d4d22 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -3663,7 +3663,7 @@ TEST_P(ASTMatchersTest, NullPointerConstant) {
   expr(nullPointerConstant(;
   EXPECT_TRUE(matches("char *cp = (char *)0;", expr(nullPointerConstant(;
   EXPECT_TRUE(matches("int *ip = 0;", expr(nullPointerConstant(;
-  EXPECT_TRUE(matches("int i = 0;", expr(nullPointerConstant(;
+  EXPECT_FALSE(matches("int i = 0;", expr(nullPointerConstant(;
 }
 
 TEST_P(ASTMatchersTest, NullPointerConstant_GNUNull) {



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


[clang] b109172 - [clang] use a different name for generated test cdb

2021-06-04 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2021-06-04T18:12:58+02:00
New Revision: b109172d993edacd9853a8bbb8128a94da014399

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

LOG: [clang] use a different name for generated test cdb

if build system copied source files as readonly, then override of db_tu.json
will fail

Added: 


Modified: 
clang/test/ClangScanDeps/modules-pch.c

Removed: 




diff  --git a/clang/test/ClangScanDeps/modules-pch.c 
b/clang/test/ClangScanDeps/modules-pch.c
index 44b1a0df764c..ddb6949f5e6f 100644
--- a/clang/test/ClangScanDeps/modules-pch.c
+++ b/clang/test/ClangScanDeps/modules-pch.c
@@ -8,6 +8,6 @@
 
 // Scan dependencies of the TU:
 //
-// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch/cdb_tu.json > %t/cdb_tu.json
-// RUN: clang-scan-deps -compilation-database %t/cdb_tu.json -format 
experimental-full \
+// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch/cdb_tu.json > %t/cdb.json
+// RUN: clang-scan-deps -compilation-database %t/cdb.json -format 
experimental-full \
 // RUN:   -generate-modules-path-args -module-files-dir %t/build



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


[clang] c21e571 - Fix clang baremetal test

2022-10-05 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2022-10-05T11:32:28+02:00
New Revision: c21e57156c25734df44bb4893b9fc31dfc7de56d

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

LOG: Fix clang baremetal test

def48cae45a5085b7759f2be71768e27718b901a accidentally dropped 
-no-canonical-prefixes

Added: 


Modified: 
clang/test/Driver/baremetal.cpp

Removed: 




diff  --git a/clang/test/Driver/baremetal.cpp b/clang/test/Driver/baremetal.cpp
index ac99089432477..aded919156095 100644
--- a/clang/test/Driver/baremetal.cpp
+++ b/clang/test/Driver/baremetal.cpp
@@ -97,7 +97,7 @@
 // RUN:   | FileCheck %s --check-prefix=CHECK-SYSROOT-INC
 // CHECK-SYSROOT-INC-NOT: "-internal-isystem" "include"
 
-// RUN: %clang %s -### --target=aarch64-none-elf 2>&1 \
+// RUN: %clang -no-canonical-prefixes %s -### --target=aarch64-none-elf 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-AARCH64-NO-HOST-INC %s
 // Verify that the bare metal driver does not include any host system paths:
 // CHECK-AARCH64-NO-HOST-INC: InstalledDir: [[INSTALLEDDIR:.+]]



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


[clang] 0026874 - fix warn-xparser test

2022-12-23 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2022-12-23T15:34:06+01:00
New Revision: 0026874c8bd0616b520779b9fcfdb05e53ea4dca

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

LOG: fix warn-xparser test

for https://reviews.llvm.org/D140224

Added: 


Modified: 
clang/test/Driver/warn-Xparser.c

Removed: 




diff  --git a/clang/test/Driver/warn-Xparser.c 
b/clang/test/Driver/warn-Xparser.c
index 191826a6f4af9..d20db97dbd820 100644
--- a/clang/test/Driver/warn-Xparser.c
+++ b/clang/test/Driver/warn-Xparser.c
@@ -1,5 +1,5 @@
 /// Some macOS projects use -Xparser.
-// RUN: %clang -c -Xparser %s 2>&1 | FileCheck %s
+// RUN: %clang -c -o /dev/null -Xparser %s 2>&1 | FileCheck %s
 
 // CHECK: warning: argument unused during compilation: '-Xparser' 
[-Wunused-command-line-argument]
 



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


[clang] 7f608a2 - Revert "[opt][clang] Enable using -module-summary/-flto=thin with -S/-emit-llvm"

2022-11-18 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2022-11-18T09:25:45+01:00
New Revision: 7f608a2497c7578b9f3ca98014176ab95cffe3c0

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

LOG: Revert "[opt][clang] Enable using -module-summary/-flto=thin with 
-S/-emit-llvm"

This reverts commit 34ab474348e2623cc67abddb7bb662385297ac65.

as it has introduced circular dependency lib - analysis

Added: 


Modified: 
clang/lib/CodeGen/BackendUtil.cpp
clang/test/CodeGen/split-lto-unit.c
llvm/include/llvm/IRPrinter/IRPrintingPasses.h
llvm/lib/IRPrinter/CMakeLists.txt
llvm/lib/IRPrinter/IRPrintingPasses.cpp
llvm/test/Bitcode/thinlto-function-summary.ll
llvm/tools/opt/NewPMDriver.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/BackendUtil.cpp 
b/clang/lib/CodeGen/BackendUtil.cpp
index d6a7a9800ec58..9c677140b4a5d 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -983,24 +983,19 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
   if (!actionRequiresCodeGen(Action) && CodeGenOpts.VerifyModule)
 MPM.addPass(VerifierPass());
 
-  if (Action == Backend_EmitBC || Action == Backend_EmitLL) {
+  switch (Action) {
+  case Backend_EmitBC:
 if (CodeGenOpts.PrepareForThinLTO && !CodeGenOpts.DisableLLVMPasses) {
+  if (!CodeGenOpts.ThinLinkBitcodeFile.empty()) {
+ThinLinkOS = openOutputFile(CodeGenOpts.ThinLinkBitcodeFile);
+if (!ThinLinkOS)
+  return;
+  }
   if (!TheModule->getModuleFlag("EnableSplitLTOUnit"))
 TheModule->addModuleFlag(Module::Error, "EnableSplitLTOUnit",
  CodeGenOpts.EnableSplitLTOUnit);
-  if (Action == Backend_EmitBC) {
-if (!CodeGenOpts.ThinLinkBitcodeFile.empty()) {
-  ThinLinkOS = openOutputFile(CodeGenOpts.ThinLinkBitcodeFile);
-  if (!ThinLinkOS)
-return;
-}
-MPM.addPass(ThinLTOBitcodeWriterPass(*OS, ThinLinkOS ? 
&ThinLinkOS->os()
- : nullptr));
-  } else {
-MPM.addPass(PrintModulePass(*OS, "", CodeGenOpts.EmitLLVMUseLists,
-/*EmitLTOSummary=*/true));
-  }
-
+  MPM.addPass(ThinLTOBitcodeWriterPass(*OS, ThinLinkOS ? &ThinLinkOS->os()
+   : nullptr));
 } else {
   // Emit a module summary by default for Regular LTO except for ld64
   // targets
@@ -1012,13 +1007,17 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
   TheModule->addModuleFlag(Module::Error, "EnableSplitLTOUnit",
uint32_t(1));
   }
-  if (Action == Backend_EmitBC)
-MPM.addPass(BitcodeWriterPass(*OS, CodeGenOpts.EmitLLVMUseLists,
-  EmitLTOSummary));
-  else
-MPM.addPass(PrintModulePass(*OS, "", CodeGenOpts.EmitLLVMUseLists,
-EmitLTOSummary));
+  MPM.addPass(
+  BitcodeWriterPass(*OS, CodeGenOpts.EmitLLVMUseLists, 
EmitLTOSummary));
 }
+break;
+
+  case Backend_EmitLL:
+MPM.addPass(PrintModulePass(*OS, "", CodeGenOpts.EmitLLVMUseLists));
+break;
+
+  default:
+break;
   }
 
   // Now that we have all of the passes ready, run them.

diff  --git a/clang/test/CodeGen/split-lto-unit.c 
b/clang/test/CodeGen/split-lto-unit.c
index b1560b61f3e30..941aebafd01b3 100644
--- a/clang/test/CodeGen/split-lto-unit.c
+++ b/clang/test/CodeGen/split-lto-unit.c
@@ -1,15 +1,12 @@
 // ; Check that -flto=thin without -fsplit-lto-unit has EnableSplitLTOUnit = 0
 // RUN: %clang_cc1 -flto=thin -emit-llvm-bc < %s | llvm-dis -o - | FileCheck %s
-// RUN: %clang_cc1 -flto=thin -emit-llvm < %s | FileCheck %s
 // CHECK: !{i32 1, !"EnableSplitLTOUnit", i32 0}
 //
 // ; Check that -flto=thin with -fsplit-lto-unit has EnableSplitLTOUnit = 1
 // RUN: %clang_cc1 -flto=thin -fsplit-lto-unit -emit-llvm-bc < %s | llvm-dis 
-o - | FileCheck %s --check-prefix=SPLIT
-// RUN: %clang_cc1 -flto=thin -fsplit-lto-unit -emit-llvm < %s | FileCheck %s 
--check-prefix=SPLIT
 // SPLIT: !{i32 1, !"EnableSplitLTOUnit", i32 1}
 //
 // ; Check that regular LTO has EnableSplitLTOUnit = 1
 // RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc < %s | 
llvm-dis -o - | FileCheck %s --implicit-check-not="EnableSplitLTOUnit" 
--check-prefix=SPLIT
-// RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm < %s | 
FileCheck %s --implicit-check-not="EnableSplitLTOUnit" --check-prefix=SPLIT
 
 int main(void) {}

diff  --git a/llvm/include/llvm/IRPrinter/IRPrintingPasses.h 
b/llvm/include/llvm/IRPrinter/IRPrintingPasses.h
index 8eb7973365172..6cfa7a87af933 100644
--- a/llvm/include/llvm/IRPrinter/IRPrintingPasses.h
++

[clang] f951a6b - Fix potentially uninitialized memory

2022-06-01 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2022-06-01T15:31:37+02:00
New Revision: f951a6b2f37baf6ae832318fcca9ba4121c29529

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

LOG: Fix potentially uninitialized memory

For 
https://github.com/llvm/llvm-project/commit/7d76d6095880f34914d85d876b260cc4a4ea640d

Added: 


Modified: 
clang/tools/driver/driver.cpp

Removed: 




diff  --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index c9aee57d92cf4..d361457f8cecd 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -505,7 +505,9 @@ int main(int Argc, const char **Argv) {
   bool IsCrash = false;
   Driver::CommandStatus CommandStatus = Driver::CommandStatus::Ok;
   // Pretend the first command failed if ReproStatus is Always.
-  const Command *FailingCommand = &*C->getJobs().begin();
+  const Command *FailingCommand = nullptr;
+  if (!C->getJobs().empty())
+FailingCommand = &*C->getJobs().begin();
   if (C && !C->containsError()) {
 SmallVector, 4> FailingCommands;
 Res = TheDriver.ExecuteCompilation(*C, FailingCommands);
@@ -542,8 +544,9 @@ int main(int Argc, const char **Argv) {
   // crash, but only if we're crashing due to FORCE_CLANG_DIAGNOSTICS_CRASH.
   if (::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH"))
 llvm::dbgs() << llvm::getBugReportMsg();
-  if (TheDriver.maybeGenerateCompilationDiagnostics(CommandStatus, ReproLevel,
-*C, *FailingCommand))
+  if (FailingCommand != nullptr &&
+TheDriver.maybeGenerateCompilationDiagnostics(CommandStatus, ReproLevel,
+  *C, *FailingCommand))
 Res = 1;
 
   Diags.getClient()->finish();



___
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 namespace qualifier NFC (PR #68579)

2023-10-09 Thread Mikhail Goncharov via cfe-commits

https://github.com/metaflow created 
https://github.com/llvm/llvm-project/pull/68579

for daca97216cf132d733513f992d49e3c722aabf40 #68134 adds a namespace as we are 
not using llvm::StringRef yet

>From c91b8034ddcd97fb255ccafe7a153056c0c2f446 Mon Sep 17 00:00:00 2001
From: Mikhail Goncharov 
Date: Mon, 9 Oct 2023 13:52:27 +0200
Subject: [PATCH] [clang-tidy] add namespace qualifier NFC

for daca97216cf132d733513f992d49e3c722aabf40 #68134 adds a namespace
as we are not using llvm::StringRef yet
---
 clang-tools-extra/clang-tidy/llvmlibc/NamespaceConstants.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang-tools-extra/clang-tidy/llvmlibc/NamespaceConstants.h 
b/clang-tools-extra/clang-tidy/llvmlibc/NamespaceConstants.h
index 31fcdaa7b273b0b..7d4120085b86677 100644
--- a/clang-tools-extra/clang-tidy/llvmlibc/NamespaceConstants.h
+++ b/clang-tools-extra/clang-tidy/llvmlibc/NamespaceConstants.h
@@ -10,7 +10,7 @@
 
 namespace clang::tidy::llvm_libc {
 
-const static StringRef RequiredNamespaceStart = "__llvm_libc";
-const static StringRef RequiredNamespaceMacroName = "LIBC_NAMESPACE";
+const static llvm::StringRef RequiredNamespaceStart = "__llvm_libc";
+const static llvm::StringRef RequiredNamespaceMacroName = "LIBC_NAMESPACE";
 
 } // namespace clang::tidy::llvm_libc

___
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 namespace qualifier NFC (PR #68579)

2023-10-09 Thread Mikhail Goncharov via cfe-commits

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


[clang] c2647ed - fix unused variables in condition warning

2023-08-30 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2023-08-30T17:39:54+02:00
New Revision: c2647ed9b9cd5a0baddb2edf242c9b1f8976d7b6

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

LOG: fix unused variables in condition warning

for 92023b15099012a657da07ebf49dd7d94a260f84

Added: 


Modified: 
clang/include/clang/AST/DeclTemplate.h
clang/lib/AST/Interp/ByteCodeExprGen.cpp

Removed: 




diff  --git a/clang/include/clang/AST/DeclTemplate.h 
b/clang/include/clang/AST/DeclTemplate.h
index 7cd505218f2b90..f2e86da1c745a0 100644
--- a/clang/include/clang/AST/DeclTemplate.h
+++ b/clang/include/clang/AST/DeclTemplate.h
@@ -377,7 +377,8 @@ class DefaultArgStorage {
 InheritedFrom = getParmOwningDefaultArg(InheritedFrom);
 if (!isSet())
   ValueOrInherited = InheritedFrom;
-else if (auto *D = ValueOrInherited.template dyn_cast()) {
+else if ([[maybe_unused]] auto *D =
+ ValueOrInherited.template dyn_cast()) {
   assert(C.isSameDefaultTemplateArgument(D, InheritedFrom));
   ValueOrInherited =
   new (allocateDefaultArgStorageChain(C)) Chain{InheritedFrom, get()};

diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp 
b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index d8a4ca0db12fc8..a865faeedae6f4 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -1670,7 +1670,7 @@ template 
 std::optional
 ByteCodeExprGen::allocateLocal(DeclTy &&Src, bool IsExtended) {
   // Make sure we don't accidentally register the same decl twice.
-  if (const auto *VD =
+  if ([[maybe_unused]]  const auto *VD =
   dyn_cast_if_present(Src.dyn_cast())) {
 assert(!P.getGlobal(VD));
 assert(!Locals.contains(VD));



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


[clang] [Clang] Fix missing diagnostic for non-standard layout type in `offsetof` (PR #65246)

2023-09-04 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

@kasuga-fj could you please re-upload change to trigger the build?

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


[clang] [Clang] Fix missing diagnostic for non-standard layout type in `offsetof` (PR #65246)

2023-09-04 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

alright, build has been triggered successfully! thank you <3

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


[clang] 4faa6c6 - [clang][test] Use a physical copy of FS

2023-06-06 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2023-06-06T17:36:35+02:00
New Revision: 4faa6c6699149de504216173ea34f33765193905

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

LOG: [clang][test] Use a physical copy of FS

(missing piece from https://reviews.llvm.org/D152265)
476e7c49ecb762df1d68273696b06c36feb0fd96

Added: 


Modified: 
clang/unittests/Serialization/ModuleCacheTest.cpp

Removed: 




diff  --git a/clang/unittests/Serialization/ModuleCacheTest.cpp 
b/clang/unittests/Serialization/ModuleCacheTest.cpp
index 1e152a399c218..c3e347ffec660 100644
--- a/clang/unittests/Serialization/ModuleCacheTest.cpp
+++ b/clang/unittests/Serialization/ModuleCacheTest.cpp
@@ -149,6 +149,7 @@ TEST_F(ModuleCacheTest, CachedModuleNewPathAllowErrors) {
   CompilerInstance::createDiagnostics(new DiagnosticOptions());
   CreateInvocationOptions CIOpts;
   CIOpts.Diags = Diags;
+  CIOpts.VFS = llvm::vfs::createPhysicalFileSystem();
 
   // First run should pass with no errors
   const char *Args[] = {"clang","-fmodules",  "-Fframeworks",



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


[clang] 46131aa - Revert "Reapply "[Clang][Sema] Fix crash when 'this' is used in a dependent class scope function template specialization that instantiates to a static member function (#87541)" (#883

2024-04-14 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-04-15T08:41:32+02:00
New Revision: 46131aaf616c5cd97df0ec376a7e6ba475e1913c

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

LOG: Revert "Reapply "[Clang][Sema] Fix crash when 'this' is used in a 
dependent class scope function template specialization that instantiates to a 
static member function (#87541)" (#88311)"

This reverts commit aa80f3ec48419a73aafcc2ff947c6dd1e3734481.

See
https://github.com/llvm/llvm-project/pull/88311#issuecomment-2052291140.

There is a fix forward proposed but I am reverting this commit to fix
trunk.

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaExprMember.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/lib/Sema/TreeTransform.h
clang/test/SemaTemplate/instantiate-using-decl.cpp
clang/test/SemaTemplate/ms-function-specialization-class-scope.cpp

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index ade8f4e93d5a0c..de5fa99bff5dbe 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -529,8 +529,6 @@ Bug Fixes to C++ Support
 - Fix an issue caused by not handling invalid cases when substituting into the 
parameter mapping of a constraint. Fixes (#GH86757).
 - Fixed a bug that prevented member function templates of class templates 
declared with a deduced return type
   from being explicitly specialized for a given implicit instantiation of the 
class template.
-- Fixed a crash when ``this`` is used in a dependent class scope function 
template specialization
-  that instantiates to a static member function.
 
 - Fix crash when inheriting from a cv-qualified type. Fixes:
   (`#35603 `_)

diff  --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index c6e0332c3176b3..c6035445e90192 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -5452,8 +5452,7 @@ class Sema final : public SemaBase {
 
   ExprResult BuildDeclarationNameExpr(const CXXScopeSpec &SS, LookupResult &R,
   bool NeedsADL,
-  bool AcceptInvalidDecl = false,
-  bool NeedUnresolved = false);
+  bool AcceptInvalidDecl = false);
   ExprResult BuildDeclarationNameExpr(
   const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, NamedDecl 
*D,
   NamedDecl *FoundD = nullptr,
@@ -6596,10 +6595,7 @@ class Sema final : public SemaBase {
 SourceLocation RParenLoc);
 
    ActOnCXXThis -  Parse 'this' pointer.
-  ExprResult ActOnCXXThis(SourceLocation Loc);
-
-  /// Check whether the type of 'this' is valid in the current context.
-  bool CheckCXXThisType(SourceLocation Loc, QualType Type);
+  ExprResult ActOnCXXThis(SourceLocation loc);
 
   /// Build a CXXThisExpr and mark it referenced in the current context.
   Expr *BuildCXXThisExpr(SourceLocation Loc, QualType Type, bool IsImplicit);
@@ -7022,14 +7018,10 @@ class Sema final : public SemaBase {
   ///@{
 
 public:
-  /// Check whether an expression might be an implicit class member access.
-  bool isPotentialImplicitMemberAccess(const CXXScopeSpec &SS, LookupResult &R,
-   bool IsAddressOfOperand);
-
   ExprResult BuildPossibleImplicitMemberExpr(
   const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R,
-  const TemplateArgumentListInfo *TemplateArgs, const Scope *S);
-
+  const TemplateArgumentListInfo *TemplateArgs, const Scope *S,
+  UnresolvedLookupExpr *AsULE = nullptr);
   ExprResult
   BuildImplicitMemberExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc,
   LookupResult &R,

diff  --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 505d068ac42ebe..c5395fb2068a18 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -2917,9 +2917,26 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
   // to get this right here so that we don't end up making a
   // spuriously dependent expression if we're inside a dependent
   // instance method.
-  if (isPotentialImplicitMemberAccess(SS, R, IsAddressOfOperand))
-return BuildPossibleImplicitMemberExpr(SS, TemplateKWLoc, R, TemplateArgs,
-   S);
+  if (getLangOpts().CPlusPlus && !R.empty() &&
+  (*R.begin())->isCXXClassMember()) {
+bool MightBeImplicitMember;
+if (!IsAddressOfOperand)
+  MightBeImplicitMember = true;
+else if (!SS.isEmpty())
+  MightBeImp

[clang] d35a643 - Revert "Fix test from #83124 and #88902"

2024-04-16 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-04-17T08:37:21+02:00
New Revision: d35a64363bb851045387717d2ef7d6449b7b547f

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

LOG: Revert "Fix test from #83124 and #88902"

This reverts commit 0a789ea8a829da345e46d8224d73b2ddaba6969f.

Breaks builds, see discussion in https://github.com/llvm/llvm-project/pull/83124

Added: 


Modified: 
clang/test/SemaCXX/PR41441.cpp

Removed: 




diff  --git a/clang/test/SemaCXX/PR41441.cpp b/clang/test/SemaCXX/PR41441.cpp
index d0f2917e52f211..0b012b33fce343 100644
--- a/clang/test/SemaCXX/PR41441.cpp
+++ b/clang/test/SemaCXX/PR41441.cpp
@@ -1,9 +1,6 @@
 // RUN: %clang --target=x86_64-pc-linux -S -fno-discard-value-names -emit-llvm 
-o - %s | FileCheck %s
 
-namespace std {
-  using size_t = decltype(sizeof(int));
-};
-void* operator new[](std::size_t, void*) noexcept;
+#include 
 
 // CHECK: call void @llvm.memset.p0.i64(ptr align 1 %x, i8 0, i64 8, i1 false)
 // CHECK: call void @llvm.memset.p0.i64(ptr align 16 %x, i8 0, i64 32, i1 
false)



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


[clang] dbda478 - Revert "[Clang][Sema] placement new initializes typedef array with correct size (#88902)"

2024-04-16 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-04-17T08:37:21+02:00
New Revision: dbda478693104f78b142375862d66f3369ad8c78

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

LOG: Revert "[Clang][Sema] placement new initializes typedef array with correct 
size (#88902)"

This reverts commit 5c6af605b307213453a9a043532b9293db21b5c6.

Breaks builds, see discussion in https://github.com/llvm/llvm-project/pull/83124

Added: 
clang/test/SemaCXX/instantiate-new-placement-size.cpp

Modified: 


Removed: 
clang/test/SemaCXX/PR41441.cpp



diff  --git a/clang/test/SemaCXX/PR41441.cpp 
b/clang/test/SemaCXX/instantiate-new-placement-size.cpp
similarity index 75%
rename from clang/test/SemaCXX/PR41441.cpp
rename to clang/test/SemaCXX/instantiate-new-placement-size.cpp
index 0b012b33fce343..7a29d3dee8491e 100644
--- a/clang/test/SemaCXX/PR41441.cpp
+++ b/clang/test/SemaCXX/instantiate-new-placement-size.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang --target=x86_64-pc-linux -S -fno-discard-value-names -emit-llvm 
-o - %s | FileCheck %s
-
+// RUN: %clang -S -fno-discard-value-names -emit-llvm -o - %s | FileCheck %s
+// Issue no: 41441
 #include 
 
 // CHECK: call void @llvm.memset.p0.i64(ptr align 1 %x, i8 0, i64 8, i1 false)



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


[clang] dd84d23 - Revert "[Clang][Sema] placement new initializes typedef array with correct size (#83124)"

2024-04-16 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-04-17T08:37:22+02:00
New Revision: dd84d23adc84cc0c3d2b8fb8f0c353279d99d27a

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

LOG: Revert "[Clang][Sema] placement new initializes typedef array with correct 
size (#83124)"

This reverts commit c309dc6d0759b23b570c563f611530ff1a49e1bd.

Breaks builds, see discussion in https://github.com/llvm/llvm-project/pull/83124

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
clang/lib/Sema/TreeTransform.h

Removed: 
clang/test/SemaCXX/instantiate-new-placement-size.cpp



diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 6099f8ab02f443..96ad92b540b47f 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -534,7 +534,6 @@ Bug Fixes to C++ Support
   Fixes (#GH70604), (#GH79754), (#GH84163), (#GH84425), (#GH86054), 
(#GH86398), and (#GH86399).
 - Fix a crash when deducing ``auto`` from an invalid dereference (#GH88329).
 - Fix a crash in requires expression with templated base class member 
function. Fixes (#GH84020).
-- Placement new initializes typedef array with correct size (#GH41441)
 
 Bug Fixes to AST Handling
 ^

diff  --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 0c7fdb357235e1..eb05783a6219dc 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -12864,19 +12864,6 @@ TreeTransform::TransformCXXNewExpr(CXXNewExpr 
*E) {
 ArraySize = NewArraySize.get();
   }
 
-  // Per C++0x [expr.new]p5, the type being constructed may be a
-  // typedef of an array type.
-  QualType AllocType = AllocTypeInfo->getType();
-  if (ArraySize) {
-if (const ConstantArrayType *Array =
-SemaRef.Context.getAsConstantArrayType(AllocType)) {
-  ArraySize = IntegerLiteral::Create(SemaRef.Context, Array->getSize(),
- SemaRef.Context.getSizeType(),
- E->getBeginLoc());
-  AllocType = Array->getElementType();
-}
-  }
-
   // Transform the placement arguments (if any).
   bool ArgumentChanged = false;
   SmallVector PlacementArgs;
@@ -12938,6 +12925,7 @@ TreeTransform::TransformCXXNewExpr(CXXNewExpr 
*E) {
 return E;
   }
 
+  QualType AllocType = AllocTypeInfo->getType();
   if (!ArraySize) {
 // If no array size was specified, but the new expression was
 // instantiated with an array type (e.g., "new T" where T is

diff  --git a/clang/test/SemaCXX/instantiate-new-placement-size.cpp 
b/clang/test/SemaCXX/instantiate-new-placement-size.cpp
deleted file mode 100644
index 7a29d3dee8491e..00
--- a/clang/test/SemaCXX/instantiate-new-placement-size.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// RUN: %clang -S -fno-discard-value-names -emit-llvm -o - %s | FileCheck %s
-// Issue no: 41441
-#include 
-
-// CHECK: call void @llvm.memset.p0.i64(ptr align 1 %x, i8 0, i64 8, i1 false)
-// CHECK: call void @llvm.memset.p0.i64(ptr align 16 %x, i8 0, i64 32, i1 
false)
-template 
-void f()
-{
-typedef TYPE TArray[8];
-
-TArray x;
-new(&x) TArray();
-}
-
-int main()
-{
-f();
-f();
-}



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


[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #83124)

2024-04-16 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

The problem is still present. I have reverted this chain of commits.

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


[clang] 8363ff6 - specify openmp lib in aix-toolchain-include.cpp test

2024-04-18 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-04-19T08:27:38+02:00
New Revision: 8363ff6a2e9d20258fb72e4db64ffb6e4167618f

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

LOG: specify openmp lib in aix-toolchain-include.cpp test

when unset -fopenmp tries to find the library itself and in some
configurations this test fails

fix for #88545 8f07a67f9731dfcd490f8aaefac34d95f207b39c

Added: 


Modified: 
clang/test/Driver/aix-toolchain-include.cpp

Removed: 




diff  --git a/clang/test/Driver/aix-toolchain-include.cpp 
b/clang/test/Driver/aix-toolchain-include.cpp
index 31dc4fa9eb6a19..b0074bf0ba1fdb 100644
--- a/clang/test/Driver/aix-toolchain-include.cpp
+++ b/clang/test/Driver/aix-toolchain-include.cpp
@@ -5,28 +5,28 @@
 // RUN:--target=powerpc-ibm-aix \
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck 
-check-prefixes=CHECK-INTERNAL-INCLUDE,CHECK-INTERNAL-INCLUDE-CXX %s
 
 // RUN: %clangxx -### %s 2>&1 \
 // RUN:--target=powerpc64-ibm-aix \
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck 
-check-prefixes=CHECK-INTERNAL-INCLUDE,CHECK-INTERNAL-INCLUDE-CXX %s
 
 // RUN: %clang -### -xc %s 2>&1 \
 // RUN:--target=powerpc-ibm-aix \
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck -check-prefix=CHECK-INTERNAL-INCLUDE %s
 
 // RUN: %clang -### -xc %s 2>&1 \
 // RUN:--target=powerpc64-ibm-aix \
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck -check-prefix=CHECK-INTERNAL-INCLUDE %s
 
 // CHECK-INTERNAL-INCLUDE:  "-cc1"
@@ -78,7 +78,7 @@
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:-nostdlibinc \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
 
 // RUN: %clangxx -### %s 2>&1 \
@@ -86,7 +86,7 @@
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:-nostdlibinc \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
 
 // RUN: %clang -### -xc %s 2>&1 \
@@ -94,7 +94,7 @@
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:-nostdlibinc \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
 
 // RUN: %clang -### -xc %s 2>&1 \
@@ -102,7 +102,7 @@
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:-nostdlibinc \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck -check-prefix=CHECK-NOSTDLIBINC-INCLUDE %s
 
 // CHECK-NOSTDLIBINC-INCLUDE:  "-cc1"
@@ -120,7 +120,7 @@
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:-nobuiltininc \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck 
-check-prefixes=CHECK-NOBUILTININC-INCLUDE,CHECK-NOBUILTININC-INCLUDE-CXX %s
 
 // RUN: %clangxx -### %s 2>&1 \
@@ -128,7 +128,7 @@
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:-nobuiltininc \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck 
-check-prefixes=CHECK-NOBUILTININC-INCLUDE,CHECK-NOBUILTININC-INCLUDE-CXX  %s
 
 // RUN: %clang -### -xc %s 2>&1 \
@@ -136,7 +136,7 @@
 // RUN:-resource-dir=%S/Inputs/resource_dir \
 // RUN:--sysroot=%S/Inputs/basic_aix_tree \
 // RUN:-nobuiltininc \
-// RUN: -fopenmp \
+// RUN:-fopenmp=libomp \
 // RUN:   | FileCheck -check-prefix=CHECK-NOBUILTININC-INCLUDE %s
 
 // RUN: %clang -### -xc %s 2>&1 \
@@ -144,7 +144,7 @@
 // RUN:   

[clang] [X86][test] Avoid writing to a potentially write-protected dir (PR #108525)

2024-09-13 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

there is also `avx10_2satcvtds-builtins-errors.c` that calls emit

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


[clang] [X86][test] Avoid writing to a potentially write-protected dir (PR #108525)

2024-09-13 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

thank you for the fix @MalaySanghi !

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


[clang] a41bb71 - [X86][test] Avoid writing to a potentially write-protected dir

2024-09-13 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-09-13T14:24:09+02:00
New Revision: a41bb71f2216cef08ab04f1d730ae1701c145f3c

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

LOG: [X86][test] Avoid writing to a potentially write-protected dir

see https://github.com/llvm/llvm-project/pull/108525 (#108525)

for a409ebc1fc136be4004073a12cd7f847a5f3a588

Added: 


Modified: 
clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-errors.c
clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-x64-error.c
clang/test/CodeGen/X86/avx10_2satcvtds-builtins-errors.c

Removed: 




diff  --git a/clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-errors.c 
b/clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-errors.c
index c2e891217fbbcf..46d47648440723 100644
--- a/clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-errors.c
+++ b/clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-errors.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s 
-triple=i386-unknown-unknown -target-feature +avx10.2-512 -emit-llvm -Wall 
-Werror -verify
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s 
-triple=i386-unknown-unknown -target-feature +avx10.2-512 -Wall -Werror -verify
 
 #include 
 #include 

diff  --git a/clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-x64-error.c 
b/clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-x64-error.c
index 2900256914570c..334edfb501e2f0 100755
--- a/clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-x64-error.c
+++ b/clang/test/CodeGen/X86/avx10_2_512satcvtds-builtins-x64-error.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s 
-triple=x86_64-unknown-unknown -target-feature +avx10.2-512 -emit-llvm -Wall 
-Werror -verify
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s 
-triple=x86_64-unknown-unknown -target-feature +avx10.2-512 -Wall -Werror 
-verify
 
 #include 
 #include 

diff  --git a/clang/test/CodeGen/X86/avx10_2satcvtds-builtins-errors.c 
b/clang/test/CodeGen/X86/avx10_2satcvtds-builtins-errors.c
index 72d2769dc21067..f32dfba60132d4 100644
--- a/clang/test/CodeGen/X86/avx10_2satcvtds-builtins-errors.c
+++ b/clang/test/CodeGen/X86/avx10_2satcvtds-builtins-errors.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s 
-triple=i386-unknown-unknown -target-feature +avx10.2-256 -emit-llvm -Wall 
-Werror -verify
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s 
-triple=i386-unknown-unknown -target-feature +avx10.2-256 -Wall -Werror -verify
 
 unsigned long long test_mm_cvttssd(unsigned long long __A) {
   return _mm_cvttssd(__A); // expected-error {{call to undeclared function 
'_mm_cvttssd'}}



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


[clang] [X86][test] Avoid writing to a potentially write-protected dir (PR #108525)

2024-09-13 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

I have submitted it as a41bb71f2216cef08ab04f1d730ae1701c145f3c (with 3 files). 
Sorry for the race, but I want it working :)

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


[clang] c0a2915 - [SystemZ][z/OS] don't write to source

2024-10-08 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-10-08T15:09:23+02:00
New Revision: c0a2915321870672b1870c1ee1d192c07dddcd04

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

LOG: [SystemZ][z/OS] don't write to source

test invoked clang that has tried to write in source directory that
might be readonly #111053

for 4c26a1e4d7e490a38dcd2a24e4c8939075fd4a5a

Added: 


Modified: 
clang/test/SemaCXX/pragma-pack-packed-2.cpp

Removed: 




diff  --git a/clang/test/SemaCXX/pragma-pack-packed-2.cpp 
b/clang/test/SemaCXX/pragma-pack-packed-2.cpp
index 3639addd6fe5fc..f288dc04313e69 100644
--- a/clang/test/SemaCXX/pragma-pack-packed-2.cpp
+++ b/clang/test/SemaCXX/pragma-pack-packed-2.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -triple s390x-ibm-zos -fzos-extensions -fsyntax-only 
-verify %s
 // RUN: %clang_cc1 -triple s390x-ibm-zos -fzos-extensions -fxl-pragma-pack 
-fsyntax-only -verify %s
-// RUN: %clang -target s390x-ibm-zos -S -emit-llvm -Xclang -verify 
-fno-xl-pragma-pack %s
+// RUN: %clang -target s390x-ibm-zos -S -emit-llvm -Xclang -verify 
-fno-xl-pragma-pack -o %t.ll %s
 
 #pragma pack(show) // expected-warning {{value of #pragma pack(show) == 8}}
 #pragma pack(twobyte)



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


[clang] efcfa6e - Revert "Reland: [clang] Finish implementation of P0522 (#111711)"

2024-10-11 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-10-11T14:47:38+02:00
New Revision: efcfa6e711689ada546c323316145ecd749d380a

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

LOG: Revert "Reland: [clang] Finish implementation of P0522 (#111711)"

See discussion in https://github.com/llvm/llvm-project/pull/111711

This reverts commit 6213aa5e58a7d32bdc82dd40322fb1bab83c4783.

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Frontend/FrontendActions.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/test/CXX/temp/temp.arg/temp.arg.template/p3-0x.cpp
clang/test/CXX/temp/temp.param/p12.cpp
clang/test/Modules/cxx-templates.cpp
clang/test/SemaCXX/make_integer_seq.cpp
clang/test/SemaTemplate/cwg2398.cpp
clang/test/SemaTemplate/temp_arg_nontype.cpp
clang/test/SemaTemplate/temp_arg_template.cpp
clang/test/SemaTemplate/temp_arg_template_p0522.cpp
clang/test/Templight/templight-empty-entries-fix.cpp
clang/test/Templight/templight-prior-template-arg.cpp

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 00376ce2a6008b..a7500196399622 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -177,10 +177,6 @@ C++23 Feature Support
 C++20 Feature Support
 ^
 
-C++17 Feature Support
-^
-- The implementation of the relaxed template template argument matching rules 
is
-  more complete and reliable, and should provide more accurate diagnostics.
 
 Resolutions to C++ Defect Reports
 ^
@@ -338,10 +334,6 @@ Improvements to Clang's diagnostics
 
 - Clang now diagnoses when the result of a [[nodiscard]] function is discarded 
after being cast in C. Fixes #GH104391.
 
-- Clang now properly explains the reason a template template argument failed to
-  match a template template parameter, in terms of the C++17 relaxed matching 
rules
-  instead of the old ones.
-
 - Don't emit duplicated dangling diagnostics. (#GH93386).
 
 - Improved diagnostic when trying to befriend a concept. (#GH45182).
@@ -451,8 +443,6 @@ Bug Fixes to C++ Support
 - Correctly check constraints of explicit instantiations of member functions. 
(#GH46029)
 - When performing partial ordering of function templates, clang now checks that
   the deduction was consistent. Fixes (#GH18291).
-- Fixes to several issues in partial ordering of template template parameters, 
which
-  were documented in the test suite.
 - Fixed an assertion failure about a constraint of a friend function template 
references to a value with greater
   template depth than the friend function template. (#GH98258)
 - Clang now rebuilds the template parameters of out-of-line declarations and 
specializations in the context

diff  --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td 
b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index f4a2d4a3f0656a..777ea1f37cea46 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -5262,13 +5262,6 @@ def note_template_arg_refers_here_func : Note<
 def err_template_arg_template_params_mismatch : Error<
   "template template argument has 
diff erent template parameters than its "
   "corresponding template template parameter">;
-def note_template_arg_template_params_mismatch : Note<
-  "template template argument has 
diff erent template parameters than its "
-  "corresponding template template parameter">;
-def err_non_deduced_mismatch : Error<
-  "could not match %
diff {$ against $|types}0,1">;
-def err_inconsistent_deduction : Error<
-  "conflicting deduction %
diff {$ against $|types}0,1 for parameter">;
 def err_template_arg_not_integral_or_enumeral : Error<
   "non-type template argument of type %0 must have an integral or enumeration"
   " type">;

diff  --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 49c593bf88c989..24191fd688dc5a 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -12418,9 +12418,8 @@ class Sema final : public SemaBase {
 sema::TemplateDeductionInfo &Info);
 
   bool isTemplateTemplateParameterAtLeastAsSpecializedAs(
-  TemplateParameterList *PParam, TemplateDecl *PArg, TemplateDecl *AArg,
-  const DefaultArguments &DefaultArgs, SourceLocation ArgLoc,
-  bool IsDeduced);
+  TemplateParameterList *PParam, TemplateDecl *AArg,
+  const DefaultArguments &DefaultArgs, SourceLocation Loc, bool IsDeduced);
 
   /// Mark which template parameters are used in a given express

[clang] bdd46cc - Revert "[clang] CWG2398: improve overload resolution backwards compat (#107350)"

2024-10-11 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-10-11T14:47:21+02:00
New Revision: bdd46cc6b74eeed14936f1373bbb6446e09979fe

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

LOG: Revert "[clang] CWG2398: improve overload resolution backwards compat 
(#107350)"

See discussion in https://github.com/llvm/llvm-project/pull/111711

This reverts commit 224519b08945637a85e9798c78286643288f7b77.

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
clang/include/clang/Sema/Sema.h
clang/include/clang/Sema/TemplateDeduction.h
clang/lib/Sema/SemaLookup.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/test/SemaTemplate/cwg2398.cpp

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index df165b91252505..00376ce2a6008b 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -207,8 +207,7 @@ Resolutions to C++ Defect Reports
   (`CWG2351: void{} `_).
 
 - Clang now has improved resolution to CWG2398, allowing class templates to 
have
-  default arguments deduced when partial ordering, and better backwards 
compatibility
-  in overload resolution.
+  default arguments deduced when partial ordering.
 
 - Clang now allows comparing unequal object pointers that have been cast to 
``void *``
   in constant expressions. These comparisons always worked in non-constant 
expressions.

diff  --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 66b0846f286a81..49c593bf88c989 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -11638,8 +11638,7 @@ class Sema final : public SemaBase {
 SourceLocation RAngleLoc, unsigned ArgumentPackIndex,
 SmallVectorImpl &SugaredConverted,
 SmallVectorImpl &CanonicalConverted,
-CheckTemplateArgumentKind CTAK,
-bool *MatchedPackOnParmToNonPackOnArg);
+CheckTemplateArgumentKind CTAK);
 
   /// Check that the given template arguments can be provided to
   /// the given template, converting the arguments along the way.
@@ -11686,8 +11685,7 @@ class Sema final : public SemaBase {
   SmallVectorImpl &SugaredConverted,
   SmallVectorImpl &CanonicalConverted,
   bool UpdateArgsWithConversions = true,
-  bool *ConstraintsNotSatisfied = nullptr, bool PartialOrderingTTP = false,
-  bool *MatchedPackOnParmToNonPackOnArg = nullptr);
+  bool *ConstraintsNotSatisfied = nullptr, bool PartialOrderingTTP = 
false);
 
   bool CheckTemplateTypeArgument(
   TemplateTypeParmDecl *Param, TemplateArgumentLoc &Arg,
@@ -11721,8 +11719,7 @@ class Sema final : public SemaBase {
   /// It returns true if an error occurred, and false otherwise.
   bool CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param,
  TemplateParameterList *Params,
- TemplateArgumentLoc &Arg, bool IsDeduced,
- bool *MatchedPackOnParmToNonPackOnArg);
+ TemplateArgumentLoc &Arg, bool IsDeduced);
 
   void NoteTemplateLocation(const NamedDecl &Decl,
 std::optional ParamRange = {});
@@ -12423,7 +12420,7 @@ class Sema final : public SemaBase {
   bool isTemplateTemplateParameterAtLeastAsSpecializedAs(
   TemplateParameterList *PParam, TemplateDecl *PArg, TemplateDecl *AArg,
   const DefaultArguments &DefaultArgs, SourceLocation ArgLoc,
-  bool IsDeduced, bool *MatchedPackOnParmToNonPackOnArg);
+  bool IsDeduced);
 
   /// Mark which template parameters are used in a given expression.
   ///
@@ -13422,8 +13419,7 @@ class Sema final : public SemaBase {
   bool InstantiateClassTemplateSpecialization(
   SourceLocation PointOfInstantiation,
   ClassTemplateSpecializationDecl *ClassTemplateSpec,
-  TemplateSpecializationKind TSK, bool Complain = true,
-  bool PrimaryHasMatchedPackOnParmToNonPackOnArg = false);
+  TemplateSpecializationKind TSK, bool Complain = true);
 
   /// Instantiates the definitions of all of the member
   /// of the given class, which is an instantiation of a class template

diff  --git a/clang/include/clang/Sema/TemplateDeduction.h 
b/clang/include/clang/Sema/TemplateDeduction.h
index 9c12eef5c42a06..28b014fd84e4b3 100644
--- a/clang/include/clang/Sema/TemplateDeduction.h
+++ b/clang/include/clang/Sema/TemplateDeduction.h
@@ -51,11 +51,6 @@ class TemplateDeductionInfo {
   /// Have we suppressed an error during deduction?
   bool HasSFINAEDiagnostic = false;
 
-  /// Have we ma

[clang] ed7251b - Revert "[clang] Implement TTP P0522 pack matching for deduced function template calls. (#111457)"

2024-10-11 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-10-11T14:46:46+02:00
New Revision: ed7251b3aeb7c471dc50e9409e83a9ec01f40df5

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

LOG: Revert "[clang] Implement TTP P0522 pack matching for deduced function 
template calls. (#111457)"

See discussion in https://github.com/llvm/llvm-project/pull/111711

This reverts commit 4dadf42c1a74dd4e37db9ffd6fbb3027f59751a7.

Added: 


Modified: 
clang/include/clang/Sema/Overload.h
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaLookup.cpp
clang/lib/Sema/SemaOverload.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/test/SemaTemplate/cwg2398.cpp

Removed: 




diff  --git a/clang/include/clang/Sema/Overload.h 
b/clang/include/clang/Sema/Overload.h
index d38278c5041118..c716a25bb673b8 100644
--- a/clang/include/clang/Sema/Overload.h
+++ b/clang/include/clang/Sema/Overload.h
@@ -925,11 +925,6 @@ class Sema;
 
 bool TookAddressOfOverload : 1;
 
-/// Have we matched any packs on the parameter side, versus any non-packs 
on
-/// the argument side, in a context where the opposite matching is also
-/// allowed?
-bool HasMatchedPackOnParmToNonPackOnArg : 1;
-
 /// True if the candidate was found using ADL.
 CallExpr::ADLCallKind IsADLCandidate : 1;
 
@@ -1004,9 +999,8 @@ class Sema;
 friend class OverloadCandidateSet;
 OverloadCandidate()
 : IsSurrogate(false), IgnoreObjectArgument(false),
-  TookAddressOfOverload(false),
-  HasMatchedPackOnParmToNonPackOnArg(false),
-  IsADLCandidate(CallExpr::NotADL), RewriteKind(CRK_None) {}
+  TookAddressOfOverload(false), IsADLCandidate(CallExpr::NotADL),
+  RewriteKind(CRK_None) {}
   };
 
   /// OverloadCandidateSet - A set of overload candidates, used in C++

diff  --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index f8118ca64ad3f2..66b0846f286a81 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -10134,8 +10134,7 @@ class Sema final : public SemaBase {
   ADLCallKind IsADLCandidate = ADLCallKind::NotADL,
   ConversionSequenceList EarlyConversions = std::nullopt,
   OverloadCandidateParamOrder PO = {},
-  bool AggregateCandidateDeduction = false,
-  bool HasMatchedPackOnParmToNonPackOnArg = false);
+  bool AggregateCandidateDeduction = false);
 
   /// Add all of the function declarations in the given function set to
   /// the overload candidate set.
@@ -10170,8 +10169,7 @@ class Sema final : public SemaBase {
  bool SuppressUserConversions = false,
  bool PartialOverloading = false,
  ConversionSequenceList EarlyConversions = std::nullopt,
- OverloadCandidateParamOrder PO = {},
- bool HasMatchedPackOnParmToNonPackOnArg = false);
+ OverloadCandidateParamOrder PO = {});
 
   /// Add a C++ member function template as a candidate to the candidate
   /// set, using template argument deduction to produce an appropriate member
@@ -10217,8 +10215,7 @@ class Sema final : public SemaBase {
   CXXConversionDecl *Conversion, DeclAccessPair FoundDecl,
   CXXRecordDecl *ActingContext, Expr *From, QualType ToType,
   OverloadCandidateSet &CandidateSet, bool AllowObjCConversionOnExplicit,
-  bool AllowExplicit, bool AllowResultConversion = true,
-  bool HasMatchedPackOnParmToNonPackOnArg = false);
+  bool AllowExplicit, bool AllowResultConversion = true);
 
   /// Adds a conversion function template specialization
   /// candidate to the overload set, using template argument deduction
@@ -11641,7 +11638,7 @@ class Sema final : public SemaBase {
 SourceLocation RAngleLoc, unsigned ArgumentPackIndex,
 SmallVectorImpl &SugaredConverted,
 SmallVectorImpl &CanonicalConverted,
-CheckTemplateArgumentKind CTAK, bool PartialOrdering,
+CheckTemplateArgumentKind CTAK,
 bool *MatchedPackOnParmToNonPackOnArg);
 
   /// Check that the given template arguments can be provided to
@@ -11724,8 +11721,7 @@ class Sema final : public SemaBase {
   /// It returns true if an error occurred, and false otherwise.
   bool CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param,
  TemplateParameterList *Params,
- TemplateArgumentLoc &Arg,
- bool PartialOrdering,
+ TemplateArgumentLoc &Arg, bool IsDeduced,
  bool *MatchedPac

[clang] 90627a5 - Revert "[XRay] Add support for instrumentation of DSOs on x86_64 (#90959)"

2024-10-11 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-10-11T14:01:58+02:00
New Revision: 90627a5a190a99ae2991d524580d866484aaba16

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

LOG: Revert "[XRay] Add support for instrumentation of DSOs on x86_64 (#90959)"

This reverts commit a4402039bffd788b9af82435fd5a2fb311fdc6e8 and 
4451f9f812d458f6b53785b27869674caf01e67b

Added: 


Modified: 
clang/include/clang/Basic/CodeGenOptions.def
clang/include/clang/Driver/Options.td
clang/include/clang/Driver/XRayArgs.h
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/lib/Driver/XRayArgs.cpp
compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
compiler-rt/cmake/config-ix.cmake
compiler-rt/include/xray/xray_interface.h
compiler-rt/lib/xray/CMakeLists.txt
compiler-rt/lib/xray/xray_init.cpp
compiler-rt/lib/xray/xray_interface.cpp
compiler-rt/lib/xray/xray_interface_internal.h
compiler-rt/lib/xray/xray_trampoline_x86_64.S
compiler-rt/lib/xray/xray_x86_64.cpp

Removed: 
clang/test/Driver/XRay/xray-shared.cpp
compiler-rt/lib/xray/xray_dso_init.cpp
compiler-rt/test/xray/TestCases/Posix/basic-mode-dso.cpp
compiler-rt/test/xray/TestCases/Posix/clang-xray-shared.cpp
compiler-rt/test/xray/TestCases/Posix/dlopen.cpp
compiler-rt/test/xray/TestCases/Posix/dso-dep-chains.cpp
compiler-rt/test/xray/TestCases/Posix/patch-premain-dso.cpp
compiler-rt/test/xray/TestCases/Posix/patching-unpatching-dso.cpp



diff  --git a/clang/include/clang/Basic/CodeGenOptions.def 
b/clang/include/clang/Basic/CodeGenOptions.def
index e45370bde74a5d..eac831278ee20d 100644
--- a/clang/include/clang/Basic/CodeGenOptions.def
+++ b/clang/include/clang/Basic/CodeGenOptions.def
@@ -136,8 +136,6 @@ CODEGENOPT(XRayIgnoreLoops , 1, 0)
 ///< Emit the XRay function index section.
 CODEGENOPT(XRayFunctionIndex , 1, 1)
 
-///< Set when -fxray-shared is enabled
-CODEGENOPT(XRayShared , 1, 0)
 
 ///< Set the minimum number of instructions in a function to determine 
selective
 ///< XRay instrumentation.

diff  --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 4ee16e213d0e13..d306c751505e98 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -2946,11 +2946,6 @@ def fxray_selected_function_group :
   HelpText<"When using -fxray-function-groups, select which group of functions 
to instrument. Valid range is 0 to fxray-function-groups - 1">,
   MarshallingInfoInt, "0">;
 
-defm xray_shared : BoolFOption<"xray-shared",
-  CodeGenOpts<"XRayShared">, DefaultFalse,
-  PosFlag,
-  NegFlag>;
 
 defm fine_grained_bitfield_accesses : BoolOption<"f", 
"fine-grained-bitfield-accesses",
   CodeGenOpts<"FineGrainedBitfieldAccesses">, DefaultFalse,

diff  --git a/clang/include/clang/Driver/XRayArgs.h 
b/clang/include/clang/Driver/XRayArgs.h
index 1b5c4a4c42f12a..bdd3d979547eed 100644
--- a/clang/include/clang/Driver/XRayArgs.h
+++ b/clang/include/clang/Driver/XRayArgs.h
@@ -27,7 +27,6 @@ class XRayArgs {
   XRayInstrSet InstrumentationBundle;
   llvm::opt::Arg *XRayInstrument = nullptr;
   bool XRayRT = true;
-  bool XRayShared = false;
 
 public:
   /// Parses the XRay arguments from an argument list.
@@ -36,7 +35,6 @@ class XRayArgs {
llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const;
 
   bool needsXRayRt() const { return XRayInstrument && XRayRT; }
-  bool needsXRayDSORt() const { return XRayInstrument && XRayRT && XRayShared; 
}
   llvm::ArrayRef modeList() const { return Modes; }
   XRayInstrSet instrumentationBundle() const { return InstrumentationBundle; }
 };

diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 0a1b7c209563e8..0c6a585c3acffd 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1613,14 +1613,10 @@ bool tools::addSanitizerRuntimes(const ToolChain &TC, 
const ArgList &Args,
 }
 
 bool tools::addXRayRuntime(const ToolChain&TC, const ArgList &Args, 
ArgStringList &CmdArgs) {
-  if (Args.hasArg(options::OPT_shared)) {
-if (TC.getXRayArgs().needsXRayDSORt()) {
-  CmdArgs.push_back("--whole-archive");
-  CmdArgs.push_back(TC.getCompilerRTArgString(Args, "xray-dso"));
-  CmdArgs.push_back("--no-whole-archive");
-  return true;
-}
-  } else if (TC.getXRayArgs().needsXRayRt()) {
+  if (Args.hasArg(options::OPT_shared))
+return false;
+
+  if (TC.getXRayArgs().needsXRayRt()) {
 CmdArgs.push_back("--whole-archive");
 CmdArgs.push_back(TC.getCompilerRTArgString(Args, "xray"));
 for (const auto &Mode : TC.getXRayArgs().modeList())

diff  --git a/clang/lib/Driver/XRayArgs.cpp b/clang/lib/Driver/XRayArgs.cpp
index d0bb5d4887c

[clang] Reland: [clang] Finish implementation of P0522 (PR #111711)

2024-10-11 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

I am going to revert this, sorry

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


[clang] Reland: [clang] Finish implementation of P0522 (PR #111711)

2024-10-11 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

oh, that might become messy quickly. Do you know if 
4dadf42c1a74dd4e37db9ffd6fbb3027f59751a7 and 
224519b08945637a85e9798c78286643288f7b77 depend on this PR and should also be 
reverted?

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


[clang] Fix false positive of [[clang::require_explicit_initialization]] on copy/move constructors (PR #126553)

2025-02-10 Thread Mikhail Goncharov via cfe-commits

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


[clang] Fix false positive of [[clang::require_explicit_initialization]] on copy/move constructors (PR #126553)

2025-02-10 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

thank you!

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


[clang] [Clang] Re-write codegen for atomic_test_and_set and atomic_clear (PR #120449)

2024-12-20 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

@ostannard :christmas_tree: :santa: happy holidays

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


[clang] 93743ee - Revert "[Clang] Re-write codegen for atomic_test_and_set and atomic_clear (#120449)"

2024-12-19 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-12-20T08:14:26+01:00
New Revision: 93743ee566694d2fcafa3243c03330e86bf9c806

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

LOG: Revert "[Clang] Re-write codegen for atomic_test_and_set and atomic_clear 
(#120449)"

This reverts commit 9fc2fadbfcb34df5f72bdaed28a7874bf584eed7.

See https://github.com/llvm/llvm-project/pull/120449#issuecomment-2556089016

Added: 


Modified: 
clang/include/clang/Basic/Builtins.td
clang/lib/AST/Expr.cpp
clang/lib/CodeGen/CGAtomic.cpp
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/Sema/atomic-ops.c

Removed: 
clang/test/CodeGen/atomic-test-and-set.c



diff  --git a/clang/include/clang/Basic/Builtins.td 
b/clang/include/clang/Basic/Builtins.td
index 1e77016001e484..d64a66fc9d9cf7 100644
--- a/clang/include/clang/Basic/Builtins.td
+++ b/clang/include/clang/Basic/Builtins.td
@@ -1977,16 +1977,16 @@ def AtomicNandFetch : AtomicBuiltin {
   let Prototype = "void(...)";
 }
 
-def AtomicTestAndSet : AtomicBuiltin {
+def AtomicTestAndSet : Builtin {
   let Spellings = ["__atomic_test_and_set"];
-  let Attributes = [NoThrow, CustomTypeChecking];
-  let Prototype = "void(...)";
+  let Attributes = [NoThrow];
+  let Prototype = "bool(void volatile*, int)";
 }
 
-def AtomicClear : AtomicBuiltin {
+def AtomicClear : Builtin {
   let Spellings = ["__atomic_clear"];
-  let Attributes = [NoThrow, CustomTypeChecking];
-  let Prototype = "void(...)";
+  let Attributes = [NoThrow];
+  let Prototype = "void(void volatile*, int)";
 }
 
 def AtomicThreadFence : Builtin {

diff  --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 7e6cb53064ff2b..8c8ccdb61dc01c 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -5070,8 +5070,6 @@ unsigned AtomicExpr::getNumSubExprs(AtomicOp Op) {
   case AO__opencl_atomic_init:
   case AO__c11_atomic_load:
   case AO__atomic_load_n:
-  case AO__atomic_test_and_set:
-  case AO__atomic_clear:
 return 2;
 
   case AO__scoped_atomic_load_n:

diff  --git a/clang/lib/CodeGen/CGAtomic.cpp b/clang/lib/CodeGen/CGAtomic.cpp
index 3adb2a7ad207f0..f6cb2ad421e906 100644
--- a/clang/lib/CodeGen/CGAtomic.cpp
+++ b/clang/lib/CodeGen/CGAtomic.cpp
@@ -723,24 +723,6 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr 
*E, Address Dest,
   case AtomicExpr::AO__scoped_atomic_fetch_nand:
 Op = llvm::AtomicRMWInst::Nand;
 break;
-
-  case AtomicExpr::AO__atomic_test_and_set: {
-llvm::AtomicRMWInst *RMWI =
-CGF.emitAtomicRMWInst(llvm::AtomicRMWInst::Xchg, Ptr,
-  CGF.Builder.getInt8(1), Order, Scope, E);
-RMWI->setVolatile(E->isVolatile());
-llvm::Value *Result = CGF.Builder.CreateIsNotNull(RMWI, "tobool");
-CGF.Builder.CreateStore(Result, Dest);
-return;
-  }
-
-  case AtomicExpr::AO__atomic_clear: {
-llvm::StoreInst *Store =
-CGF.Builder.CreateStore(CGF.Builder.getInt8(0), Ptr);
-Store->setAtomic(Order, Scope);
-Store->setVolatile(E->isVolatile());
-return;
-  }
   }
 
   llvm::Value *LoadVal1 = CGF.Builder.CreateLoad(Val1);
@@ -896,8 +878,6 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
   case AtomicExpr::AO__c11_atomic_load:
   case AtomicExpr::AO__opencl_atomic_load:
   case AtomicExpr::AO__hip_atomic_load:
-  case AtomicExpr::AO__atomic_test_and_set:
-  case AtomicExpr::AO__atomic_clear:
 break;
 
   case AtomicExpr::AO__atomic_load:
@@ -1220,8 +1200,6 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
 case AtomicExpr::AO__opencl_atomic_fetch_max:
 case AtomicExpr::AO__scoped_atomic_fetch_max:
 case AtomicExpr::AO__scoped_atomic_max_fetch:
-case AtomicExpr::AO__atomic_test_and_set:
-case AtomicExpr::AO__atomic_clear:
   llvm_unreachable("Integral atomic operations always become atomicrmw!");
 }
 
@@ -1261,8 +1239,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E) {
  E->getOp() == AtomicExpr::AO__atomic_store ||
  E->getOp() == AtomicExpr::AO__atomic_store_n ||
  E->getOp() == AtomicExpr::AO__scoped_atomic_store ||
- E->getOp() == AtomicExpr::AO__scoped_atomic_store_n ||
- E->getOp() == AtomicExpr::AO__atomic_clear;
+ E->getOp() == AtomicExpr::AO__scoped_atomic_store_n;
   bool IsLoad = E->getOp() == AtomicExpr::AO__c11_atomic_load ||
 E->getOp() == AtomicExpr::AO__opencl_atomic_load ||
 E->getOp() == AtomicExpr::AO__hip_atomic_load ||

diff  --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 0ea2ee4c264aef..4d4b7428abd505 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -5099,6 +5099,147 @@ 

[clang] d1dae1e - Revert "[RISCV] Add mvendorid/marchid/mimpid to CPU definitions (#116202)" chain

2024-11-22 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2024-11-22T14:09:13+01:00
New Revision: d1dae1e8612a2fa69d0d731e16d07baf8ce10c85

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

LOG: Revert "[RISCV] Add mvendorid/marchid/mimpid to CPU definitions (#116202)" 
chain

This reverts commit b36fcf4f493ad9d30455e178076d91be99f3a7d8.
This reverts commit c11b6b1b8af7454b35eef342162dc2cddf54b4de.
This reverts commit 775148f2367600f90d28684549865ee9ea2f11be.

multiple bot build breakages, e.g. 
https://lab.llvm.org/buildbot/#/builders/3/builds/8076

Added: 


Modified: 
clang/lib/Basic/Targets/RISCV.cpp
clang/lib/Basic/Targets/RISCV.h
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/CodeGen/CodeGenFunction.h
llvm/include/llvm/TargetParser/RISCVTargetParser.h
llvm/lib/Target/RISCV/RISCVProcessors.td
llvm/lib/TargetParser/RISCVTargetParser.cpp
llvm/test/TableGen/riscv-target-def.td
llvm/utils/TableGen/RISCVTargetDefEmitter.cpp

Removed: 
clang/test/CodeGen/RISCV/builtin-cpu-is-error.c
clang/test/CodeGen/RISCV/builtin-cpu-is.c



diff  --git a/clang/lib/Basic/Targets/RISCV.cpp 
b/clang/lib/Basic/Targets/RISCV.cpp
index 2384b322c50f92..c61ee7ee203923 100644
--- a/clang/lib/Basic/Targets/RISCV.cpp
+++ b/clang/lib/Basic/Targets/RISCV.cpp
@@ -512,10 +512,3 @@ bool RISCVTargetInfo::validateGlobalRegisterVariable(
   }
   return false;
 }
-
-bool RISCVTargetInfo::validateCpuIs(StringRef CPUName) const {
-  assert(getTriple().isOSLinux() &&
- "__builtin_cpu_is() is only supported for Linux.");
-
-  return llvm::RISCV::hasValidCPUModel(CPUName);
-}

diff  --git a/clang/lib/Basic/Targets/RISCV.h b/clang/lib/Basic/Targets/RISCV.h
index 3544ea64cb5e77..3b418585ab4a39 100644
--- a/clang/lib/Basic/Targets/RISCV.h
+++ b/clang/lib/Basic/Targets/RISCV.h
@@ -128,10 +128,8 @@ class RISCVTargetInfo : public TargetInfo {
   }
 
   bool supportsCpuSupports() const override { return getTriple().isOSLinux(); }
-  bool supportsCpuIs() const override { return getTriple().isOSLinux(); }
   bool supportsCpuInit() const override { return getTriple().isOSLinux(); }
   bool validateCpuSupports(StringRef Feature) const override;
-  bool validateCpuIs(StringRef CPUName) const override;
   bool isValidFeatureName(StringRef Name) const override;
 
   bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize,

diff  --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 4b96bdb709c777..ff7132fd8bc1e7 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -66,7 +66,6 @@
 #include "llvm/Support/ScopedPrinter.h"
 #include "llvm/TargetParser/AArch64TargetParser.h"
 #include "llvm/TargetParser/RISCVISAInfo.h"
-#include "llvm/TargetParser/RISCVTargetParser.h"
 #include "llvm/TargetParser/X86TargetParser.h"
 #include 
 #include 
@@ -22694,47 +22693,6 @@ Value 
*CodeGenFunction::EmitHexagonBuiltinExpr(unsigned BuiltinID,
   return nullptr;
 }
 
-Value *CodeGenFunction::EmitRISCVCpuIs(const CallExpr *E) {
-  const Expr *CPUExpr = E->getArg(0)->IgnoreParenCasts();
-  StringRef CPUStr = cast(CPUExpr)->getString();
-  return EmitRISCVCpuIs(CPUStr);
-}
-
-Value *CodeGenFunction::EmitRISCVCpuIs(StringRef CPUStr) {
-  llvm::Type *Int32Ty = Builder.getInt32Ty();
-  llvm::Type *Int64Ty = Builder.getInt64Ty();
-  llvm::StructType *StructTy = llvm::StructType::get(Int32Ty, Int64Ty, 
Int64Ty);
-  llvm::Constant *RISCVCPUModel =
-  CGM.CreateRuntimeVariable(StructTy, "__riscv_cpu_model");
-  cast(RISCVCPUModel)->setDSOLocal(true);
-
-  auto loadRISCVCPUID = [&](unsigned Index) {
-Value *Ptr = Builder.CreateStructGEP(StructTy, RISCVCPUModel, Index);
-Value *CPUID = Builder.CreateAlignedLoad(StructTy->getTypeAtIndex(Index),
- Ptr, llvm::MaybeAlign());
-return CPUID;
-  };
-
-  const llvm::RISCV::CPUModel Model = llvm::RISCV::getCPUModel(CPUStr);
-
-  // Compare mvendorid.
-  Value *VendorID = loadRISCVCPUID(0);
-  Value *Result =
-  Builder.CreateICmpEQ(VendorID, Builder.getInt32(Model.MVendorID));
-
-  // Compare marchid.
-  Value *ArchID = loadRISCVCPUID(1);
-  Result = Builder.CreateAnd(
-  Result, Builder.CreateICmpEQ(ArchID, Builder.getInt64(Model.MArchID)));
-
-  // Compare mimpid.
-  Value *ImpID = loadRISCVCPUID(2);
-  Result = Builder.CreateAnd(
-  Result, Builder.CreateICmpEQ(ImpID, Builder.getInt64(Model.MImpID)));
-
-  return Result;
-}
-
 Value *CodeGenFunction::EmitRISCVBuiltinExpr(unsigned BuiltinID,
  const CallExpr *E,
  ReturnValueSlot ReturnValue) {
@@ -22743,8 +22701,6 @@ Value *CodeGenFunction::EmitRISCVBuiltinExpr(unsigned 
BuiltinID,
 return EmitRISCVCpuSupports(E);
   if (B

[clang] [clang][analysis] Fix flaky clang/test/Analysis/live-stmts.cpp test (PR #126913)

2025-02-13 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

For what it worth this change made it persistently failing in my setup.

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


[clang] [clang][analysis] Fix flaky clang/test/Analysis/live-stmts.cpp test (PR #126913)

2025-02-14 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

> > For what it worth this change made it persistently failing in my setup.
> 
> I'm not sure I follow you. The test is disabled on all platforms 
> unconditionally on main. Since #127034

yea, I know it was disabled. I meant that this very 
55f3df875d3a266c566f593357e2290879f49321 made it constantly failing.

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


[clang] 60493ed - [NFC] format c-index-test.c

2025-02-13 Thread Mikhail Goncharov via cfe-commits

Author: Mikhail Goncharov
Date: 2025-02-13T13:55:20+01:00
New Revision: 60493ede24a758771a0b34067a30ceb929525b73

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

LOG: [NFC] format c-index-test.c

to separate formatting changes from a functional fix later
also inlcude CXDiagnostic and CXFile

Added: 


Modified: 
clang/tools/c-index-test/c-index-test.c

Removed: 




diff  --git a/clang/tools/c-index-test/c-index-test.c 
b/clang/tools/c-index-test/c-index-test.c
index b48f44950ab75..a9d8261bd03e7 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -2,7 +2,9 @@
 
 #include "clang-c/BuildSystem.h"
 #include "clang-c/CXCompilationDatabase.h"
+#include "clang-c/CXDiagnostic.h"
 #include "clang-c/CXErrorCode.h"
+#include "clang-c/CXFile.h"
 #include "clang-c/CXSourceLocation.h"
 #include "clang-c/CXString.h"
 #include "clang-c/Documentation.h"



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


[clang] [clang][analysis] Fix flaky clang/test/Analysis/live-stmts.cpp test (PR #126913)

2025-02-14 Thread Mikhail Goncharov via cfe-commits

metaflow wrote:

oh sorry, I meant be25d618320d136faffd9dc450b406557e07634e :) 

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