[PATCH] D132214: [ARM] Fix bug in also_compatible_with attribute parser
Victor Campos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 22 01:40:54 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1d66c5ebbc43: [ARM] Fix bug in also_compatible_with attribute parser (authored by vhscampos).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132214/new/
https://reviews.llvm.org/D132214
Files:
llvm/include/llvm/Support/ELFAttributeParser.h
llvm/lib/Support/ARMAttributeParser.cpp
llvm/lib/Support/ELFAttributeParser.cpp
Index: llvm/lib/Support/ELFAttributeParser.cpp
===================================================================
--- llvm/lib/Support/ELFAttributeParser.cpp
+++ llvm/lib/Support/ELFAttributeParser.cpp
@@ -53,7 +53,7 @@
StringRef tagName =
ELFAttrs::attrTypeAsString(tag, tagToStringMap, /*hasTagPrefix=*/false);
StringRef desc = de.getCStrRef(cursor);
- attributesStr.insert(std::make_pair(tag, desc));
+ setAttributeString(tag, desc);
if (sw) {
DictScope scope(*sw, "Attribute");
Index: llvm/lib/Support/ARMAttributeParser.cpp
===================================================================
--- llvm/lib/Support/ARMAttributeParser.cpp
+++ llvm/lib/Support/ARMAttributeParser.cpp
@@ -448,14 +448,18 @@
}
}
- DictScope scope(*sw, "Attribute");
- sw->printNumber("Tag", tag);
- sw->printString("TagName",
- ELFAttrs::attrTypeAsString(tag, tagToStringMap, false));
- sw->printStringEscaped("Value", RawStringValue);
- if (!Description.empty()) {
- sw->printString("Description", Description);
+ setAttributeString(tag, RawStringValue);
+ if (sw) {
+ DictScope scope(*sw, "Attribute");
+ sw->printNumber("Tag", tag);
+ sw->printString("TagName",
+ ELFAttrs::attrTypeAsString(tag, tagToStringMap, false));
+ sw->printStringEscaped("Value", RawStringValue);
+ if (!Description.empty()) {
+ sw->printString("Description", Description);
+ }
}
+
cursor.seek(FinalOffset);
return returnValue ? std::move(*returnValue) : Error::success();
Index: llvm/include/llvm/Support/ELFAttributeParser.h
===================================================================
--- llvm/include/llvm/Support/ELFAttributeParser.h
+++ llvm/include/llvm/Support/ELFAttributeParser.h
@@ -42,6 +42,10 @@
void parseIndexList(SmallVectorImpl<uint8_t> &indexList);
Error parseSubsection(uint32_t length);
+ void setAttributeString(unsigned tag, StringRef value) {
+ attributesStr.emplace(tag, value);
+ }
+
public:
virtual ~ELFAttributeParser() { static_cast<void>(!cursor.takeError()); }
Error integerAttribute(unsigned tag);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132214.454413.patch
Type: text/x-patch
Size: 2132 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220822/616ad003/attachment-0001.bin>
More information about the llvm-commits
mailing list