Bug 1501129 - Use field names instead of their index when mangling. r=mccr8
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 23 Oct 2018 17:58:11 +0000
changeset 490991 23205c4744f095d4f4c87a6f6238c98f87ae3ae5
parent 490990 52e7a7889da0f493c65fa0aa2fcea6a0e1f6a06b
child 490992 7de933e484c6e551e8655c9d1fdee96456838456
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersmccr8
bugs1501129
milestone65.0a1
Bug 1501129 - Use field names instead of their index when mangling. r=mccr8 Differential Revision: https://phabricator.services.mozilla.com/D9558
build/clang-plugin/mozsearch-plugin/MozsearchIndexer.cpp
--- 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();
       }
     }