zhangyz / llvm-slicing

Symbolic Program Slicing with LLVM
Apache License 2.0
74 stars 13 forks source link

build: Could not find module `LLVM.Analysis.IFDS' #3

Open mchalupa opened 8 years ago

mchalupa commented 8 years ago

Hi,

when trying to build llvm-slicing, I get the following error:

Building llvm-slicing-0.3.3...
Preprocessing executable 'llvm-slicing' for llvm-slicing-0.3.3...

LLVM/Slicing/Static/SDG/IFDS/SummaryEdge.hs:33:8:
    Could not find module `LLVM.Analysis.IFDS'
    Perhaps you meant
      LLVM.Analysis.CDG (from llvm-analysis-0.3.0)
      LLVM.Analysis.CFG (from llvm-analysis-0.3.0)
      LLVM.Analysis (from llvm-analysis-0.3.0)
    Use -v to see a list of the files searched for.

LLVM/Slicing/Static/SDG/IFDS/SummaryEdge.hs:34:8:
    Could not find module `LLVM.Analysis.ICFG'
    Perhaps you meant
      LLVM.Analysis.CFG (from llvm-analysis-0.3.0)
      LLVM.Analysis.CDG (from llvm-analysis-0.3.0)
      LLVM.Analysis (from llvm-analysis-0.3.0)
    Use -v to see a list of the files searched for.

LLVM/Slicing/Static/SDG/IFDS/SummaryEdge.hs:35:8:
    Could not find module `LLVM.Analysis.Internal.Worklist'
    Use -v to see a list of the files searched for.

looks like the llvm-analysis does not export these data types at all. Any clue?

Thanks, Marek

zhangyz commented 8 years ago

Hi, Marek, Thanks for your interest in this project. For your problem, in fact I mentioned in the file SummaryEdge.hs (as comments before import IFDS module): -- Based on the IFDS algorithm which is not directly import from LLVM.Analysis, -- but it could be found from its github website as follows. -- https://github.com/travitch/llvm-analysis/blob/master/src/LLVM/Analysis/IFDS.hs So you can directly download these files about IFDS and put them together with LLVM.Analysis, then recompile LLVM.Analysis.
Alternatively, you can directly download our pre-built binary in the folder bin/.

mchalupa commented 8 years ago

Thanks for the answer. Is this the only thing I am supposed to do? Because I'm getting a lot of errors when trying to compile llvm-analysis with these files. IFDS module was dropped from llvm-analysis in 2012 and since then a lot of changes took place, so making it work is not so easy -- at least I haven't managed to make it compilable again.

zhangyz commented 8 years ago

If you do not have to use the IFDS method to compute summary information, for your choice, this project supports another way (called SDG method in this project) for computing summary information, which also can generate dependence graphs such as IR SDG and can return final static slice result based on graph reachability. To do so, you should hide the import modules about IFDS in the file Slicing.hs, and instead use the method SDG for SDG-based slicing.