Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the arguments to WriteBitcodeToFile function #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

0xBUGSPRAY
Copy link

@0xBUGSPRAY 0xBUGSPRAY commented Jun 30, 2019

WriteBitcodeToFile expectes reference to the Module object: https://llvm.org/doxygen/BitcodeWriter_8cpp_source.html#l04360

Error details:
~/SVF/lib/Util/SVFModule.cpp:371:36: error: cannot convert 'llvm::Module' to 'const llvm::Module*' for argument '1' to 'void llvm::WriteBitcodeToFile(const llvm::Module*, llvm::raw_ostream&, bool, const llvm::ModuleSummaryIndex*, bool, llvm::ModuleHash*)'
WriteBitcodeToFile(*mod, OS);

WriteBitcodeToFile expectes reference to the Module object: https://llvm.org/doxygen/BitcodeWriter_8cpp_source.html#l04360

Error details:
razzer/tools/SVF/lib/Util/SVFModule.cpp:371:36: error: cannot convert 'llvm::Module' to 'const llvm::Module*' for argument '1' to 'void llvm::WriteBitcodeToFile(const llvm::Module*, llvm::raw_ostream&, bool, const llvm::ModuleSummaryIndex*, bool, llvm::ModuleHash*)'
         WriteBitcodeToFile(*mod, OS);
@yuleisui
Copy link
Collaborator

Is this the fix for the latest LLVM-8.0?

@0xBUGSPRAY
Copy link
Author

This fix is for LLVM-6.0 and 7.0. Didn't check for 8.0 which is unsupported for SVF I suppose?

@yuleisui
Copy link
Collaborator

yuleisui commented Jul 3, 2019

For a successful compilation, it needs to pass the reference "*mod" but not "mod", otherwise it would be the compilation errors below:

/lib/Util/SVFModule.cpp:  error: error: no matchingno  functionmatching  for function  call for
       callto
       'WriteBitcodeToFile'to 
'WriteBitcodeToFile'
        WriteBitcodeToFile(mod, OS);
        WriteBitcodeToFile(mod, OS);
        ^~~~~~~~~~~~~~~~~~
        ^~~~~~~~~~~~~~~~~~
/Users/136884/Documents/workspace/llvm-7.0.0.src/include/llvm/Bitcode/BitcodeWriter.h:129:8/Users/136884/Documents/workspace/llvm-7.0.0.src/include/llvm/Bitcode/BitcodeWriter.h:: 129:8note::  candidate
note      : function candidatenot
       viable:function  nonot  knownviable:  conversionno  fromknown  'Module *'conversion  (aka 'llvm::Module *')from  to'Module *'  'const llvm::Module'(aka 'llvm::Module *')
       tofor  'const llvm::Module'1st
       argument;for  dereference1st  theargument;  argumentdereference  withthe  *argument 
with *
  void WriteBitcodeToFile(const Module &M, raw_ostream &Out,
       ^  void WriteBitcodeToFile(const Module &M, raw_ostream &Out,

       ^
1 error1 generated.
 error generated.
make[2]: make[2]: *** [lib/CMakeFiles/LLVMSvf.dir/Util/SVFModule.cpp.o] Error 1*** [lib/CMakeFiles/Svf.dir/Util/SVFModule.cpp.o] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants