Skip to content
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

[Reflection] NFC: Workaround LLVM C++ standard library weirdness #32406

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions include/swift/Reflection/ReflectionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "swift/Runtime/Unreachable.h"

#include <set>
#include <sstream>
#include <unordered_map>
#include <utility>
#include <vector>
Expand Down Expand Up @@ -946,10 +945,12 @@ class ReflectionContext
reinterpret_cast<const MetadataAllocationBacktraceHeader<Runtime> *>(
HeaderBytes.get());
if (HeaderPtr == nullptr) {
std::stringstream stream;
stream << "unable to read Next pointer 0x" << std::hex
<< BacktraceListNext.getAddressData();
return stream.str();
// FIXME: std::stringstream would be better, but LLVM's standard library
// introduces a vtable and we don't want that.
char result[128];
std::snprintf(result, sizeof(result), "unable to read Next pointer %p",
BacktraceListNext.getAddressData());
return std::string(result);
}
auto BacktraceAddrPtr =
BacktraceListNext +
Expand Down