When I try to print out a instruction by the following way, I am getting the error message below. Anyone knows what's the problem? Instruction* inst; ... inst-print(cerr); testbuild.cpp:178: error: no matching function for call to 'llvm::Instruction::print(llvm::OStream&)' /x/pchsu/llvm/llvm-2.4/include/llvm/Value.h:83: note: candidates are: void llvm::Value::print(std::ostream&, llvm::AssemblyAnnotationWriter*) const /x/pchsu/llvm/llvm-2.4/include/llvm/Value.h:84: note: void llvm::Value::print(llvm::raw_ostream&, llvm::AssemblyAnnotationWriter*) const Po-Chun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081118/1b16e526/attachment.html>
On Tue, 2008-11-18 at 18:54 -0500, Po-Chun Hsu wrote:> When I try to print out a instruction by the following way, I am > getting the error message below. > Anyone knows what's the problem? > > Instruction* inst; > ... > inst-print(cerr); > > testbuild.cpp:178: error: no matching function for call to > 'llvm::Instruction::print(llvm::OStream&)' > /x/pchsu/llvm/llvm-2.4/include/llvm/Value.h:83: note: candidates are: > void llvm::Value::print(std::ostream&, > llvm::AssemblyAnnotationWriter*) const > /x/pchsu/llvm/llvm-2.4/include/llvm/Value.h:84: note: > void llvm::Value::print(llvm::raw_ostream&, > llvm::AssemblyAnnotationWriter*) constThe "cerr" object exists in both "std and "llvm" namespaces, and you have "using namspace" on both of these. Prefix cerr with the namespace you want to use. If you want to use cerr from <iostream>, write "std::cerr". Cheers, David
On Tue, 2008-11-18 at 18:54 -0500, Po-Chun Hsu wrote:> When I try to print out a instruction by the following way, I am > getting the error message below. > Anyone knows what's the problem? > > Instruction* inst; > ... > inst-print(cerr); > > testbuild.cpp:178: error: no matching function for call to > 'llvm::Instruction::print(llvm::OStream&)' > /x/pchsu/llvm/llvm-2.4/include/llvm/Value.h:83: note: candidates are: > void llvm::Value::print(std::ostream&, > llvm::AssemblyAnnotationWriter*) const > /x/pchsu/llvm/llvm-2.4/include/llvm/Value.h:84: note: > void llvm::Value::print(llvm::raw_ostream&, > llvm::AssemblyAnnotationWriter*) constThe "cerr" object exists in both "std and "llvm" namespaces, and you have "using namspace" on both of these. Prefix cerr with the namespace you want to use. If you want to use cerr from <iostream>, write "std::cerr". Cheers, David --