@@ -115,14 +115,6 @@ class DataLayout {
115
115
// FIXME: `unsigned char` truncates the value parsed by `parseSpecifier`.
116
116
SmallVector<unsigned char , 8 > LegalIntWidths;
117
117
118
- // / Type specifier used by some internal functions.
119
- enum class TypeSpecifier {
120
- Integer = ' i' ,
121
- Float = ' f' ,
122
- Vector = ' v' ,
123
- Aggregate = ' a'
124
- };
125
-
126
118
// / Primitive type specifications. Sorted and uniqued by type bit width.
127
119
SmallVector<PrimitiveSpec, 6 > IntSpecs;
128
120
SmallVector<PrimitiveSpec, 4 > FloatSpecs;
@@ -145,28 +137,35 @@ class DataLayout {
145
137
// / well-defined bitwise representation.
146
138
SmallVector<unsigned , 8 > NonIntegralAddressSpaces;
147
139
148
- // / Attempts to set the specification for the given type.
149
- // / Returns an error description on failure.
150
- Error setPrimitiveSpec (TypeSpecifier Specifier, uint32_t BitWidth,
151
- Align ABIAlign, Align PrefAlign);
140
+ // / Sets or updates the specification for the given primitive type.
141
+ void setPrimitiveSpec (char Specifier, uint32_t BitWidth, Align ABIAlign,
142
+ Align PrefAlign);
152
143
153
144
// / Searches for a pointer specification that matches the given address space.
154
145
// / Returns the default address space specification if not found.
155
146
const PointerSpec &getPointerSpec (uint32_t AddrSpace) const ;
156
147
157
- // / Attempts to set the specification for pointer in the given address space.
158
- // / Returns an error description on failure.
159
- Error setPointerSpec (uint32_t AddrSpace, uint32_t BitWidth, Align ABIAlign,
160
- Align PrefAlign, uint32_t IndexBitWidth);
148
+ // / Sets or updates the specification for pointer in the given address space.
149
+ void setPointerSpec (uint32_t AddrSpace, uint32_t BitWidth, Align ABIAlign,
150
+ Align PrefAlign, uint32_t IndexBitWidth);
161
151
162
152
// / Internal helper to get alignment for integer of given bitwidth.
163
153
Align getIntegerAlignment (uint32_t BitWidth, bool abi_or_pref) const ;
164
154
165
155
// / Internal helper method that returns requested alignment for type.
166
156
Align getAlignment (Type *Ty, bool abi_or_pref) const ;
167
157
158
+ // / Attempts to parse primitive specification ('i', 'f', or 'v').
159
+ Error parsePrimitiveSpec (StringRef Spec);
160
+
161
+ // / Attempts to parse aggregate specification ('a').
162
+ Error parseAggregateSpec (StringRef Spec);
163
+
164
+ // / Attempts to parse pointer specification ('p').
165
+ Error parsePointerSpec (StringRef Spec);
166
+
168
167
// / Attempts to parse a single specification.
169
- Error parseSpecification (StringRef Specification );
168
+ Error parseSpecification (StringRef Spec );
170
169
171
170
// / Attempts to parse a data layout string.
172
171
Error parseLayoutString (StringRef LayoutString);
0 commit comments