RE: [PATCH] D27763: Debug Info: Modified DIBuilder::createCompileUnit() to take DIFile instead of FileName and Directory. (Clang part)

2016-12-19 Thread Aboud, Amjad via cfe-commits
It was approved by Reid.
This patch had two parts, he did not stamp the change in Clang, but he did 
stamp the change for LLVM.
https://reviews.llvm.org/D27762

I assumed that this means a green light to commit.
Did I misinterpret the rules?

Thanks,
Amjad

From: David Blaikie [mailto:dblai...@gmail.com]
Sent: Monday, December 19, 2016 19:00
To: reviews+d27763+public+4530ee00cad28...@reviews.llvm.org; Amjad Aboud via 
Phabricator ; Aboud, Amjad ; 
r...@google.com
Cc: cfe-commits@lists.llvm.org
Subject: Re: [PATCH] D27763: Debug Info: Modified 
DIBuilder::createCompileUnit() to take DIFile instead of FileName and 
Directory. (Clang part)

Was this change approved by anyone? Generally once it's sent for review, you 
should wait until it's approved before committing (the assumption being, if you 
sent it for review it's because it needed review)

On Wed, Dec 14, 2016 at 12:49 PM Amjad Aboud via Phabricator via cfe-commits 
mailto:cfe-commits@lists.llvm.org>> wrote:
This revision was automatically updated to reflect the committed changes.
Closed by commit rL289701: [DebugInfo] Changed DIBuilder::createCompileUnit() 
to take DIFile instead of… (authored by aaboud).

Changed prior to commit:
  https://reviews.llvm.org/D27763?vs=81397&id=81438#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27763

Files:
  cfe/trunk/lib/CodeGen/CGDebugInfo.cpp


Index: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
===
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
@@ -466,7 +466,8 @@
   // Create new compile unit.
   // FIXME - Eliminate TheCU.
   TheCU = DBuilder.createCompileUnit(
-  LangTag, remapDIPath(MainFileName), remapDIPath(getCurrentDirname()),
+  LangTag, DBuilder.createFile(remapDIPath(MainFileName),
+remapDIPath(getCurrentDirname())),
   Producer, LO.Optimize, CGM.getCodeGenOpts().DwarfDebugFlags, RuntimeVers,
   CGM.getCodeGenOpts().SplitDwarfFile, EmissionKind, 0 /* DWOid */,
   CGM.getCodeGenOpts().SplitDwarfInlining);
@@ -1977,10 +1978,11 @@
 // but LLVM detects skeleton CUs by looking for a non-zero DWO id.
 uint64_t Signature = Mod.getSignature() ? Mod.getSignature() : ~1ULL;
 llvm::DIBuilder DIB(CGM.getModule());
-DIB.createCompileUnit(TheCU->getSourceLanguage(), Mod.getModuleName(),
-  Mod.getPath(), TheCU->getProducer(), true,
-  StringRef(), 0, Mod.getASTFile(),
-  llvm::DICompileUnit::FullDebug, Signature);
+DIB.createCompileUnit(TheCU->getSourceLanguage(),
+  DIB.createFile(Mod.getModuleName(), Mod.getPath()),
+  TheCU->getProducer(), true, StringRef(), 0,
+  Mod.getASTFile(), llvm::DICompileUnit::FullDebug,
+  Signature);
 DIB.finalize();
   }
   llvm::DIModule *Parent =


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
-
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


RE: [PATCH] D16135: Macro Debug Info support in Clang

2016-07-22 Thread Aboud, Amjad via cfe-commits
Thanks Ranjeet,
Indeed I was planning to update the patches to top of trunk and reload them, so 
if you can save me this trouble I would appreciate that.
Once we upload the updated patches I would like to ping the community and ask 
for feedback.

Thanks,
Amjad 
> -Original Message-
> From: Ranjeet Singh [mailto:ranjeet.si...@arm.com]
> Sent: Friday, July 22, 2016 20:16
> To: Aboud, Amjad ; rich...@metafoo.co.uk;
> paul.robin...@sony.com; apra...@apple.com
> Cc: ranjeet.si...@arm.com; cfe-commits@lists.llvm.org
> Subject: Re: [PATCH] D16135: Macro Debug Info support in Clang
> 
> rs added a subscriber: rs.
> rs added a comment.
> 
> Hi Amjad,
> 
> are you still planning on getting this patch and
> https://reviews.llvm.org/D16077 committed ? It looks like these two patches
> are final pieces in the puzzle to get macro information in the DWARF debug
> output.
> 
> I've downloaded the diffs and applied them myself on my local checkout and
> they seem to work fine. If you would like me to upload the rebased patches
> onto phabricator to save you the trouble of having to the fix conflicts
> downstream then let me know.
> 
> Thanks,
> Ranjeet
> 
> 
> https://reviews.llvm.org/D16135
> 
> 

-
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


RE: r268055 - Recommitted r264281 "Supporting all entities declared in lexical scope in LLVM debug info."

2016-04-29 Thread Aboud, Amjad via cfe-commits
Sorry for that, I broke a LIT test that I added few days ago.
The LIT test need to be fixed and I already fixed it in r268063.

Let's wait till r268063 run bots and see that everything will pass.

Thanks,
Amjad
From: peter_coo...@apple.com [mailto:peter_coo...@apple.com]
Sent: Friday, April 29, 2016 19:53
To: Aboud, Amjad 
Cc: cfe-commits@lists.llvm.org
Subject: Re: r268055 - Recommitted r264281 "Supporting all entities declared in 
lexical scope in LLVM debug info."

Hi Amjad

Either this change, or r268054, appears to have broken the bots.  Can you 
please take a look?

The error at: 
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/22409/consoleFull#8333002949ba4694-19c4-4d7e-bec5-911270d8a58c

Thanks,
Pete
On Apr 29, 2016, at 9:08 AM, Amjad Aboud via cfe-commits 
mailto:cfe-commits@lists.llvm.org>> wrote:

Author: aaboud
Date: Fri Apr 29 11:08:08 2016
New Revision: 268055

URL: http://llvm.org/viewvc/llvm-project?rev=268055&view=rev
Log:
Recommitted r264281 "Supporting all entities declared in lexical scope in LLVM 
debug info."
After fixing PR26942 in r267004.

Added:
   cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp
Modified:
   cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
   cfe/trunk/lib/CodeGen/CGDebugInfo.h
   cfe/trunk/lib/CodeGen/CGDecl.cpp
   cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=268055&r1=268054&r2=268055&view=diff
==
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 29 11:08:08 2016
@@ -814,15 +814,18 @@ llvm::DIType *CGDebugInfo::CreateType(co

llvm::DIType *CGDebugInfo::CreateType(const TypedefType *Ty,
  llvm::DIFile *Unit) {
+  TypedefNameDecl *TD = Ty->getDecl();
  // We don't set size information, but do specify where the typedef was
  // declared.
-  SourceLocation Loc = Ty->getDecl()->getLocation();
+  SourceLocation Loc = TD->getLocation();
+
+  llvm::DIScope *TDContext = getDeclarationLexicalScope(*TD, QualType(Ty, 0));

  // Typedefs are derived from some other type.
  return DBuilder.createTypedef(
  getOrCreateType(Ty->getDecl()->getUnderlyingType(), Unit),
  Ty->getDecl()->getName(), getOrCreateFile(Loc), getLineNumber(Loc),
-  getDeclContextDescriptor(Ty->getDecl()));
+  TDContext);
}

llvm::DIType *CGDebugInfo::CreateType(const FunctionType *Ty,
@@ -1457,6 +1460,23 @@ llvm::DIType *CGDebugInfo::getOrCreateSt
  return T;
}

+void CGDebugInfo::recordDeclarationLexicalScope(const Decl &D) {
+  assert(LexicalBlockMap.find(&D) == LexicalBlockMap.end() &&
+ "D is already mapped to lexical block scope");
+  if (!LexicalBlockStack.empty())
+LexicalBlockMap[&D] = LexicalBlockStack.back();
+}
+
+llvm::DIScope *CGDebugInfo::getDeclarationLexicalScope(const Decl &D,
+   QualType Ty) {
+  auto I = LexicalBlockMap.find(&D);
+  if (I != LexicalBlockMap.end()) {
+RetainedTypes.push_back(Ty.getAsOpaquePtr());
+return I->second;
+  }
+  return getDeclContextDescriptor(cast(&D));
+}
+
void CGDebugInfo::completeType(const EnumDecl *ED) {
  if (DebugKind <= codegenoptions::DebugLineTablesOnly)
return;
@@ -2060,7 +2080,7 @@ llvm::DIType *CGDebugInfo::CreateEnumTyp
// entered into the ReplaceMap: finalize() will replace the first
// FwdDecl with the second and then replace the second with
// complete type.
-llvm::DIScope *EDContext = getDeclContextDescriptor(ED);
+llvm::DIScope *EDContext = getDeclarationLexicalScope(*ED, QualType(Ty, 
0));
llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
llvm::TempDIScope TmpContext(DBuilder.createReplaceableCompositeType(
llvm::dwarf::DW_TAG_enumeration_type, "", TheCU, DefUnit, 0));
@@ -2104,7 +2124,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDef

  llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
  unsigned Line = getLineNumber(ED->getLocation());
-  llvm::DIScope *EnumContext = getDeclContextDescriptor(ED);
+  llvm::DIScope *EnumContext = getDeclarationLexicalScope(*ED, QualType(Ty, 
0));
  llvm::DIType *ClassTy =
  ED->isFixed() ? getOrCreateType(ED->getIntegerType(), DefUnit) : nullptr;
  return DBuilder.createEnumerationType(EnumContext, ED->getName(), DefUnit,
@@ -2365,7 +2385,7 @@ llvm::DICompositeType *CGDebugInfo::Crea
  unsigned Line = getLineNumber(RD->getLocation());
  StringRef RDName = getClassName(RD);

-  llvm::DIScope *RDContext = getDeclContextDescriptor(RD);
+  llvm::DIScope *RDContext = getDeclarationLexicalScope(*RD, QualType(Ty, 0));

  // If we ended up creating the type during the context chain construction,
  // just return that.
@@ -2536,8 +2556,15 @@ void CGDebugInfo::collectVarDeclProps(co
  if (DC->isRecord())
DC = CGM.getContext().getTranslationUnitDecl

RE: r268055 - Recommitted r264281 "Supporting all entities declared in lexical scope in LLVM debug info."

2016-04-29 Thread Aboud, Amjad via cfe-commits
I could not reproduce the issue.
This error appeared before and it always meant that LLVM and Clang were not 
aligned.
You need both revisions to work correctly: (LLVM) 268054, (Clang) 268055

Please, let me know if you can reproduce the issue locally using these versions.

Regards,
Amjad

> -Original Message-
> From: Rafael Espíndola [mailto:rafael.espind...@gmail.com]
> Sent: Friday, April 29, 2016 22:42
> To: Aboud, Amjad 
> Cc: cfe-commits cfe 
> Subject: Re: r268055 - Recommitted r264281 "Supporting all entities declared 
> in
> lexical scope in LLVM debug info."
> 
> Maybe this is the cause of this bootstrap failure:
> http://lab.llvm.org:8080/green/job/llvm-stage2-cmake-RgLTO_build/6843
> ?
> 
> Cheers,
> Rafael
> 
> 
> On 29 April 2016 at 12:08, Amjad Aboud via cfe-commits  comm...@lists.llvm.org> wrote:
> > Author: aaboud
> > Date: Fri Apr 29 11:08:08 2016
> > New Revision: 268055
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=268055&view=rev
> > Log:
> > Recommitted r264281 "Supporting all entities declared in lexical scope in 
> > LLVM
> debug info."
> > After fixing PR26942 in r267004.
> >
> > Added:
> > cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp
> > Modified:
> > cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> > cfe/trunk/lib/CodeGen/CGDebugInfo.h
> > cfe/trunk/lib/CodeGen/CGDecl.cpp
> > cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp
> >
> > Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> > URL:
> > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.
> > cpp?rev=268055&r1=268054&r2=268055&view=diff
> >
> =
> =
> > 
> > --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> > +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 29 11:08:08 2016
> > @@ -814,15 +814,18 @@ llvm::DIType *CGDebugInfo::CreateType(co
> >
> >  llvm::DIType *CGDebugInfo::CreateType(const TypedefType *Ty,
> >llvm::DIFile *Unit) {
> > +  TypedefNameDecl *TD = Ty->getDecl();
> >// We don't set size information, but do specify where the typedef was
> >// declared.
> > -  SourceLocation Loc = Ty->getDecl()->getLocation();
> > +  SourceLocation Loc = TD->getLocation();
> > +
> > +  llvm::DIScope *TDContext = getDeclarationLexicalScope(*TD,
> > + QualType(Ty, 0));
> >
> >// Typedefs are derived from some other type.
> >return DBuilder.createTypedef(
> >getOrCreateType(Ty->getDecl()->getUnderlyingType(), Unit),
> >Ty->getDecl()->getName(), getOrCreateFile(Loc), getLineNumber(Loc),
> > -  getDeclContextDescriptor(Ty->getDecl()));
> > +  TDContext);
> >  }
> >
> >  llvm::DIType *CGDebugInfo::CreateType(const FunctionType *Ty, @@
> > -1457,6 +1460,23 @@ llvm::DIType *CGDebugInfo::getOrCreateSt
> >return T;
> >  }
> >
> > +void CGDebugInfo::recordDeclarationLexicalScope(const Decl &D) {
> > +  assert(LexicalBlockMap.find(&D) == LexicalBlockMap.end() &&
> > + "D is already mapped to lexical block scope");
> > +  if (!LexicalBlockStack.empty())
> > +LexicalBlockMap[&D] = LexicalBlockStack.back(); }
> > +
> > +llvm::DIScope *CGDebugInfo::getDeclarationLexicalScope(const Decl &D,
> > +   QualType Ty) {
> > +  auto I = LexicalBlockMap.find(&D);
> > +  if (I != LexicalBlockMap.end()) {
> > +RetainedTypes.push_back(Ty.getAsOpaquePtr());
> > +return I->second;
> > +  }
> > +  return getDeclContextDescriptor(cast(&D));
> > +}
> > +
> >  void CGDebugInfo::completeType(const EnumDecl *ED) {
> >if (DebugKind <= codegenoptions::DebugLineTablesOnly)
> >  return;
> > @@ -2060,7 +2080,7 @@ llvm::DIType *CGDebugInfo::CreateEnumTyp
> >  // entered into the ReplaceMap: finalize() will replace the first
> >  // FwdDecl with the second and then replace the second with
> >  // complete type.
> > -llvm::DIScope *EDContext = getDeclContextDescriptor(ED);
> > +llvm::DIScope *EDContext = getDeclarationLexicalScope(*ED,
> > + QualType(Ty, 0));
> >  llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
> >  llvm::TempDIScope
> TmpContext(DBuilder.createReplaceableCompositeType(
> >  llvm::dwarf::DW_TAG_enumeration_type, "", TheCU, DefUnit,
> > 0)); @@ -2104,7 +2124,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDef
> >
> >llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
> >unsigned Line = getLineNumber(ED->getLocation());
> > -  llvm::DIScope *EnumContext = getDeclContextDescriptor(ED);
> > +  llvm::DIScope *EnumContext = getDeclarationLexicalScope(*ED,
> > + QualType(Ty, 0));
> >llvm::DIType *ClassTy =
> >ED->isFixed() ? getOrCreateType(ED->getIntegerType(), DefUnit) : 
> > nullptr;
> >return DBuilder.createEnumerationType(EnumContext, ED->getName(),
> > DefUnit, @@ -2365,7 +2385,7 @@ llvm::DICompositeType
> *CGDebugInfo::Crea
> >unsigned Line = getLineNumber(RD->getLocation());
> >StringRe

RE: r264281 - Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug info."

2016-03-24 Thread Aboud, Amjad via cfe-commits
I believe it is safe to disable the assertion.
I added this assertion...I am trying to figure out why we are hitting it.

I am not convinced that we should do a total revert.

Regards,
Amjad

From: Alexey Samsonov [mailto:vonos...@gmail.com]
Sent: Thursday, March 24, 2016 22:27
To: Aboud, Amjad 
Cc: cfe-commits 
Subject: Re: r264281 - Recommitted r263425 "Supporting all entities declared in 
lexical scope in LLVM debug info."

Heads-up: I see segmentation faults in Clang following this revision. I will 
try to come up with a standalone reproducer and update 
https://llvm.org/bugs/show_bug.cgi?id=26942, possibly reverting this change.

On Thu, Mar 24, 2016 at 6:30 AM, Amjad Aboud via cfe-commits 
mailto:cfe-commits@lists.llvm.org>> wrote:
Author: aaboud
Date: Thu Mar 24 08:30:41 2016
New Revision: 264281

URL: http://llvm.org/viewvc/llvm-project?rev=264281&view=rev
Log:
Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM 
debug info."
After fixing PR26942 (the fix is included in this commit).

Differential Revision: http://reviews.llvm.org/D18350

Added:
cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp
  - copied unchanged from r263435, 
cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.h
cfe/trunk/lib/CodeGen/CGDecl.cpp
cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=264281&r1=264280&r2=264281&view=diff
==
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Mar 24 08:30:41 2016
@@ -831,15 +831,18 @@ llvm::DIType *CGDebugInfo::CreateType(co

 llvm::DIType *CGDebugInfo::CreateType(const TypedefType *Ty,
   llvm::DIFile *Unit) {
+  TypedefNameDecl *TD = Ty->getDecl();
   // We don't set size information, but do specify where the typedef was
   // declared.
-  SourceLocation Loc = Ty->getDecl()->getLocation();
+  SourceLocation Loc = TD->getLocation();
+
+  llvm::DIScope *TDContext = getDeclarationLexicalScope(*TD, QualType(Ty, 0));

   // Typedefs are derived from some other type.
   return DBuilder.createTypedef(
   getOrCreateType(Ty->getDecl()->getUnderlyingType(), Unit),
   Ty->getDecl()->getName(), getOrCreateFile(Loc), getLineNumber(Loc),
-  getDeclContextDescriptor(Ty->getDecl()));
+  TDContext);
 }

 llvm::DIType *CGDebugInfo::CreateType(const FunctionType *Ty,
@@ -1472,6 +1475,23 @@ llvm::DIType *CGDebugInfo::getOrCreateSt
   return T;
 }

+void CGDebugInfo::recordDeclarationLexicalScope(const Decl &D) {
+  assert(LexicalBlockMap.find(&D) == LexicalBlockMap.end() &&
+ "D is already mapped to lexical block scope");
+  if (!LexicalBlockStack.empty())
+LexicalBlockMap[&D] = LexicalBlockStack.back();
+}
+
+llvm::DIScope *CGDebugInfo::getDeclarationLexicalScope(const Decl &D,
+   QualType Ty) {
+  auto I = LexicalBlockMap.find(&D);
+  if (I != LexicalBlockMap.end()) {
+RetainedTypes.push_back(Ty.getAsOpaquePtr());
+return I->second;
+  }
+  return getDeclContextDescriptor(cast(&D));
+}
+
 void CGDebugInfo::completeType(const EnumDecl *ED) {
   if (DebugKind <= codegenoptions::DebugLineTablesOnly)
 return;
@@ -2057,7 +2077,7 @@ llvm::DIType *CGDebugInfo::CreateEnumTyp
 // entered into the ReplaceMap: finalize() will replace the first
 // FwdDecl with the second and then replace the second with
 // complete type.
-llvm::DIScope *EDContext = getDeclContextDescriptor(ED);
+llvm::DIScope *EDContext = getDeclarationLexicalScope(*ED, QualType(Ty, 
0));
 llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
 llvm::TempDIScope TmpContext(DBuilder.createReplaceableCompositeType(
 llvm::dwarf::DW_TAG_enumeration_type, "", TheCU, DefUnit, 0));
@@ -2101,7 +2121,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDef

   llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
   unsigned Line = getLineNumber(ED->getLocation());
-  llvm::DIScope *EnumContext = getDeclContextDescriptor(ED);
+  llvm::DIScope *EnumContext = getDeclarationLexicalScope(*ED, QualType(Ty, 
0));
   llvm::DIType *ClassTy =
   ED->isFixed() ? getOrCreateType(ED->getIntegerType(), DefUnit) : nullptr;
   return DBuilder.createEnumerationType(EnumContext, ED->getName(), DefUnit,
@@ -2362,7 +2382,7 @@ llvm::DICompositeType *CGDebugInfo::Crea
   unsigned Line = getLineNumber(RD->getLocation());
   StringRef RDName = getClassName(RD);

-  llvm::DIScope *RDContext = getDeclContextDescriptor(RD);
+  llvm::DIScope *RDContext = getDeclarationLexicalScope(*RD, QualType(Ty, 0));

   // If we ended up creating the type during the context chain construction,
   // just return that.
@@ -2509,8 +2529,15 @@ void CGDebu

RE: r264281 - Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug info."

2016-03-24 Thread Aboud, Amjad via cfe-commits
Hi Alexey,
It will help to have a reproducer that fail without assertions.
If I remove the assertion, the test failed in clang self-build will pass.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/11281

Thanks,
Amjad

From: Alexey Samsonov [mailto:vonos...@gmail.com]
Sent: Thursday, March 24, 2016 22:46
To: Aboud, Amjad 
Cc: cfe-commits 
Subject: Re: r264281 - Recommitted r263425 "Supporting all entities declared in 
lexical scope in LLVM debug info."

I've been using no-asserts build, and it led to segfault, so probably it was 
required. I see that Reid already proceeded with the revert. I will still work 
on a reproducer.

On Thu, Mar 24, 2016 at 1:43 PM, Aboud, Amjad 
mailto:amjad.ab...@intel.com>> wrote:
I believe it is safe to disable the assertion.
I added this assertion...I am trying to figure out why we are hitting it.

I am not convinced that we should do a total revert.

Regards,
Amjad

From: Alexey Samsonov [mailto:vonos...@gmail.com]
Sent: Thursday, March 24, 2016 22:27
To: Aboud, Amjad mailto:amjad.ab...@intel.com>>
Cc: cfe-commits mailto:cfe-commits@lists.llvm.org>>
Subject: Re: r264281 - Recommitted r263425 "Supporting all entities declared in 
lexical scope in LLVM debug info."

Heads-up: I see segmentation faults in Clang following this revision. I will 
try to come up with a standalone reproducer and update 
https://llvm.org/bugs/show_bug.cgi?id=26942, possibly reverting this change.

On Thu, Mar 24, 2016 at 6:30 AM, Amjad Aboud via cfe-commits 
mailto:cfe-commits@lists.llvm.org>> wrote:
Author: aaboud
Date: Thu Mar 24 08:30:41 2016
New Revision: 264281

URL: http://llvm.org/viewvc/llvm-project?rev=264281&view=rev
Log:
Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM 
debug info."
After fixing PR26942 (the fix is included in this commit).

Differential Revision: http://reviews.llvm.org/D18350

Added:
cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp
  - copied unchanged from r263435, 
cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
cfe/trunk/lib/CodeGen/CGDebugInfo.h
cfe/trunk/lib/CodeGen/CGDecl.cpp
cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=264281&r1=264280&r2=264281&view=diff
==
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Mar 24 08:30:41 2016
@@ -831,15 +831,18 @@ llvm::DIType *CGDebugInfo::CreateType(co

 llvm::DIType *CGDebugInfo::CreateType(const TypedefType *Ty,
   llvm::DIFile *Unit) {
+  TypedefNameDecl *TD = Ty->getDecl();
   // We don't set size information, but do specify where the typedef was
   // declared.
-  SourceLocation Loc = Ty->getDecl()->getLocation();
+  SourceLocation Loc = TD->getLocation();
+
+  llvm::DIScope *TDContext = getDeclarationLexicalScope(*TD, QualType(Ty, 0));

   // Typedefs are derived from some other type.
   return DBuilder.createTypedef(
   getOrCreateType(Ty->getDecl()->getUnderlyingType(), Unit),
   Ty->getDecl()->getName(), getOrCreateFile(Loc), getLineNumber(Loc),
-  getDeclContextDescriptor(Ty->getDecl()));
+  TDContext);
 }

 llvm::DIType *CGDebugInfo::CreateType(const FunctionType *Ty,
@@ -1472,6 +1475,23 @@ llvm::DIType *CGDebugInfo::getOrCreateSt
   return T;
 }

+void CGDebugInfo::recordDeclarationLexicalScope(const Decl &D) {
+  assert(LexicalBlockMap.find(&D) == LexicalBlockMap.end() &&
+ "D is already mapped to lexical block scope");
+  if (!LexicalBlockStack.empty())
+LexicalBlockMap[&D] = LexicalBlockStack.back();
+}
+
+llvm::DIScope *CGDebugInfo::getDeclarationLexicalScope(const Decl &D,
+   QualType Ty) {
+  auto I = LexicalBlockMap.find(&D);
+  if (I != LexicalBlockMap.end()) {
+RetainedTypes.push_back(Ty.getAsOpaquePtr());
+return I->second;
+  }
+  return getDeclContextDescriptor(cast(&D));
+}
+
 void CGDebugInfo::completeType(const EnumDecl *ED) {
   if (DebugKind <= codegenoptions::DebugLineTablesOnly)
 return;
@@ -2057,7 +2077,7 @@ llvm::DIType *CGDebugInfo::CreateEnumTyp
 // entered into the ReplaceMap: finalize() will replace the first
 // FwdDecl with the second and then replace the second with
 // complete type.
-llvm::DIScope *EDContext = getDeclContextDescriptor(ED);
+llvm::DIScope *EDContext = getDeclarationLexicalScope(*ED, QualType(Ty, 
0));
 llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());
 llvm::TempDIScope TmpContext(DBuilder.createReplaceableCompositeType(
 llvm::dwarf::DW_TAG_enumeration_type, "", TheCU, DefUnit, 0));
@@ -2101,7 +2121,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDef

   llvm::DIFile *DefUnit = getOrCreateFile(

Proposing a fix for revision 256933

2016-01-07 Thread Aboud, Amjad via cfe-commits
Hi Samuel,
I noticed that the two tests you added in the below commit have a minor issue.
"target_codegen_registration_naming.cpp" is failing on my local machine (Win32).
"target_codegen_registration.cpp" is not failing, but it contain "CHECK..." 
lines with wrong syntax that make FileCheck ignore them.

Please, see the attach patch I suggest for fixing these test.

Thanks,
Amjad


Author: sfantao

Date: Wed Jan  6 07:42:12 2016

New Revision: 256933



URL: http://llvm.org/viewvc/llvm-project?rev=256933&view=rev

Log:

[OpenMP] Reapply rL256842: [OpenMP] Offloading descriptor registration and 
device codegen.



This patch attempts to fix the regressions identified when the patch was 
committed initially.



Thanks to Michael Liao for identifying the fix in the offloading metadata 
generation

related with side effects in evaluation of function arguments.





Added:

cfe/trunk/test/OpenMP/target_codegen_registration.cpp

cfe/trunk/test/OpenMP/target_codegen_registration_naming.cpp

Modified:

cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td

cfe/trunk/include/clang/Basic/LangOptions.def

cfe/trunk/include/clang/Basic/LangOptions.h

cfe/trunk/include/clang/Driver/CC1Options.td

cfe/trunk/include/clang/Driver/Options.td

cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp

cfe/trunk/lib/CodeGen/CGOpenMPRuntime.h

cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp

cfe/trunk/lib/CodeGen/CodeGenModule.cpp

cfe/trunk/lib/Frontend/CompilerInvocation.cpp

cfe/trunk/lib/Serialization/ASTReader.cpp

cfe/trunk/lib/Serialization/ASTWriter.cpp

cfe/trunk/test/OpenMP/target_codegen.cpp

cfe/trunk/test/OpenMP/target_codegen_global_capture.cpp

cfe/trunk/test/OpenMP/target_map_codegen.cpp

cfe/trunk/test/OpenMP/target_messages.cpp

-
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


r256933-Fix.patch
Description: r256933-Fix.patch
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits