r256662 - [MS ABI] Replace dead code with an assertion
David Majnemer via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 30 21:36:50 PST 2015
Author: majnemer
Date: Wed Dec 30 23:36:50 2015
New Revision: 256662
URL: http://llvm.org/viewvc/llvm-project?rev=256662&view=rev
Log:
[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.
Modified:
cfe/trunk/lib/AST/MicrosoftMangle.cpp
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=256662&r1=256661&r2=256662&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Wed Dec 30 23:36:50 2015
@@ -2215,7 +2215,8 @@ void MicrosoftCXXNameMangler::mangleType
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
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);
}
More information about the cfe-commits
mailing list