Skip to content

Commit 7dd8ebe

Browse files
committed
add number
1 parent 8fb896f commit 7dd8ebe

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

clang-tools-extra/clang-doc/Mapper.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ bool MapASTVisitor::mapDecl(const T *D, bool IsDefinition) {
7575
llvm::SmallString<128> File =
7676
getFile(D, D->getASTContext(), CDCtx.SourceRoot, IsFileInRootDir);
7777
auto I = serialize::emitInfo(D, getComment(D, D->getASTContext()),
78-
getDeclLocation(D), File,
79-
IsFileInRootDir, CDCtx.PublicOnly);
78+
getDeclLocation(D), CDCtx.PublicOnly);
8079

8180
// A null in place of I indicates that the serializer is skipping this decl
8281
// for some reason (e.g. we're only reporting public decls).

clang-tools-extra/clang-doc/Serialize.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,32 @@ namespace serialize {
3737
// its parent scope. For NamespaceDecl and RecordDecl both elements are not
3838
// nullptr.
3939
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
40-
emitInfo(const NamespaceDecl *D, const FullComment *FC, int LineNumber,
41-
StringRef File, bool IsFileInRootDir, bool PublicOnly);
40+
emitInfo(const NamespaceDecl *D, const FullComment *FC, Location Loc,
41+
bool PublicOnly);
4242

4343
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
44-
emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
45-
StringRef File, bool IsFileInRootDir, bool PublicOnly);
44+
emitInfo(const RecordDecl *D, const FullComment *FC, Location Loc,
45+
bool PublicOnly);
4646

4747
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
48-
emitInfo(const EnumDecl *D, const FullComment *FC, int LineNumber,
49-
StringRef File, bool IsFileInRootDir, bool PublicOnly);
48+
emitInfo(const EnumDecl *D, const FullComment *FC, Location Loc,
49+
bool PublicOnly);
5050

5151
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
52-
emitInfo(const FunctionDecl *D, const FullComment *FC, int LineNumber,
53-
StringRef File, bool IsFileInRootDir, bool PublicOnly);
52+
emitInfo(const FunctionDecl *D, const FullComment *FC, Location Loc,
53+
bool PublicOnly);
5454

5555
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
56-
emitInfo(const CXXMethodDecl *D, const FullComment *FC, int LineNumber,
57-
StringRef File, bool IsFileInRootDir, bool PublicOnly);
56+
emitInfo(const CXXMethodDecl *D, const FullComment *FC, Location Loc,
57+
bool PublicOnly);
5858

5959
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
60-
emitInfo(const TypedefDecl *D, const FullComment *FC, int LineNumber,
61-
StringRef File, bool IsFileInRootDir, bool PublicOnly);
60+
emitInfo(const TypedefDecl *D, const FullComment *FC, Location Loc,
61+
bool PublicOnly);
6262

6363
std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
64-
emitInfo(const TypeAliasDecl *D, const FullComment *FC, int LineNumber,
65-
StringRef File, bool IsFileInRootDir, bool PublicOnly);
64+
emitInfo(const TypeAliasDecl *D, const FullComment *FC, Location Loc,
65+
bool PublicOnly);
6666

6767
// Function to hash a given USR value for storage.
6868
// As USRs (Unified Symbol Resolution) could be large, especially for functions

clang-tools-extra/clang-doc/YAMLGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static void CommentInfoMapping(IO &IO, CommentInfo &I) {
169169

170170
template <> struct MappingTraits<Location> {
171171
static void mapping(IO &IO, Location &Loc) {
172-
IO.mapOptional("LineNumber", Loc.LineNumber, 0);
172+
IO.mapOptional("LineNumber", Loc.StartLineNumber, 0);
173173
IO.mapOptional("Filename", Loc.Filename, SmallString<32>());
174174
}
175175
};

0 commit comments

Comments
 (0)