Home | History | Annotate | Download | only in clang-diff

Lines Matching refs:Diff

23 static cl::OptionCategory ClangDiffCategory("clang-diff options");
40 cl::desc("Output a side-by-side diff in HTML."),
52 static cl::opt<std::string> StopAfter("stop-diff-after",
248 static std::string getChangeKindAbbr(diff::ChangeKind Kind) {
250 case diff::None:
252 case diff::Delete:
254 case diff::Update:
256 case diff::Insert:
258 case diff::Move:
260 case diff::UpdateMove:
266 static unsigned printHtmlForNode(raw_ostream &OS, const diff::ASTDiff &Diff,
267 diff::SyntaxTree &Tree, bool IsLeft,
268 diff::NodeId Id, unsigned Offset) {
269 const diff::Node &Node = Tree.getNode(Id);
271 diff::NodeId LeftId, RightId;
272 diff::NodeId TargetId = Diff.getMapped(Tree, Id);
301 if (Node.Change != diff::None)
305 for (diff::NodeId Child : Node.Children)
306 Offset = printHtmlForNode(OS, Diff, Tree, IsLeft, Child, Offset);
344 static void printNodeAttributes(raw_ostream &OS, diff::SyntaxTree &Tree,
345 diff::NodeId Id) {
346 const diff::Node &N = Tree.getNode(Id);
360 static void printNodeAsJson(raw_ostream &OS, diff::SyntaxTree &Tree,
361 diff::NodeId Id) {
362 const diff::Node &N = Tree.getNode(Id);
388 static void printNode(raw_ostream &OS, diff::SyntaxTree &Tree,
389 diff::NodeId Id) {
401 static void printTree(raw_ostream &OS, diff::SyntaxTree &Tree) {
402 for (diff::NodeId Id : Tree) {
410 static void printDstChange(raw_ostream &OS, diff::ASTDiff &Diff,
411 diff::SyntaxTree &SrcTree, diff::SyntaxTree &DstTree,
412 diff::NodeId Dst) {
413 const diff::Node &DstNode = DstTree.getNode(Dst);
414 diff::NodeId Src = Diff.getMapped(DstTree, Dst);
416 case diff::None:
418 case diff::Delete:
420 case diff::Update:
425 case diff::Insert:
426 case diff::Move:
427 case diff::UpdateMove:
428 if (DstNode.Change == diff::Insert)
430 else if (DstNode.Change == diff::Move)
432 else if (DstNode.Change == diff::UpdateMove)
465 diff::SyntaxTree Tree(AST->getASTContext());
488 diff::ComparisonOptions Options;
499 diff::SyntaxTree SrcTree(Src->getASTContext());
500 diff::SyntaxTree DstTree(Dst->getASTContext());
501 diff::ASTDiff Diff(SrcTree, DstTree, Options);
506 printHtmlForNode(llvm::outs(), Diff, SrcTree, true, SrcTree.getRootId(), 0);
509 printHtmlForNode(llvm::outs(), Diff, DstTree, false, DstTree.getRootId(),
516 for (diff::NodeId Dst : DstTree) {
517 diff::NodeId Src = Diff.getMapped(DstTree, Dst);
525 printDstChange(llvm::outs(), Diff, SrcTree, DstTree, Dst);
527 for (diff::NodeId Src : SrcTree) {
528 if (Diff.getMapped(SrcTree, Src).isInvalid()) {