Index: include/llvm/DebugInfo/PDB/IPDBSession.h =================================================================== --- include/llvm/DebugInfo/PDB/IPDBSession.h +++ include/llvm/DebugInfo/PDB/IPDBSession.h @@ -36,7 +36,7 @@ if (!Symbol) return nullptr; - T *ConcreteSymbol = dyn_cast(Symbol.get()); + T *ConcreteSymbol = dyn_cast(Symbol); if (!ConcreteSymbol) return nullptr; Symbol.release(); Index: lib/DebugInfo/PDB/PDBContext.cpp =================================================================== --- lib/DebugInfo/PDB/PDBContext.cpp +++ lib/DebugInfo/PDB/PDBContext.cpp @@ -38,9 +38,9 @@ uint32_t Length = 1; std::unique_ptr Symbol = Session->findSymbolByAddress(Address, PDB_SymType::None); - if (auto Func = dyn_cast_or_null(Symbol.get())) { + if (auto *Func = dyn_cast_or_null(Symbol)) { Length = Func->getLength(); - } else if (auto Data = dyn_cast_or_null(Symbol.get())) { + } else if (auto *Data = dyn_cast_or_null(Symbol)) { Length = Data->getLength(); } @@ -101,7 +101,7 @@ // PDBSymbolPublicSymbol. auto PublicSym = Session->findSymbolByAddress(Address, PDB_SymType::PublicSymbol); - if (auto PS = dyn_cast_or_null(PublicSym.get())) + if (auto *PS = dyn_cast_or_null(PublicSym)) return PS->getName(); } @@ -113,8 +113,8 @@ // although they technically requested the linkage name, if the linkage // name is not available we fallback to at least returning a non-empty // string. - if (auto Func = dyn_cast_or_null(FuncSymbol.get())) - return Func->getName(); + if (auto *Func = dyn_cast_or_null(FuncSymbol)) + return Func->getName(); return std::string(); } Index: lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp =================================================================== --- lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp +++ lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp @@ -194,7 +194,7 @@ // probably using PEs and PDBs, and we shouldn't do the override. PE files // generally only contain the names of exported symbols. return FNKind == FunctionNameKind::LinkageName && UseSymbolTable && - isa(DebugInfoContext.get()); + isa(DebugInfoContext); } DILineInfo SymbolizableObjectFile::symbolizeCode(uint64_t ModuleOffset, Index: lib/Object/ELFYAML.cpp =================================================================== --- lib/Object/ELFYAML.cpp +++ lib/Object/ELFYAML.cpp @@ -713,33 +713,33 @@ case ELF::SHT_RELA: if (!IO.outputting()) Section.reset(new ELFYAML::RelocationSection()); - sectionMapping(IO, *cast(Section.get())); + sectionMapping(IO, cast(*Section)); break; case ELF::SHT_GROUP: if (!IO.outputting()) Section.reset(new ELFYAML::Group()); - groupSectionMapping(IO, *cast(Section.get())); + groupSectionMapping(IO, cast(*Section)); break; case ELF::SHT_NOBITS: if (!IO.outputting()) Section.reset(new ELFYAML::NoBitsSection()); - sectionMapping(IO, *cast(Section.get())); + sectionMapping(IO, cast(*Section)); break; case ELF::SHT_MIPS_ABIFLAGS: if (!IO.outputting()) Section.reset(new ELFYAML::MipsABIFlags()); - sectionMapping(IO, *cast(Section.get())); + sectionMapping(IO, cast(*Section)); break; default: if (!IO.outputting()) Section.reset(new ELFYAML::RawContentSection()); - sectionMapping(IO, *cast(Section.get())); + sectionMapping(IO, cast(*Section)); } } StringRef MappingTraits>::validate( IO &io, std::unique_ptr &Section) { - const auto *RawSection = dyn_cast(Section.get()); + const auto *RawSection = dyn_cast(Section); if (!RawSection || RawSection->Size >= RawSection->Content.binary_size()) return StringRef(); return "Section size must be greater or equal to the content size"; Index: lib/ProfileData/CoverageMappingReader.cpp =================================================================== --- lib/ProfileData/CoverageMappingReader.cpp +++ lib/ProfileData/CoverageMappingReader.cpp @@ -445,14 +445,14 @@ return EC; auto Bin = std::move(BinOrErr.get()); std::unique_ptr OF; - if (auto *Universal = dyn_cast(Bin.get())) { + if (auto *Universal = dyn_cast(Bin)) { // If we have a universal binary, try to look up the object for the // appropriate architecture. auto ObjectFileOrErr = Universal->getObjectForArch(Arch); if (std::error_code EC = ObjectFileOrErr.getError()) return EC; OF = std::move(ObjectFileOrErr.get()); - } else if (isa(Bin.get())) { + } else if (isa(Bin)) { // For any other object file, upcast and take ownership. OF.reset(cast(Bin.release())); // If we've asked for a particular arch, make sure they match. Index: lib/Support/YAMLTraits.cpp =================================================================== --- lib/Support/YAMLTraits.cpp +++ lib/Support/YAMLTraits.cpp @@ -276,7 +276,7 @@ if (SequenceHNode *SQ = dyn_cast(CurrentNode)) { unsigned Index = 0; for (auto &N : SQ->Entries) { - if (ScalarHNode *SN = dyn_cast(N.get())) { + if (ScalarHNode *SN = dyn_cast(N)) { if (SN->value().equals(Str)) { BitValuesUsed[Index] = true; return true; Index: tools/dsymutil/BinaryHolder.cpp =================================================================== --- tools/dsymutil/BinaryHolder.cpp +++ tools/dsymutil/BinaryHolder.cpp @@ -174,7 +174,7 @@ ErrorOr BinaryHolder::getObjfileForArch(const Triple &T) { for (const auto &Obj : CurrentObjectFiles) { - if (const auto *MachO = dyn_cast(Obj.get())) { + if (const auto *MachO = dyn_cast(Obj)) { if (getTriple(*MachO).str() == T.str()) return *MachO; } else if (Obj->getArch() == T.getArch()) Index: tools/llvm-pdbdump/ClassDefinitionDumper.cpp =================================================================== --- tools/llvm-pdbdump/ClassDefinitionDumper.cpp +++ tools/llvm-pdbdump/ClassDefinitionDumper.cpp @@ -83,7 +83,7 @@ auto &AccessGroup = Groups.find((int)Access)->second; - if (auto Func = dyn_cast(Child.get())) { + if (auto *Func = dyn_cast(Child)) { if (Func->isCompilerGenerated() && opts::ExcludeCompilerGenerated) continue; if (Func->getLength() == 0 && !Func->isPureVirtual() && @@ -91,7 +91,7 @@ continue; Child.release(); AccessGroup.Functions.push_back(std::unique_ptr(Func)); - } else if (auto Data = dyn_cast(Child.get())) { + } else if (auto *Data = dyn_cast(Child)) { Child.release(); AccessGroup.Data.push_back(std::unique_ptr(Data)); } else { Index: tools/llvm-pdbdump/FunctionDumper.cpp =================================================================== --- tools/llvm-pdbdump/FunctionDumper.cpp +++ tools/llvm-pdbdump/FunctionDumper.cpp @@ -234,7 +234,7 @@ if (!PointeeType) return; - if (auto FuncSig = dyn_cast(PointeeType.get())) { + if (auto *FuncSig = dyn_cast(PointeeType)) { FunctionDumper NestedDumper(Printer); PointerType Pointer = Symbol.isReference() ? PointerType::Reference : PointerType::Pointer; Index: tools/llvm-pdbdump/TypedefDumper.cpp =================================================================== --- tools/llvm-pdbdump/TypedefDumper.cpp +++ tools/llvm-pdbdump/TypedefDumper.cpp @@ -56,7 +56,7 @@ auto PointeeType = Symbol.getSession().getSymbolById(PointeeId); if (!PointeeType) return; - if (auto FuncSig = dyn_cast(PointeeType.get())) { + if (auto *FuncSig = dyn_cast(PointeeType)) { FunctionDumper::PointerType Pointer = FunctionDumper::PointerType::Pointer; if (Symbol.isReference()) Pointer = FunctionDumper::PointerType::Reference; Index: tools/llvm-pdbdump/VariableDumper.cpp =================================================================== --- tools/llvm-pdbdump/VariableDumper.cpp +++ tools/llvm-pdbdump/VariableDumper.cpp @@ -100,7 +100,7 @@ if (!PointeeType) return; - if (auto Func = dyn_cast(PointeeType.get())) { + if (auto *Func = dyn_cast(PointeeType)) { FunctionDumper NestedDumper(Printer); FunctionDumper::PointerType Pointer = Symbol.isReference() ? FunctionDumper::PointerType::Reference @@ -131,7 +131,7 @@ std::string IndexSpec; raw_string_ostream IndexStream(IndexSpec); std::unique_ptr ElementType = ArrayType->getElementType(); - while (auto NestedArray = dyn_cast(ElementType.get())) { + while (auto *NestedArray = dyn_cast(ElementType)) { IndexStream << "["; IndexStream << NestedArray->getCount(); IndexStream << "]"; @@ -155,8 +155,7 @@ // signature carries no name, so we have to handle this case separately. if (auto *PointerType = dyn_cast(&Type)) { auto PointeeType = PointerType->getPointeeType(); - if (auto *FunctionSig = - dyn_cast(PointeeType.get())) { + if (auto *FunctionSig = dyn_cast(PointeeType)) { FunctionDumper Dumper(Printer); FunctionDumper::PointerType PT = FunctionDumper::PointerType::Pointer; if (PointerType->isReference())