[llvm] [LLVM][DWARF] Create thread safe context for DWP DWARFContext (PR #68262)
Alexander Yermolovich via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 14:42:18 PDT 2023
https://github.com/ayermolo created https://github.com/llvm/llvm-project/pull/68262
Right now DWARFContext is created is the same when input is DWO or DWP file.
Changed so that for DWP it creates a thread safe context.
>From 76536613038f6dc540b7bdce6c34d42c20c4e26c Mon Sep 17 00:00:00 2001
From: Alexander Yermolovich <ayermolo at meta.com>
Date: Wed, 4 Oct 2023 14:39:41 -0700
Subject: [PATCH] [LLVM][DWARF] Create thread safe context for DWP DWARFContext
Summary:
Right now DWARFContext is created is the same when input is DWO or DWP file.
Changed so that for DWP it creates a thread safe context.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
---
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index 1e1ab814673f423..6a91be97255b8bb 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -575,8 +575,11 @@ class ThreadUnsafeDWARFContextState : public DWARFContext::DWARFContextState {
auto S = std::make_shared<DWOFile>();
S->File = std::move(Obj.get());
- S->Context = DWARFContext::create(*S->File.getBinary(),
- DWARFContext::ProcessDebugRelocations::Ignore);
+ StringRef FileName = S->File.getBinary()->getFileName();
+ S->Context = DWARFContext::create(
+ *S->File.getBinary(), DWARFContext::ProcessDebugRelocations::Ignore,
+ nullptr, "", nullptr, nullptr,
+ FileName.find(".dwp") != StringRef::npos);
*Entry = S;
auto *Ctxt = S->Context.get();
return std::shared_ptr<DWARFContext>(std::move(S), Ctxt);
More information about the llvm-commits
mailing list