r369773 - [NFC] Move some variable declarations into their 'if' conditions.
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 23 08:58:35 PDT 2019
Author: erichkeane
Date: Fri Aug 23 08:58:35 2019
New Revision: 369773
URL: http://llvm.org/viewvc/llvm-project?rev=369773&view=rev
Log:
[NFC] Move some variable declarations into their 'if' conditions.
A couple of variables are being declared outside of the 'if' condition
that is their only actual use. Additionally, switch a few 'const TYPE
*' to 'const auto *' for consistency.
Modified:
cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=369773&r1=369772&r2=369773&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Fri Aug 23 08:58:35 2019
@@ -470,14 +470,12 @@ void Sema::InstantiateAttrs(const MultiL
continue;
}
- const AssumeAlignedAttr *AssumeAligned = dyn_cast<AssumeAlignedAttr>(TmplAttr);
- if (AssumeAligned) {
+ if (const auto *AssumeAligned = dyn_cast<AssumeAlignedAttr>(TmplAttr)) {
instantiateDependentAssumeAlignedAttr(*this, TemplateArgs, AssumeAligned, New);
continue;
}
- const AlignValueAttr *AlignValue = dyn_cast<AlignValueAttr>(TmplAttr);
- if (AlignValue) {
+ if (const auto *AlignValue = dyn_cast<AlignValueAttr>(TmplAttr)) {
instantiateDependentAlignValueAttr(*this, TemplateArgs, AlignValue, New);
continue;
}
@@ -500,14 +498,14 @@ void Sema::InstantiateAttrs(const MultiL
continue;
}
- if (const CUDALaunchBoundsAttr *CUDALaunchBounds =
+ if (const auto *CUDALaunchBounds =
dyn_cast<CUDALaunchBoundsAttr>(TmplAttr)) {
instantiateDependentCUDALaunchBoundsAttr(*this, TemplateArgs,
*CUDALaunchBounds, New);
continue;
}
- if (const ModeAttr *Mode = dyn_cast<ModeAttr>(TmplAttr)) {
+ if (const auto *Mode = dyn_cast<ModeAttr>(TmplAttr)) {
instantiateDependentModeAttr(*this, TemplateArgs, *Mode, New);
continue;
}
@@ -517,13 +515,13 @@ void Sema::InstantiateAttrs(const MultiL
continue;
}
- if (const AMDGPUFlatWorkGroupSizeAttr *AMDGPUFlatWorkGroupSize =
+ if (const auto *AMDGPUFlatWorkGroupSize =
dyn_cast<AMDGPUFlatWorkGroupSizeAttr>(TmplAttr)) {
instantiateDependentAMDGPUFlatWorkGroupSizeAttr(
*this, TemplateArgs, *AMDGPUFlatWorkGroupSize, New);
}
- if (const AMDGPUWavesPerEUAttr *AMDGPUFlatWorkGroupSize =
+ if (const auto *AMDGPUFlatWorkGroupSize =
dyn_cast<AMDGPUWavesPerEUAttr>(TmplAttr)) {
instantiateDependentAMDGPUWavesPerEUAttr(*this, TemplateArgs,
*AMDGPUFlatWorkGroupSize, New);
@@ -537,7 +535,7 @@ void Sema::InstantiateAttrs(const MultiL
}
}
- if (auto ABIAttr = dyn_cast<ParameterABIAttr>(TmplAttr)) {
+ if (const auto *ABIAttr = dyn_cast<ParameterABIAttr>(TmplAttr)) {
AddParameterABIAttr(ABIAttr->getRange(), New, ABIAttr->getABI(),
ABIAttr->getSpellingListIndex());
continue;
More information about the cfe-commits
mailing list