aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@fb.com>2023-11-08 10:20:02 -0800
committerGitHub <noreply@github.com>2023-11-08 10:20:02 -0800
commit5aa934e2af8727852dec0ec1cfa0cba05d858f70 (patch)
tree053702e1a0b56835b265f22e00fed64e997de8d6 /clang/lib/CodeGen/CodeGenAction.cpp
parent070fde30a74222c35dc2b72a6b156cc39c94fee3 (diff)
downloadllvm-5aa934e2af8727852dec0ec1cfa0cba05d858f70.zip
llvm-5aa934e2af8727852dec0ec1cfa0cba05d858f70.tar.gz
llvm-5aa934e2af8727852dec0ec1cfa0cba05d858f70.tar.bz2
Make DWARFUnitVector threadsafe. (#71487)
The DWARFUnitVector class lives inside of the DWARFContextState. Prior to this fix a non const reference was being handed out to clients. When fetching the DWO units, there used to be a "bool Lazy" parameter that could be passed that would allow the DWARFUnitVector to parse individual units on the fly. There were two major issues with this approach: - not thread safe and causes crashes - the accessor would check if DWARFUnitVector was empty and if not empty it would return a partially filled in DWARFUnitVector if it was constructed with "Lazy = true" This patch fixes the issues by always fully parsing the DWARFUnitVector when it is requested and only hands out a "const DWARFUnitVector &". This allows the thread safety mechanism built into the DWARFContext class to work corrrectly, and avoids the issue where if someone construct DWARFUnitVector with "Lazy = true", and then calls an API that partially fills in the DWARFUnitVector with individual entries, and then someone accesses the DWARFUnitVector, they would get a partial and incomplete listing of the DWARF units for the DWOs.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
0 files changed, 0 insertions, 0 deletions