sorry, the network has something wrong.
the error as follows:
[image: 内嵌图片 1]
2015-10-31 12:47 GMT+08:00 Q Z <zhaoqian301 at gmail.com>:
> I wrote a very simple pass. The code as follows(rude.cpp):
> #include "llvm/Pass.h"
> #include "llvm/IR/Function.h"
> #include "llvm/Support/raw_ostream.h"
> #include "llvm/IR/BasicBlock"
>
> using namespace llvm;
>
> namespace {
> struct rude : public FunctionPass {
> static char ID;
> rude() : FunctionPass(ID) {}
>
> bool runOnFunction(Function &F) override {
> errs() << "Hello,I'm rude: ";
> errs().write_escaped(F.getName()) << '\n';
>
> for(Function::iterator b=F.begin(),be=F.end();b!=be;++b)
> {
> errs()<<"\n\tBB:";
> for(BasicBlock::iterator
i=b->begin(),ie=b->end();i!=ie;++i)
> {
> errs()<<"\n\tanalysis instructions";
> }
> }
> return false;
> }
> };
> }
>
> char Hello::ID = 9;
> static RegisterPass<rude> X("rude", "rude Pass",
false, false);
>
> then I use command :
> opt -load XX/Debug+Assertion/rude.so <test1.bc> /dev/null to run the
> rude.so file .
> the error as follows:
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20151031/d9c9e9b3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 286146 bytes
Desc: not available
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20151031/d9c9e9b3/attachment-0001.png>