[PATCH] D48721: Patch to fix pragma metadata for do-while loops

Deepak Panickal via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 28 07:08:04 PDT 2018


deepak2427 updated this revision to Diff 153316.
deepak2427 added a comment.

Add full context


https://reviews.llvm.org/D48721

Files:
  lib/CodeGen/CGStmt.cpp


Index: lib/CodeGen/CGStmt.cpp
===================================================================
--- lib/CodeGen/CGStmt.cpp
+++ lib/CodeGen/CGStmt.cpp
@@ -777,19 +777,19 @@
   // Emit the body of the loop.
   llvm::BasicBlock *LoopBody = createBasicBlock("do.body");
 
-  const SourceRange &R = S.getSourceRange();
-  LoopStack.push(LoopBody, CGM.getContext(), DoAttrs,
-                 SourceLocToDebugLoc(R.getBegin()),
-                 SourceLocToDebugLoc(R.getEnd()));
-
   EmitBlockWithFallThrough(LoopBody, &S);
   {
     RunCleanupsScope BodyScope(*this);
     EmitStmt(S.getBody());
   }
 
   EmitBlock(LoopCond.getBlock());
 
+  const SourceRange &R = S.getSourceRange();
+  LoopStack.push(LoopBody, CGM.getContext(), DoAttrs,
+                 SourceLocToDebugLoc(R.getBegin()),
+                 SourceLocToDebugLoc(R.getEnd()));
+
   // C99 6.8.5.2: "The evaluation of the controlling expression takes place
   // after each execution of the loop body."
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48721.153316.patch
Type: text/x-patch
Size: 971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180628/9a036192/attachment.bin>


More information about the cfe-commits mailing list