@@ -187,8 +187,8 @@ class alignas(8) InitializedEntity {
187
187
ObjCMethodDecl *MethodDecl;
188
188
189
189
// / When Kind == EK_Parameter, the ParmVarDecl, with the
190
- // / low bit indicating whether the parameter is "consumed".
191
- uintptr_t Parameter;
190
+ // / integer indicating whether the parameter is "consumed".
191
+ llvm::PointerIntPair<ParmVarDecl *, 1 > Parameter;
192
192
193
193
// / When Kind == EK_Temporary or EK_CompoundLiteralInit, the type
194
194
// / source information for the temporary.
@@ -197,9 +197,9 @@ class alignas(8) InitializedEntity {
197
197
struct LN LocAndNRVO;
198
198
199
199
// / When Kind == EK_Base, the base specifier that provides the
200
- // / base class. The lower bit specifies whether the base is an inherited
200
+ // / base class. The integer specifies whether the base is an inherited
201
201
// / virtual base.
202
- uintptr_t Base;
202
+ llvm::PointerIntPair< const CXXBaseSpecifier *, 1 > Base;
203
203
204
204
// / When Kind == EK_ArrayElement, EK_VectorElement, or
205
205
// / EK_ComplexElement, the index of the array or vector element being
@@ -252,15 +252,14 @@ class alignas(8) InitializedEntity {
252
252
253
253
// / Create the initialization entity for a parameter.
254
254
static InitializedEntity InitializeParameter (ASTContext &Context,
255
- const ParmVarDecl *Parm) {
255
+ ParmVarDecl *Parm) {
256
256
return InitializeParameter (Context, Parm, Parm->getType ());
257
257
}
258
258
259
259
// / Create the initialization entity for a parameter, but use
260
260
// / another type.
261
- static InitializedEntity InitializeParameter (ASTContext &Context,
262
- const ParmVarDecl *Parm,
263
- QualType Type) {
261
+ static InitializedEntity
262
+ InitializeParameter (ASTContext &Context, ParmVarDecl *Parm, QualType Type) {
264
263
bool Consumed = (Context.getLangOpts ().ObjCAutoRefCount &&
265
264
Parm->hasAttr <NSConsumedAttr>());
266
265
@@ -269,8 +268,7 @@ class alignas(8) InitializedEntity {
269
268
Entity.Type =
270
269
Context.getVariableArrayDecayedType (Type.getUnqualifiedType ());
271
270
Entity.Parent = nullptr ;
272
- Entity.Parameter
273
- = (static_cast <uintptr_t >(Consumed) | reinterpret_cast <uintptr_t >(Parm));
271
+ Entity.Parameter = {Parm, Consumed};
274
272
return Entity;
275
273
}
276
274
@@ -283,7 +281,7 @@ class alignas(8) InitializedEntity {
283
281
Entity.Kind = EK_Parameter;
284
282
Entity.Type = Context.getVariableArrayDecayedType (Type);
285
283
Entity.Parent = nullptr ;
286
- Entity.Parameter = ( Consumed) ;
284
+ Entity.Parameter = { nullptr , Consumed} ;
287
285
return Entity;
288
286
}
289
287
@@ -466,19 +464,19 @@ class alignas(8) InitializedEntity {
466
464
// / parameter.
467
465
bool isParameterConsumed () const {
468
466
assert (isParameterKind () && " Not a parameter" );
469
- return ( Parameter & 1 );
467
+ return Parameter. getInt ( );
470
468
}
471
469
472
470
// / Retrieve the base specifier.
473
471
const CXXBaseSpecifier *getBaseSpecifier () const {
474
472
assert (getKind () == EK_Base && " Not a base specifier" );
475
- return reinterpret_cast < const CXXBaseSpecifier *>( Base & ~ 0x1 );
473
+ return Base. getPointer ( );
476
474
}
477
475
478
476
// / Return whether the base is an inherited virtual base.
479
477
bool isInheritedVirtualBase () const {
480
478
assert (getKind () == EK_Base && " Not a base specifier" );
481
- return Base & 0x1 ;
479
+ return Base. getInt () ;
482
480
}
483
481
484
482
// / Determine whether this is an array new with an unknown bound.
0 commit comments