[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-31 Thread Nikita Popov via cfe-commits

nikic wrote:

> I wonder if compile-time regressions come from new translation units I add, 
> because they definitely include stuff.

Yes, I believe that is the primary contributor. You can see the per-file 
breakdown here: 
https://llvm-compile-time-tracker.com/compare_clang.php?from=59e2a6b08f3e40afea87da3838ba69e1e15b6672=8aa80199751b0cd6631d057b0bfb21584acb206f=instructions%3Au=absolute-difference

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-31 Thread Vlad Serebrennikov via cfe-commits

Endilll wrote:

I wonder if compile-time regressions come from new translation units I add, 
because they definitely include stuff.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-31 Thread Vlad Serebrennikov via cfe-commits

Endilll wrote:

> Mildly curious that there isn't a SemaX86?
> 
> Doh, there already is one. Don't mind me.

This PR was based on the success with X86 and RISCV.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-30 Thread Paul T Robinson via cfe-commits

pogo59 wrote:

Mildly curious that there isn't a SemaX86?

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits

Endilll wrote:

Thank you for letting me know! Given the amount of positive feedback I've heard 
about this effort, I think we'll continue, trying to claw back the compile 
times elsewhere (my recent patch that removed try_compile checks from CMake 
should've helped, even if it's not counted in your metrics).

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-30 Thread Nikita Popov via cfe-commits

nikic wrote:

These Sema refactorings have been increasing the time to build clang by a small 
increment with every patch -- this one is an extra large jump of 0.7% 
(https://llvm-compile-time-tracker.com/compare.php?from=59e2a6b08f3e40afea87da3838ba69e1e15b6672=8aa80199751b0cd6631d057b0bfb21584acb206f=instructions:u).

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-30 Thread Vlad Serebrennikov via cfe-commits

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-30 Thread Aaron Ballman via cfe-commits

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

LGTM

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-30 Thread Aaron Ballman via cfe-commits

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-29 Thread Vlad Serebrennikov via cfe-commits


@@ -0,0 +1,36 @@
+//===- Attr.h --- Helper functions for attribute handling in Sema 
-===//
+//
+// 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 provides helpers for Sema functions that handle attributes.
+//
+//===--===//
+
+#ifndef LLVM_CLANG_SEMA_ATTR_H
+#define LLVM_CLANG_SEMA_ATTR_H
+
+#include "clang/AST/Decl.h"
+#include "clang/AST/DeclBase.h"
+#include "llvm/Support/Casting.h"
+
+namespace clang {
+
+/// isFunctionOrMethod - Return true if the given decl has function
+/// type (function or function-typed variable) or an Objective-C
+/// method.
+inline bool isFunctionOrMethod(const Decl *D) {

Endilll wrote:

I update the names of both functions.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-29 Thread Aaron Ballman via cfe-commits


@@ -0,0 +1,36 @@
+//===- Attr.h --- Helper functions for attribute handling in Sema 
-===//
+//
+// 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 provides helpers for Sema functions that handle attributes.
+//
+//===--===//
+
+#ifndef LLVM_CLANG_SEMA_ATTR_H
+#define LLVM_CLANG_SEMA_ATTR_H
+
+#include "clang/AST/Decl.h"
+#include "clang/AST/DeclBase.h"
+#include "llvm/Support/Casting.h"
+
+namespace clang {
+
+/// isFunctionOrMethod - Return true if the given decl has function
+/// type (function or function-typed variable) or an Objective-C
+/// method.
+inline bool isFunctionOrMethod(const Decl *D) {

AaronBallman wrote:

We could go with `isFuncOrMethodForAttrSubject()` since it seems that we have 
to expose the interface... I don't love it, but I could live with it?

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-29 Thread via cfe-commits


@@ -0,0 +1,36 @@
+//===- Attr.h --- Helper functions for attribute handling in Sema 
-===//
+//
+// 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 provides helpers for Sema functions that handle attributes.
+//
+//===--===//
+
+#ifndef LLVM_CLANG_SEMA_ATTR_H
+#define LLVM_CLANG_SEMA_ATTR_H
+
+#include "clang/AST/Decl.h"
+#include "clang/AST/DeclBase.h"
+#include "llvm/Support/Casting.h"
+
+namespace clang {
+
+/// isFunctionOrMethod - Return true if the given decl has function
+/// type (function or function-typed variable) or an Objective-C
+/// method.
+inline bool isFunctionOrMethod(const Decl *D) {

cor3ntin wrote:

I would prefer a better (more specific) name given that's not generally 
usable/used

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-28 Thread Vlad Serebrennikov via cfe-commits


@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase {
 BuiltinFunction
   };
 
+  /// A helper function to provide Attribute Location for the Attr types
+  /// AND the ParsedAttr.
+  template 
+  static std::enable_if_t, SourceLocation>
+  getAttrLoc(const AttrInfo ) {
+return AL.getLocation();
+  }
+  SourceLocation getAttrLoc(const ParsedAttr );
+
+  /// If Expr is a valid integer constant, get the value of the integer
+  /// expression and return success or failure. May output an error.
+  ///
+  /// Negative argument is implicitly converted to unsigned, unless
+  /// \p StrictlyUnsigned is true.
+  template 
+  bool checkUInt32Argument(const AttrInfo , const Expr *Expr, uint32_t ,
+   unsigned Idx = UINT_MAX,
+   bool StrictlyUnsigned = false) {
+std::optional I = llvm::APSInt(32);
+if (Expr->isTypeDependent() ||
+!(I = Expr->getIntegerConstantExpr(Context))) {
+  if (Idx != UINT_MAX)
+Diag(getAttrLoc(AI), diag::err_attribute_argument_n_type)
+<<  << Idx << AANT_ArgumentIntegerConstant
+<< Expr->getSourceRange();
+  else
+Diag(getAttrLoc(AI), diag::err_attribute_argument_type)
+<<  << AANT_ArgumentIntegerConstant << Expr->getSourceRange();
+  return false;
+}
+
+if (!I->isIntN(32)) {
+  Diag(Expr->getExprLoc(), diag::err_ice_too_large)
+  << toString(*I, 10, false) << 32 << /* Unsigned */ 1;
+  return false;
+}
+
+if (StrictlyUnsigned && I->isSigned() && I->isNegative()) {
+  Diag(getAttrLoc(AI), diag::err_attribute_requires_positive_integer)
+  <<  << /*non-negative*/ 1;
+  return false;
+}
+
+Val = (uint32_t)I->getZExtValue();
+return true;
+  }
+
+  bool isFunctionOrMethod(const Decl *D);
+  bool isFunctionOrMethodOrBlock(const Decl *D);

Endilll wrote:

This should be fixed now.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-28 Thread Aaron Ballman via cfe-commits


@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase {
 BuiltinFunction
   };
 
+  /// A helper function to provide Attribute Location for the Attr types
+  /// AND the ParsedAttr.
+  template 
+  static std::enable_if_t, SourceLocation>
+  getAttrLoc(const AttrInfo ) {
+return AL.getLocation();
+  }
+  SourceLocation getAttrLoc(const ParsedAttr );
+
+  /// If Expr is a valid integer constant, get the value of the integer
+  /// expression and return success or failure. May output an error.
+  ///
+  /// Negative argument is implicitly converted to unsigned, unless
+  /// \p StrictlyUnsigned is true.
+  template 
+  bool checkUInt32Argument(const AttrInfo , const Expr *Expr, uint32_t ,
+   unsigned Idx = UINT_MAX,
+   bool StrictlyUnsigned = false) {
+std::optional I = llvm::APSInt(32);
+if (Expr->isTypeDependent() ||
+!(I = Expr->getIntegerConstantExpr(Context))) {
+  if (Idx != UINT_MAX)
+Diag(getAttrLoc(AI), diag::err_attribute_argument_n_type)
+<<  << Idx << AANT_ArgumentIntegerConstant
+<< Expr->getSourceRange();
+  else
+Diag(getAttrLoc(AI), diag::err_attribute_argument_type)
+<<  << AANT_ArgumentIntegerConstant << Expr->getSourceRange();
+  return false;
+}
+
+if (!I->isIntN(32)) {
+  Diag(Expr->getExprLoc(), diag::err_ice_too_large)
+  << toString(*I, 10, false) << 32 << /* Unsigned */ 1;
+  return false;
+}
+
+if (StrictlyUnsigned && I->isSigned() && I->isNegative()) {
+  Diag(getAttrLoc(AI), diag::err_attribute_requires_positive_integer)
+  <<  << /*non-negative*/ 1;
+  return false;
+}
+
+Val = (uint32_t)I->getZExtValue();
+return true;
+  }
+
+  bool isFunctionOrMethod(const Decl *D);
+  bool isFunctionOrMethodOrBlock(const Decl *D);

AaronBallman wrote:

Ah I missed the other calls to `isFunctionOrMethod()`, sorry about that! I 
think it might make sense to move the attribute helper functions to 
`clang/include/clang/Sema/Attr.h` or somewhere similar.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-28 Thread Vlad Serebrennikov via cfe-commits


@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase {
 BuiltinFunction
   };
 
+  /// A helper function to provide Attribute Location for the Attr types
+  /// AND the ParsedAttr.
+  template 
+  static std::enable_if_t, SourceLocation>
+  getAttrLoc(const AttrInfo ) {
+return AL.getLocation();
+  }
+  SourceLocation getAttrLoc(const ParsedAttr );
+
+  /// If Expr is a valid integer constant, get the value of the integer
+  /// expression and return success or failure. May output an error.
+  ///
+  /// Negative argument is implicitly converted to unsigned, unless
+  /// \p StrictlyUnsigned is true.
+  template 
+  bool checkUInt32Argument(const AttrInfo , const Expr *Expr, uint32_t ,
+   unsigned Idx = UINT_MAX,
+   bool StrictlyUnsigned = false) {
+std::optional I = llvm::APSInt(32);
+if (Expr->isTypeDependent() ||
+!(I = Expr->getIntegerConstantExpr(Context))) {
+  if (Idx != UINT_MAX)
+Diag(getAttrLoc(AI), diag::err_attribute_argument_n_type)
+<<  << Idx << AANT_ArgumentIntegerConstant
+<< Expr->getSourceRange();
+  else
+Diag(getAttrLoc(AI), diag::err_attribute_argument_type)
+<<  << AANT_ArgumentIntegerConstant << Expr->getSourceRange();
+  return false;
+}
+
+if (!I->isIntN(32)) {
+  Diag(Expr->getExprLoc(), diag::err_ice_too_large)
+  << toString(*I, 10, false) << 32 << /* Unsigned */ 1;
+  return false;
+}
+
+if (StrictlyUnsigned && I->isSigned() && I->isNegative()) {
+  Diag(getAttrLoc(AI), diag::err_attribute_requires_positive_integer)
+  <<  << /*non-negative*/ 1;
+  return false;
+}
+
+Val = (uint32_t)I->getZExtValue();
+return true;
+  }
+
+  bool isFunctionOrMethod(const Decl *D);
+  bool isFunctionOrMethodOrBlock(const Decl *D);

Endilll wrote:

I see `isFunctionOrMethod` used in AVR-, MIPS-, MSP430-, and X86-specific 
functions in `SemaDeclAttr.cpp`. If we're to move target specific functions, 
which I'll try to do, I'd need to replicate the hack every time. I can inline 
the function where it's used, or I can copy-paste the definition of static 
function where it's needed. We can also rename it to e.g. 
`isFunctionDeclOrMethodDecl` to avoid the confusion.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-28 Thread Aaron Ballman via cfe-commits


@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase {
 BuiltinFunction
   };
 
+  /// A helper function to provide Attribute Location for the Attr types
+  /// AND the ParsedAttr.
+  template 
+  static std::enable_if_t, SourceLocation>
+  getAttrLoc(const AttrInfo ) {
+return AL.getLocation();
+  }
+  SourceLocation getAttrLoc(const ParsedAttr );
+
+  /// If Expr is a valid integer constant, get the value of the integer
+  /// expression and return success or failure. May output an error.
+  ///
+  /// Negative argument is implicitly converted to unsigned, unless
+  /// \p StrictlyUnsigned is true.
+  template 
+  bool checkUInt32Argument(const AttrInfo , const Expr *Expr, uint32_t ,
+   unsigned Idx = UINT_MAX,
+   bool StrictlyUnsigned = false) {
+std::optional I = llvm::APSInt(32);
+if (Expr->isTypeDependent() ||
+!(I = Expr->getIntegerConstantExpr(Context))) {
+  if (Idx != UINT_MAX)
+Diag(getAttrLoc(AI), diag::err_attribute_argument_n_type)
+<<  << Idx << AANT_ArgumentIntegerConstant
+<< Expr->getSourceRange();
+  else
+Diag(getAttrLoc(AI), diag::err_attribute_argument_type)
+<<  << AANT_ArgumentIntegerConstant << Expr->getSourceRange();
+  return false;
+}
+
+if (!I->isIntN(32)) {
+  Diag(Expr->getExprLoc(), diag::err_ice_too_large)
+  << toString(*I, 10, false) << 32 << /* Unsigned */ 1;
+  return false;
+}
+
+if (StrictlyUnsigned && I->isSigned() && I->isNegative()) {
+  Diag(getAttrLoc(AI), diag::err_attribute_requires_positive_integer)
+  <<  << /*non-negative*/ 1;
+  return false;
+}
+
+Val = (uint32_t)I->getZExtValue();
+return true;
+  }
+
+  bool isFunctionOrMethod(const Decl *D);
+  bool isFunctionOrMethodOrBlock(const Decl *D);

AaronBallman wrote:

It's not clear to me that these should be public interfaces in Sema. We have 
`DeclBase::isFunctionOrMethod()` which is subtly different. When these were 
static functions in SemaDeclAttr.cpp, they were a bit more reasonable (if still 
somewhat poorly named).

It looks like `isFunctionOrMethodOrBlock()` doesn't need to move out of 
SemaDeclAttr.cpp, and the only reason `isFunctionOrMethod()` is exposed is 
because of WebAssembly. Perhaps a horrible hack would be to leave the interface 
in SemaDeclAttr.cpp, make it `extern`, and forward declare for the use in wasm?

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-24 Thread Ulrich Weigand via cfe-commits


@@ -0,0 +1,94 @@
+//===-- SemaSystemZ.cpp -- SystemZ target-specific routines 
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+//
+//  This file implements semantic analysis functions specific to AIX.

uweigand wrote:

Comment should read SystemZ instead of AIX.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-24 Thread Ulrich Weigand via cfe-commits

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-24 Thread Ulrich Weigand via cfe-commits

https://github.com/uweigand commented:

See comment fix - otherwise SystemZ part LGTM.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Lu Weining via cfe-commits

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

LGTM from the LoongArch side. Thanks!

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Vlad Serebrennikov via cfe-commits


@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase {
 BuiltinFunction
   };
 
+  /// A helper function to provide Attribute Location for the Attr types

Endilll wrote:

We decided that there's nothing to change here after an offline discussion.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Erich Keane via cfe-commits

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


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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Erich Keane via cfe-commits


@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase {
 BuiltinFunction
   };
 
+  /// A helper function to provide Attribute Location for the Attr types

erichkeane wrote:

Right, my concern is the comment claims it is for both, but I see you copied it 
over, so I probably wrote the misleading comment :) 

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Erich Keane via cfe-commits


@@ -67,6 +67,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringExtras.h"

erichkeane wrote:

Got it, thanks!

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Vlad Serebrennikov via cfe-commits

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Vlad Serebrennikov via cfe-commits


@@ -67,6 +67,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringExtras.h"

Endilll wrote:

For `toString(*I, 10, false)` in `CheckUInt32Argument` definition that I moved.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Vlad Serebrennikov via cfe-commits


@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase {
 BuiltinFunction
   };
 
+  /// A helper function to provide Attribute Location for the Attr types

Endilll wrote:

Yes, I moved them together, so 
http://eel.is/c++draft/over.match.best#general-2.4 should apply as usual.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Erich Keane via cfe-commits

https://github.com/erichkeane commented:

I'm  in favor here, the changes to SemaDeclAttr are reasonable.

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Erich Keane via cfe-commits


@@ -3548,6 +3561,56 @@ class Sema final : public SemaBase {
 BuiltinFunction
   };
 
+  /// A helper function to provide Attribute Location for the Attr types

erichkeane wrote:

Is this comment right?  ParsedAttr will always call the non-template version 
below, right?

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Erich Keane via cfe-commits

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Erich Keane via cfe-commits


@@ -67,6 +67,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringExtras.h"

erichkeane wrote:

What do we need this addition for?

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


[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Vlad Serebrennikov via cfe-commits

Endilll wrote:

> Should update the GitHub autolabeler paths for the targets if they don't get 
> caught talready

AMDGPU has been already caught, I updated the rest. Thank you!

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