diff options
author | Calixte Denizet <cdenizet@mozilla.com> | 2018-09-20 08:53:06 +0000 |
---|---|---|
committer | Calixte Denizet <cdenizet@mozilla.com> | 2018-09-20 08:53:06 +0000 |
commit | eb7f60201cb348223d3feec20638b3b084804a26 (patch) | |
tree | 91714ce01f4b5ac14c50086733f91282dcf0609f /llvm/lib/AsmParser | |
parent | 226f3ef5a52db932e4acbcfdf9bb860a25ba6d59 (diff) | |
download | bcm5719-llvm-eb7f60201cb348223d3feec20638b3b084804a26.tar.gz bcm5719-llvm-eb7f60201cb348223d3feec20638b3b084804a26.zip |
[IR] Add a boolean field in DILocation to know if a line must covered or not
Summary:
Some lines have a hit counter where they should not have one.
For example, in C++, some cleanup is adding at the end of a scope represented by a '}'.
So such a line has a hit counter where a user expects to not have one.
The goal of the patch is to add this information in DILocation which is used to get the covered lines in GCOVProfiling.cpp.
A following patch in clang will add this information when generating IR (https://reviews.llvm.org/D49916).
Reviewers: marco-c, davidxl, vsk, javed.absar, rnk
Reviewed By: rnk
Subscribers: eraman, xur, danielcdh, aprantl, rnk, dblaikie, #debug-info, vsk, llvm-commits, sylvestre.ledru
Tags: #debug-info
Differential Revision: https://reviews.llvm.org/D49915
llvm-svn: 342631
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 1fce430e30e..30d3b49d9d7 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -4228,18 +4228,21 @@ bool LLParser::ParseSpecializedMDNode(MDNode *&N, bool IsDistinct) { (IsDistinct ? CLASS::getDistinct ARGS : CLASS::get ARGS) /// ParseDILocationFields: -/// ::= !DILocation(line: 43, column: 8, scope: !5, inlinedAt: !6) +/// ::= !DILocation(line: 43, column: 8, scope: !5, inlinedAt: !6, +/// isImplicitCode: true) bool LLParser::ParseDILocation(MDNode *&Result, bool IsDistinct) { #define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \ OPTIONAL(line, LineField, ); \ OPTIONAL(column, ColumnField, ); \ REQUIRED(scope, MDField, (/* AllowNull */ false)); \ - OPTIONAL(inlinedAt, MDField, ); + OPTIONAL(inlinedAt, MDField, ); \ + OPTIONAL(isImplicitCode, MDBoolField, (false)); PARSE_MD_FIELDS(); #undef VISIT_MD_FIELDS - Result = GET_OR_DISTINCT( - DILocation, (Context, line.Val, column.Val, scope.Val, inlinedAt.Val)); + Result = + GET_OR_DISTINCT(DILocation, (Context, line.Val, column.Val, scope.Val, + inlinedAt.Val, isImplicitCode.Val)); return false; } |