Skip to content

Commit

Permalink
Improve pretty-printing for APValues of void type.
Browse files Browse the repository at this point in the history
No functionality change intended: there doesn't seem to be any way to
cause Clang to print such a value, but they can show up when dumping
APValues from a debugger.
  • Loading branch information
zygoloid committed Aug 21, 2020
1 parent 53aff8d commit 7092398
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions clang/lib/AST/APValue.cpp
Expand Up @@ -388,6 +388,13 @@ static double GetApproxValue(const llvm::APFloat &F) {

void APValue::printPretty(raw_ostream &Out, const ASTContext &Ctx,
QualType Ty) const {
// There are no objects of type 'void', but values of this type can be
// returned from functions.
if (Ty->isVoidType()) {
Out << "void()";
return;
}

switch (getKind()) {
case APValue::None:
Out << "<out of lifetime>";
Expand Down

0 comments on commit 7092398

Please sign in to comment.