[MS ABI] Replace dead code with an assertion

As per C++ [dcl.ref]p1, cv-qualified references are not valid. As such,
change the mangler to assert that this event does not happen.

llvm-svn: 256662
This commit is contained in:
David Majnemer 2015-12-31 05:36:50 +00:00
parent 474b323a03
commit e3d7191a74
1 changed files with 4 additions and 2 deletions

View File

@ -2215,7 +2215,8 @@ void MicrosoftCXXNameMangler::mangleType(const ObjCObjectPointerType *T,
void MicrosoftCXXNameMangler::mangleType(const LValueReferenceType *T,
Qualifiers Quals, SourceRange Range) {
QualType PointeeType = T->getPointeeType();
Out << (Quals.hasVolatile() ? 'B' : 'A');
assert(!Quals.hasConst() && !Quals.hasVolatile() && "unexpected qualifier!");
Out << 'A';
manglePointerExtQualifiers(Quals, PointeeType);
mangleType(PointeeType, Range);
}
@ -2226,7 +2227,8 @@ void MicrosoftCXXNameMangler::mangleType(const LValueReferenceType *T,
void MicrosoftCXXNameMangler::mangleType(const RValueReferenceType *T,
Qualifiers Quals, SourceRange Range) {
QualType PointeeType = T->getPointeeType();
Out << (Quals.hasVolatile() ? "$$R" : "$$Q");
assert(!Quals.hasConst() && !Quals.hasVolatile() && "unexpected qualifier!");
Out << "$$Q";
manglePointerExtQualifiers(Quals, PointeeType);
mangleType(PointeeType, Range);
}