@@ -166,6 +166,7 @@ class DataLayout {
166
166
SmallVector<unsigned , 8 > NonIntegralAddressSpaces;
167
167
168
168
DenseMap<unsigned , int64_t > AddrSpaceToSentinelValueMap;
169
+ bool sentinelValueDefined = false ;
169
170
170
171
// / Attempts to set the alignment of the given type. Returns an error
171
172
// / description on failure.
@@ -222,6 +223,8 @@ class DataLayout {
222
223
StructAlignment = DL.StructAlignment ;
223
224
Pointers = DL.Pointers ;
224
225
NonIntegralAddressSpaces = DL.NonIntegralAddressSpaces ;
226
+ AddrSpaceToSentinelValueMap = DL.AddrSpaceToSentinelValueMap ;
227
+ sentinelValueDefined = DL.isSentinelValueDefined ();
225
228
return *this ;
226
229
}
227
230
@@ -302,7 +305,7 @@ class DataLayout {
302
305
return ManglingMode == MM_WinCOFFX86;
303
306
}
304
307
305
- int64_t getSentinelPointerValue (unsigned AddrSpace) {
308
+ int64_t getSentinelPointerValue (unsigned AddrSpace) const {
306
309
auto It = AddrSpaceToSentinelValueMap.find (AddrSpace);
307
310
if (It == AddrSpaceToSentinelValueMap.end ())
308
311
return 0 ;
@@ -313,6 +316,8 @@ class DataLayout {
313
316
AddrSpaceToSentinelValueMap[AddrSpace] = Value;
314
317
}
315
318
319
+ bool isSentinelValueDefined () const { return sentinelValueDefined; }
320
+
316
321
// / Returns true if symbols with leading question marks should not receive IR
317
322
// / mangling. True for Windows mangling modes.
318
323
bool doNotMangleLeadingQuestionMark () const {
0 commit comments