[PATCH] D148392: [Demangle] fix windows build
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 14 16:07:28 PDT 2023
nickdesaulniers created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
nickdesaulniers requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Fixes diagnostics reported against
https://reviews.llvm.org/D148384
https://lab.llvm.org/buildbot/#/builders/127/builds/46749/steps/4/logs/stdio
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D148392
Files:
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.begin(), Borrowed.size());
return {Stable, Borrowed.size()};
}
@@ -791,7 +791,7 @@
Error = true;
return nullptr;
}
- const char *Start = MangledName.begin();
+ const char *Start = &*MangledName.begin();
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.begin());
}
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.begin());
}
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.begin() - &*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.begin());
}
void print(const Node *N) {
if (N)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148392.513786.patch
Type: text/x-patch
Size: 2200 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230414/81551ed5/attachment.bin>
More information about the llvm-commits
mailing list