diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-14 16:58:19 +0100 |
|---|---|---|
| committer | Who? Me?! <mark-i-m@users.noreply.github.com> | 2018-12-14 17:29:38 -0600 |
| commit | 3826e3d027b20a5ed2c4d0a86b98ca202dff2b9f (patch) | |
| tree | 336dc54373618a9c028f672ab23632b89b7239df /src/doc/rustc-dev-guide | |
| parent | 136e62f1f757ddeccaf60b82b0e9d4ab8067aa1e (diff) | |
Add graphs that I forgot to push in the original PR
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/mir/construction.md | 7 | ||||
| -rw-r--r-- | src/doc/rustc-dev-guide/src/mir/mir_detailed.dot | 27 | ||||
| -rw-r--r-- | src/doc/rustc-dev-guide/src/mir/mir_detailed.svg | 300 | ||||
| -rw-r--r-- | src/doc/rustc-dev-guide/src/mir/mir_overview.dot | 10 | ||||
| -rw-r--r-- | src/doc/rustc-dev-guide/src/mir/mir_overview.svg | 103 |
5 files changed, 447 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/mir/construction.md b/src/doc/rustc-dev-guide/src/mir/construction.md index f0e3cf76ad4..0e0bf35e739 100644 --- a/src/doc/rustc-dev-guide/src/mir/construction.md +++ b/src/doc/rustc-dev-guide/src/mir/construction.md @@ -92,6 +92,13 @@ There are essentially four kinds of representations one might want of an express * `Operand` is an argument to e.g. a `+` operation or a function call * a temporary variable containing a copy of the value +These following image depicts a general overview of the interactions between the +representations: + +<img src="mir_overview.svg"> + +[Click here for a more detailed view](mir_detailed.svg) + We start out with lowering the function body to an `Rvalue` so we can create an assignment to `RETURN_PLACE`, This `Rvalue` lowering will in turn trigger lowering to `Operand` for its arguments (if any). `Operand` lowering either produces a `const` diff --git a/src/doc/rustc-dev-guide/src/mir/mir_detailed.dot b/src/doc/rustc-dev-guide/src/mir/mir_detailed.dot new file mode 100644 index 00000000000..1494f4f0bd2 --- /dev/null +++ b/src/doc/rustc-dev-guide/src/mir/mir_detailed.dot @@ -0,0 +1,27 @@ +digraph G { + Operand -> Constant + Operand -> Place [taillabel="read"] + Place -> Projection + Projection -> Place + Place -> LocalId + Rvalue -> "Rvalue\nAggregate" + Rvalue -> "Rvalue\nBinaryOp" + Rvalue -> "Rvalue\nUnaryOp" + Rvalue -> "Rvalue\n..." + "Rvalue\nAggregate" -> Operand [headlabel="*"] + "Rvalue\nBinaryOp" -> Operand [headlabel="2"] + "Rvalue\nUnaryOp" -> Operand + "Statement\nAssignment" -> Place [taillabel="write"] + "Statement\nAssignment" -> Rvalue + Statement -> "Statement\nAssignment" + Statement -> "Statement\n..." + Block -> Statement [headlabel="*"] + Block -> Terminator + Terminator -> "Terminator\nSwitchInt" + "Terminator\nSwitchInt" -> Operand + "Terminator\nSwitchInt" -> Constant [headlabel="*"] + "Terminator\nSwitchInt" -> BlockId [headlabel="*"] + Terminator -> "Terminator\n..." + Mir -> Block [headlabel="*"] + Mir -> Local [headlabel="*"] +} \ No newline at end of file diff --git a/src/doc/rustc-dev-guide/src/mir/mir_detailed.svg b/src/doc/rustc-dev-guide/src/mir/mir_detailed.svg new file mode 100644 index 00000000000..771e9e5dc0a --- /dev/null +++ b/src/doc/rustc-dev-guide/src/mir/mir_detailed.svg @@ -0,0 +1,300 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Generated by graphviz version 2.40.1 (20161225.0304) + --> +<!-- Title: G Pages: 1 --> +<svg width="710pt" height="655pt" + viewBox="0.00 0.00 710.21 655.48" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 651.4802)"> +<title>G</title> +<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-651.4802 706.2058,-651.4802 706.2058,4 -4,4"/> +<!-- Operand --> +<g id="node1" class="node"> +<title>Operand</title> +<ellipse fill="none" stroke="#000000" cx="235.0515" cy="-162" rx="40.8928" ry="18"/> +<text text-anchor="middle" x="235.0515" y="-158.3" font-family="Times,serif" font-size="14.00" fill="#000000">Operand</text> +</g> +<!-- Constant --> +<g id="node2" class="node"> +<title>Constant</title> +<ellipse fill="none" stroke="#000000" cx="307.0515" cy="-90" rx="42.4939" ry="18"/> +<text text-anchor="middle" x="307.0515" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#000000">Constant</text> +</g> +<!-- Operand->Constant --> +<g id="edge1" class="edge"> +<title>Operand->Constant</title> +<path fill="none" stroke="#000000" d="M251.7507,-145.3008C261.1107,-135.9408 272.942,-124.1095 283.2569,-113.7945"/> +<polygon fill="#000000" stroke="#000000" points="285.8466,-116.1546 290.4428,-106.6087 280.8969,-111.2049 285.8466,-116.1546"/> +</g> +<!-- Place --> +<g id="node3" class="node"> +<title>Place</title> +<ellipse fill="none" stroke="#000000" cx="163.0515" cy="-90" rx="29.795" ry="18"/> +<text text-anchor="middle" x="163.0515" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#000000">Place</text> +</g> +<!-- Operand->Place --> +<g id="edge2" class="edge"> +<title>Operand->Place</title> +<path fill="none" stroke="#000000" d="M218.3523,-145.3008C208.7249,-135.6734 196.4829,-123.4314 185.9657,-112.9142"/> +<polygon fill="#000000" stroke="#000000" points="188.2204,-110.2191 178.6744,-105.6229 183.2706,-115.1689 188.2204,-110.2191"/> +<text text-anchor="middle" x="206.3523" y="-134.1008" font-family="Times,serif" font-size="14.00" fill="#000000">read</text> +</g> +<!-- Projection --> +<g id="node4" class="node"> +<title>Projection</title> +<ellipse fill="none" stroke="#000000" cx="163.0515" cy="-18" rx="46.5926" ry="18"/> +<text text-anchor="middle" x="163.0515" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">Projection</text> +</g> +<!-- Place->Projection --> +<g id="edge3" class="edge"> +<title>Place->Projection</title> +<path fill="none" stroke="#000000" d="M157.1358,-72.2022C156.3519,-64.3864 156.1204,-55.0171 156.4412,-46.2836"/> +<polygon fill="#000000" stroke="#000000" points="159.9475,-46.2999 157.1065,-36.0931 152.9624,-45.8439 159.9475,-46.2999"/> +</g> +<!-- LocalId --> +<g id="node5" class="node"> +<title>LocalId</title> +<ellipse fill="none" stroke="#000000" cx="266.0515" cy="-18" rx="38.1938" ry="18"/> +<text text-anchor="middle" x="266.0515" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">LocalId</text> +</g> +<!-- Place->LocalId --> +<g id="edge5" class="edge"> +<title>Place->LocalId</title> +<path fill="none" stroke="#000000" d="M182.9109,-76.1177C197.9447,-65.6086 218.8518,-50.994 235.939,-39.0495"/> +<polygon fill="#000000" stroke="#000000" points="238.2842,-41.6805 244.475,-33.0826 234.2737,-35.9433 238.2842,-41.6805"/> +</g> +<!-- Projection->Place --> +<g id="edge4" class="edge"> +<title>Projection->Place</title> +<path fill="none" stroke="#000000" d="M168.9965,-36.0931C169.7664,-43.9477 169.9841,-53.3282 169.6494,-62.0453"/> +<polygon fill="#000000" stroke="#000000" points="166.1453,-61.9901 168.9672,-72.2022 173.1296,-62.4593 166.1453,-61.9901"/> +</g> +<!-- Rvalue --> +<g id="node6" class="node"> +<title>Rvalue</title> +<ellipse fill="none" stroke="#000000" cx="204.0515" cy="-323.7401" rx="35.9954" ry="18"/> +<text text-anchor="middle" x="204.0515" y="-320.0401" font-family="Times,serif" font-size="14.00" fill="#000000">Rvalue</text> +</g> +<!-- Rvalue\nAggregate --> +<g id="node7" class="node"> +<title>Rvalue\nAggregate</title> +<ellipse fill="none" stroke="#000000" cx="69.0515" cy="-242.8701" rx="51.7379" ry="26.7407"/> +<text text-anchor="middle" x="69.0515" y="-246.6701" font-family="Times,serif" font-size="14.00" fill="#000000">Rvalue</text> +<text text-anchor="middle" x="69.0515" y="-231.6701" font-family="Times,serif" font-size="14.00" fill="#000000">Aggregate</text> +</g> +<!-- Rvalue->Rvalue\nAggregate --> +<g id="edge6" class="edge"> +<title>Rvalue->Rvalue\nAggregate</title> +<path fill="none" stroke="#000000" d="M180.8442,-309.8381C161.9431,-298.5156 134.7462,-282.2237 111.9105,-268.5442"/> +<polygon fill="#000000" stroke="#000000" points="113.454,-265.3889 103.0768,-263.2525 109.8568,-271.3939 113.454,-265.3889"/> +</g> +<!-- Rvalue\nBinaryOp --> +<g id="node8" class="node"> +<title>Rvalue\nBinaryOp</title> +<ellipse fill="none" stroke="#000000" cx="188.0515" cy="-242.8701" rx="49.4949" ry="26.7407"/> +<text text-anchor="middle" x="188.0515" y="-246.6701" font-family="Times,serif" font-size="14.00" fill="#000000">Rvalue</text> +<text text-anchor="middle" x="188.0515" y="-231.6701" font-family="Times,serif" font-size="14.00" fill="#000000">BinaryOp</text> +</g> +<!-- Rvalue->Rvalue\nBinaryOp --> +<g id="edge7" class="edge"> +<title>Rvalue->Rvalue\nBinaryOp</title> +<path fill="none" stroke="#000000" d="M200.5006,-305.7924C198.9755,-298.0839 197.134,-288.7767 195.3406,-279.7121"/> +<polygon fill="#000000" stroke="#000000" points="198.73,-278.8098 193.3556,-269.6793 191.8631,-280.1684 198.73,-278.8098"/> +</g> +<!-- Rvalue\nUnaryOp --> +<g id="node9" class="node"> +<title>Rvalue\nUnaryOp</title> +<ellipse fill="none" stroke="#000000" cx="303.0515" cy="-242.8701" rx="47.2526" ry="26.7407"/> +<text text-anchor="middle" x="303.0515" y="-246.6701" font-family="Times,serif" font-size="14.00" fill="#000000">Rvalue</text> +<text text-anchor="middle" x="303.0515" y="-231.6701" font-family="Times,serif" font-size="14.00" fill="#000000">UnaryOp</text> +</g> +<!-- Rvalue->Rvalue\nUnaryOp --> +<g id="edge8" class="edge"> +<title>Rvalue->Rvalue\nUnaryOp</title> +<path fill="none" stroke="#000000" d="M223.1397,-308.1476C235.7504,-297.8463 252.6606,-284.0328 267.6777,-271.7658"/> +<polygon fill="#000000" stroke="#000000" points="270.2561,-274.179 275.7864,-265.142 265.8276,-268.7578 270.2561,-274.179"/> +</g> +<!-- Rvalue\n... --> +<g id="node10" class="node"> +<title>Rvalue\n...</title> +<ellipse fill="none" stroke="#000000" cx="407.0515" cy="-242.8701" rx="38.7821" ry="26.7407"/> +<text text-anchor="middle" x="407.0515" y="-246.6701" font-family="Times,serif" font-size="14.00" fill="#000000">Rvalue</text> +<text text-anchor="middle" x="407.0515" y="-231.6701" font-family="Times,serif" font-size="14.00" fill="#000000">...</text> +</g> +<!-- Rvalue->Rvalue\n... --> +<g id="edge9" class="edge"> +<title>Rvalue->Rvalue\n...</title> +<path fill="none" stroke="#000000" d="M235.256,-314.6368C267.0067,-304.9668 317.3424,-288.5057 359.0515,-269.7401 362.195,-268.3258 365.4063,-266.7762 368.6037,-265.1575"/> +<polygon fill="#000000" stroke="#000000" points="370.2926,-268.2238 377.5103,-260.4678 367.0313,-262.0299 370.2926,-268.2238"/> +</g> +<!-- Rvalue\nAggregate->Operand --> +<g id="edge10" class="edge"> +<title>Rvalue\nAggregate->Operand</title> +<path fill="none" stroke="#000000" d="M107.1352,-224.3168C134.5352,-210.9684 171.2807,-193.0672 198.3573,-179.8763"/> +<polygon fill="#000000" stroke="#000000" points="200.0432,-182.9483 207.5003,-175.4221 196.9774,-176.6553 200.0432,-182.9483"/> +<text text-anchor="middle" x="204.0003" y="-179.2221" font-family="Times,serif" font-size="14.00" fill="#000000">*</text> +</g> +<!-- Rvalue\nBinaryOp->Operand --> +<g id="edge11" class="edge"> +<title>Rvalue\nBinaryOp->Operand</title> +<path fill="none" stroke="#000000" d="M203.1813,-216.8371C208.4947,-207.6947 214.4647,-197.4225 219.7889,-188.2614"/> +<polygon fill="#000000" stroke="#000000" points="222.8508,-189.9584 224.8496,-179.5538 216.7986,-186.441 222.8508,-189.9584"/> +<text text-anchor="middle" x="221.3496" y="-183.3538" font-family="Times,serif" font-size="14.00" fill="#000000">2</text> +</g> +<!-- Rvalue\nUnaryOp->Operand --> +<g id="edge12" class="edge"> +<title>Rvalue\nUnaryOp->Operand</title> +<path fill="none" stroke="#000000" d="M282.6492,-218.6064C274.253,-208.621 264.5321,-197.0602 256.0725,-186.9996"/> +<polygon fill="#000000" stroke="#000000" points="258.7225,-184.7128 249.6079,-179.3114 253.3648,-189.2178 258.7225,-184.7128"/> +</g> +<!-- Statement\nAssignment --> +<g id="node11" class="node"> +<title>Statement\nAssignment</title> +<ellipse fill="none" stroke="#000000" cx="204.0515" cy="-404.6102" rx="57.9655" ry="26.7407"/> +<text text-anchor="middle" x="204.0515" y="-408.4102" font-family="Times,serif" font-size="14.00" fill="#000000">Statement</text> +<text text-anchor="middle" x="204.0515" y="-393.4102" font-family="Times,serif" font-size="14.00" fill="#000000">Assignment</text> +</g> +<!-- Statement\nAssignment->Place --> +<g id="edge13" class="edge"> +<title>Statement\nAssignment->Place</title> +<path fill="none" stroke="#000000" d="M158.0853,-387.9226C110.712,-367.9515 39.4797,-329.5163 8.0515,-269.7401 -28.3835,-200.4412 74.6545,-134.9955 130.1983,-105.8591"/> +<polygon fill="#000000" stroke="#000000" points="132.0277,-108.8542 139.3251,-101.1732 128.8305,-102.627 132.0277,-108.8542"/> +<text text-anchor="middle" x="144.0853" y="-376.7226" font-family="Times,serif" font-size="14.00" fill="#000000">write</text> +</g> +<!-- Statement\nAssignment->Rvalue --> +<g id="edge14" class="edge"> +<title>Statement\nAssignment->Rvalue</title> +<path fill="none" stroke="#000000" d="M204.0515,-377.6816C204.0515,-369.4111 204.0515,-360.2888 204.0515,-351.9358"/> +<polygon fill="#000000" stroke="#000000" points="207.5516,-351.8889 204.0515,-341.8889 200.5516,-351.889 207.5516,-351.8889"/> +</g> +<!-- Statement --> +<g id="node12" class="node"> +<title>Statement</title> +<ellipse fill="none" stroke="#000000" cx="346.0515" cy="-485.4802" rx="46.2923" ry="18"/> +<text text-anchor="middle" x="346.0515" y="-481.7802" font-family="Times,serif" font-size="14.00" fill="#000000">Statement</text> +</g> +<!-- Statement->Statement\nAssignment --> +<g id="edge15" class="edge"> +<title>Statement->Statement\nAssignment</title> +<path fill="none" stroke="#000000" d="M319.6752,-470.4587C300.0617,-459.2887 272.808,-443.7675 249.6863,-430.5996"/> +<polygon fill="#000000" stroke="#000000" points="251.1463,-427.4033 240.7246,-425.4958 247.6821,-433.486 251.1463,-427.4033"/> +</g> +<!-- Statement\n... --> +<g id="node13" class="node"> +<title>Statement\n...</title> +<ellipse fill="none" stroke="#000000" cx="346.0515" cy="-404.6102" rx="50.41" ry="26.7407"/> +<text text-anchor="middle" x="346.0515" y="-408.4102" font-family="Times,serif" font-size="14.00" fill="#000000">Statement</text> +<text text-anchor="middle" x="346.0515" y="-393.4102" font-family="Times,serif" font-size="14.00" fill="#000000">...</text> +</g> +<!-- Statement->Statement\n... --> +<g id="edge16" class="edge"> +<title>Statement->Statement\n...</title> +<path fill="none" stroke="#000000" d="M346.0515,-467.1296C346.0515,-459.5597 346.0515,-450.5002 346.0515,-441.6583"/> +<polygon fill="#000000" stroke="#000000" points="349.5516,-441.4808 346.0515,-431.4808 342.5516,-441.4808 349.5516,-441.4808"/> +</g> +<!-- Block --> +<g id="node14" class="node"> +<title>Block</title> +<ellipse fill="none" stroke="#000000" cx="385.0515" cy="-557.4802" rx="31.6951" ry="18"/> +<text text-anchor="middle" x="385.0515" y="-553.7802" font-family="Times,serif" font-size="14.00" fill="#000000">Block</text> +</g> +<!-- Block->Statement --> +<g id="edge17" class="edge"> +<title>Block->Statement</title> +<path fill="none" stroke="#000000" d="M375.6107,-540.051C371.0795,-531.6857 365.5504,-521.4782 360.5052,-512.1641"/> +<polygon fill="#000000" stroke="#000000" points="363.5167,-510.375 355.6763,-503.2491 357.3617,-513.7091 363.5167,-510.375"/> +<text text-anchor="middle" x="352.1763" y="-507.0491" font-family="Times,serif" font-size="14.00" fill="#000000">*</text> +</g> +<!-- Terminator --> +<g id="node15" class="node"> +<title>Terminator</title> +<ellipse fill="none" stroke="#000000" cx="519.0515" cy="-323.7401" rx="50.8918" ry="18"/> +<text text-anchor="middle" x="519.0515" y="-320.0401" font-family="Times,serif" font-size="14.00" fill="#000000">Terminator</text> +</g> +<!-- Block->Terminator --> +<g id="edge18" class="edge"> +<title>Block->Terminator</title> +<path fill="none" stroke="#000000" d="M394.9048,-540.2928C418.0234,-499.9664 475.8876,-399.0322 503.6797,-350.5535"/> +<polygon fill="#000000" stroke="#000000" points="506.8808,-352.0069 508.818,-341.5907 500.808,-348.5254 506.8808,-352.0069"/> +</g> +<!-- Terminator\nSwitchInt --> +<g id="node16" class="node"> +<title>Terminator\nSwitchInt</title> +<ellipse fill="none" stroke="#000000" cx="519.0515" cy="-242.8701" rx="55.3091" ry="26.7407"/> +<text text-anchor="middle" x="519.0515" y="-246.6701" font-family="Times,serif" font-size="14.00" fill="#000000">Terminator</text> +<text text-anchor="middle" x="519.0515" y="-231.6701" font-family="Times,serif" font-size="14.00" fill="#000000">SwitchInt</text> +</g> +<!-- Terminator->Terminator\nSwitchInt --> +<g id="edge19" class="edge"> +<title>Terminator->Terminator\nSwitchInt</title> +<path fill="none" stroke="#000000" d="M519.0515,-305.3894C519.0515,-297.8196 519.0515,-288.7601 519.0515,-279.9182"/> +<polygon fill="#000000" stroke="#000000" points="522.5516,-279.7406 519.0515,-269.7407 515.5516,-279.7407 522.5516,-279.7406"/> +</g> +<!-- Terminator\n... --> +<g id="node18" class="node"> +<title>Terminator\n...</title> +<ellipse fill="none" stroke="#000000" cx="647.0515" cy="-242.8701" rx="55.3091" ry="26.7407"/> +<text text-anchor="middle" x="647.0515" y="-246.6701" font-family="Times,serif" font-size="14.00" fill="#000000">Terminator</text> +<text text-anchor="middle" x="647.0515" y="-231.6701" font-family="Times,serif" font-size="14.00" fill="#000000">...</text> +</g> +<!-- Terminator->Terminator\n... --> +<g id="edge23" class="edge"> +<title>Terminator->Terminator\n...</title> +<path fill="none" stroke="#000000" d="M544.035,-307.9556C561.1466,-297.1446 584.2754,-282.5318 604.2825,-269.8914"/> +<polygon fill="#000000" stroke="#000000" points="606.3452,-272.7283 612.9298,-264.4281 602.6063,-266.8104 606.3452,-272.7283"/> +</g> +<!-- Terminator\nSwitchInt->Operand --> +<g id="edge20" class="edge"> +<title>Terminator\nSwitchInt->Operand</title> +<path fill="none" stroke="#000000" d="M478.0996,-224.5602C470.5153,-221.4896 462.6034,-218.4951 455.0515,-216 396.6759,-196.7135 327.5597,-180.8457 282.5872,-171.4129"/> +<polygon fill="#000000" stroke="#000000" points="283.0363,-167.9317 272.5338,-169.3272 281.6143,-174.7857 283.0363,-167.9317"/> +</g> +<!-- Terminator\nSwitchInt->Constant --> +<g id="edge21" class="edge"> +<title>Terminator\nSwitchInt->Constant</title> +<path fill="none" stroke="#000000" d="M487.7702,-220.3136C447.2089,-191.0654 376.9492,-140.4022 337.034,-111.6199"/> +<polygon fill="#000000" stroke="#000000" points="338.9197,-108.6647 328.7614,-105.6547 334.8255,-114.3425 338.9197,-108.6647"/> +<text text-anchor="middle" x="325.2614" y="-109.4547" font-family="Times,serif" font-size="14.00" fill="#000000">*</text> +</g> +<!-- BlockId --> +<g id="node17" class="node"> +<title>BlockId</title> +<ellipse fill="none" stroke="#000000" cx="519.0515" cy="-162" rx="38.9931" ry="18"/> +<text text-anchor="middle" x="519.0515" y="-158.3" font-family="Times,serif" font-size="14.00" fill="#000000">BlockId</text> +</g> +<!-- Terminator\nSwitchInt->BlockId --> +<g id="edge22" class="edge"> +<title>Terminator\nSwitchInt->BlockId</title> +<path fill="none" stroke="#000000" d="M519.0515,-215.9415C519.0515,-207.6709 519.0515,-198.5487 519.0515,-190.1957"/> +<polygon fill="#000000" stroke="#000000" points="522.5516,-190.1488 519.0515,-180.1488 515.5516,-190.1489 522.5516,-190.1488"/> +<text text-anchor="middle" x="515.5515" y="-183.9488" font-family="Times,serif" font-size="14.00" fill="#000000">*</text> +</g> +<!-- Mir --> +<g id="node19" class="node"> +<title>Mir</title> +<ellipse fill="none" stroke="#000000" cx="425.0515" cy="-629.4802" rx="27" ry="18"/> +<text text-anchor="middle" x="425.0515" y="-625.7802" font-family="Times,serif" font-size="14.00" fill="#000000">Mir</text> +</g> +<!-- Mir->Block --> +<g id="edge24" class="edge"> +<title>Mir->Block</title> +<path fill="none" stroke="#000000" d="M415.572,-612.4172C410.81,-603.8456 404.9356,-593.2716 399.6162,-583.6968"/> +<polygon fill="#000000" stroke="#000000" points="402.6568,-581.9627 394.7408,-574.9209 396.5377,-585.3623 402.6568,-581.9627"/> +<text text-anchor="middle" x="391.2408" y="-578.7209" font-family="Times,serif" font-size="14.00" fill="#000000">*</text> +</g> +<!-- Local --> +<g id="node20" class="node"> +<title>Local</title> +<ellipse fill="none" stroke="#000000" cx="465.0515" cy="-557.4802" rx="30.5947" ry="18"/> +<text text-anchor="middle" x="465.0515" y="-553.7802" font-family="Times,serif" font-size="14.00" fill="#000000">Local</text> +</g> +<!-- Mir->Local --> +<g id="edge25" class="edge"> +<title>Mir->Local</title> +<path fill="none" stroke="#000000" d="M434.5309,-612.4172C439.293,-603.8456 445.1674,-593.2716 450.4867,-583.6968"/> +<polygon fill="#000000" stroke="#000000" points="453.5653,-585.3623 455.3622,-574.9209 447.4462,-581.9627 453.5653,-585.3623"/> +<text text-anchor="middle" x="451.8622" y="-578.7209" font-family="Times,serif" font-size="14.00" fill="#000000">*</text> +</g> +</g> +</svg> diff --git a/src/doc/rustc-dev-guide/src/mir/mir_overview.dot b/src/doc/rustc-dev-guide/src/mir/mir_overview.dot new file mode 100644 index 00000000000..c0b51674dc1 --- /dev/null +++ b/src/doc/rustc-dev-guide/src/mir/mir_overview.dot @@ -0,0 +1,10 @@ +digraph G { + Operand -> Constant + Operand -> Place + Place -> Projection + Projection -> Place + Place -> Local + Rvalue -> Operand + Assignment -> Place + Assignment -> Operand +} \ No newline at end of file diff --git a/src/doc/rustc-dev-guide/src/mir/mir_overview.svg b/src/doc/rustc-dev-guide/src/mir/mir_overview.svg new file mode 100644 index 00000000000..b8f092cd280 --- /dev/null +++ b/src/doc/rustc-dev-guide/src/mir/mir_overview.svg @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Generated by graphviz version 2.40.1 (20161225.0304) + --> +<!-- Title: G Pages: 1 --> +<svg width="276pt" height="260pt" + viewBox="0.00 0.00 276.29 260.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 256)"> +<title>G</title> +<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-256 272.2941,-256 272.2941,4 -4,4"/> +<!-- Operand --> +<g id="node1" class="node"> +<title>Operand</title> +<ellipse fill="none" stroke="#000000" cx="62.7468" cy="-162" rx="40.8928" ry="18"/> +<text text-anchor="middle" x="62.7468" y="-158.3" font-family="Times,serif" font-size="14.00" fill="#000000">Operand</text> +</g> +<!-- Constant --> +<g id="node2" class="node"> +<title>Constant</title> +<ellipse fill="none" stroke="#000000" cx="52.7468" cy="-90" rx="42.4939" ry="18"/> +<text text-anchor="middle" x="52.7468" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#000000">Constant</text> +</g> +<!-- Operand->Constant --> +<g id="edge1" class="edge"> +<title>Operand->Constant</title> +<path fill="none" stroke="#000000" d="M60.2234,-143.8314C59.1539,-136.131 57.8822,-126.9743 56.6936,-118.4166"/> +<polygon fill="#000000" stroke="#000000" points="60.1467,-117.8367 55.3042,-108.4133 53.2133,-118.7997 60.1467,-117.8367"/> +</g> +<!-- Place --> +<g id="node3" class="node"> +<title>Place</title> +<ellipse fill="none" stroke="#000000" cx="142.7468" cy="-90" rx="29.795" ry="18"/> +<text text-anchor="middle" x="142.7468" y="-86.3" font-family="Times,serif" font-size="14.00" fill="#000000">Place</text> +</g> +<!-- Operand->Place --> +<g id="edge2" class="edge"> +<title>Operand->Place</title> +<path fill="none" stroke="#000000" d="M80.9001,-145.6621C92.0182,-135.6558 106.3846,-122.726 118.4722,-111.8471"/> +<polygon fill="#000000" stroke="#000000" points="120.9379,-114.3368 126.0295,-105.0456 116.2551,-109.1338 120.9379,-114.3368"/> +</g> +<!-- Projection --> +<g id="node4" class="node"> +<title>Projection</title> +<ellipse fill="none" stroke="#000000" cx="142.7468" cy="-18" rx="46.5926" ry="18"/> +<text text-anchor="middle" x="142.7468" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">Projection</text> +</g> +<!-- Place->Projection --> +<g id="edge3" class="edge"> +<title>Place->Projection</title> +<path fill="none" stroke="#000000" d="M136.8311,-72.2022C136.0473,-64.3864 135.8158,-55.0171 136.1366,-46.2836"/> +<polygon fill="#000000" stroke="#000000" points="139.6429,-46.2999 136.8018,-36.0931 132.6577,-45.8439 139.6429,-46.2999"/> +</g> +<!-- Local --> +<g id="node5" class="node"> +<title>Local</title> +<ellipse fill="none" stroke="#000000" cx="237.7468" cy="-18" rx="30.5947" ry="18"/> +<text text-anchor="middle" x="237.7468" y="-14.3" font-family="Times,serif" font-size="14.00" fill="#000000">Local</text> +</g> +<!-- Place->Local --> +<g id="edge5" class="edge"> +<title>Place->Local</title> +<path fill="none" stroke="#000000" d="M161.5158,-75.7751C175.477,-65.194 194.7426,-50.5927 210.4126,-38.7165"/> +<polygon fill="#000000" stroke="#000000" points="212.8361,-41.2714 218.6917,-32.4418 208.6079,-35.6926 212.8361,-41.2714"/> +</g> +<!-- Projection->Place --> +<g id="edge4" class="edge"> +<title>Projection->Place</title> +<path fill="none" stroke="#000000" d="M148.6918,-36.0931C149.4618,-43.9477 149.6794,-53.3282 149.3447,-62.0453"/> +<polygon fill="#000000" stroke="#000000" points="145.8406,-61.9901 148.6626,-72.2022 152.8249,-62.4593 145.8406,-61.9901"/> +</g> +<!-- Rvalue --> +<g id="node6" class="node"> +<title>Rvalue</title> +<ellipse fill="none" stroke="#000000" cx="35.7468" cy="-234" rx="35.9954" ry="18"/> +<text text-anchor="middle" x="35.7468" y="-230.3" font-family="Times,serif" font-size="14.00" fill="#000000">Rvalue</text> +</g> +<!-- Rvalue->Operand --> +<g id="edge6" class="edge"> +<title>Rvalue->Operand</title> +<path fill="none" stroke="#000000" d="M42.421,-216.2022C45.4715,-208.0675 49.153,-198.2501 52.54,-189.2181"/> +<polygon fill="#000000" stroke="#000000" points="55.8217,-190.4348 56.0559,-179.8425 49.2674,-187.9769 55.8217,-190.4348"/> +</g> +<!-- Assignment --> +<g id="node7" class="node"> +<title>Assignment</title> +<ellipse fill="none" stroke="#000000" cx="142.7468" cy="-234" rx="53.0913" ry="18"/> +<text text-anchor="middle" x="142.7468" y="-230.3" font-family="Times,serif" font-size="14.00" fill="#000000">Assignment</text> +</g> +<!-- Assignment->Operand --> +<g id="edge8" class="edge"> +<title>Assignment->Operand</title> +<path fill="none" stroke="#000000" d="M123.7879,-216.937C113.2012,-207.4089 99.8654,-195.4067 88.3611,-185.0529"/> +<polygon fill="#000000" stroke="#000000" points="90.5199,-182.287 80.7456,-178.1989 85.8371,-187.4901 90.5199,-182.287"/> +</g> +<!-- Assignment->Place --> +<g id="edge7" class="edge"> +<title>Assignment->Place</title> +<path fill="none" stroke="#000000" d="M142.7468,-215.7623C142.7468,-191.201 142.7468,-147.2474 142.7468,-118.3541"/> +<polygon fill="#000000" stroke="#000000" points="146.2469,-118.0896 142.7468,-108.0896 139.2469,-118.0897 146.2469,-118.0896"/> +</g> +</g> +</svg> |
