mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SerializeLoc: address Jordan's previous code review comments
This commit is contained in:
@@ -1261,7 +1261,7 @@ public:
|
||||
std::unique_ptr<ModuleFile::SerializedDeclUSRTable>
|
||||
ModuleFile::readDeclUSRsTable(ArrayRef<uint64_t> fields, StringRef blobData) {
|
||||
if (fields.empty() || blobData.empty())
|
||||
return nullptr;
|
||||
return nullptr;
|
||||
uint32_t tableOffset = static_cast<uint32_t>(fields.front());
|
||||
auto base = reinterpret_cast<const uint8_t *>(blobData.data());
|
||||
return std::unique_ptr<SerializedDeclUSRTable>(
|
||||
@@ -2357,6 +2357,8 @@ Optional<CommentInfo> ModuleFile::getCommentForDecl(const Decl *D) const {
|
||||
|
||||
if (!DeclCommentTable)
|
||||
return None;
|
||||
if (D->isImplicit())
|
||||
return None;
|
||||
// Compute the USR.
|
||||
llvm::SmallString<128> USRBuffer;
|
||||
llvm::raw_svector_ostream OS(USRBuffer);
|
||||
@@ -2381,6 +2383,8 @@ ModuleFile::getBasicDeclLocsForDecl(const Decl *D) const {
|
||||
// Future compilers may not provide BasicDeclLocsData anymore.
|
||||
if (BasicDeclLocsData.empty())
|
||||
return None;
|
||||
if (D->isImplicit())
|
||||
return None;
|
||||
// Compute the USR.
|
||||
llvm::SmallString<128> USRBuffer;
|
||||
llvm::raw_svector_ostream OS(USRBuffer);
|
||||
|
||||
Reference in New Issue
Block a user