<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks David for taking care of this one.<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></a></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> David Blaikie [mailto:dblaikie@gmail.com]
<br>
<b>Sent:</b> Monday, March 14, 2016 00:38<br>
<b>To:</b> Mehdi Amini <mehdi.amini@apple.com><br>
<b>Cc:</b> Aboud, Amjad <amjad.aboud@intel.com>; llvm-commits <llvm-commits@lists.llvm.org><br>
<b>Subject:</b> Re: [llvm] r263379 - Fixed DIBuilder to verify that same imported entity will not be added twice to the "imports" list of the DICompileUnit.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Done in r<span style="font-family:"Courier New""> 263396</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Sun, Mar 13, 2016 at 2:48 PM, Mehdi Amini via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hi Amjad,<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
> On Mar 13, 2016, at 4:11 AM, Amjad Aboud via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Author: aaboud<br>
> Date: Sun Mar 13 06:11:39 2016<br>
> New Revision: 263379<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=263379&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=263379&view=rev</a><br>
> Log:<br>
> Fixed DIBuilder to verify that same imported entity will not be added twice to the "imports" list of the DICompileUnit.<br>
><br>
> Differential Revision: <a href="http://reviews.llvm.org/D17884" target="_blank">
http://reviews.llvm.org/D17884</a><br>
><br>
> Modified:<br>
>    llvm/trunk/lib/IR/DIBuilder.cpp<br>
>    llvm/trunk/unittests/IR/IRBuilderTest.cpp<br>
><br>
> Modified: llvm/trunk/lib/IR/DIBuilder.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=263379&r1=263378&r2=263379&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=263379&r1=263378&r2=263379&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/IR/DIBuilder.cpp (original)<br>
> +++ llvm/trunk/lib/IR/DIBuilder.cpp Sun Mar 13 06:11:39 2016<br>
> @@ -19,6 +19,7 @@<br>
> #include "llvm/IR/Module.h"<br>
> #include "llvm/Support/Debug.h"<br>
> #include "llvm/Support/Dwarf.h"<br>
> +#include "LLVMContextImpl.h"<br>
><br>
> using namespace llvm;<br>
> using namespace llvm::dwarf;<br>
> @@ -168,8 +169,12 @@ static DIImportedEntity *<br>
> createImportedModule(LLVMContext &C, dwarf::Tag Tag, DIScope *Context,<br>
>                      Metadata *NS, unsigned Line, StringRef Name,<br>
>                      SmallVectorImpl<TrackingMDNodeRef> &AllImportedModules) {<br>
> +  unsigned EntitiesCount = C.pImpl->DIImportedEntitys.size();<br>
>   auto *M = DIImportedEntity::get(C, Tag, Context, DINodeRef(NS), Line, Name);<br>
> -  AllImportedModules.emplace_back(M);<br>
> +  if (EntitiesCount < C.pImpl->DIImportedEntitys.size())<br>
> +    // A new Imported Entity was just added to the context.<br>
> +    // Add it to the Imported Modules list.<br>
> +    AllImportedModules.emplace_back(M);<br>
>   return M;<br>
> }<br>
><br>
><br>
> Modified: llvm/trunk/unittests/IR/IRBuilderTest.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/IRBuilderTest.cpp?rev=263379&r1=263378&r2=263379&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/IRBuilderTest.cpp?rev=263379&r1=263378&r2=263379&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/unittests/IR/IRBuilderTest.cpp (original)<br>
> +++ llvm/trunk/unittests/IR/IRBuilderTest.cpp Sun Mar 13 06:11:39 2016<br>
> @@ -418,4 +418,19 @@ TEST_F(IRBuilderTest, DebugLoc) {<br>
><br>
>   DIB.finalize();<br>
> }<br>
> +<br>
> +TEST_F(IRBuilderTest, DIImportedEntity) {<br>
> +  IRBuilder<> Builder(BB);<br>
> +  DIBuilder DIB(*M);<br>
> +  auto File = DIB.createFile("F.CBL", "/");<br>
> +  auto CU = DIB.createCompileUnit(dwarf::DW_LANG_Cobol74, "F.CBL", "/",<br>
> +    "llvm-cobol74", true, "", 0);<br>
> +  auto IE1 = DIB.createImportedDeclaration(CU, nullptr, 1);<br>
> +  auto IE2 = DIB.createImportedDeclaration(CU, nullptr, 1);<br>
> +  auto IE3 = DIB.createImportedModule(CU, (DIImportedEntity*)nullptr, 2);<br>
> +  auto IE4 = DIB.createImportedModule(CU, (DIImportedEntity*)nullptr, 2);<br>
<br>
<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">This triggers many warnings for unused variables, can you fix it please?<br>
<br>
Thanks,<br>
<br>
Mehdi<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
<br>
> +  DIB.finalize();<br>
> +  EXPECT_TRUE(verifyModule(*M));<br>
> +  EXPECT_TRUE(CU->getImportedEntities().size() == 2);<br>
> +}<br>
> }<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<p>---------------------------------------------------------------------<br>
Intel Israel (74) Limited</p>

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