summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-02-27 00:58:09 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-02-27 00:58:09 +0000
commitbb111152b7e4d45aeb711be9262b252936e0c028 (patch)
treeb51f6ff5fa375cb0e7028e5236afd3dd4239378f /llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp
parent25838c6dacca8203b4478ac2c16e563b51c3708b (diff)
downloadbcm5719-llvm-bb111152b7e4d45aeb711be9262b252936e0c028.tar.gz
bcm5719-llvm-bb111152b7e4d45aeb711be9262b252936e0c028.zip
[DWARFFormValue] Cleanup DWARFFormValue interface. (NFC)
DWARFFormValues can be created from a data extractor or by passing its value directly. Until now this was done by member functions that modified an existing object's internal state. This patch replaces a subset of these methods with static method that return a new DWARFFormValue. llvm-svn: 354941
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp
index 28354dafb84..f4dd7993760 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp
@@ -163,11 +163,11 @@ Optional<DWARFFormValue> DWARFAbbreviationDeclaration::getAttributeValue(
for (const auto &Spec : AttributeSpecs) {
if (*MatchAttrIndex == AttrIndex) {
// We have arrived at the attribute to extract, extract if from Offset.
+ if (Spec.isImplicitConst())
+ return DWARFFormValue::createFromSValue(Spec.Form,
+ Spec.getImplicitConstValue());
+
DWARFFormValue FormValue(Spec.Form);
- if (Spec.isImplicitConst()) {
- FormValue.setSValue(Spec.getImplicitConstValue());
- return FormValue;
- }
if (FormValue.extractValue(DebugInfoData, &Offset, U.getFormParams(), &U))
return FormValue;
}
OpenPOWER on IntegriCloud