aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-doc/Serialize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-doc/Serialize.cpp')
-rw-r--r--clang-tools-extra/clang-doc/Serialize.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp
index 7a0e00c..de73f68 100644
--- a/clang-tools-extra/clang-doc/Serialize.cpp
+++ b/clang-tools-extra/clang-doc/Serialize.cpp
@@ -495,7 +495,8 @@ static void InsertChild(ScopeChildren &Scope, const NamespaceInfo &Info) {
static void InsertChild(ScopeChildren &Scope, const RecordInfo &Info) {
Scope.Records.emplace_back(Info.USR, Info.Name, InfoType::IT_record,
- Info.Name, getInfoRelativePath(Info.Namespace));
+ Info.Name, getInfoRelativePath(Info.Namespace),
+ Info.MangledName);
}
static void InsertChild(ScopeChildren &Scope, EnumInfo Info) {
@@ -777,7 +778,13 @@ static void populateSymbolInfo(SymbolInfo &I, const T *D, const FullComment *C,
Mangler->mangleCXXVTable(CXXD, MangledStream);
else
MangledStream << D->getNameAsString();
- I.MangledName = MangledName;
+ if (MangledName.size() > 255)
+ // File creation fails if the mangled name is too long, so default to the
+ // USR. We should look for a better check since filesystems differ in
+ // maximum filename length
+ I.MangledName = llvm::toStringRef(llvm::toHex(I.USR));
+ else
+ I.MangledName = MangledName;
delete Mangler;
}