donat.nagy marked 6 inline comments as done.
donat.nagy added a comment.

An example of duplicated code in Clang (it appears in 
llvm/tools/clang/lib/Frontend/Rewrite/RewriteMacros.cpp starting from line 128):

  // If this is a #warning directive or #pragma mark (GNU extensions),
  // comment the line out.
  if (RawTokens[CurRawTok].is(tok::identifier)) {
    const IdentifierInfo *II = RawTokens[CurRawTok].getIdentifierInfo();
    if (II->getName() == "warning") {
      // Comment out #warning.
      RB.InsertTextAfter(SM.getFileOffset(RawTok.getLocation()), "//");       
// THIS IS...
    } else if (II->getName() == "pragma" &&
               RawTokens[CurRawTok+1].is(tok::identifier) &&
               (RawTokens[CurRawTok+1].getIdentifierInfo()->getName() ==
                "mark")) {
      // Comment out #pragma mark.
      RB.InsertTextAfter(SM.getFileOffset(RawTok.getLocation()), "//");       
// IDENTICAL TO THIS
    }
  }


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54757



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to