Skip to content

Commit 8c41281

Browse files
committed
tidy up names and dtd
1 parent feb76a7 commit 8c41281

File tree

3 files changed

+32
-19
lines changed

3 files changed

+32
-19
lines changed

source/lib/BasicVisitor.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,13 @@ bool
125125
BasicVisitor::
126126
VisitTypedefDecl(TypedefDecl const* D)
127127
{
128-
//QualType qt = D->getASTContext().getTypedefType(D);
129128
return mapDecl(D);
130129
}
131130

132131
bool
133132
BasicVisitor::
134133
VisitTypeAliasDecl(TypeAliasDecl const* D)
135134
{
136-
//QualType qt = D->getASTContext().getTypedefType(D);
137135
return mapDecl(D);
138136
}
139137

source/lib/Serialize.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,12 +479,6 @@ static void populateFunctionInfo(FunctionInfo& I, const FunctionDecl* D,
479479
IsInAnonymousNamespace);
480480

481481
I.ReturnType = getTypeInfoForType(D->getReturnType());
482-
{
483-
// VFALCO generate the correct USR
484-
SmallVector<char> buf;
485-
index::generateUSRForType(D->getReturnType(), D->getASTContext(), buf);
486-
I.ReturnType.Type.USR = hashUSR(llvm::StringRef(buf.data(), buf.size()));
487-
}
488482
parseParameters(I, D);
489483

490484
PopulateTemplateParameters(I.Template, D);

source/lib/XML.cpp

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ write(
283283
std::vector<TypedefInfo> const& v)
284284
{
285285
for(auto const& I : v)
286-
writeInfo(I);
286+
write(I);
287287
}
288288

289289
//------------------------------------------------
@@ -293,9 +293,9 @@ XMLGenerator::
293293
write(
294294
NamespaceInfo const& I)
295295
{
296-
openTag("scope", {
296+
assert(I.IT == InfoType::IT_namespace);
297+
openTag("namespace", {
297298
{ "name", I.Name },
298-
{ "tag", toString(I.IT) },
299299
{ "usr", toBase64(I.USR) }
300300
});
301301
writeInfo(I);
@@ -304,25 +304,33 @@ write(
304304
write(I.Children.functions);
305305
write(I.Children.Enums);
306306
write(I.Children.Typedefs);
307-
closeTag("scope");
307+
closeTag("namespace");
308308
}
309309

310310
void
311311
XMLGenerator::
312312
write(
313313
RecordInfo const& I)
314314
{
315-
openTag( "scope", {
315+
llvm::StringRef tag;
316+
switch(I.TagType)
317+
{
318+
case TagTypeKind::TTK_Struct: tag = "struct"; break;
319+
case TagTypeKind::TTK_Class: tag = "class"; break;
320+
case TagTypeKind::TTK_Union: tag = "union"; break;
321+
default:
322+
llvm_unreachable("unexpected TagType");
323+
}
324+
openTag(tag, {
316325
{ "name", I.Name },
317-
{ "tag", getTagType(I.TagType) },
318326
{ "usr", toBase64(I.USR) }
319327
});
320328
writeSymbolInfo(I);
321329
writeRecords(I.Children.Records);
322330
write(I.Children.functions);
323331
write(I.Children.Enums);
324332
write(I.Children.Typedefs);
325-
closeTag("scope");
333+
closeTag(tag);
326334
}
327335

328336
void
@@ -336,11 +344,24 @@ write(
336344
{ "usr", toBase64(I.USR) }
337345
});
338346
writeSymbolInfo(I);
339-
writeTagLine("return",
340-
//I.ReturnType.Type.Name, {
341-
I.ReturnType.Type.QualName, {
342-
{ "usr", toString(I.ReturnType.Type.USR) }
347+
348+
#if 1
349+
350+
writeTag("return", {
351+
{ "name", I.ReturnType.Type.Name },
352+
{ "usr", toString(I.ReturnType.Type.USR) }
353+
});
354+
#else
355+
auto it = infos_->find(llvm::toHex(llvm::toStringRef(
356+
I.ReturnType.Type.USR)));
357+
assert(it != infos_->end());
358+
Info const& inf = *it->second.get();
359+
writeTag("return", {
360+
{ "name", inf.Name },
361+
{ "usr", toString(inf.USR) }
343362
});
363+
#endif
364+
344365
write(I.Params);
345366
#if 0
346367
//writeRef(I.ReturnType.Type);

0 commit comments

Comments
 (0)