[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.

llvm-svn: 369773
This commit is contained in:
Erich Keane 2019-08-23 15:58:35 +00:00
parent 688f3bc240
commit 23384a1c8d
1 changed files with 7 additions and 9 deletions

View File

@ -470,14 +470,12 @@ void Sema::InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs,
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 MultiLevelTemplateArgumentList &TemplateArgs,
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 MultiLevelTemplateArgumentList &TemplateArgs,
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 MultiLevelTemplateArgumentList &TemplateArgs,
}
}
if (auto ABIAttr = dyn_cast<ParameterABIAttr>(TmplAttr)) {
if (const auto *ABIAttr = dyn_cast<ParameterABIAttr>(TmplAttr)) {
AddParameterABIAttr(ABIAttr->getRange(), New, ABIAttr->getABI(),
ABIAttr->getSpellingListIndex());
continue;