diff options
author | Yingwei Zheng <dtcxzyw2333@gmail.com> | 2024-03-26 21:32:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 21:32:57 +0800 |
commit | 93d33a1355438638232e66991f3a90c376c61fea (patch) | |
tree | c34f83bdb13c6b2715baef9558bffd983f71ab53 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 3a2c70b3713a856ea416d92abdddb7893fca308b (diff) | |
download | llvm-93d33a1355438638232e66991f3a90c376c61fea.zip llvm-93d33a1355438638232e66991f3a90c376c61fea.tar.gz llvm-93d33a1355438638232e66991f3a90c376c61fea.tar.bz2 |
[PatternMatch] Refactor `m_SpecificInt` to avoid constructing APInt. NFC. (#86259)
This patch passes APInt by const reference in m_SpecificInt instead of
by value. Specifically, it refactors `m_SpecificInt(uint64_t V)` to
avoid APInt construction and dangling reference.
I believe it is safe to pass the APInt by const reference into
`m_SpecificInt` even if it is a temporary.
See also https://en.cppreference.com/w/cpp/language/lifetime
> All temporary objects are destroyed as the last step in evaluating the
[full-expression](https://en.cppreference.com/w/cpp/language/expressions#Full-expressions)
that (lexically) contains the point where they were created
Compile-time impact:
https://llvm-compile-time-tracker.com/compare.php?from=d1f182c895728d89c5c3d198b133e212a5d9d4a3&to=7edf459b95ab2be33b70ec67faf87b3b8cc84f09&stat=instructions:u
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions