diff --git a/src/CTUApexVisitor.cpp b/src/CTUApexVisitor.cpp index fb17c50c43212fd454aeda30cf73491267b67677..fbb2d0834f2730e938625a260709e7ec3d7d437d 100644 --- a/src/CTUApexVisitor.cpp +++ b/src/CTUApexVisitor.cpp @@ -42,6 +42,9 @@ bool FunctionFinderVisitor::VisitFunctionDecl(clang::FunctionDecl *functionDecl) //std::cout<<functionDecl->getNameAsString()<<col2str(possibleNames," All possible manglings are:(",",",")")<<"\n"; for(const auto& name : possibleNames){ + + assert(callgraph->hasNode(name)); + // we should find every node in the whole program callgraph if(!callgraph->hasNode(name)){ SPDLOG_WARN("Node {} is not in the call-graph. Graph might be wrong or incomplete!",name); diff --git a/src/main.cpp b/src/main.cpp index d3b54ff9b7b68e8af2129ec14d04ad0dfe725191..c7e9e8efa23da6537ae933a5f2492b4ab9817dd9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -208,14 +208,9 @@ int main(int argc, const char **argv) { } auto &mcgManager = metacg::graph::MCGManager::get(); - mcgManager.addToManagedGraphs("emptyGraph", std::make_unique<metacg::Callgraph>()); - nlohmann::json j = fs.get().at("_CG"); - std::cout<<j.dump(4); - metacg::io::VersionTwoMetaCGReader::upgradeV2FormatToV3Format(j); - std::cout<<j.dump(4); - mcgReader->read(); + mcgManager.addToManagedGraphs("activeGraph",mcgReader->read()); + auto &cg = *mcgManager.getCallgraph(); - std::cout<<cg.size()<<"\n"; //Add extraction point gotten via the CLI for(const auto& extractionFunc : extractionPoints){ @@ -230,8 +225,6 @@ int main(int argc, const char **argv) { markFunctionsAlongCallpaths(cg); - - tool.run(clang::tooling::newFrontendActionFactory<CTUApexFrontendAction>( new CTUApexFrontendAction(*mcgManager.getCallgraph())).get()); return 0; diff --git a/test/4_Lulesh/CMakeLists.txt b/test/4_Lulesh/CMakeLists.txt index c186bcc6897dc6dcd6c18059c023e47a31ce15d5..7e6e609273cbb2ea5fdf9bbbb23a6021a6b880a3 100644 --- a/test/4_Lulesh/CMakeLists.txt +++ b/test/4_Lulesh/CMakeLists.txt @@ -43,11 +43,11 @@ if (WITH_SILO) endif() set(LULESH_SOURCES - lulesh-comm.mini.cc - lulesh-init.mini.cc - lulesh-util.mini.cc - lulesh-viz.mini.cc - lulesh.mini.cc) + lulesh-comm.cc + lulesh-init.cc + lulesh-util.cc + lulesh-viz.cc + lulesh.cc) set(LULESH_EXEC lulesh2.0) diff --git a/test/4_Lulesh/demo.sh b/test/4_Lulesh/demo.sh old mode 100644 new mode 100755 index 38b3b0e445e2823c761c0d04e2b497d1e5b1c814..e885a86b8ef5837e00467e73eb0137036291608c --- a/test/4_Lulesh/demo.sh +++ b/test/4_Lulesh/demo.sh @@ -1,23 +1,27 @@ # this is the cgcollector from metacg -cgcollector --metacg-format-version=2 lulesh.cc -cgcollector --metacg-format-version=2 lulesh-init.cc -cgcollector --metacg-format-version=2 lulesh-comm.cc -cgcollector --metacg-format-version=2 lulesh-util.cc -cgcollector --metacg-format-version=2 lulesh-viz.cc +cgcollector -p build --metacg-format-version=2 lulesh.cc +cgcollector -p build --metacg-format-version=2 lulesh-init.cc +cgcollector -p build --metacg-format-version=2 lulesh-comm.cc +cgcollector -p build --metacg-format-version=2 lulesh-util.cc +cgcollector -p build --metacg-format-version=2 lulesh-viz.cc echo "null" > merged.ipcg #this is cgmerge from metacg cgmerge merged.ipcg *.ipcg + +sed -i 's/fileProperties/FileProperties/g' merged.ipcg + #this currently uses hardcoded include directories as to be compatible with C++ #this is a terrible solution and is currently being worked on -CTUApex --extra-arg=-I/home/groups/da_sc/moduletree/packages-2023-08-24/.gcc/8.5/clang/15.0.7.debug/include \ ---extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12 \ ---extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/x86_64-redhat-linux \ ---extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/backward \ ---extra-arg=-I/work/groups/da_sc/moduletree/packages-2023-08-24/.gcc/8.5.0/clang/debug.15.0.7/lib/clang/15.0.7/include \ ---extra-arg=-I/usr/local/include \ ---extra-arg=-I/usr/include \ +#CTUApex --extra-arg=-I/home/groups/da_sc/moduletree/packages-2023-08-24/.gcc/11.2.0/clang/15.0.7.debug/include \ +#--extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12 \ +#--extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/x86_64-redhat-linux \ +#--extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/backward \ +#--extra-arg=-I/work/groups/da_sc/moduletree/packages-2023-08-24/.gcc/8.5.0/clang/debug.15.0.7/lib/clang/15.0.7/include \ +#--extra-arg=-I/usr/local/include \ +#--extra-arg=-I/usr/include \ +CTUApex \ --cg-file=merged.ipcg \ --extra-arg=-DUSE_MPI=0 \ --log-level=debug \