[PATCH] D80944: Add begin source location for the attributed statement created from PragmaLoopHint decorated loop
Yuanfang Chen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 5 16:48:34 PDT 2020
ychen marked 4 inline comments as done.
ychen added inline comments.
================
Comment at: clang/lib/Parse/ParsePragma.cpp:2941
LoopHintTok.setKind(tok::annot_pragma_loop_hint);
- LoopHintTok.setLocation(PragmaName.getLocation());
+ LoopHintTok.setLocation(Introducer.Loc);
LoopHintTok.setAnnotationEndLoc(PragmaName.getLocation());
----------------
jdenny wrote:
> When I remove this change, the new test still passes. Please make sure this case is covered.
Added a test case for this.
================
Comment at: clang/lib/Parse/ParseStmt.cpp:2167
+ SourceLocation StartLoc =
+ PP.getSourceManager().getExpansionLoc(Tok.getLocation());
+
----------------
jdenny wrote:
> I think the call to getExpansionLoc shouldn't be here. If the ast dumper or other clients want to convert to that form, they can do so.
Indeed. Removing this helps code coverage shows the coverage for the macro spelling location. Thanks.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80944/new/
https://reviews.llvm.org/D80944
More information about the cfe-commits
mailing list