This repository was archived by the owner on Dec 14, 2021. It is now read-only.
File tree 3 files changed +10
-5
lines changed
src/lib_cxx/data/parser/cxx
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -121,19 +121,23 @@ Id CanonicalFilePathCache::getFileSymbolId(const std::wstring& path)
121
121
return 0 ;
122
122
}
123
123
124
- std::wstring CanonicalFilePathCache::getDeclarationFileName (const clang::Decl* declaration)
124
+ FilePath CanonicalFilePathCache::getDeclarationFilePath (const clang::Decl* declaration)
125
125
{
126
126
const clang::SourceManager& sourceManager = declaration->getASTContext ().getSourceManager ();
127
127
const clang::FileID fileId = sourceManager.getFileID (declaration->getBeginLoc ());
128
128
const clang::FileEntry* fileEntry = sourceManager.getFileEntryForID (fileId);
129
129
if (fileEntry != nullptr && fileEntry->isValid ())
130
130
{
131
- return getCanonicalFilePath (fileId, sourceManager). fileName () ;
131
+ return getCanonicalFilePath (fileId, sourceManager);
132
132
}
133
133
return getCanonicalFilePath (
134
134
utility::decodeFromUtf8 (
135
- sourceManager.getPresumedLoc (declaration->getBeginLoc ()).getFilename ()))
136
- .fileName ();
135
+ sourceManager.getPresumedLoc (declaration->getBeginLoc ()).getFilename ()));
136
+ }
137
+
138
+ std::wstring CanonicalFilePathCache::getDeclarationFileName (const clang::Decl* declaration)
139
+ {
140
+ return getDeclarationFilePath (declaration).fileName ();
137
141
}
138
142
139
143
bool CanonicalFilePathCache::isProjectFile (
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class CanonicalFilePathCache
29
29
Id getFileSymbolId (const clang::FileEntry* entry);
30
30
Id getFileSymbolId (const std::wstring& path);
31
31
32
+ FilePath getDeclarationFilePath (const clang::Decl* declaration);
32
33
std::wstring getDeclarationFileName (const clang::Decl* declaration);
33
34
34
35
bool isProjectFile (const clang::FileID& fileId, const clang::SourceManager& sourceManager);
Original file line number Diff line number Diff line change @@ -999,7 +999,7 @@ Id CxxAstVisitorComponentIndexer::getOrCreateSymbolId(const clang::NamedDecl* de
999
999
symbolName.pop ();
1000
1000
symbolName.push (NameElement (
1001
1001
L" .:main:." +
1002
- getAstVisitor ()->getCanonicalFilePathCache ()->getDeclarationFileName (decl),
1002
+ getAstVisitor ()->getCanonicalFilePathCache ()->getDeclarationFilePath (decl). wstr ( ),
1003
1003
sig.getPrefix (),
1004
1004
sig.getPostfix ()));
1005
1005
}
You can’t perform that action at this time.
0 commit comments