Skip to content

Commit 8990763

Browse files
committed
[clang][codegen][NFC] Improve const correctness
1 parent eb76bc3 commit 8990763

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/lib/CodeGen/CGExprConstant.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,10 +2041,10 @@ ConstantLValueEmitter::tryEmitBase(const APValue::LValueBase &base) {
20412041
return ConstantLValue(C);
20422042
};
20432043

2044-
if (auto FD = dyn_cast<FunctionDecl>(D))
2044+
if (const auto *FD = dyn_cast<FunctionDecl>(D))
20452045
return PtrAuthSign(CGM.getRawFunctionPointer(FD));
20462046

2047-
if (auto VD = dyn_cast<VarDecl>(D)) {
2047+
if (const auto *VD = dyn_cast<VarDecl>(D)) {
20482048
// We can never refer to a variable with local storage.
20492049
if (!VD->hasLocalStorage()) {
20502050
if (VD->isFileVarDecl() || VD->hasExternalStorage())
@@ -2057,13 +2057,13 @@ ConstantLValueEmitter::tryEmitBase(const APValue::LValueBase &base) {
20572057
}
20582058
}
20592059

2060-
if (auto *GD = dyn_cast<MSGuidDecl>(D))
2060+
if (const auto *GD = dyn_cast<MSGuidDecl>(D))
20612061
return CGM.GetAddrOfMSGuidDecl(GD);
20622062

2063-
if (auto *GCD = dyn_cast<UnnamedGlobalConstantDecl>(D))
2063+
if (const auto *GCD = dyn_cast<UnnamedGlobalConstantDecl>(D))
20642064
return CGM.GetAddrOfUnnamedGlobalConstantDecl(GCD);
20652065

2066-
if (auto *TPO = dyn_cast<TemplateParamObjectDecl>(D))
2066+
if (const auto *TPO = dyn_cast<TemplateParamObjectDecl>(D))
20672067
return CGM.GetAddrOfTemplateParamObject(TPO);
20682068

20692069
return nullptr;

0 commit comments

Comments
 (0)