[PATCH] D50208: [clang-doc] Fix unique_ptr error on bots
Julie Hockett via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 2 17:40:39 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE338796: [clang-doc] Fix unique_ptr error on bots (authored by juliehockett, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D50208?vs=158872&id=158874#toc
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D50208
Files:
clang-doc/Serialize.cpp
Index: clang-doc/Serialize.cpp
===================================================================
--- clang-doc/Serialize.cpp
+++ clang-doc/Serialize.cpp
@@ -329,7 +329,7 @@
return nullptr;
auto I = llvm::make_unique<NamespaceInfo>();
populateInfo(*I, D, FC);
- return I;
+ return std::unique_ptr<Info>{std::move(I)};
}
std::unique_ptr<Info> emitInfo(const RecordDecl *D, const FullComment *FC,
@@ -343,7 +343,7 @@
parseFields(*I, D, PublicOnly);
if (const auto *C = dyn_cast<CXXRecordDecl>(D))
parseBases(*I, C);
- return I;
+ return std::unique_ptr<Info>{std::move(I)};
}
std::unique_ptr<Info> emitInfo(const FunctionDecl *D, const FullComment *FC,
@@ -362,7 +362,7 @@
else
I->USR = SymbolID();
I->ChildFunctions.push_back(std::move(Func));
- return I;
+ return std::unique_ptr<Info>{std::move(I)};
}
std::unique_ptr<Info> emitInfo(const CXXMethodDecl *D, const FullComment *FC,
@@ -383,7 +383,7 @@
auto I = llvm::make_unique<RecordInfo>();
I->USR = ParentUSR;
I->ChildFunctions.push_back(std::move(Func));
- return I;
+ return std::unique_ptr<Info>{std::move(I)};
}
std::unique_ptr<Info> emitInfo(const EnumDecl *D, const FullComment *FC,
@@ -400,18 +400,16 @@
if (!Enum.Namespace.empty()) {
switch (Enum.Namespace[0].RefType) {
case InfoType::IT_namespace: {
- std::unique_ptr<Info> IPtr = llvm::make_unique<NamespaceInfo>();
- NamespaceInfo *I = static_cast<NamespaceInfo *>(IPtr.get());
+ auto I = llvm::make_unique<NamespaceInfo>();
I->USR = Enum.Namespace[0].USR;
I->ChildEnums.push_back(std::move(Enum));
- return IPtr;
+ return std::unique_ptr<Info>{std::move(I)};
}
case InfoType::IT_record: {
- std::unique_ptr<Info> IPtr = llvm::make_unique<RecordInfo>();
- RecordInfo *I = static_cast<RecordInfo *>(IPtr.get());
+ auto I = llvm::make_unique<RecordInfo>();
I->USR = Enum.Namespace[0].USR;
I->ChildEnums.push_back(std::move(Enum));
- return IPtr;
+ return std::unique_ptr<Info>{std::move(I)};
}
default:
break;
@@ -422,7 +420,7 @@
auto I = llvm::make_unique<NamespaceInfo>();
I->USR = SymbolID();
I->ChildEnums.push_back(std::move(Enum));
- return I;
+ return std::unique_ptr<Info>{std::move(I)};
}
} // namespace serialize
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50208.158874.patch
Type: text/x-patch
Size: 2336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180803/792bcf8d/attachment.bin>
More information about the cfe-commits
mailing list