[PATCH] D148392: [Demangle] fix windows build
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 14 16:15:39 PDT 2023
nickdesaulniers updated this revision to Diff 513791.
nickdesaulniers added a comment.
- use front again to fix the binary - properly
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148392/new/
https://reviews.llvm.org/D148392
Files:
llvm/include/llvm/Demangle/Utility.h
llvm/lib/Demangle/ItaniumDemangle.cpp
llvm/lib/Demangle/MicrosoftDemangle.cpp
Index: llvm/lib/Demangle/MicrosoftDemangle.cpp
===================================================================
--- llvm/lib/Demangle/MicrosoftDemangle.cpp
+++ llvm/lib/Demangle/MicrosoftDemangle.cpp
@@ -267,7 +267,7 @@
// This is not a micro-optimization, it avoids UB, should Borrowed be an null
// buffer.
if (Borrowed.size())
- std::memcpy(Stable, Borrowed.begin(), Borrowed.size());
+ std::memcpy(Stable, &Borrowed.front(), Borrowed.size());
return {Stable, Borrowed.size()};
}
@@ -791,7 +791,7 @@
Error = true;
return nullptr;
}
- const char *Start = MangledName.begin();
+ const char *Start = &MangledName.front();
MangledName.remove_prefix(MD5Last + 1);
// There are two additional special cases for MD5 names:
@@ -2377,7 +2377,7 @@
T->output(OB, OF_Default);
std::string_view B = OB;
- std::printf(" [%d] - %.*s\n", (int)I, (int)B.size(), B.begin());
+ std::printf(" [%d] - %.*s\n", (int)I, (int)B.size(), &B.front());
}
std::free(OB.getBuffer());
@@ -2386,7 +2386,7 @@
std::printf("%d name backreferences\n", (int)Backrefs.NamesCount);
for (size_t I = 0; I < Backrefs.NamesCount; ++I) {
std::printf(" [%d] - %.*s\n", (int)I, (int)Backrefs.Names[I]->Name.size(),
- Backrefs.Names[I]->Name.begin());
+ &Backrefs.Names[I]->Name.front());
}
if (Backrefs.NamesCount > 0)
std::printf("\n");
@@ -2400,7 +2400,7 @@
std::string_view Name{MangledName};
SymbolNode *AST = D.parse(Name);
if (!D.Error && NMangled)
- *NMangled = Name.begin() - MangledName;
+ *NMangled = &Name.front() - MangledName;
if (Flags & MSDF_DumpBackrefs)
D.dumpBackReferences();
Index: llvm/lib/Demangle/ItaniumDemangle.cpp
===================================================================
--- llvm/lib/Demangle/ItaniumDemangle.cpp
+++ llvm/lib/Demangle/ItaniumDemangle.cpp
@@ -79,7 +79,7 @@
void printStr(const char *S) { fprintf(stderr, "%s", S); }
void print(std::string_view SV) {
- fprintf(stderr, "\"%.*s\"", (int)SV.size(), SV.begin());
+ fprintf(stderr, "\"%.*s\"", (int)SV.size(), &SV.front());
}
void print(const Node *N) {
if (N)
Index: llvm/include/llvm/Demangle/Utility.h
===================================================================
--- llvm/include/llvm/Demangle/Utility.h
+++ llvm/include/llvm/Demangle/Utility.h
@@ -108,7 +108,7 @@
OutputBuffer &operator+=(std::string_view R) {
if (size_t Size = R.size()) {
grow(Size);
- std::memcpy(Buffer + CurrentPosition, R.begin(), Size);
+ std::memcpy(Buffer + CurrentPosition, &R.front(), Size);
CurrentPosition += Size;
}
return *this;
@@ -125,7 +125,7 @@
grow(Size);
std::memmove(Buffer + Size, Buffer, CurrentPosition);
- std::memcpy(Buffer, R.begin(), Size);
+ std::memcpy(Buffer, &R.front(), Size);
CurrentPosition += Size;
return *this;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148392.513791.patch
Type: text/x-patch
Size: 2933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230414/142b30d8/attachment.bin>
More information about the llvm-commits
mailing list