aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-06-24 15:00:11 +0200
committerGitHub <noreply@github.com>2024-06-24 15:00:11 +0200
commit5cd0ba30f53d11835dbfd05ad4071d397387fb04 (patch)
treef82e4b26861f63fed771a50c5075c75a7e1cc4ad /llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
parent0cf1e662b13fb20d3897c5b9055c60b0de50beca (diff)
downloadllvm-5cd0ba30f53d11835dbfd05ad4071d397387fb04.zip
llvm-5cd0ba30f53d11835dbfd05ad4071d397387fb04.tar.gz
llvm-5cd0ba30f53d11835dbfd05ad4071d397387fb04.tar.bz2
Reapply [IR] Lazily initialize the class to pass name mapping (NFC) (#96321) (#96462)
On MSVC the `this` uses inside `decltype` require a lambda capture. On clang they result in an unused capture warning instead. Add the capture and suppress the warning with `(void)this`. ----- Initializing this map is somewhat expensive (especially for O0), so we currently only do it if certain flags are used. I would like to make use of it for crash dumps (#96078), where we don't know in advance whether it will be needed or not. This patch changes the initialization to a lazy approach, where a callback is registered that does the actual initialization. The callbacks will be run the first time the pass name is requested. This way there is no compile-time impact if the mapping is not used.
Diffstat (limited to 'llvm/lib/Target/DirectX/DirectXTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/DirectX/DirectXTargetMachine.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp b/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
index c853393..e6dbb25 100644
--- a/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
+++ b/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
@@ -102,8 +102,7 @@ DirectXTargetMachine::DirectXTargetMachine(const Target &T, const Triple &TT,
DirectXTargetMachine::~DirectXTargetMachine() {}
-void DirectXTargetMachine::registerPassBuilderCallbacks(
- PassBuilder &PB, bool PopulateClassToPassNames) {
+void DirectXTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
#define GET_PASS_REGISTRY "DirectXPassRegistry.def"
#include "llvm/Passes/TargetPassRegistry.inc"
}