bool swapSectionWithPrefix()

in lib/BPFCov.cpp [150:164]


    bool swapSectionWithPrefix(Module &M, StringRef Prefix, StringRef New)
    {
        bool Changed = false;
        for (auto gv_iter = M.global_begin(); gv_iter != M.global_end(); gv_iter++)
        {
            GlobalVariable *GV = &*gv_iter;
            if (GV->hasSection() && GV->getSection().startswith(Prefix))
            {
                errs() << "swapping " << GV->getName() << " section with " << New << " \n";
                GV->setSection(New);
                Changed = true;
            }
        }
        return Changed;
    }