-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[lldb] Add a missing <atomic> include. NFC. #162809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-lldb Author: Martin Storsjö (mstorsjo) ChangesThis fixes building LLDB for mingw with libstdc++, after 8ae30a3. Previously, building errored out with errors like these: Full diff: https://github.com/llvm/llvm-project/pull/162809.diff 1 Files Affected:
diff --git a/lldb/include/lldb/Host/JSONTransport.h b/lldb/include/lldb/Host/JSONTransport.h
index 1453316e96fb4..29b40421575ac 100644
--- a/lldb/include/lldb/Host/JSONTransport.h
+++ b/lldb/include/lldb/Host/JSONTransport.h
@@ -35,6 +35,7 @@
#include <utility>
#include <variant>
#include <vector>
+#include <atomic>
#if __cplusplus >= 202002L
#include <concepts>
#endif
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
This fixes building LLDB for mingw with libstdc++, after 8ae30a3. Previously, building errored out with errors like these: In file included from llvm-project/lldb/include/lldb/Protocol/MCP/Transport.h:12, from llvm-project/lldb/include/lldb/Protocol/MCP/Server.h:16, from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.h:15, from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp:9: llvm-project/lldb/include/lldb/Host/JSONTransport.h:608:23: error: field ‘replied’ has incomplete type ‘std::atomic<bool>’ 608 | std::atomic<bool> replied = {false}; | ^~~~~~~ In file included from gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/bits/shared_ptr_atomic.h:33, from gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/memory:78, from llvm-project/lldb/include/lldb/Host/Socket.h:12, from llvm-project/lldb/include/lldb/Core/ProtocolServer.h:13, from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.h:12: gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/bits/atomic_base.h:162:12: note: declaration of ‘struct std::atomic<bool>’ 162 | struct atomic; | ^~~~~~
31bf67e to
8983730
Compare
DavidSpickett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the "include what you use" basis, this LGTM.
This fixes building LLDB for mingw with libstdc++, after 8ae30a3. Previously, building errored out with errors like these: In file included from llvm-project/lldb/include/lldb/Protocol/MCP/Transport.h:12, from llvm-project/lldb/include/lldb/Protocol/MCP/Server.h:16, from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.h:15, from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp:9: llvm-project/lldb/include/lldb/Host/JSONTransport.h:608:23: error: field ‘replied’ has incomplete type ‘std::atomic<bool>’ 608 | std::atomic<bool> replied = {false}; | ^~~~~~~ In file included from gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/bits/shared_ptr_atomic.h:33, from gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/memory:78, from llvm-project/lldb/include/lldb/Host/Socket.h:12, from llvm-project/lldb/include/lldb/Core/ProtocolServer.h:13, from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.h:12: gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/bits/atomic_base.h:162:12: note: declaration of ‘struct std::atomic<bool>’ 162 | struct atomic; | ^~~~~~
This fixes building LLDB for mingw with libstdc++, after 8ae30a3. Previously, building errored out with errors like these: In file included from llvm-project/lldb/include/lldb/Protocol/MCP/Transport.h:12, from llvm-project/lldb/include/lldb/Protocol/MCP/Server.h:16, from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.h:15, from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp:9: llvm-project/lldb/include/lldb/Host/JSONTransport.h:608:23: error: field ‘replied’ has incomplete type ‘std::atomic<bool>’ 608 | std::atomic<bool> replied = {false}; | ^~~~~~~ In file included from gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/bits/shared_ptr_atomic.h:33, from gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/memory:78, from llvm-project/lldb/include/lldb/Host/Socket.h:12, from llvm-project/lldb/include/lldb/Core/ProtocolServer.h:13, from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.h:12: gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/bits/atomic_base.h:162:12: note: declaration of ‘struct std::atomic<bool>’ 162 | struct atomic; | ^~~~~~
This fixes building LLDB for mingw with libstdc++, after 8ae30a3.
Previously, building errored out with errors like these: