<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/mir-opt/instsimplify/duplicate_switch_targets.rs, branch perf-tmp</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-07-29T10:14:35+00:00</updated>
<entry>
<title>Perform instsimplify before inline to eliminate some trivial calls</title>
<updated>2024-07-29T10:14:35+00:00</updated>
<author>
<name>DianQK</name>
<email>dianqk@dianqk.net</email>
</author>
<published>2024-07-27T06:36:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ae681c940dd0813f75770fecd4f565d376b37d37'/>
<id>urn:sha1:ae681c940dd0813f75770fecd4f565d376b37d37</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reformat `mir!` macro invocations to use braces.</title>
<updated>2024-06-03T03:24:44+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-06-03T00:19:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ac242996366cd0d1ec48ff76638320969c65bed3'/>
<id>urn:sha1:ac242996366cd0d1ec48ff76638320969c65bed3</id>
<content type='text'>
The `mir!` macro has multiple parts:
- An optional return type annotation.
- A sequence of zero or more local declarations.
- A mandatory starting anonymous basic block, which is brace-delimited.
- A sequence of zero of more additional named basic blocks.

Some `mir!` invocations use braces with a "block" style, like so:
```
mir! {
    let _unit: ();
    {
	let non_copy = S(42);
	let ptr = std::ptr::addr_of_mut!(non_copy);
	// Inside `callee`, the first argument and `*ptr` are basically
	// aliasing places!
	Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue())
    }
    after_call = {
	Return()
    }
}
```
Some invocations use parens with a "block" style, like so:
```
mir!(
    let x: [i32; 2];
    let one: i32;
    {
	x = [42, 43];
	one = 1;
	x = [one, 2];
	RET = Move(x);
	Return()
    }
)
```
And some invocations uses parens with a "tighter" style, like so:
```
mir!({
    SetDiscriminant(*b, 0);
    Return()
})
```
This last style is generally used for cases where just the mandatory
starting basic block is present. Its braces are placed next to the
parens.

This commit changes all `mir!` invocations to use braces with a "block"
style. Why?

- Consistency is good.

- The contents of the invocation is a block of code, so it's odd to use
  parens. They are more normally used for function-like macros.

- Most importantly, the next commit will enable rustfmt for
  `tests/mir-opt/`. rustfmt is more aggressive about formatting macros
  that use parens than macros that use braces. Without this commit's
  changes, rustfmt would break a couple of `mir!` macro invocations that
  use braces within `tests/mir-opt` by inserting an extraneous comma.
  E.g.:
  ```
  mir!(type RET = (i32, bool);, { // extraneous comma after ';'
      RET.0 = 1;
      RET.1 = true;
      Return()
  })
  ```
  Switching those `mir!` invocations to use braces avoids that problem,
  resulting in this, which is nicer to read as well as being valid
  syntax:
  ```
  mir! {
      type RET = (i32, bool);
      {
	  RET.0 = 1;
	  RET.1 = true;
	  Return()
      }
  }
  ```
</content>
</entry>
<entry>
<title>mir-opt tests: rename unit-test -&gt; test-mir-pass</title>
<updated>2024-04-20T11:19:34+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2024-04-20T11:19:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=75d0fdd96713874703998cb06dae67ab09b7897e'/>
<id>urn:sha1:75d0fdd96713874703998cb06dae67ab09b7897e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives</title>
<updated>2024-02-22T16:04:04+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>jieyouxu@outlook.com</email>
</author>
<published>2024-02-22T12:10:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6e48b96692d63a79a14563f27fe5185f122434f8'/>
<id>urn:sha1:6e48b96692d63a79a14563f27fe5185f122434f8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>FileCheck duplicate_switch_targets.</title>
<updated>2023-10-19T15:51:54+00:00</updated>
<author>
<name>Camille GILLOT</name>
<email>gillot.camille@gmail.com</email>
</author>
<published>2023-10-16T19:39:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=386fff34f79be519d0a5ef023f5fea367a5e16f8'/>
<id>urn:sha1:386fff34f79be519d0a5ef023f5fea367a5e16f8</id>
<content type='text'>
</content>
</entry>
</feed>
