[PATCH] D80944: Add begin source location for the attributed statement created from PragmaLoopHint decorated loop

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 09:25:59 PDT 2020


jdenny added a comment.

This looks like a continuation of the work started in D61643 <https://reviews.llvm.org/D61643> (which makes the loc of `#pragma` available to pragma handlers) and D61509 <https://reviews.llvm.org/D61509> (which changes the start loc for OpenMP pragmas from `omp` to `#pragma`).



================
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());
----------------
When I remove this change, the new test still passes.  Please make sure this case is covered.


================
Comment at: clang/lib/Parse/ParseStmt.cpp:2167
+  SourceLocation StartLoc =
+      PP.getSourceManager().getExpansionLoc(Tok.getLocation());
+
----------------
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.


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