secure-software-engineering / phasar

A LLVM-based static analysis framework.
Other
931 stars 140 forks source link

Add save/load methods for LLVMPointsToSet #411

Closed ga0 closed 2 years ago

ga0 commented 3 years ago

Is your feature request related to a problem? Please describe. LLVMPointsToSet takes too much time.

Describe the solution you'd like Since parallelize LLVMPointsToSet is too hard ( #305 ), providing methods to serialize/deserialize or save/load LLVMPointsToSet may be very useful.

    ProjectIRDB IRDB({path});
    LLVMPointsToSet PTS(IRDB, false, PointerAnalysisType::CFLAnders);
    std::ofstream PointsToSetCacheFile("/tmp/points_to_set");
    PTS.save(PointsToSetCacheFile);

Next time when we want to analyze the same project.

    ProjectIRDB IRDB({path});
    LLVMPointsToSet PTS(IRDB);
    std::ifstream PointsToSetCacheFile("/tmp/points_to_set");
    PTS.load(PointsToSetCacheFile);

This will save much time.

The PointsToSetMap is an unordered_map of llvm::Value* pointers. I don't known how to serializing these pointers' relations. Can you give me some instructions?

fabianbs96 commented 2 years ago

Updates are in #441