From 8c3593658371902e8486fd9a0bb970b5e95a2562 Mon Sep 17 00:00:00 2001
From: John McCall
Date: Tue, 7 Sep 2010 23:10:21 +0000
Subject: [PATCH] Add documentation for llvm-diff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113303 91177308-0d34-0410-b5e6-96231b3b80d8
---
docs/CommandGuide/index.html | 3 ++
docs/CommandGuide/llvm-diff.pod | 53 +++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+)
create mode 100644 docs/CommandGuide/llvm-diff.pod
diff --git a/docs/CommandGuide/index.html b/docs/CommandGuide/index.html
index 72cd2cf5f96..8854fbbebe6 100644
--- a/docs/CommandGuide/index.html
+++ b/docs/CommandGuide/index.html
@@ -72,6 +72,9 @@ options) arguments to the tool you are interested in.
llvmc -
a generic customizable compiler driver
+llvm-diff -
+ structurally compare two modules
+
diff --git a/docs/CommandGuide/llvm-diff.pod b/docs/CommandGuide/llvm-diff.pod
new file mode 100644
index 00000000000..c8cfdb3be94
--- /dev/null
+++ b/docs/CommandGuide/llvm-diff.pod
@@ -0,0 +1,53 @@
+=pod
+
+=head1 NAME
+
+llvm-diff - LLVM structural 'diff'
+
+=head1 SYNOPSIS
+
+B [I] I I [I]
+
+=head1 DESCRIPTION
+
+B compares the structure of two LLVM modules, primarily
+focusing on differences in function definitions. Insignificant
+differences, such as changes in the ordering of globals or in the
+names of local values, are ignored.
+
+An input module will be interpreted as an assembly file if its name
+ends in '.ll'; otherwise it will be read in as a bitcode file.
+
+If a list of global names is given, just the values with those names
+are compared; otherwise, all global values are compared, and
+diagnostics are produced for globals which only appear in one module
+or the other.
+
+B compares two functions by comparing their basic blocks,
+beginning with the entry blocks. If the terminators seem to match,
+then the corresponding successors are compared; otherwise they are
+ignored. This algorithm is very sensitive to changes in control flow,
+which tend to stop any downstream changes from being detected.
+
+B is intended as a debugging tool for writers of LLVM
+passes and frontends. It does not have a stable output format.
+
+=head1 EXIT STATUS
+
+If B finds no differences between the modules, it will exit
+with 0 and produce no output. Otherwise it will exit with a non-zero
+value.
+
+=head1 BUGS
+
+Many important differences, like changes in linkage or function
+attributes, are not diagnosed.
+
+Changes in memory behavior (for example, coalescing loads) can cause
+massive detected differences in blocks.
+
+=head1 AUTHORS
+
+Maintained by the LLVM Team (L).
+
+=cut