Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct CustomMappingTraits<
}
Args.push_back(Arg);
}
io.mapRequired(Key.str().c_str(), V[Args]);
io.mapRequired(Key, V[Args]);
}
static void output(
IO &io,
Expand All @@ -91,7 +91,7 @@ struct CustomMappingTraits<
Key += ',';
Key += llvm::utostr(Arg);
}
io.mapRequired(Key.c_str(), P.second);
io.mapRequired(Key, P.second);
}
}
};
Expand Down Expand Up @@ -122,11 +122,11 @@ struct CustomMappingTraits<std::map<uint64_t, WholeProgramDevirtResolution>> {
io.setError("key not an integer");
return;
}
io.mapRequired(Key.str().c_str(), V[KeyInt]);
io.mapRequired(Key, V[KeyInt]);
}
static void output(IO &io, std::map<uint64_t, WholeProgramDevirtResolution> &V) {
for (auto &P : V)
io.mapRequired(llvm::utostr(P.first).c_str(), P.second);
io.mapRequired(llvm::utostr(P.first), P.second);
}
};

Expand Down Expand Up @@ -215,7 +215,7 @@ namespace yaml {
template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> {
static void inputOne(IO &io, StringRef Key, GlobalValueSummaryMapTy &V) {
std::vector<GlobalValueSummaryYaml> GVSums;
io.mapRequired(Key.str().c_str(), GVSums);
io.mapRequired(Key, GVSums);
uint64_t KeyInt;
if (Key.getAsInteger(0, KeyInt)) {
io.setError("key not an integer");
Expand Down Expand Up @@ -290,7 +290,7 @@ template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> {
}
}
if (!GVSums.empty())
io.mapRequired(llvm::utostr(P.first).c_str(), GVSums);
io.mapRequired(llvm::utostr(P.first), GVSums);
}
}
static void fixAliaseeLinks(GlobalValueSummaryMapTy &V) {
Expand All @@ -313,12 +313,12 @@ template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> {
template <> struct CustomMappingTraits<TypeIdSummaryMapTy> {
static void inputOne(IO &io, StringRef Key, TypeIdSummaryMapTy &V) {
TypeIdSummary TId;
io.mapRequired(Key.str().c_str(), TId);
io.mapRequired(Key, TId);
V.insert({GlobalValue::getGUIDAssumingExternalLinkage(Key), {Key, TId}});
}
static void output(IO &io, TypeIdSummaryMapTy &V) {
for (auto &TidIter : V)
io.mapRequired(TidIter.second.first.str().c_str(), TidIter.second.second);
io.mapRequired(TidIter.second.first, TidIter.second.second);
}
};

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ProfileData/MemProfYAML.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ template <> struct CustomMappingTraits<memprof::PortableMemInfoBlock> {
#define MIBEntryDef(NameTag, Name, Type) \
if (KeyStr == #Name) { \
uint64_t Value; \
Io.mapRequired(KeyStr.str().c_str(), Value); \
Io.mapRequired(KeyStr, Value); \
MIB.Name = static_cast<Type>(Value); \
MIB.Schema.set(llvm::to_underlying(memprof::Meta::Name)); \
return; \
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/YAMLTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -1921,12 +1921,12 @@ template <typename T> struct StdMapStringCustomMappingTraitsImpl {
using map_type = std::map<std::string, T>;

static void inputOne(IO &io, StringRef key, map_type &v) {
io.mapRequired(key.str().c_str(), v[std::string(key)]);
io.mapRequired(key, v[std::string(key)]);
}

static void output(IO &io, map_type &v) {
for (auto &p : v)
io.mapRequired(p.first.c_str(), p.second);
io.mapRequired(p.first, p.second);
}
};

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/BinaryFormat/MsgPackDocumentYAML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ template <> struct CustomMappingTraits<MapDocNode> {
static void inputOne(IO &IO, StringRef Key, MapDocNode &M) {
ScalarDocNode KeyObj = M.getDocument()->getNode();
KeyObj.fromString(Key, "");
IO.mapRequired(Key.str().c_str(), M.getMap()[KeyObj]);
IO.mapRequired(Key, M.getMap()[KeyObj]);
}

static void output(IO &IO, MapDocNode &M) {
for (auto I : M.getMap()) {
IO.mapRequired(I.first.toString().c_str(), I.second);
IO.mapRequired(I.first.toString(), I.second);
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CGData/OutlinedHashTreeRecord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ template <> struct MappingTraits<HashNodeStable> {
template <> struct CustomMappingTraits<IdHashNodeStableMapTy> {
static void inputOne(IO &io, StringRef Key, IdHashNodeStableMapTy &V) {
HashNodeStable NodeStable;
io.mapRequired(Key.str().c_str(), NodeStable);
io.mapRequired(Key, NodeStable);
unsigned Id;
if (Key.getAsInteger(0, Id)) {
io.setError("Id not an integer");
Expand All @@ -48,7 +48,7 @@ template <> struct CustomMappingTraits<IdHashNodeStableMapTy> {

static void output(IO &io, IdHashNodeStableMapTy &V) {
for (auto Iter = V.begin(); Iter != V.end(); ++Iter)
io.mapRequired(utostr(Iter->first).c_str(), Iter->second);
io.mapRequired(utostr(Iter->first), Iter->second);
}
};

Expand Down
3 changes: 1 addition & 2 deletions llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ template <> struct MappingTraits<WebAssemblyFunctionInfo> {
template <> struct CustomMappingTraits<BBNumberMap> {
static void inputOne(IO &YamlIO, StringRef Key,
BBNumberMap &SrcToUnwindDest) {
YamlIO.mapRequired(Key.str().c_str(),
SrcToUnwindDest[std::atoi(Key.str().c_str())]);
YamlIO.mapRequired(Key, SrcToUnwindDest[std::atoi(Key.str().c_str())]);
}

static void output(IO &YamlIO, BBNumberMap &SrcToUnwindDest) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ struct CustomMappingTraits<std::map<exegesis::ValidationEvent, int64_t>> {
Io.setError("Key is not a valid validation event");
return;
}
Io.mapRequired(KeyStr.str().c_str(), VI[*Key]);
Io.mapRequired(KeyStr, VI[*Key]);
}

static void output(IO &Io, std::map<exegesis::ValidationEvent, int64_t> &VI) {
Expand Down
4 changes: 2 additions & 2 deletions llvm/unittests/Support/YAMLIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3221,12 +3221,12 @@ template <> struct TaggedScalarTraits<Scalar> {

template <> struct CustomMappingTraits<Map> {
static void inputOne(IO &IO, StringRef Key, Map &M) {
IO.mapRequired(Key.str().c_str(), M[Key]);
IO.mapRequired(Key, M[Key]);
}

static void output(IO &IO, Map &M) {
for (auto &N : M)
IO.mapRequired(N.getKey().str().c_str(), N.getValue());
IO.mapRequired(N.getKey(), N.getValue());
}
};

Expand Down