OSDN Git Service

Change while to do-while
authorSeija Kijin <doremylover123@gmail.com>
Thu, 25 Jun 2020 16:29:50 +0000 (09:29 -0700)
committerFangrui Song <maskray@google.com>
Thu, 25 Jun 2020 16:30:30 +0000 (09:30 -0700)
Differential Revision: https://reviews.llvm.org/D70603

clang/lib/Analysis/ReachableCode.cpp

index 369879a..221d137 100644 (file)
@@ -138,10 +138,10 @@ static bool isDeadReturn(const CFGBlock *B, const Stmt *S) {
 static SourceLocation getTopMostMacro(SourceLocation Loc, SourceManager &SM) {
   assert(Loc.isMacroID());
   SourceLocation Last;
-  while (Loc.isMacroID()) {
+  do {
     Last = Loc;
     Loc = SM.getImmediateMacroCallerLoc(Loc);
-  }
+  } while (Loc.isMacroID());
   return Last;
 }