-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
EDMPluginDumper.cc
43 lines (34 loc) · 1.25 KB
/
EDMPluginDumper.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "EDMPluginDumper.h"
#include <boost/interprocess/sync/interprocess_semaphore.hpp>
#include <iostream>
#include <fstream>
#include <iterator>
#include <string>
#include <algorithm>
using namespace clang;
using namespace clang::ento;
using namespace llvm;
namespace clangcms {
void EDMPluginDumper::checkASTDecl(const clang::ClassTemplateDecl *TD,clang::ento::AnalysisManager& mgr,
clang::ento::BugReporter &BR ) const {
std::string tname = TD->getTemplatedDecl()->getQualifiedNameAsString();
if ( tname == "edm::WorkerMaker" ) {
for ( auto I = TD->spec_begin(), E = TD->spec_end(); I != E; ++I) {
for (unsigned J = 0, F = I->getTemplateArgs().size(); J!=F; ++J) {
llvm::SmallString<100> buf;
llvm::raw_svector_ostream os(buf);
I->getTemplateArgs().get(J).print(mgr.getASTContext().getPrintingPolicy(),os);
std::string rname = os.str();
const char * pPath = std::getenv("LOCALRT");
std::string dname("");
if ( pPath != NULL ) dname = std::string(pPath);
std::string fname("/tmp/plugins.txt.unsorted");
std::string tname = dname + fname;
std::string ostring = rname +"\n";
std::ofstream file(tname.c_str(),std::ios::app);
file<<ostring;
}
}
}
} //end class
}//end namespace