<div dir="ltr">Anyway the best way to disable this behaviour is to comment "Loc.isImplicitCode()" in lib/Transform/Instrumentation/GCOVProfiling.cpp.<br></div><br><div class="gmail_quote"><div dir="ltr">Le lun. 24 sept. 2018 à 19:47, Calixte Denizet <<a href="mailto:cdenizet@mozilla.com">cdenizet@mozilla.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>The idea behind this change was to have the same behaviour as gcc.</div><div>With g++-8 I got for example:</div><div>Creating 'a.c.gcov'<br><br> -: 0:Source:a.c<br> -: 0:Graph:a.gcno<br> -: 0:Data:a.gcda<br> -: 0:Runs:1<br> -: 0:Programs:1<br> -: 1:struct A {<br> -: 2:<br> -: 3: A() {}<br> -: 4: ~A() {}<br> -: 5:};<br> -: 6:<br>function _Z3fooi called 0 returned 0% blocks executed 0%<br> #####: 7:void foo(int K) {}<br> -: 8:<br>function main called 1 returned 100% blocks executed 100%<br> 1: 9:int main() {<br> 2: 10: A a;<br> 1: 11: static int toto[12];<br> 1: 12: int x = 1;<br> 1: 13: foo(x);<br> 1: 14: x = x + 2;<br> -: 15:<br> 1: 16: return x;<br> -: 17:}<br></div><div><br></div><div>and with clang 7:</div><div>a.c:creating 'a.c.gcov'<br><br> -: 0:Source:a.c<br> -: 0:Graph:a.gcno<br> -: 0:Data:a.gcda<br> -: 0:Runs:1<br> -: 0:Programs:1<br> -: 1:struct A {<br> -: 2:<br> 2: 3: A() {}<br> 2: 4: ~A() {}<br> -: 5:};<br> -: 6:<br> 2: 7:void foo(int K) {}<br> -: 8:<br> -: 9:int main() {<br> 2: 10: A a;<br> -: 11: static int toto[12];<br> -: 12: int x = 1;<br> 1: 13: foo(x);<br> -: 14: x = x + 2;<br> -: 15:<br> -: 16: return x;<br> 1: 17:}<br></div><div><br></div><div>I'm ok to put that behind an option, what could be a good name ?<br></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">Le lun. 24 sept. 2018 à 19:39, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Calixte,<div><br></div><div>I still think this should be controlled by an option and not default. I appreciate you trying to fix it forward, but this seems to be a change that should have been discussed. I'm not sure who the other reviewer is, but given I don't recognize them they probably shouldn't be approving changes to this area of clang either.</div><div><br></div><div>Thanks!</div><div><br></div><div>-eric</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 24, 2018 at 10:37 AM Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Agreed on the default behavior change for sure. I think we can fix DILocation forward for my API request, but I'm going to revert the Clang patch for now since it changes defaults in a way that it's unclear we want. I also talked to Reid offline about reverting.<div><br></div><div>Let's continue the discussion for sure though.</div><div><br></div><div>Thanks!</div></div><div dir="ltr"><div><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 24, 2018 at 10:23 AM Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Regarding the API, an enum would be fine for readability. It can still have a default argument.<div><br></div><div>Regarding the functionality, this seems like something it would be worth having a clang argument for. I can think of many use cases that want to know about coverage of implicitly generated code. In fact, the old behavior should probably remain the default.</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Sep 24, 2018 at 10:01 AM Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">From taking a look at the changes in <a href="https://reviews.llvm.org/rL342718" target="_blank">https://reviews.llvm.org/rL342718</a> I have some concerns about this patch.<div><br></div><div>(Besides the fact that I'm also not a fan of the new boolean argument to DILocation - at a minimum that should be an enum)</div><div><br></div><div>One of the changes from that patch has:</div><div><br></div><div><span style="font-family:Menlo,Consolas,Monaco,monospace;font-size:11px;white-space:pre-wrap;background-color:rgba(251,175,175,0.3)">// CHECK-NEXT: </span><span class="m_3855234075428585866m_-8045966659396336364m_2835124160478852291m_1656858245497129894m_-9170494309174779947inbox-inbox-bright" style="display:inline;word-break:break-all;background:rgba(251,175,175,0.7);font-family:Menlo,Consolas,Monaco,monospace;font-size:11px;white-space:pre-wrap">1</span><span style="font-family:Menlo,Consolas,Monaco,monospace;font-size:11px;white-space:pre-wrap;background-color:rgba(251,175,175,0.3)">: 1:void func(int K) {}</span><br></div><div><br></div><div>to</div><div><br></div><div><span style="font-family:Menlo,Consolas,Monaco,monospace;font-size:11px;white-space:pre-wrap;background-color:rgba(151,234,151,0.3)">// CHECK-NEXT: </span><span class="m_3855234075428585866m_-8045966659396336364m_2835124160478852291m_1656858245497129894m_-9170494309174779947inbox-inbox-bright" style="display:inline;word-break:break-all;background:rgba(151,234,151,0.6);font-family:Menlo,Consolas,Monaco,monospace;font-size:11px;white-space:pre-wrap">-</span><span style="font-family:Menlo,Consolas,Monaco,monospace;font-size:11px;white-space:pre-wrap;background-color:rgba(151,234,151,0.3)">: 1:void func(int K) {}</span><br></div><div><br></div><div>even though func is still being called - but with no code executed. The brace location does provide the knowledge that a function isn't unused which we lose as part of this work.</div><div><br></div><div>Thoughts from others?</div><div><br></div><div>Thanks!</div><div><br></div><div>-eric</div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 20, 2018 at 1:54 AM Calixte Denizet via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: calixte<br>
Date: Thu Sep 20 01:53:06 2018<br>
New Revision: 342631<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=342631&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=342631&view=rev</a><br>
Log:<br>
[IR] Add a boolean field in DILocation to know if a line must covered or not<br>
<br>
Summary:<br>
Some lines have a hit counter where they should not have one.<br>
For example, in C++, some cleanup is adding at the end of a scope represented by a '}'.<br>
So such a line has a hit counter where a user expects to not have one.<br>
The goal of the patch is to add this information in DILocation which is used to get the covered lines in GCOVProfiling.cpp.<br>
A following patch in clang will add this information when generating IR (<a href="https://reviews.llvm.org/D49916" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49916</a>).<br>
<br>
Reviewers: marco-c, davidxl, vsk, javed.absar, rnk<br>
<br>
Reviewed By: rnk<br>
<br>
Subscribers: eraman, xur, danielcdh, aprantl, rnk, dblaikie, #debug-info, vsk, llvm-commits, sylvestre.ledru<br>
<br>
Tags: #debug-info<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D49915" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49915</a><br>
<br>
Added:<br>
llvm/trunk/test/Bitcode/DILocation-implicit-code.ll<br>
llvm/trunk/test/Bitcode/DILocation-implicit-code.ll.bc<br>
Modified:<br>
llvm/trunk/docs/SourceLevelDebugging.rst<br>
llvm/trunk/include/llvm/IR/DebugInfoMetadata.h<br>
llvm/trunk/include/llvm/IR/DebugLoc.h<br>
llvm/trunk/include/llvm/IR/Metadata.h<br>
llvm/trunk/lib/AsmParser/LLParser.cpp<br>
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp<br>
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp<br>
llvm/trunk/lib/IR/AsmWriter.cpp<br>
llvm/trunk/lib/IR/DebugInfoMetadata.cpp<br>
llvm/trunk/lib/IR/DebugLoc.cpp<br>
llvm/trunk/lib/IR/LLVMContextImpl.h<br>
llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp<br>
llvm/trunk/test/Assembler/dilocation.ll<br>
<br>
Modified: llvm/trunk/docs/SourceLevelDebugging.rst<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SourceLevelDebugging.rst?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SourceLevelDebugging.rst?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/docs/SourceLevelDebugging.rst (original)<br>
+++ llvm/trunk/docs/SourceLevelDebugging.rst Thu Sep 20 01:53:06 2018<br>
@@ -429,8 +429,23 @@ instruction. One can extract line numbe<br>
unsigned Line = Loc->getLine();<br>
StringRef File = Loc->getFilename();<br>
StringRef Dir = Loc->getDirectory();<br>
+ bool ImplicitCode = Loc->isImplicitCode();<br>
}<br>
<br>
+When the flag ImplicitCode is true then it means that the Instruction has been<br>
+added by the front-end but doesn't correspond to source code written by the user. For example<br>
+<br>
+.. code-block:: c++<br>
+<br>
+ if (MyBoolean) {<br>
+ MyObject MO;<br>
+ ...<br>
+ }<br>
+<br>
+At the end of the scope the MyObject's destructor is called but it isn't written<br>
+explicitly. This information is useful to avoid to have counters on brackets when<br>
+making code coverage.<br>
+<br>
C/C++ global variable information<br>
---------------------------------<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)<br>
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Thu Sep 20 01:53:06 2018<br>
@@ -1396,19 +1396,20 @@ class DILocation : public MDNode {<br>
friend class MDNode;<br>
<br>
DILocation(LLVMContext &C, StorageType Storage, unsigned Line,<br>
- unsigned Column, ArrayRef<Metadata *> MDs);<br>
+ unsigned Column, ArrayRef<Metadata *> MDs, bool ImplicitCode);<br>
~DILocation() { dropAllReferences(); }<br>
<br>
static DILocation *getImpl(LLVMContext &Context, unsigned Line,<br>
unsigned Column, Metadata *Scope,<br>
- Metadata *InlinedAt, StorageType Storage,<br>
- bool ShouldCreate = true);<br>
+ Metadata *InlinedAt, bool ImplicitCode,<br>
+ StorageType Storage, bool ShouldCreate = true);<br>
static DILocation *getImpl(LLVMContext &Context, unsigned Line,<br>
unsigned Column, DILocalScope *Scope,<br>
- DILocation *InlinedAt, StorageType Storage,<br>
- bool ShouldCreate = true) {<br>
+ DILocation *InlinedAt, bool ImplicitCode,<br>
+ StorageType Storage, bool ShouldCreate = true) {<br>
return getImpl(Context, Line, Column, static_cast<Metadata *>(Scope),<br>
- static_cast<Metadata *>(InlinedAt), Storage, ShouldCreate);<br>
+ static_cast<Metadata *>(InlinedAt), ImplicitCode, Storage,<br>
+ ShouldCreate);<br>
}<br>
<br>
/// With a given unsigned int \p U, use up to 13 bits to represent it.<br>
@@ -1437,7 +1438,7 @@ class DILocation : public MDNode {<br>
// Get the raw scope/inlinedAt since it is possible to invoke this on<br>
// a DILocation containing temporary metadata.<br>
return getTemporary(getContext(), getLine(), getColumn(), getRawScope(),<br>
- getRawInlinedAt());<br>
+ getRawInlinedAt(), isImplicitCode());<br>
}<br>
<br>
public:<br>
@@ -1446,12 +1447,13 @@ public:<br>
<br>
DEFINE_MDNODE_GET(DILocation,<br>
(unsigned Line, unsigned Column, Metadata *Scope,<br>
- Metadata *InlinedAt = nullptr),<br>
- (Line, Column, Scope, InlinedAt))<br>
+ Metadata *InlinedAt = nullptr, bool ImplicitCode = false),<br>
+ (Line, Column, Scope, InlinedAt, ImplicitCode))<br>
DEFINE_MDNODE_GET(DILocation,<br>
(unsigned Line, unsigned Column, DILocalScope *Scope,<br>
- DILocation *InlinedAt = nullptr),<br>
- (Line, Column, Scope, InlinedAt))<br>
+ DILocation *InlinedAt = nullptr,<br>
+ bool ImplicitCode = false),<br>
+ (Line, Column, Scope, InlinedAt, ImplicitCode))<br>
<br>
/// Return a (temporary) clone of this.<br>
TempDILocation clone() const { return cloneImpl(); }<br>
@@ -1464,6 +1466,15 @@ public:<br>
return cast_or_null<DILocation>(getRawInlinedAt());<br>
}<br>
<br>
+ /// Check if the location corresponds to an implicit code.<br>
+ /// When the ImplicitCode flag is true, it means that the Instruction<br>
+ /// with this DILocation has been added by the front-end but it hasn't been<br>
+ /// written explicitly by the user (e.g. cleanup stuff in C++ put on a closing<br>
+ /// bracket). It's useful for code coverage to not show a counter on "empty"<br>
+ /// lines.<br>
+ bool isImplicitCode() const { return ImplicitCode; }<br>
+ void setImplicitCode(bool ImplicitCode) { this->ImplicitCode = ImplicitCode; }<br>
+<br>
DIFile *getFile() const { return getScope()->getFile(); }<br>
StringRef getFilename() const { return getScope()->getFilename(); }<br>
StringRef getDirectory() const { return getScope()->getDirectory(); }<br>
<br>
Modified: llvm/trunk/include/llvm/IR/DebugLoc.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugLoc.h?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugLoc.h?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/DebugLoc.h (original)<br>
+++ llvm/trunk/include/llvm/IR/DebugLoc.h Thu Sep 20 01:53:06 2018<br>
@@ -78,7 +78,8 @@ namespace llvm {<br>
///<br>
/// FIXME: Remove this. Users should use DILocation::get().<br>
static DebugLoc get(unsigned Line, unsigned Col, const MDNode *Scope,<br>
- const MDNode *InlinedAt = nullptr);<br>
+ const MDNode *InlinedAt = nullptr,<br>
+ bool ImplicitCode = false);<br>
<br>
enum { ReplaceLastInlinedAt = true };<br>
/// Rebuild the entire inlined-at chain for this instruction so that the top of<br>
@@ -112,6 +113,10 @@ namespace llvm {<br>
/// Return \c this as a bar \a MDNode.<br>
MDNode *getAsMDNode() const { return Loc; }<br>
<br>
+ /// Check if the DebugLoc corresponds to an implicit code.<br>
+ bool isImplicitCode() const;<br>
+ void setImplicitCode(bool ImplicitCode);<br>
+<br>
bool operator==(const DebugLoc &DL) const { return Loc == DL.Loc; }<br>
bool operator!=(const DebugLoc &DL) const { return Loc != DL.Loc; }<br>
<br>
<br>
Modified: llvm/trunk/include/llvm/IR/Metadata.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.h?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.h?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/IR/Metadata.h (original)<br>
+++ llvm/trunk/include/llvm/IR/Metadata.h Thu Sep 20 01:53:06 2018<br>
@@ -66,9 +66,11 @@ protected:<br>
enum StorageType { Uniqued, Distinct, Temporary };<br>
<br>
/// Storage flag for non-uniqued, otherwise unowned, metadata.<br>
- unsigned char Storage;<br>
+ unsigned char Storage : 7;<br>
// TODO: expose remaining bits to subclasses.<br>
<br>
+ unsigned char ImplicitCode : 1;<br>
+<br>
unsigned short SubclassData16 = 0;<br>
unsigned SubclassData32 = 0;<br>
<br>
@@ -80,7 +82,7 @@ public:<br>
<br>
protected:<br>
Metadata(unsigned ID, StorageType Storage)<br>
- : SubclassID(ID), Storage(Storage) {<br>
+ : SubclassID(ID), Storage(Storage), ImplicitCode(false) {<br>
static_assert(sizeof(*this) == 8, "Metadata fields poorly packed");<br>
}<br>
<br>
<br>
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)<br>
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Thu Sep 20 01:53:06 2018<br>
@@ -4228,18 +4228,21 @@ bool LLParser::ParseSpecializedMDNode(MD<br>
(IsDistinct ? CLASS::getDistinct ARGS : CLASS::get ARGS)<br>
<br>
/// ParseDILocationFields:<br>
-/// ::= !DILocation(line: 43, column: 8, scope: !5, inlinedAt: !6)<br>
+/// ::= !DILocation(line: 43, column: 8, scope: !5, inlinedAt: !6,<br>
+/// isImplicitCode: true)<br>
bool LLParser::ParseDILocation(MDNode *&Result, bool IsDistinct) {<br>
#define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \<br>
OPTIONAL(line, LineField, ); \<br>
OPTIONAL(column, ColumnField, ); \<br>
REQUIRED(scope, MDField, (/* AllowNull */ false)); \<br>
- OPTIONAL(inlinedAt, MDField, );<br>
+ OPTIONAL(inlinedAt, MDField, ); \<br>
+ OPTIONAL(isImplicitCode, MDBoolField, (false));<br>
PARSE_MD_FIELDS();<br>
#undef VISIT_MD_FIELDS<br>
<br>
- Result = GET_OR_DISTINCT(<br>
- DILocation, (Context, line.Val, column.Val, scope.Val, inlinedAt.Val));<br>
+ Result =<br>
+ GET_OR_DISTINCT(DILocation, (Context, line.Val, column.Val, scope.Val,<br>
+ inlinedAt.Val, isImplicitCode.Val));<br>
return false;<br>
}<br>
<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Thu Sep 20 01:53:06 2018<br>
@@ -3516,6 +3516,7 @@ Error BitcodeReader::parseFunctionBody(F<br>
<br>
unsigned Line = Record[0], Col = Record[1];<br>
unsigned ScopeID = Record[2], IAID = Record[3];<br>
+ bool isImplicitCode = Record.size() == 5 && Record[4];<br>
<br>
MDNode *Scope = nullptr, *IA = nullptr;<br>
if (ScopeID) {<br>
@@ -3528,7 +3529,7 @@ Error BitcodeReader::parseFunctionBody(F<br>
if (!IA)<br>
return error("Invalid record");<br>
}<br>
- LastLoc = DebugLoc::get(Line, Col, Scope, IA);<br>
+ LastLoc = DebugLoc::get(Line, Col, Scope, IA, isImplicitCode);<br>
I->setDebugLoc(LastLoc);<br>
I = nullptr;<br>
continue;<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp Thu Sep 20 01:53:06 2018<br>
@@ -1139,7 +1139,7 @@ Error MetadataLoader::MetadataLoaderImpl<br>
break;<br>
}<br>
case bitc::METADATA_LOCATION: {<br>
- if (Record.size() != 5)<br>
+ if (Record.size() != 6)<br>
return error("Invalid record");<br>
<br>
IsDistinct = Record[0];<br>
@@ -1147,8 +1147,10 @@ Error MetadataLoader::MetadataLoaderImpl<br>
unsigned Column = Record[2];<br>
Metadata *Scope = getMD(Record[3]);<br>
Metadata *InlinedAt = getMDOrNull(Record[4]);<br>
+ bool ImplicitCode = Record[5];<br>
MetadataList.assignValue(<br>
- GET_OR_DISTINCT(DILocation, (Context, Line, Column, Scope, InlinedAt)),<br>
+ GET_OR_DISTINCT(DILocation, (Context, Line, Column, Scope, InlinedAt,<br>
+ ImplicitCode)),<br>
NextMetadataNo);<br>
NextMetadataNo++;<br>
break;<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Thu Sep 20 01:53:06 2018<br>
@@ -1403,6 +1403,7 @@ unsigned ModuleBitcodeWriter::createDILo<br>
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));<br>
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));<br>
Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));<br>
+ Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1));<br>
return Stream.EmitAbbrev(std::move(Abbv));<br>
}<br>
<br>
@@ -1417,6 +1418,7 @@ void ModuleBitcodeWriter::writeDILocatio<br>
Record.push_back(N->getColumn());<br>
Record.push_back(VE.getMetadataID(N->getScope()));<br>
Record.push_back(VE.getMetadataOrNullID(N->getInlinedAt()));<br>
+ Record.push_back(N->isImplicitCode());<br>
<br>
Stream.EmitRecord(bitc::METADATA_LOCATION, Record, Abbrev);<br>
Record.clear();<br>
@@ -3093,6 +3095,7 @@ void ModuleBitcodeWriter::writeFunction(<br>
Vals.push_back(DL->getColumn());<br>
Vals.push_back(VE.getMetadataOrNullID(DL->getScope()));<br>
Vals.push_back(VE.getMetadataOrNullID(DL->getInlinedAt()));<br>
+ Vals.push_back(DL->isImplicitCode());<br>
Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_LOC, Vals);<br>
Vals.clear();<br>
<br>
<br>
Modified: llvm/trunk/lib/IR/AsmWriter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)<br>
+++ llvm/trunk/lib/IR/AsmWriter.cpp Thu Sep 20 01:53:06 2018<br>
@@ -1754,6 +1754,8 @@ static void writeDILocation(raw_ostream<br>
Printer.printInt("column", DL->getColumn());<br>
Printer.printMetadata("scope", DL->getRawScope(), /* ShouldSkipNull */ false);<br>
Printer.printMetadata("inlinedAt", DL->getRawInlinedAt());<br>
+ Printer.printBool("isImplicitCode", DL->isImplicitCode(),<br>
+ /* Default */ false);<br>
Out << ")";<br>
}<br>
<br>
<br>
Modified: llvm/trunk/lib/IR/DebugInfoMetadata.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfoMetadata.cpp?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfoMetadata.cpp?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/DebugInfoMetadata.cpp (original)<br>
+++ llvm/trunk/lib/IR/DebugInfoMetadata.cpp Thu Sep 20 01:53:06 2018<br>
@@ -23,7 +23,8 @@<br>
using namespace llvm;<br>
<br>
DILocation::DILocation(LLVMContext &C, StorageType Storage, unsigned Line,<br>
- unsigned Column, ArrayRef<Metadata *> MDs)<br>
+ unsigned Column, ArrayRef<Metadata *> MDs,<br>
+ bool ImplicitCode)<br>
: MDNode(C, DILocationKind, Storage, MDs) {<br>
assert((MDs.size() == 1 || MDs.size() == 2) &&<br>
"Expected a scope and optional inlined-at");<br>
@@ -33,6 +34,8 @@ DILocation::DILocation(LLVMContext &C, S<br>
<br>
SubclassData32 = Line;<br>
SubclassData16 = Column;<br>
+<br>
+ setImplicitCode(ImplicitCode);<br>
}<br>
<br>
static void adjustColumn(unsigned &Column) {<br>
@@ -43,15 +46,15 @@ static void adjustColumn(unsigned &Colum<br>
<br>
DILocation *DILocation::getImpl(LLVMContext &Context, unsigned Line,<br>
unsigned Column, Metadata *Scope,<br>
- Metadata *InlinedAt, StorageType Storage,<br>
- bool ShouldCreate) {<br>
+ Metadata *InlinedAt, bool ImplicitCode,<br>
+ StorageType Storage, bool ShouldCreate) {<br>
// Fixup column.<br>
adjustColumn(Column);<br>
<br>
if (Storage == Uniqued) {<br>
- if (auto *N =<br>
- getUniqued(Context.pImpl->DILocations,<br>
- DILocationInfo::KeyTy(Line, Column, Scope, InlinedAt)))<br>
+ if (auto *N = getUniqued(Context.pImpl->DILocations,<br>
+ DILocationInfo::KeyTy(Line, Column, Scope,<br>
+ InlinedAt, ImplicitCode)))<br>
return N;<br>
if (!ShouldCreate)<br>
return nullptr;<br>
@@ -63,8 +66,8 @@ DILocation *DILocation::getImpl(LLVMCont<br>
Ops.push_back(Scope);<br>
if (InlinedAt)<br>
Ops.push_back(InlinedAt);<br>
- return storeImpl(new (Ops.size())<br>
- DILocation(Context, Storage, Line, Column, Ops),<br>
+ return storeImpl(new (Ops.size()) DILocation(Context, Storage, Line, Column,<br>
+ Ops, ImplicitCode),<br>
Storage, Context.pImpl->DILocations);<br>
}<br>
<br>
<br>
Modified: llvm/trunk/lib/IR/DebugLoc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugLoc.cpp?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugLoc.cpp?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/DebugLoc.cpp (original)<br>
+++ llvm/trunk/lib/IR/DebugLoc.cpp Thu Sep 20 01:53:06 2018<br>
@@ -56,15 +56,28 @@ DebugLoc DebugLoc::getFnDebugLoc() const<br>
return DebugLoc();<br>
}<br>
<br>
+bool DebugLoc::isImplicitCode() const {<br>
+ if (DILocation *Loc = get()) {<br>
+ return Loc->isImplicitCode();<br>
+ }<br>
+ return true;<br>
+}<br>
+<br>
+void DebugLoc::setImplicitCode(bool ImplicitCode) {<br>
+ if (DILocation *Loc = get()) {<br>
+ Loc->setImplicitCode(ImplicitCode);<br>
+ }<br>
+}<br>
+<br>
DebugLoc DebugLoc::get(unsigned Line, unsigned Col, const MDNode *Scope,<br>
- const MDNode *InlinedAt) {<br>
+ const MDNode *InlinedAt, bool ImplicitCode) {<br>
// If no scope is available, this is an unknown location.<br>
if (!Scope)<br>
return DebugLoc();<br>
<br>
return DILocation::get(Scope->getContext(), Line, Col,<br>
const_cast<MDNode *>(Scope),<br>
- const_cast<MDNode *>(InlinedAt));<br>
+ const_cast<MDNode *>(InlinedAt), ImplicitCode);<br>
}<br>
<br>
DebugLoc DebugLoc::appendInlinedAt(DebugLoc DL, DILocation *InlinedAt,<br>
<br>
Modified: llvm/trunk/lib/IR/LLVMContextImpl.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContextImpl.h?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContextImpl.h?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/LLVMContextImpl.h (original)<br>
+++ llvm/trunk/lib/IR/LLVMContextImpl.h Thu Sep 20 01:53:06 2018<br>
@@ -280,21 +280,24 @@ template <> struct MDNodeKeyImpl<DILocat<br>
unsigned Column;<br>
Metadata *Scope;<br>
Metadata *InlinedAt;<br>
+ bool ImplicitCode;<br>
<br>
MDNodeKeyImpl(unsigned Line, unsigned Column, Metadata *Scope,<br>
- Metadata *InlinedAt)<br>
- : Line(Line), Column(Column), Scope(Scope), InlinedAt(InlinedAt) {}<br>
+ Metadata *InlinedAt, bool ImplicitCode)<br>
+ : Line(Line), Column(Column), Scope(Scope), InlinedAt(InlinedAt),<br>
+ ImplicitCode(ImplicitCode) {}<br>
MDNodeKeyImpl(const DILocation *L)<br>
: Line(L->getLine()), Column(L->getColumn()), Scope(L->getRawScope()),<br>
- InlinedAt(L->getRawInlinedAt()) {}<br>
+ InlinedAt(L->getRawInlinedAt()), ImplicitCode(L->isImplicitCode()) {}<br>
<br>
bool isKeyOf(const DILocation *RHS) const {<br>
return Line == RHS->getLine() && Column == RHS->getColumn() &&<br>
- Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt();<br>
+ Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt() &&<br>
+ ImplicitCode == RHS->isImplicitCode();<br>
}<br>
<br>
unsigned getHashValue() const {<br>
- return hash_combine(Line, Column, Scope, InlinedAt);<br>
+ return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode);<br>
}<br>
};<br>
<br>
<br>
Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Thu Sep 20 01:53:06 2018<br>
@@ -593,7 +593,8 @@ void GCOVProfiler::emitProfileNotes() {<br>
continue;<br>
<br>
// Artificial lines such as calls to the global constructors.<br>
- if (Loc.getLine() == 0) continue;<br>
+ if (Loc.getLine() == 0 || Loc.isImplicitCode())<br>
+ continue;<br>
<br>
if (Line == Loc.getLine()) continue;<br>
Line = Loc.getLine();<br>
<br>
Modified: llvm/trunk/test/Assembler/dilocation.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/dilocation.ll?rev=342631&r1=342630&r2=342631&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/dilocation.ll?rev=342631&r1=342630&r2=342631&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Assembler/dilocation.ll (original)<br>
+++ llvm/trunk/test/Assembler/dilocation.ll Thu Sep 20 01:53:06 2018<br>
@@ -1,10 +1,10 @@<br>
; RUN: llvm-as < %s | llvm-dis | FileCheck %s<br>
; RUN: verify-uselistorder %s<br>
<br>
-; CHECK: !named = !{!0, !2, !3, !3, !4, !4, !5, !5, !6}<br>
-!named = !{!0, !2, !3, !4, !5, !6, !7, !8, !9}<br>
+; CHECK: !named = !{!0, !2, !3, !3, !4, !4, !5, !5, !6, !7, !8}<br>
+!named = !{!0, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11}<br>
<br>
-!llvm.module.flags = !{!10}<br>
+!llvm.module.flags = !{!12}<br>
!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!1}<br>
<br>
; CHECK: !0 = distinct !DISubprogram(<br>
@@ -32,4 +32,9 @@<br>
; CHECK-NEXT: !6 = !DILocation(line: 4294967295, column: 65535, scope: !0)<br>
!9 = !DILocation(line: 4294967295, column: 65535, scope: !0)<br>
<br>
-!10 = !{i32 2, !"Debug Info Version", i32 3}<br>
+!10 = !DILocation(scope: !0, column: 0, line: 0, isImplicitCode: true)<br>
+!11 = !DILocation(scope: !0, column: 0, line: 1, isImplicitCode: false)<br>
+; CHECK-NEXT: !7 = !DILocation(line: 0, scope: !0, isImplicitCode: true)<br>
+; CHECK-NEXT: !8 = !DILocation(line: 1, scope: !0)<br>
+<br>
+!12 = !{i32 2, !"Debug Info Version", i32 3}<br>
<br>
Added: llvm/trunk/test/Bitcode/DILocation-implicit-code.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/DILocation-implicit-code.ll?rev=342631&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/DILocation-implicit-code.ll?rev=342631&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/Bitcode/DILocation-implicit-code.ll (added)<br>
+++ llvm/trunk/test/Bitcode/DILocation-implicit-code.ll Thu Sep 20 01:53:06 2018<br>
@@ -0,0 +1,190 @@<br>
+; RUN: llvm-dis %s.bc -o - | FileCheck %s<br>
+; ModuleID = 'DILocation-implicit-code.cpp'<br>
+source_filename = "DILocation-implicit-code.cpp"<br>
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"<br>
+target triple = "x86_64-unknown-linux-gnu"<br>
+<br>
+%struct.A = type { i8 }<br>
+<br>
+$_ZN1AC2Ev = comdat any<br>
+<br>
+$_ZN1A3fooEi = comdat any<br>
+<br>
+@_ZTIi = external dso_local constant i8*<br>
+<br>
+; Function Attrs: noinline optnone uwtable<br>
+define dso_local void @_Z5test1v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !7 {<br>
+entry:<br>
+ %retval = alloca %struct.A, align 1<br>
+ %a = alloca %struct.A, align 1<br>
+ %exn.slot = alloca i8*<br>
+ %ehselector.slot = alloca i32<br>
+ %undef.agg.tmp = alloca %struct.A, align 1<br>
+ %e = alloca i32, align 4<br>
+ %undef.agg.tmp3 = alloca %struct.A, align 1<br>
+ call void @_ZN1AC2Ev(%struct.A* %a), !dbg !9<br>
+ invoke void @_ZN1A3fooEi(%struct.A* %a, i32 0)<br>
+ to label %invoke.cont unwind label %lpad, !dbg !10<br>
+<br>
+invoke.cont: ; preds = %entry<br>
+ br label %return, !dbg !11<br>
+<br>
+lpad: ; preds = %entry<br>
+ %0 = landingpad { i8*, i32 }<br>
+ catch i8* bitcast (i8** @_ZTIi to i8*), !dbg !12<br>
+ %1 = extractvalue { i8*, i32 } %0, 0, !dbg !12<br>
+ store i8* %1, i8** %exn.slot, align 8, !dbg !12<br>
+ %2 = extractvalue { i8*, i32 } %0, 1, !dbg !12<br>
+ store i32 %2, i32* %ehselector.slot, align 4, !dbg !12<br>
+ br label %catch.dispatch, !dbg !12<br>
+<br>
+catch.dispatch: ; preds = %lpad<br>
+ %sel = load i32, i32* %ehselector.slot, align 4, !dbg !13<br>
+ %3 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #4, !dbg !13<br>
+ %matches = icmp eq i32 %sel, %3, !dbg !13<br>
+ br i1 %matches, label %catch, label %eh.resume, !dbg !13<br>
+<br>
+catch: ; preds = %catch.dispatch<br>
+ %exn = load i8*, i8** %exn.slot, align 8, !dbg !13<br>
+ %4 = call i8* @__cxa_begin_catch(i8* %exn) #4, !dbg !13<br>
+ %5 = bitcast i8* %4 to i32*, !dbg !13<br>
+ %6 = load i32, i32* %5, align 4, !dbg !13<br>
+ store i32 %6, i32* %e, align 4, !dbg !13<br>
+ %7 = load i32, i32* %e, align 4, !dbg !14<br>
+ invoke void @_ZN1A3fooEi(%struct.A* %a, i32 %7)<br>
+ to label %invoke.cont2 unwind label %lpad1, !dbg !15<br>
+<br>
+invoke.cont2: ; preds = %catch<br>
+ call void @__cxa_end_catch() #4, !dbg !16<br>
+ br label %return<br>
+<br>
+lpad1: ; preds = %catch<br>
+ %8 = landingpad { i8*, i32 }<br>
+ cleanup, !dbg !12<br>
+ %9 = extractvalue { i8*, i32 } %8, 0, !dbg !12<br>
+ store i8* %9, i8** %exn.slot, align 8, !dbg !12<br>
+ %10 = extractvalue { i8*, i32 } %8, 1, !dbg !12<br>
+ store i32 %10, i32* %ehselector.slot, align 4, !dbg !12<br>
+ call void @__cxa_end_catch() #4, !dbg !16<br>
+ br label %eh.resume, !dbg !16<br>
+<br>
+try.cont: ; No predecessors!<br>
+ call void @llvm.trap(), !dbg !16<br>
+ unreachable, !dbg !16<br>
+<br>
+return: ; preds = %invoke.cont2, %invoke.cont<br>
+ ret void, !dbg !12<br>
+<br>
+eh.resume: ; preds = %lpad1, %catch.dispatch<br>
+ %exn4 = load i8*, i8** %exn.slot, align 8, !dbg !13<br>
+ %sel5 = load i32, i32* %ehselector.slot, align 4, !dbg !13<br>
+ %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn4, 0, !dbg !13<br>
+ %lpad.val6 = insertvalue { i8*, i32 } %lpad.val, i32 %sel5, 1, !dbg !13<br>
+ resume { i8*, i32 } %lpad.val6, !dbg !13<br>
+}<br>
+<br>
+; Function Attrs: noinline nounwind optnone uwtable<br>
+define linkonce_odr dso_local void @_ZN1AC2Ev(%struct.A* %this) unnamed_addr #1 comdat align 2 !dbg !17 {<br>
+entry:<br>
+ %this.addr = alloca %struct.A*, align 8<br>
+ store %struct.A* %this, %struct.A** %this.addr, align 8<br>
+ %this1 = load %struct.A*, %struct.A** %this.addr, align 8<br>
+ ret void, !dbg !18<br>
+}<br>
+<br>
+; Function Attrs: noinline optnone uwtable<br>
+define linkonce_odr dso_local void @_ZN1A3fooEi(%struct.A* %this, i32 %i) #0 comdat align 2 !dbg !19 {<br>
+entry:<br>
+ %retval = alloca %struct.A, align 1<br>
+ %this.addr = alloca %struct.A*, align 8<br>
+ %i.addr = alloca i32, align 4<br>
+ store %struct.A* %this, %struct.A** %this.addr, align 8<br>
+ store i32 %i, i32* %i.addr, align 4<br>
+ %this1 = load %struct.A*, %struct.A** %this.addr, align 8<br>
+ %0 = load i32, i32* %i.addr, align 4, !dbg !20<br>
+ %cmp = icmp eq i32 %0, 0, !dbg !21<br>
+ br i1 %cmp, label %if.then, label %if.end, !dbg !20<br>
+<br>
+if.then: ; preds = %entry<br>
+ %exception = call i8* @__cxa_allocate_exception(i64 4) #4, !dbg !22<br>
+ %1 = bitcast i8* %exception to i32*, !dbg !22<br>
+ store i32 1, i32* %1, align 16, !dbg !22<br>
+ call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #5, !dbg !22<br>
+ unreachable, !dbg !22<br>
+<br>
+if.end: ; preds = %entry<br>
+ ret void, !dbg !23<br>
+}<br>
+<br>
+declare dso_local i32 @__gxx_personality_v0(...)<br>
+<br>
+; Function Attrs: nounwind readnone<br>
+declare i32 @llvm.eh.typeid.for(i8*) #2<br>
+<br>
+declare dso_local i8* @__cxa_begin_catch(i8*)<br>
+<br>
+declare dso_local void @__cxa_end_catch()<br>
+<br>
+; Function Attrs: noreturn nounwind<br>
+declare void @llvm.trap() #3<br>
+<br>
+; Function Attrs: noinline optnone uwtable<br>
+define dso_local void @_Z5test2v() #0 !dbg !24 {<br>
+entry:<br>
+ %a = alloca %struct.A, align 1<br>
+ %b = alloca %struct.A, align 1<br>
+ %undef.agg.tmp = alloca %struct.A, align 1<br>
+ call void @_ZN1AC2Ev(%struct.A* %a), !dbg !25<br>
+ call void @_ZN1A3fooEi(%struct.A* %a, i32 1), !dbg !26<br>
+ ret void, !dbg !27<br>
+}<br>
+<br>
+declare dso_local i8* @__cxa_allocate_exception(i64)<br>
+<br>
+declare dso_local void @__cxa_throw(i8*, i8*, i8*)<br>
+<br>
+attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
+attributes #1 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
+attributes #2 = { nounwind readnone }<br>
+attributes #3 = { noreturn nounwind }<br>
+attributes #4 = { nounwind }<br>
+attributes #5 = { noreturn }<br>
+<br>
+!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0}<br>
+!llvm.module.flags = !{!3, !4, !5}<br>
+!llvm.ident = !{!6}<br>
+<br>
+; CHECK: !DILocation(line: 20, column: 1, scope: !{{[0-9]+}}, isImplicitCode: true)<br>
+; CHECK: !DILocation(line: 17, column: 5, scope: !{{[0-9]+}}, isImplicitCode: true)<br>
+; CHECK: !DILocation(line: 19, column: 5, scope: !{{[0-9]+}}, isImplicitCode: true)<br>
+; CHECK: !DILocation(line: 3, column: 10, scope: !{{[0-9]+}}, isImplicitCode: true)<br>
+; CHECK: !DILocation(line: 25, column: 1, scope: !{{[0-9]+}}, isImplicitCode: true)<br>
+<br>
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0 (trunk 342445)", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, nameTableKind: None)<br>
+!1 = !DIFile(filename: "DILocation-implicit-code.cpp", directory: "/tmp")<br>
+!2 = !{}<br>
+!3 = !{i32 2, !"Dwarf Version", i32 4}<br>
+!4 = !{i32 2, !"Debug Info Version", i32 3}<br>
+!5 = !{i32 1, !"wchar_size", i32 4}<br>
+!6 = !{!"clang version 8.0.0 (trunk 342445)"}<br>
+!7 = distinct !DISubprogram(name: "test1", scope: !1, file: !1, line: 13, type: !8, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)<br>
+!8 = !DISubroutineType(types: !2)<br>
+!9 = !DILocation(line: 14, column: 7, scope: !7)<br>
+!10 = !DILocation(line: 16, column: 18, scope: !7)<br>
+!11 = !DILocation(line: 16, column: 9, scope: !7)<br>
+!12 = !DILocation(line: 20, column: 1, scope: !7, isImplicitCode: true)<br>
+!13 = !DILocation(line: 17, column: 5, scope: !7, isImplicitCode: true)<br>
+!14 = !DILocation(line: 18, column: 22, scope: !7)<br>
+!15 = !DILocation(line: 18, column: 18, scope: !7)<br>
+!16 = !DILocation(line: 19, column: 5, scope: !7, isImplicitCode: true)<br>
+!17 = distinct !DISubprogram(name: "A", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)<br>
+!18 = !DILocation(line: 3, column: 10, scope: !17, isImplicitCode: true)<br>
+!19 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)<br>
+!20 = !DILocation(line: 5, column: 13, scope: !19)<br>
+!21 = !DILocation(line: 5, column: 15, scope: !19)<br>
+!22 = !DILocation(line: 6, column: 13, scope: !19)<br>
+!23 = !DILocation(line: 9, column: 9, scope: !19)<br>
+!24 = distinct !DISubprogram(name: "test2", scope: !1, file: !1, line: 22, type: !8, isLocal: false, isDefinition: true, scopeLine: 22, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)<br>
+!25 = !DILocation(line: 23, column: 7, scope: !24)<br>
+!26 = !DILocation(line: 24, column: 13, scope: !24)<br>
+!27 = !DILocation(line: 25, column: 1, scope: !24, isImplicitCode: true)<br>
<br>
Added: llvm/trunk/test/Bitcode/DILocation-implicit-code.ll.bc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/DILocation-implicit-code.ll.bc?rev=342631&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/DILocation-implicit-code.ll.bc?rev=342631&view=auto</a><br>
==============================================================================<br>
Binary files llvm/trunk/test/Bitcode/DILocation-implicit-code.ll.bc (added) and llvm/trunk/test/Bitcode/DILocation-implicit-code.ll.bc Thu Sep 20 01:53:06 2018 differ<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div></div>
</blockquote></div>
</blockquote></div></div></div></blockquote></div>
</blockquote></div>
</blockquote></div>