[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-03-04 Thread Shahid Iqbal via cfe-commits

shahidiqbal13 wrote:

Hi @AaronBallman 
Can you pls explain me your previous response _"It would be better for us to 
associate the data with catch statements specifically because there's a lot 
fewer of those than there are variable declarations in general."_

I mean storing the ellipsis's location in catch stmt is not going to work, we 
need to add certain flags/function in VarDecl. Can you please review which I 
have raised currently one more time?

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-27 Thread Shahid Iqbal via cfe-commits

shahidiqbal13 wrote:

Hi @cor3ntin ,
I tried but didn't work as per design, Can you pls review this , I m not 
updating the Decl , updating the VarDecl 

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-27 Thread Shahid Iqbal via cfe-commits


@@ -41,7 +41,7 @@ void TestCatch2() {
   try {
   }
 // CHECK-NEXT:CXXCatchStmt
-// CHECK-NEXT:  NULL
+// CHECK-NEXT:  VarDecl {{.*}} ''

shahidiqbal13 wrote:

Can't do much here , its intently being created the var of unknown type

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-27 Thread Shahid Iqbal via cfe-commits


@@ -16983,7 +16983,7 @@ VarDecl *Sema::BuildExceptionDeclaration(Scope *S,
 
 /// ActOnExceptionDeclarator - Parsed the exception-declarator in a C++ catch
 /// handler.
-Decl *Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) {
+Decl *Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D, bool isCatchAll) 
{

shahidiqbal13 wrote:

I think it won't be possible since if you see the ActOnExceptionDeclarator , we 
are not passing the Decl*, later we are updating the Decl*

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-27 Thread Shahid Iqbal via cfe-commits


@@ -271,6 +271,9 @@ void TextNodeDumper::Visit(const Decl *D) {
   OS << " hidden";
   if (D->isImplicit())
 OS << " implicit";
+  if (const VarDecl *ND = dyn_cast(D))
+  if (ND->isEllipsisVariable())
+  OS << " catch_all";

shahidiqbal13 wrote:

Will do it

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-27 Thread Shahid Iqbal via cfe-commits


@@ -115,6 +115,10 @@ void JSONNodeDumper::Visit(const Decl *D) {
   else if (D->isThisDeclarationReferenced())
 JOS.attribute("isReferenced", true);
 
+  if (const VarDecl *ND = dyn_cast(D))
+  if (ND->isEllipsisVariable())
+  JOS.attribute("catch_all", true);

shahidiqbal13 wrote:

Will do it

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-27 Thread Shahid Iqbal via cfe-commits


@@ -1474,6 +1478,16 @@ class VarDecl : public DeclaratorDecl, public 
Redeclarable {
 NonParmVarDeclBits.ExceptionVar = EV;
   }
 
+  /// Determine the Ellipsis (...) or not
+  bool isEllipsisVariable() const {
+return isa(this) ? false : NonParmVarDeclBits.EllipsisVar;
+  }
+  void setEllipsisVariable(bool EV) {
+assert(!isa(this));
+NonParmVarDeclBits.EllipsisVar = EV;
+  }

shahidiqbal13 wrote:

It might impact on the testcases failure , but I will check otherwise it will 
remain this

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-27 Thread Shahid Iqbal via cfe-commits


@@ -1053,6 +1053,10 @@ class VarDecl : public DeclaratorDecl, public 
Redeclarable {
 LLVM_PREFERRED_TYPE(bool)
 unsigned ExceptionVar : 1;
 
+/// To Check the ellipsis

shahidiqbal13 wrote:

Will do it , its expected

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-27 Thread Shahid Iqbal via cfe-commits


@@ -1053,6 +1053,10 @@ class VarDecl : public DeclaratorDecl, public 
Redeclarable {
 LLVM_PREFERRED_TYPE(bool)
 unsigned ExceptionVar : 1;
 
+/// To Check the ellipsis
+LLVM_PREFERRED_TYPE(bool)
+unsigned EllipsisVar : 1;

shahidiqbal13 wrote:

It might impact on the testcases failure , but I will check otherwise it will 
remain this

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-27 Thread Shahid Iqbal via cfe-commits


@@ -2698,9 +2698,16 @@ StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) {
 Declarator ExDecl(DS, Attributes, DeclaratorContext::CXXCatch);
 ParseDeclarator(ExDecl);
 ExceptionDecl = Actions.ActOnExceptionDeclarator(getCurScope(), ExDecl);
-  } else
-ConsumeToken();
-
+  }
+  else {
+  CatchLoc = ConsumeToken();
+  // explicitly creating a var of type no-type for '...' and marking it as 
catch_all
+  ParsedAttributes Attributes(AttrFactory);
+  DeclSpec DS(AttrFactory);
+  Declarator ExDecl(DS, Attributes, DeclaratorContext::BlockLiteral);
+  ParseDeclarator(ExDecl);
+  ExceptionDecl = Actions.ActOnExceptionDeclarator(getCurScope(), ExDecl, 
true);
+  }

shahidiqbal13 wrote:

Hi @ChuanqiXu9 , Thanks for the review!
I think it won't be possible since if you see the ActOnExceptionDeclarator , we 
are not passing the Decl*, later we are updating the Decl*

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Shahid Iqbal via cfe-commits

shahidiqbal13 wrote:

Hi @cor3ntin to review the updated fix, will format it later

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


[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-26 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 updated 
https://github.com/llvm/llvm-project/pull/80976

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/4] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd340..c83dda52a1fc21 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 79c592853c77fb0a96746d860be63d4605ea87e7 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Wed, 7 Feb 2024 06:08:10 -0500
Subject: [PATCH 2/4] =?UTF-8?q?Issue=20#63106:=20[=D1=81lang]=20Representa?=
 =?UTF-8?q?tion=20of=20ellipsis=20in=20AST?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 clang/include/clang/AST/DeclBase.h | 11 +--
 clang/include/clang/Sema/Sema.h|  2 +-
 clang/lib/AST/TextNodeDumper.cpp   |  3 +++
 clang/lib/Parse/ParseStmt.cpp  | 14 +++---
 clang/lib/Sema/SemaDeclCXX.cpp |  7 +--
 clang/test/AST/ast-dump-stmt.cpp   |  2 +-
 6 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/clang/include/clang/AST/DeclBase.h 
b/clang/include/clang/AST/DeclBase.h
index 5b1038582bc674..67f5c7dd1b7f98 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -301,6 +301,9 @@ class alignas(8) Decl {
   LLVM_PREFERRED_TYPE(bool)
   unsigned Implicit : 1;
 
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned HasCatchEllipsis : 1;
+
   /// Whether this declaration was "used", meaning that a definition is
   /// required.
   LLVM_PREFERRED_TYPE(bool)
@@ -394,7 +397,7 @@ class alignas(8) Decl {
   Decl(Kind DK, DeclContext *DC, SourceLocation L)
   : NextInContextAndBits(nullptr, getModuleOwnershipKindForChildOf(DC)),
 DeclCtx(DC), Loc(L), DeclKind(DK), InvalidDecl(false), HasAttrs(false),
-Implicit(false), Used(false), Referenced(false),
+Implicit(false), HasCatchEllipsis(false), Used(false), 
Referenced(false),
 TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0),
 IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
 CacheValidAndLinkage(llvm::to_underlying(Linkage::Invalid)) {
@@ -402,7 +405,7 @@ class alignas(8) Decl {
   }
 
   Decl(Kind DK, EmptyShell Empty)
-  : DeclKind(DK), InvalidDecl(false), HasAttrs(false), Implicit(false),
+  : DeclKind(DK), InvalidDecl(false), HasAttrs(false), Implicit(false), 
HasCatchEllipsis(false),
 Used(false), Referenced(false), TopLevelDeclInObjCContainer(false),
 Access(AS_none), FromASTFile(0),
 IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
@@ -597,6 +600,10 @@ class alignas(8) Decl {
   bool isImplicit() const { return Implicit; }
   void setImplicit(bool I = true) { Implicit = I; }
 
+  /// isCatchEllipsisTok - Indicates whether '...' is present in the catch decl
+  bool isCatchEllipsisTok() const { return HasCatchEllipsis; }
+  void setCatchEllipsisTok(bool I = true) { HasCatchEllipsis = I; }
+
   /// Whether *any* (re-)declaration of the entity was used, meaning that
   /// a definition is required.
   ///
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 501dc01200a1c3..ffc6d2926f85f2 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -5322,7 +5322,7 @@ class Sema final {
  SourceLocation IdLoc,
  IdentifierInfo *Id);
 
-  Decl *ActOnExceptionDeclarator(Scope *S, Declarator &D);
+  Decl *ActOnExceptionDeclarator(Scope *S, Declarator &D, bool isCatchAll = 
false);
 
   StmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
 Decl *ExDecl, Stmt *HandlerBlock);
diff --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp
index e8274fcd5cfe9c..1da20cdfa36a66 100644
--- a/clang/lib/AST/TextNodeDumper.cpp
+++ b/clang/lib/AST/TextNodeDumper.cpp
@@ -272,6 +272,9 @@ void TextNodeDumper::Visit(const Decl *D) {
   if (D->isImplicit())
 OS << " implicit";
 
+  if (D->isCatchEllipsisTok())
+OS << " catch_all ";
+
   if (D->isUsed())
 OS << " used";
   else if (D->isThisDeclarationReferenced())
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 2531147c23196a..56c1e86afd4811 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -2698,9 +2698,17 @@ StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) {
 Declarator ExDecl(DS, Attributes, DeclaratorContext::CXXCatch);
 ParseDeclarator(ExDecl);
 ExceptionDecl = Actions.ActOnExceptionDeclarator(getCurScope(), ExDecl);
-  } else
-ConsumeToken();
-
+  }
+  e

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-07 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 updated 
https://github.com/llvm/llvm-project/pull/80976

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/3] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd340..c83dda52a1fc21 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 79c592853c77fb0a96746d860be63d4605ea87e7 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Wed, 7 Feb 2024 06:08:10 -0500
Subject: [PATCH 2/3] =?UTF-8?q?Issue=20#63106:=20[=D1=81lang]=20Representa?=
 =?UTF-8?q?tion=20of=20ellipsis=20in=20AST?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 clang/include/clang/AST/DeclBase.h | 11 +--
 clang/include/clang/Sema/Sema.h|  2 +-
 clang/lib/AST/TextNodeDumper.cpp   |  3 +++
 clang/lib/Parse/ParseStmt.cpp  | 14 +++---
 clang/lib/Sema/SemaDeclCXX.cpp |  7 +--
 clang/test/AST/ast-dump-stmt.cpp   |  2 +-
 6 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/clang/include/clang/AST/DeclBase.h 
b/clang/include/clang/AST/DeclBase.h
index 5b1038582bc674..67f5c7dd1b7f98 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -301,6 +301,9 @@ class alignas(8) Decl {
   LLVM_PREFERRED_TYPE(bool)
   unsigned Implicit : 1;
 
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned HasCatchEllipsis : 1;
+
   /// Whether this declaration was "used", meaning that a definition is
   /// required.
   LLVM_PREFERRED_TYPE(bool)
@@ -394,7 +397,7 @@ class alignas(8) Decl {
   Decl(Kind DK, DeclContext *DC, SourceLocation L)
   : NextInContextAndBits(nullptr, getModuleOwnershipKindForChildOf(DC)),
 DeclCtx(DC), Loc(L), DeclKind(DK), InvalidDecl(false), HasAttrs(false),
-Implicit(false), Used(false), Referenced(false),
+Implicit(false), HasCatchEllipsis(false), Used(false), 
Referenced(false),
 TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0),
 IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
 CacheValidAndLinkage(llvm::to_underlying(Linkage::Invalid)) {
@@ -402,7 +405,7 @@ class alignas(8) Decl {
   }
 
   Decl(Kind DK, EmptyShell Empty)
-  : DeclKind(DK), InvalidDecl(false), HasAttrs(false), Implicit(false),
+  : DeclKind(DK), InvalidDecl(false), HasAttrs(false), Implicit(false), 
HasCatchEllipsis(false),
 Used(false), Referenced(false), TopLevelDeclInObjCContainer(false),
 Access(AS_none), FromASTFile(0),
 IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
@@ -597,6 +600,10 @@ class alignas(8) Decl {
   bool isImplicit() const { return Implicit; }
   void setImplicit(bool I = true) { Implicit = I; }
 
+  /// isCatchEllipsisTok - Indicates whether '...' is present in the catch decl
+  bool isCatchEllipsisTok() const { return HasCatchEllipsis; }
+  void setCatchEllipsisTok(bool I = true) { HasCatchEllipsis = I; }
+
   /// Whether *any* (re-)declaration of the entity was used, meaning that
   /// a definition is required.
   ///
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 501dc01200a1c3..ffc6d2926f85f2 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -5322,7 +5322,7 @@ class Sema final {
  SourceLocation IdLoc,
  IdentifierInfo *Id);
 
-  Decl *ActOnExceptionDeclarator(Scope *S, Declarator &D);
+  Decl *ActOnExceptionDeclarator(Scope *S, Declarator &D, bool isCatchAll = 
false);
 
   StmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
 Decl *ExDecl, Stmt *HandlerBlock);
diff --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp
index e8274fcd5cfe9c..1da20cdfa36a66 100644
--- a/clang/lib/AST/TextNodeDumper.cpp
+++ b/clang/lib/AST/TextNodeDumper.cpp
@@ -272,6 +272,9 @@ void TextNodeDumper::Visit(const Decl *D) {
   if (D->isImplicit())
 OS << " implicit";
 
+  if (D->isCatchEllipsisTok())
+OS << " catch_all ";
+
   if (D->isUsed())
 OS << " used";
   else if (D->isThisDeclarationReferenced())
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 2531147c23196a..56c1e86afd4811 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -2698,9 +2698,17 @@ StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) {
 Declarator ExDecl(DS, Attributes, DeclaratorContext::CXXCatch);
 ParseDeclarator(ExDecl);
 ExceptionDecl = Actions.ActOnExceptionDeclarator(getCurScope(), ExDecl);
-  } else
-ConsumeToken();
-
+  }
+  e

[clang] Issue #63106: [сlang] Representation of ellipsis in AST (PR #80976)

2024-02-07 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 created 
https://github.com/llvm/llvm-project/pull/80976

- Raising for preliminary review (forget about formating)
- Fixed the '...' catch all ellipsis in catch stmt
- Will fix the failed testcases once we get agree on this
- I don't think we need to support for the variadic function support ellipsis 
token this usecase [void bar(int, ...); ]
- See the issue here:  https://github.com/llvm/llvm-project/issues/63106

Output of the fixed 1st issue (catch(...))
```
`-FunctionDecl 0x55bdaf78d9a0  line:1:6 foo 'void ()'
  `-CompoundStmt 0x55bdaf78dbb8 
`-CXXTryStmt 0x55bdaf78db98 
  |-CompoundStmt 0x55bdaf78da90 
  `-CXXCatchStmt 0x55bdaf78db78 
|-VarDecl 0x55bdaf78db00 <, col:12> col:12 catch_all  
''
`-CompoundStmt 0x55bdaf78db68 
```


>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/2] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd340..c83dda52a1fc21 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 79c592853c77fb0a96746d860be63d4605ea87e7 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Wed, 7 Feb 2024 06:08:10 -0500
Subject: [PATCH 2/2] =?UTF-8?q?Issue=20#63106:=20[=D1=81lang]=20Representa?=
 =?UTF-8?q?tion=20of=20ellipsis=20in=20AST?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 clang/include/clang/AST/DeclBase.h | 11 +--
 clang/include/clang/Sema/Sema.h|  2 +-
 clang/lib/AST/TextNodeDumper.cpp   |  3 +++
 clang/lib/Parse/ParseStmt.cpp  | 14 +++---
 clang/lib/Sema/SemaDeclCXX.cpp |  7 +--
 clang/test/AST/ast-dump-stmt.cpp   |  2 +-
 6 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/clang/include/clang/AST/DeclBase.h 
b/clang/include/clang/AST/DeclBase.h
index 5b1038582bc674..67f5c7dd1b7f98 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -301,6 +301,9 @@ class alignas(8) Decl {
   LLVM_PREFERRED_TYPE(bool)
   unsigned Implicit : 1;
 
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned HasCatchEllipsis : 1;
+
   /// Whether this declaration was "used", meaning that a definition is
   /// required.
   LLVM_PREFERRED_TYPE(bool)
@@ -394,7 +397,7 @@ class alignas(8) Decl {
   Decl(Kind DK, DeclContext *DC, SourceLocation L)
   : NextInContextAndBits(nullptr, getModuleOwnershipKindForChildOf(DC)),
 DeclCtx(DC), Loc(L), DeclKind(DK), InvalidDecl(false), HasAttrs(false),
-Implicit(false), Used(false), Referenced(false),
+Implicit(false), HasCatchEllipsis(false), Used(false), 
Referenced(false),
 TopLevelDeclInObjCContainer(false), Access(AS_none), FromASTFile(0),
 IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
 CacheValidAndLinkage(llvm::to_underlying(Linkage::Invalid)) {
@@ -402,7 +405,7 @@ class alignas(8) Decl {
   }
 
   Decl(Kind DK, EmptyShell Empty)
-  : DeclKind(DK), InvalidDecl(false), HasAttrs(false), Implicit(false),
+  : DeclKind(DK), InvalidDecl(false), HasAttrs(false), Implicit(false), 
HasCatchEllipsis(false),
 Used(false), Referenced(false), TopLevelDeclInObjCContainer(false),
 Access(AS_none), FromASTFile(0),
 IdentifierNamespace(getIdentifierNamespaceForKind(DK)),
@@ -597,6 +600,10 @@ class alignas(8) Decl {
   bool isImplicit() const { return Implicit; }
   void setImplicit(bool I = true) { Implicit = I; }
 
+  /// isCatchEllipsisTok - Indicates whether '...' is present in the catch decl
+  bool isCatchEllipsisTok() const { return HasCatchEllipsis; }
+  void setCatchEllipsisTok(bool I = true) { HasCatchEllipsis = I; }
+
   /// Whether *any* (re-)declaration of the entity was used, meaning that
   /// a definition is required.
   ///
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 501dc01200a1c3..ffc6d2926f85f2 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -5322,7 +5322,7 @@ class Sema final {
  SourceLocation IdLoc,
  IdentifierInfo *Id);
 
-  Decl *ActOnExceptionDeclarator(Scope *S, Declarator &D);
+  Decl *ActOnExceptionDeclarator(Scope *S, Declarator &D, bool isCatchAll = 
false);
 
   StmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
 Decl *ExDecl, Stmt *HandlerBlock);
diff --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp
index e8274fcd5cfe9c..1da20cdfa36a66 100644
--- a/clang/lib/AST/TextNodeDumper.cpp
+++ b/clang/lib/AST/TextNodeDumper.cpp
@@ -272,6 +272,9 @@ void TextNode

[libunwind] [mlir] [libcxxabi] [flang] [libc] [libcxx] [lld] [lldb] [clang] [clang-tools-extra] [compiler-rt] [llvm] PR#72453 : Exceeding maximum file name length (PR #72654)

2024-01-14 Thread Shahid Iqbal via cfe-commits

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


[clang] [lld] [clang-tools-extra] [libcxxabi] [libcxx] [libunwind] [mlir] [llvm] [flang] [lldb] [libc] [compiler-rt] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-27 Thread Shahid Iqbal via cfe-commits

shahidiqbal13 wrote:

Hi @DrTodd13 , 
Any further needs to be done here ?? Can you please add more devs for reviewing 
this 

Thanks,
Shahid

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


[llvm] [libcxx] [clang-tools-extra] [libcxxabi] [mlir] [compiler-rt] [clang] [libunwind] [lld] [libc] [lldb] [flang] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-21 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 updated 
https://github.com/llvm/llvm-project/pull/72654

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/7] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd3409..c83dda52a1fc21e 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 7662d4f177d32c3159c1c48b11ce3884e4ea78c8 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:26:31 -0500
Subject: [PATCH 2/7] PR#72453 : Exceeding maximum file name length

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 07c08bc1cc3bcb6..f78d8ff52ee3932 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -17,6 +17,8 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/GraphWriter.h"
 
+#define MAX_FILENAME_LEN 255
+
 namespace llvm {
 
 /// Default traits class for extracting a graph from an analysis pass.
@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -280,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC)
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -310,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple, Title);
   else
 errs() << "  error opening file for writing!";

>From d3d33e5bfe907b761ecb9065fe45b698c3ce0672 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:48:43 -0500
Subject: [PATCH 3/7] Reverted the earlier test text

---
 clang/NOTES.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index c83dda52a1fc21e..f06ea8c70cd3409 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,8 +4,6 @@
 
 //===-===//
 
-//TESTING git infra//
-
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 41c19e2ceee80cce8a60d0fd869958a0783ddb7f Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 10:06:52 -0500
Subject: [PATCH 4/7] Code refactoring

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index f78d8ff52ee3932..f7ab6df3b4dd819 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -96,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -282,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -312,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC && (Filename.length() 

[libc] [llvm] [lldb] [clang] [flang] [mlir] [compiler-rt] [libunwind] [clang-tools-extra] [libcxxabi] [lld] [libcxx] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-20 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 updated 
https://github.com/llvm/llvm-project/pull/72654

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/6] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd3409..c83dda52a1fc21e 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 7662d4f177d32c3159c1c48b11ce3884e4ea78c8 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:26:31 -0500
Subject: [PATCH 2/6] PR#72453 : Exceeding maximum file name length

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 07c08bc1cc3bcb6..f78d8ff52ee3932 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -17,6 +17,8 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/GraphWriter.h"
 
+#define MAX_FILENAME_LEN 255
+
 namespace llvm {
 
 /// Default traits class for extracting a graph from an analysis pass.
@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -280,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC)
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -310,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple, Title);
   else
 errs() << "  error opening file for writing!";

>From d3d33e5bfe907b761ecb9065fe45b698c3ce0672 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:48:43 -0500
Subject: [PATCH 3/6] Reverted the earlier test text

---
 clang/NOTES.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index c83dda52a1fc21e..f06ea8c70cd3409 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,8 +4,6 @@
 
 //===-===//
 
-//TESTING git infra//
-
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 41c19e2ceee80cce8a60d0fd869958a0783ddb7f Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 10:06:52 -0500
Subject: [PATCH 4/6] Code refactoring

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index f78d8ff52ee3932..f7ab6df3b4dd819 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -96,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -282,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -312,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC && (Filename.length() 

[lld] [libunwind] [compiler-rt] [libcxxabi] [flang] [lldb] [clang] [llvm] [clang-tools-extra] [libc] [libcxx] [mlir] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-19 Thread Shahid Iqbal via cfe-commits


@@ -83,10 +85,29 @@ struct DOTGraphTraitsViewer
   StringRef Name;
 };
 
+static void shortenFileName(std::string &FN, unsigned char len = 250) {
+
+  FN = FN.substr(0, len);
+  if (nameObj.empty())
+nameObj.push_back(FN);
+
+  else {
+for (auto it = nameObj.begin(); it != nameObj.end(); it++) {
+  if (*it == FN) {
+FN = FN.substr(0, --len);

shahidiqbal13 wrote:

@DrTodd13 ,
Yes I do agree with the 3 filenames example but the chances would be highly 
rare that's what y I didn't go for keep searching mechanism

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


[clang-tools-extra] [libc] [lldb] [compiler-rt] [mlir] [flang] [libunwind] [libcxxabi] [clang] [llvm] [libcxx] [lld] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-18 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 updated 
https://github.com/llvm/llvm-project/pull/72654

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/5] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd3409..c83dda52a1fc21e 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 7662d4f177d32c3159c1c48b11ce3884e4ea78c8 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:26:31 -0500
Subject: [PATCH 2/5] PR#72453 : Exceeding maximum file name length

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 07c08bc1cc3bcb6..f78d8ff52ee3932 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -17,6 +17,8 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/GraphWriter.h"
 
+#define MAX_FILENAME_LEN 255
+
 namespace llvm {
 
 /// Default traits class for extracting a graph from an analysis pass.
@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -280,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC)
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -310,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple, Title);
   else
 errs() << "  error opening file for writing!";

>From d3d33e5bfe907b761ecb9065fe45b698c3ce0672 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:48:43 -0500
Subject: [PATCH 3/5] Reverted the earlier test text

---
 clang/NOTES.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index c83dda52a1fc21e..f06ea8c70cd3409 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,8 +4,6 @@
 
 //===-===//
 
-//TESTING git infra//
-
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 41c19e2ceee80cce8a60d0fd869958a0783ddb7f Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 10:06:52 -0500
Subject: [PATCH 4/5] Code refactoring

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index f78d8ff52ee3932..f7ab6df3b4dd819 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -96,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -282,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -312,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC && (Filename.length() 

[clang] [libc] [libcxxabi] [mlir] [llvm] [compiler-rt] [lldb] [flang] [lld] [libcxx] [clang-tools-extra] [libunwind] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-17 Thread Shahid Iqbal via cfe-commits


@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);

shahidiqbal13 wrote:

@DrTodd13 ,
Will change the fix later , need to think

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


[flang] [compiler-rt] [lldb] [lld] [libcxx] [llvm] [mlir] [libcxxabi] [clang] [libunwind] [libc] [clang-tools-extra] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-17 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 updated 
https://github.com/llvm/llvm-project/pull/72654

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/4] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd3409..c83dda52a1fc21e 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 7662d4f177d32c3159c1c48b11ce3884e4ea78c8 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:26:31 -0500
Subject: [PATCH 2/4] PR#72453 : Exceeding maximum file name length

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 07c08bc1cc3bcb6..f78d8ff52ee3932 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -17,6 +17,8 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/GraphWriter.h"
 
+#define MAX_FILENAME_LEN 255
+
 namespace llvm {
 
 /// Default traits class for extracting a graph from an analysis pass.
@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -280,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC)
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -310,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple, Title);
   else
 errs() << "  error opening file for writing!";

>From d3d33e5bfe907b761ecb9065fe45b698c3ce0672 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:48:43 -0500
Subject: [PATCH 3/4] Reverted the earlier test text

---
 clang/NOTES.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index c83dda52a1fc21e..f06ea8c70cd3409 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,8 +4,6 @@
 
 //===-===//
 
-//TESTING git infra//
-
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 41c19e2ceee80cce8a60d0fd869958a0783ddb7f Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 10:06:52 -0500
Subject: [PATCH 4/4] Code refactoring

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index f78d8ff52ee3932..f7ab6df3b4dd819 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -96,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -282,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -312,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC && (Filename.length() 

[mlir] [libunwind] [clang-tools-extra] [lld] [lldb] [compiler-rt] [libcxxabi] [clang] [llvm] [libc] [flang] [libcxx] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-17 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 updated 
https://github.com/llvm/llvm-project/pull/72654

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/3] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd3409..c83dda52a1fc21e 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 7662d4f177d32c3159c1c48b11ce3884e4ea78c8 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:26:31 -0500
Subject: [PATCH 2/3] PR#72453 : Exceeding maximum file name length

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 07c08bc1cc3bcb6..f78d8ff52ee3932 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -17,6 +17,8 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/GraphWriter.h"
 
+#define MAX_FILENAME_LEN 255
+
 namespace llvm {
 
 /// Default traits class for extracting a graph from an analysis pass.
@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -280,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC)
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -310,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple, Title);
   else
 errs() << "  error opening file for writing!";

>From d3d33e5bfe907b761ecb9065fe45b698c3ce0672 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:48:43 -0500
Subject: [PATCH 3/3] Reverted the earlier test text

---
 clang/NOTES.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index c83dda52a1fc21e..f06ea8c70cd3409 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,8 +4,6 @@
 
 //===-===//
 
-//TESTING git infra//
-
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

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


[mlir] [libunwind] [clang-tools-extra] [lld] [lldb] [compiler-rt] [libcxxabi] [clang] [llvm] [libc] [flang] [libcxx] PR#72453 : Exceeding maximum file name length (PR #72654)

2023-11-17 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 created 
https://github.com/llvm/llvm-project/pull/72654

This issue is raised by @DrTodd13

The code in include/llvm/Analysis/DOTGraphTraitsPass.h will exceed most normal 
file system's maximum filename length of 255 if, e.g., the function's name is 
that length.

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH 1/2] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd3409..c83dda52a1fc21e 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

>From 7662d4f177d32c3159c1c48b11ce3884e4ea78c8 Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Fri, 17 Nov 2023 09:26:31 -0500
Subject: [PATCH 2/2] PR#72453 : Exceeding maximum file name length

---
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h 
b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 07c08bc1cc3bcb6..f78d8ff52ee3932 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -17,6 +17,8 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/GraphWriter.h"
 
+#define MAX_FILENAME_LEN 255
+
 namespace llvm {
 
 /// Default traits class for extracting a graph from an analysis pass.
@@ -94,7 +96,7 @@ void printGraphForFunction(Function &F, GraphT Graph, 
StringRef Name,
   raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple,
GraphName + " for '" + F.getName() + "' function");
   else
@@ -280,7 +282,7 @@ class DOTGraphTraitsModulePrinterWrapperPass : public 
ModulePass {
 raw_fd_ostream File(Filename, EC, sys::fs::OF_TextWithCRLF);
 std::string Title = DOTGraphTraits::getGraphName(Graph);
 
-if (!EC)
+if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
   WriteGraph(File, Graph, IsSimple, Title);
 else
   errs() << "  error opening file for writing!";
@@ -310,7 +312,7 @@ void WriteDOTGraphToFile(Function &F, GraphT &&Graph,
   std::string GraphName = DOTGraphTraits::getGraphName(Graph);
   std::string Title = GraphName + " for '" + F.getName().str() + "' function";
 
-  if (!EC)
+  if (!EC && (Filename.length() <= MAX_FILENAME_LEN ))
 WriteGraph(File, Graph, IsSimple, Title);
   else
 errs() << "  error opening file for writing!";

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


Can't assign an issue - Add me collaborator/contributor list

2023-11-17 Thread Shahid Iqbal via cfe-commits
Hi
Please add me to a collaborator list , since I cannot assign an issue to
myself. I just want to ensure that no one works that particular issue.

My github handle is :  * shahidiqbal13*

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


[clang] TESTING infra (PR #72533)

2023-11-16 Thread Shahid Iqbal via cfe-commits

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


[clang] TESTING infra (PR #72533)

2023-11-16 Thread Shahid Iqbal via cfe-commits

https://github.com/shahidiqbal13 created 
https://github.com/llvm/llvm-project/pull/72533

Just a Test git review , will abandoned 

>From b6bfb18e25c111baf6c95a0a4a1c3d667bb25b6d Mon Sep 17 00:00:00 2001
From: Shahid Iqbal 
Date: Thu, 16 Nov 2023 11:26:43 -0500
Subject: [PATCH] TESTING infra

---
 clang/NOTES.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/NOTES.txt b/clang/NOTES.txt
index f06ea8c70cd3409..c83dda52a1fc21e 100644
--- a/clang/NOTES.txt
+++ b/clang/NOTES.txt
@@ -4,6 +4,8 @@
 
 //===-===//
 
+//TESTING git infra//
+
 To time GCC preprocessing speed without output, use:
"time gcc -MM file"
 This is similar to -Eonly.

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


Add me to LLVM-clang contributor list

2023-11-16 Thread Shahid Iqbal via cfe-commits
Hi,
I want to contribute in LLVM-clang from bug fixes perspective but cannot
assign a ticket/issue in github , please add me to contributor list

My github user: *shahidiqbal13*

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