[LLVMdev] Error in Hello World Pass
komurav1 at illinois.edu
Fri Sep 4 10:29:22 PDT 2009
I am trying to compile the Hello World pass (described at
http://llvm.org/docs/WritingAnLLVMPass.html#basiccode) in an LLVM Project
and I get an error, 'no match for ‘operator<<’ at line
llvm::cerr << "*Hello: *" << F.getName() << "\n";
But when I looked up in the LLVM API Documentation, I think "<<"
operator is not overloaded for the StringRef class returned by
getName() of the Function class. If I replace the above line with
llvm::cerr << "*Hello: *" << F.getName().str() << "\n";
it compiles fine. I was just wondering if its a bug in the document
describing the Hello World pass or am I referring it incorrectly?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev