diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-01-05 23:16:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-01-05 23:16:57 +0000 |
commit | c8a16fbb78c0e0ae2d2ebdb00bd6761d9d6714d2 (patch) | |
tree | 892aee9d179ba9759a891b635200e5d720af71c6 | |
parent | 603cfb4da2f7ba08a1c3452c2fbf70585b8e7621 (diff) |
Eliminate an unnecessary dance where we tried to cope with the lack of
TypeSourceInfo when transforming a function parameter. The callees of
this routine already assume that TypeSourceInfo will be present, and
we want to always be sure that it exists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122927 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/TreeTransform.h | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 3bd81561e0..dc87c5bbd2 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -3402,26 +3402,16 @@ bool TreeTransform<Derived>:: llvm::SmallVector<UnexpandedParameterPack, 2> Unexpanded; // Find the parameter packs that could be expanded. - SourceLocation EllipsisLoc; - SourceRange PatternRange; - if (OldParm->getTypeSourceInfo()) { - TypeLoc TL = OldParm->getTypeSourceInfo()->getTypeLoc(); - PackExpansionTypeLoc ExpansionTL = cast<PackExpansionTypeLoc>(TL); - TypeLoc Pattern = ExpansionTL.getPatternLoc(); - EllipsisLoc = ExpansionTL.getEllipsisLoc(); - PatternRange = Pattern.getSourceRange(); - SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded); - } else { - SemaRef.collectUnexpandedParameterPacks( - cast<PackExpansionType>(OldParm->getType())->getPattern(), - Unexpanded); - EllipsisLoc = OldParm->getLocation(); - } + TypeLoc TL = OldParm->getTypeSourceInfo()->getTypeLoc(); + PackExpansionTypeLoc ExpansionTL = cast<PackExpansionTypeLoc>(TL); + TypeLoc Pattern = ExpansionTL.getPatternLoc(); + SemaRef.collectUnexpandedParameterPacks(Pattern, Unexpanded); // Determine whether we should expand the parameter packs. bool ShouldExpand = false; unsigned NumExpansions = 0; - if (getDerived().TryExpandParameterPacks(EllipsisLoc, PatternRange, + if (getDerived().TryExpandParameterPacks(ExpansionTL.getEllipsisLoc(), + Pattern.getSourceRange(), Unexpanded.data(), Unexpanded.size(), ShouldExpand, NumExpansions)) { |