Skip to content

Commit 7ae5095

Browse files
committed
Rebased
1 parent dcdf61c commit 7ae5095

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

clang/lib/Interpreter/InterpreterValuePrinter.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,10 @@ static std::string EnumToString(ASTContext &Ctx, QualType QT, uint64_t Data) {
100100
std::string Str;
101101
llvm::raw_string_ostream SS(Str);
102102

103-
QualType DesugaredTy = QT.getDesugaredType(Ctx);
104-
const EnumType *EnumTy = DesugaredTy.getNonReferenceType()->getAs<EnumType>();
105-
assert(EnumTy && "Fail to cast to enum type");
106-
107-
EnumDecl *ED = EnumTy->getDecl();
108103
bool IsFirst = true;
109-
llvm::APSInt AP = Ctx.MakeIntValue(Data, V.getType());
104+
llvm::APSInt AP = Ctx.MakeIntValue(Data, QT);
110105

111-
auto *ED = V.getType()->castAsEnumDecl();
106+
auto *ED = QT->castAsEnumDecl();
112107
for (auto I = ED->enumerator_begin(), E = ED->enumerator_end(); I != E; ++I) {
113108
if (I->getInitVal() == AP) {
114109
if (!IsFirst)

0 commit comments

Comments
 (0)