@@ -166,6 +166,7 @@ class DataLayout {
166166 SmallVector<unsigned , 8 > NonIntegralAddressSpaces;
167167
168168 DenseMap<unsigned , int64_t > AddrSpaceToSentinelValueMap;
169+ bool sentinelValueDefined = false ;
169170
170171 // / Attempts to set the alignment of the given type. Returns an error
171172 // / description on failure.
@@ -222,6 +223,8 @@ class DataLayout {
222223 StructAlignment = DL.StructAlignment ;
223224 Pointers = DL.Pointers ;
224225 NonIntegralAddressSpaces = DL.NonIntegralAddressSpaces ;
226+ AddrSpaceToSentinelValueMap = DL.AddrSpaceToSentinelValueMap ;
227+ sentinelValueDefined = DL.isSentinelValueDefined ();
225228 return *this ;
226229 }
227230
@@ -302,7 +305,7 @@ class DataLayout {
302305 return ManglingMode == MM_WinCOFFX86;
303306 }
304307
305- int64_t getSentinelPointerValue (unsigned AddrSpace) {
308+ int64_t getSentinelPointerValue (unsigned AddrSpace) const {
306309 auto It = AddrSpaceToSentinelValueMap.find (AddrSpace);
307310 if (It == AddrSpaceToSentinelValueMap.end ())
308311 return 0 ;
@@ -313,6 +316,8 @@ class DataLayout {
313316 AddrSpaceToSentinelValueMap[AddrSpace] = Value;
314317 }
315318
319+ bool isSentinelValueDefined () const { return sentinelValueDefined; }
320+
316321 // / Returns true if symbols with leading question marks should not receive IR
317322 // / mangling. True for Windows mangling modes.
318323 bool doNotMangleLeadingQuestionMark () const {
0 commit comments