Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:50

0001 #include "EDMPluginDumper.h"
0002 #include <iostream>
0003 #include <fstream>
0004 #include <iterator>
0005 #include <string>
0006 #include <algorithm>
0007 
0008 using namespace clang;
0009 using namespace clang::ento;
0010 using namespace llvm;
0011 
0012 namespace clangcms {
0013 
0014   void EDMPluginDumper::checkASTDecl(const clang::ClassTemplateDecl *TD,
0015                                      clang::ento::AnalysisManager &mgr,
0016                                      clang::ento::BugReporter &BR) const {
0017     std::string tname = TD->getTemplatedDecl()->getQualifiedNameAsString();
0018     if (tname == "edm::WorkerMaker") {
0019       for (auto I = TD->spec_begin(), E = TD->spec_end(); I != E; ++I) {
0020         for (unsigned J = 0, F = I->getTemplateArgs().size(); J != F; ++J) {
0021           llvm::SmallString<100> buf;
0022           llvm::raw_svector_ostream os(buf);
0023 #if LLVM_VERSION_MAJOR >= 13
0024           I->getTemplateArgs().get(J).print(mgr.getASTContext().getPrintingPolicy(), os, false);
0025 #else
0026           I->getTemplateArgs().get(J).print(mgr.getASTContext().getPrintingPolicy(), os);
0027 #endif
0028           std::string rname = os.str().str();
0029           std::string fname("plugins.txt.unsorted");
0030           std::string ostring = rname + "\n";
0031           support::writeLog(ostring, fname);
0032         }
0033       }
0034     }
0035 
0036   }  //end class
0037 
0038 }  // namespace clangcms