@@ -194,99 +194,99 @@ CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForType(QualType T) {
194194}
195195
196196static std::pair<llvm::Value *, CGPointerAuthInfo>
197- emitLoadOfOrigPointerRValue (CodeGenFunction &CGF, const LValue &lv ,
198- SourceLocation loc ) {
199- auto value = CGF.EmitLoadOfScalar (lv, loc );
200- CGPointerAuthInfo authInfo ;
201- if (auto ptrauth = lv .getQuals ().getPointerAuth ()) {
202- authInfo = CGF.EmitPointerAuthInfo (ptrauth, lv .getAddress ());
197+ emitLoadOfOrigPointerRValue (CodeGenFunction &CGF, const LValue &LV ,
198+ SourceLocation Loc ) {
199+ auto *Value = CGF.EmitLoadOfScalar (LV, Loc );
200+ CGPointerAuthInfo AuthInfo ;
201+ if (auto PtrAuth = LV .getQuals ().getPointerAuth ()) {
202+ AuthInfo = CGF.EmitPointerAuthInfo (PtrAuth, LV .getAddress ());
203203 } else {
204- authInfo = getPointerAuthInfoForType (CGF.CGM , lv .getType ());
204+ AuthInfo = getPointerAuthInfoForType (CGF.CGM , LV .getType ());
205205 }
206- return {value, authInfo };
206+ return {Value, AuthInfo };
207207}
208208
209209std::pair<llvm::Value *, CGPointerAuthInfo>
210210CodeGenFunction::EmitOrigPointerRValue (const Expr *E) {
211211 assert (E->getType ()->isSignableType ());
212212
213213 E = E->IgnoreParens ();
214- if (auto load = dyn_cast<ImplicitCastExpr>(E)) {
215- if (load ->getCastKind () == CK_LValueToRValue) {
216- E = load ->getSubExpr ()->IgnoreParens ();
214+ if (auto *Load = dyn_cast<ImplicitCastExpr>(E)) {
215+ if (Load ->getCastKind () == CK_LValueToRValue) {
216+ E = Load ->getSubExpr ()->IgnoreParens ();
217217
218218 // We're semantically required to not emit loads of certain DREs naively.
219- if (auto refExpr = dyn_cast<DeclRefExpr>(const_cast <Expr *>(E))) {
220- if (auto result = tryEmitAsConstant (refExpr )) {
219+ if (auto *RefExpr = dyn_cast<DeclRefExpr>(const_cast <Expr *>(E))) {
220+ if (auto Result = tryEmitAsConstant (RefExpr )) {
221221 // Fold away a use of an intermediate variable.
222- if (!result .isReference ())
223- return {result .getValue (),
224- getPointerAuthInfoForType (CGM, refExpr ->getType ())};
222+ if (!Result .isReference ())
223+ return {Result .getValue (),
224+ getPointerAuthInfoForType (CGM, RefExpr ->getType ())};
225225
226226 // Fold away a use of an intermediate reference.
227- auto lv = result .getReferenceLValue (*this , refExpr );
228- return emitLoadOfOrigPointerRValue (*this , lv, refExpr ->getLocation ());
227+ auto LV = Result .getReferenceLValue (*this , RefExpr );
228+ return emitLoadOfOrigPointerRValue (*this , LV, RefExpr ->getLocation ());
229229 }
230230 }
231231
232232 // Otherwise, load and use the pointer
233- auto lv = EmitCheckedLValue (E, CodeGenFunction::TCK_Load);
234- return emitLoadOfOrigPointerRValue (*this , lv , E->getExprLoc ());
233+ auto LV = EmitCheckedLValue (E, CodeGenFunction::TCK_Load);
234+ return emitLoadOfOrigPointerRValue (*this , LV , E->getExprLoc ());
235235 }
236236 }
237237
238238 // Emit direct references to functions without authentication.
239- if (auto DRE = dyn_cast<DeclRefExpr>(E)) {
240- if (auto FD = dyn_cast<FunctionDecl>(DRE->getDecl ())) {
239+ if (auto * DRE = dyn_cast<DeclRefExpr>(E)) {
240+ if (auto * FD = dyn_cast<FunctionDecl>(DRE->getDecl ())) {
241241 return {CGM.getRawFunctionPointer (FD), CGPointerAuthInfo ()};
242242 }
243- } else if (auto ME = dyn_cast<MemberExpr>(E)) {
244- if (auto FD = dyn_cast<FunctionDecl>(ME->getMemberDecl ())) {
243+ } else if (auto * ME = dyn_cast<MemberExpr>(E)) {
244+ if (auto * FD = dyn_cast<FunctionDecl>(ME->getMemberDecl ())) {
245245 EmitIgnoredExpr (ME->getBase ());
246246 return {CGM.getRawFunctionPointer (FD), CGPointerAuthInfo ()};
247247 }
248248 }
249249
250250 // Fallback: just use the normal rules for the type.
251- auto value = EmitScalarExpr (E);
252- return {value , getPointerAuthInfoForType (CGM, E->getType ())};
251+ auto *Value = EmitScalarExpr (E);
252+ return {Value , getPointerAuthInfoForType (CGM, E->getType ())};
253253}
254254
255255llvm::Value *
256- CodeGenFunction::EmitPointerAuthQualify (PointerAuthQualifier destQualifier ,
256+ CodeGenFunction::EmitPointerAuthQualify (PointerAuthQualifier DestQualifier ,
257257 const Expr *E,
258- Address destStorageAddress ) {
259- assert (destQualifier );
258+ Address DestStorageAddress ) {
259+ assert (DestQualifier );
260260
261- auto src = EmitOrigPointerRValue (E);
262- auto value = src .first ;
263- auto curAuthInfo = src .second ;
261+ auto Src = EmitOrigPointerRValue (E);
262+ auto *Value = Src .first ;
263+ auto CurAuthInfo = Src .second ;
264264
265- auto destAuthInfo = EmitPointerAuthInfo (destQualifier, destStorageAddress );
266- return emitPointerAuthResign (value , E->getType (), curAuthInfo, destAuthInfo ,
265+ auto DestAuthInfo = EmitPointerAuthInfo (DestQualifier, DestStorageAddress );
266+ return emitPointerAuthResign (Value , E->getType (), CurAuthInfo, DestAuthInfo ,
267267 isPointerKnownNonNull (E));
268268}
269269
270270llvm::Value *CodeGenFunction::EmitPointerAuthQualify (
271- PointerAuthQualifier destQualifier , llvm::Value *value ,
272- QualType pointerType , Address destStorageAddress , bool isKnownNonNull ) {
273- assert (destQualifier );
271+ PointerAuthQualifier DestQualifier , llvm::Value *Value ,
272+ QualType PointerType , Address DestStorageAddress , bool IsKnownNonNull ) {
273+ assert (DestQualifier );
274274
275- auto curAuthInfo = getPointerAuthInfoForType (CGM, pointerType );
276- auto destAuthInfo = EmitPointerAuthInfo (destQualifier, destStorageAddress );
277- return emitPointerAuthResign (value, pointerType, curAuthInfo, destAuthInfo ,
278- isKnownNonNull );
275+ auto CurAuthInfo = getPointerAuthInfoForType (CGM, PointerType );
276+ auto DestAuthInfo = EmitPointerAuthInfo (DestQualifier, DestStorageAddress );
277+ return emitPointerAuthResign (Value, PointerType, CurAuthInfo, DestAuthInfo ,
278+ IsKnownNonNull );
279279}
280280
281281llvm::Value *CodeGenFunction::EmitPointerAuthUnqualify (
282- PointerAuthQualifier curQualifier , llvm::Value *value , QualType pointerType ,
283- Address curStorageAddress , bool isKnownNonNull ) {
284- assert (curQualifier );
285-
286- auto curAuthInfo = EmitPointerAuthInfo (curQualifier, curStorageAddress );
287- auto destAuthInfo = getPointerAuthInfoForType (CGM, pointerType );
288- return emitPointerAuthResign (value, pointerType, curAuthInfo, destAuthInfo ,
289- isKnownNonNull );
282+ PointerAuthQualifier CurQualifier , llvm::Value *Value , QualType PointerType ,
283+ Address CurStorageAddress , bool IsKnownNonNull ) {
284+ assert (CurQualifier );
285+
286+ auto CurAuthInfo = EmitPointerAuthInfo (CurQualifier, CurStorageAddress );
287+ auto DestAuthInfo = getPointerAuthInfoForType (CGM, PointerType );
288+ return emitPointerAuthResign (Value, PointerType, CurAuthInfo, DestAuthInfo ,
289+ IsKnownNonNull );
290290}
291291
292292static bool isZeroConstant (const llvm::Value *Value) {
0 commit comments