Skip to content

Commit 6a473e0

Browse files
committed
Fix some simple issues
1 parent a10bd96 commit 6a473e0

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

clang/include/clang/AST/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
22622262
/// The "size_t" type.
22632263
SizeT,
22642264

2265-
/// The "signed size_t" type.
2265+
/// The signed integer type corresponding to "size_t".
22662266
SignedSizeT,
22672267

22682268
/// The "ptrdiff_t" type.

clang/lib/AST/ASTContext.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5239,7 +5239,7 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned,
52395239

52405240
QualType ASTContext::getPredefinedSugarType(uint32_t KD) const {
52415241
using Kind = PredefinedSugarType::Kind;
5242-
auto getUnderlyingType = [](const ASTContext &Ctx, Kind KDI) -> QualType {
5242+
auto getCanonicalType = [](const ASTContext &Ctx, Kind KDI) -> QualType {
52435243
switch (KDI) {
52445244
case Kind::SizeT:
52455245
return Ctx.getFromTargetType(Ctx.Target->getSizeType());
@@ -5251,7 +5251,7 @@ QualType ASTContext::getPredefinedSugarType(uint32_t KD) const {
52515251
llvm_unreachable("unexpected kind");
52525252
};
52535253
auto *New = new (*this, alignof(PredefinedSugarType)) PredefinedSugarType(
5254-
static_cast<Kind>(KD), getUnderlyingType(*this, static_cast<Kind>(KD)));
5254+
static_cast<Kind>(KD), getCanonicalType(*this, static_cast<Kind>(KD)));
52555255
Types.push_back(New);
52565256
return QualType(New, 0);
52575257
}
@@ -14565,7 +14565,8 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X,
1456514565
CDX);
1456614566
}
1456714567
case Type::PredefinedSugar:
14568-
// FIXME: Should this be reachable here?
14568+
assert(cast<PredefinedSugarType>(X)->getKind() !=
14569+
cast<PredefinedSugarType>(Y)->getKind());
1456914570
return QualType();
1457014571
}
1457114572
llvm_unreachable("Unhandled Type Class");

clang/lib/AST/ASTStructuralEquivalence.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,9 +1485,6 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
14851485
const auto *TP2 = cast<PredefinedSugarType>(T2);
14861486
if (TP1->getKind() != TP2->getKind())
14871487
return false;
1488-
else
1489-
assert(TP1->getCanonicalTypeInternal() ==
1490-
TP2->getCanonicalTypeInternal());
14911488
break;
14921489
}
14931490
} // end switch

clang/lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5633,4 +5633,4 @@ StringRef PredefinedSugarType::getName() const {
56335633
return "__ptrdiff_t";
56345634
}
56355635
llvm_unreachable("unexpected kind");
5636-
}
5636+
}

0 commit comments

Comments
 (0)