Skip to content

Commit 65bc8d4

Browse files
committed
explore correct USRs for typeinfo
1 parent 1f49653 commit 65bc8d4

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

source/lib/Serialize.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,14 @@ static void populateFunctionInfo(FunctionInfo& I, const FunctionDecl* D,
450450
bool& IsInAnonymousNamespace) {
451451
populateSymbolInfo(I, D, FC, LineNumber, Filename, IsFileInRootDir,
452452
IsInAnonymousNamespace);
453+
453454
I.ReturnType = getTypeInfoForType(D->getReturnType());
455+
{
456+
// VFALCO generate the correct USR
457+
SmallVector<char> buf;
458+
index::generateUSRForType(D->getReturnType(), D->getASTContext(), buf);
459+
I.ReturnType.Type.USR = hashUSR(llvm::StringRef(buf.data(), buf.size()));
460+
}
454461
parseParameters(I, D);
455462

456463
PopulateTemplateParameters(I.Template, D);

source/lib/XML.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,12 @@ writeFunction(
410410
});
411411
writeInfoPart(I);
412412
writeTagLine("return",
413-
I.ReturnType.Type.Name, {
413+
//I.ReturnType.Type.Name, {
414+
I.ReturnType.Type.QualName, {
415+
//{ "usr", toString(I.ReturnType.Type.USR) }
414416
{ "usr", toString(I.ReturnType.Type.USR) }
415417
});
416-
writeRef(I.ReturnType.Type);
418+
//writeRef(I.ReturnType.Type);
417419
if(I.Template)
418420
{
419421
for(TemplateParamInfo const& tp : I.Template->Params)
@@ -478,9 +480,11 @@ writeTypedef(
478480
openTag("typedef", {
479481
{ "name", I.Name },
480482
{ "USR", toBase64(I.USR) }
483+
//{ "USR", toBase64(I.Underlying.Type.USR) }
481484
});
482485
writeInfoPart(I);
483486
writeTagLine("qualname", I.Underlying.Type.QualName);
487+
writeTagLine("qualusr", toBase64(I.Underlying.Type.USR));
484488
writeLoc(I.DefLoc);
485489
closeTag("typedef");
486490
}
@@ -528,6 +532,7 @@ XMLGenerator::
528532
writeLoc(
529533
llvm::ArrayRef<Location> const& loc)
530534
{
535+
return;
531536
if(loc.size() > 0)
532537
*os_ << level_ <<
533538
"<file>" << escape(loc[0].Filename) <<
@@ -540,6 +545,7 @@ XMLGenerator::
540545
writeLoc(
541546
std::optional<Location> const& opt)
542547
{
548+
return;
543549
if(! opt)
544550
return;
545551
Location const& loc(*opt);

0 commit comments

Comments
 (0)