Skip to content

Commit 6543bd7

Browse files
authored
[DataLayout] Extract loop body into a function to reduce nesting (NFC) (#104420)
Also, use `iterator_range` version of `split`. Pull Request: #104420
1 parent 026d963 commit 6543bd7

File tree

3 files changed

+267
-248
lines changed

3 files changed

+267
-248
lines changed

llvm/include/llvm/IR/DataLayout.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,11 @@ class DataLayout {
165165
/// Internal helper method that returns requested alignment for type.
166166
Align getAlignment(Type *Ty, bool abi_or_pref) const;
167167

168-
/// Attempts to parse a target data specification string and reports an error
169-
/// if the string is malformed.
170-
Error parseSpecifier(StringRef Desc);
168+
/// Attempts to parse a single specification.
169+
Error parseSpecification(StringRef Specification);
170+
171+
/// Attempts to parse a data layout string.
172+
Error parseLayoutString(StringRef LayoutString);
171173

172174
public:
173175
/// Constructs a DataLayout with default values.
@@ -188,7 +190,7 @@ class DataLayout {
188190

189191
/// Parse a data layout string and return the layout. Return an error
190192
/// description on failure.
191-
static Expected<DataLayout> parse(StringRef LayoutDescription);
193+
static Expected<DataLayout> parse(StringRef LayoutString);
192194

193195
/// Layout endianness...
194196
bool isLittleEndian() const { return !BigEndian; }

0 commit comments

Comments
 (0)