ASTDemangler: Fix demangling of weak/unowned/unowned(unsafe)

The check here was incorrect because we might have an optional of a
reference type as well. Just remove the check to keep things simple.
This commit is contained in:
Slava Pestov
2019-01-29 18:03:30 -05:00
parent 4a74bf4ba1
commit 9c8a5b599e
3 changed files with 33 additions and 4 deletions

View File

@@ -17,6 +17,7 @@
//===----------------------------------------------------------------------===//
#include "swift/AST/ASTDemangler.h"
#include "swift/AST/PrintOptions.h"
#include "swift/ASTSectionImporter/ASTSectionImporter.h"
#include "swift/Frontend/Frontend.h"
#include "swift/IDE/Utils.h"
@@ -99,7 +100,9 @@ static void resolveTypeFromMangledNameList(
if (!ResolvedType) {
llvm::outs() << "Can't resolve type of " << Mangled << "\n";
} else {
ResolvedType->print(llvm::outs());
swift::PrintOptions PO;
PO.PrintStorageRepresentationAttrs = true;
ResolvedType->print(llvm::outs(), PO);
llvm::outs() << "\n";
}
}
@@ -114,7 +117,9 @@ static void resolveTypeFromMangledNameListOld(
if (!ResolvedType) {
llvm::errs() << "Can't resolve type of " << Mangled << "\n";
} else {
ResolvedType->print(llvm::errs());
swift::PrintOptions PO;
PO.PrintStorageRepresentationAttrs = true;
ResolvedType->print(llvm::errs(), PO);
llvm::errs() << "\n";
}
}