Commit b91de4c
authored
[IR] Simplify dispatchRecalculateHash and dispatchResetHash (NFC) (#159903)
This patch simplifies dispatchRecalculateHash and dispatchResetHash
with "constexpr if".
This patch does not inline dispatchRecalculateHash and
dispatchResetHash into their respective call sites. Using "constexpr
if" in a non-template context like MDNode::uniquify would still
require the discarded branch to be syntactically valid, causing a
compilation error for node types that do not have
recalculateHash/setHash. Using template functions ensures that the
"constexpr if" is evaluated in a proper template context, allowing the
compiler to fully discard the inactive branch.1 parent a04c0f5 commit b91de4c
2 files changed
+10
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1410 | 1410 | | |
1411 | 1411 | | |
1412 | 1412 | | |
1413 | | - | |
1414 | | - | |
1415 | | - | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
1425 | 1421 | | |
1426 | 1422 | | |
1427 | 1423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1003 | 1003 | | |
1004 | 1004 | | |
1005 | 1005 | | |
1006 | | - | |
1007 | | - | |
| 1006 | + | |
1008 | 1007 | | |
1009 | 1008 | | |
1010 | 1009 | | |
| |||
1060 | 1059 | | |
1061 | 1060 | | |
1062 | 1061 | | |
1063 | | - | |
1064 | | - | |
| 1062 | + | |
1065 | 1063 | | |
1066 | 1064 | | |
1067 | 1065 | | |
| |||
0 commit comments