about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorPietro Albini <pietro.albini@ferrous-systems.com>2021-10-27 13:03:55 +0200
committerPietro Albini <pietro.albini@ferrous-systems.com>2021-10-27 17:00:49 +0200
commita5a8bb012540c23a9b4ab5a38bc7f75d5ebaba60 (patch)
treedb73a31a4a7af8edd49bf0592f85c6180ef8c87f /compiler/rustc_codegen_llvm/src
parent9fb66969e38f1ce4b269f9506faf7ebc161ececa (diff)
downloadrust-a5a8bb012540c23a9b4ab5a38bc7f75d5ebaba60.tar.gz
rust-a5a8bb012540c23a9b4ab5a38bc7f75d5ebaba60.zip
replace `|` with `||` in string validation
Using short-circuiting operators makes it easier to perform some kinds
of source code analysis, like MC/DC code coverage (a requirement in
safety-critical environments). The optimized x86_64 assembly is
equivalent between the old and new versions.

Old assembly of that condition:

```
mov  rax, qword ptr [rdi + rdx + 8]
or   rax, qword ptr [rdi + rdx]
test rax, r9
je   .LBB0_7
```

New assembly of that condition:

```
mov  rax, qword ptr [rdi + rdx]
or   rax, qword ptr [rdi + rdx + 8]
test rax, r8
je   .LBB0_7
```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions