Bug 1501129 - Use field names instead of their index when mangling. r=mccr8
Differential Revision:
https://phabricator.services.mozilla.com/D9558
--- a/build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp
+++ b/build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp
@@ -393,17 +393,17 @@ private:
return std::string("NS_") + mangleQualifiedName(getQualifiedName(Decl));
} else if (const ObjCIvarDecl *D2 = dyn_cast<ObjCIvarDecl>(Decl)) {
const ObjCInterfaceDecl *Iface = D2->getContainingInterface();
return std::string("F_<") + getMangledName(Ctx, Iface) + ">_" +
D2->getNameAsString();
} else if (const FieldDecl *D2 = dyn_cast<FieldDecl>(Decl)) {
const RecordDecl *Record = D2->getParent();
return std::string("F_<") + getMangledName(Ctx, Record) + ">_" +
- toString(D2->getFieldIndex());
+ D2->getNameAsString();
} else if (const EnumConstantDecl *D2 = dyn_cast<EnumConstantDecl>(Decl)) {
const DeclContext *DC = Decl->getDeclContext();
if (const NamedDecl *Named = dyn_cast<NamedDecl>(DC)) {
return std::string("E_<") + getMangledName(Ctx, Named) + ">_" +
D2->getNameAsString();
}
}