llc -load

Howdy everybody.
        I'm trying hard to load my backend. But I got problems.
I took the target SparcV8 for lab.

1. mark all of the code in the bool
SparcV8TargetMachine::addPassesToEmitAssembly(PassManager
&PM,std::ostream &Out)
and make it return false.( Of course I mark the // Output assembly language.
  PM.add(createSparcV8CodePrinterPass(Out, *this)):wink:
2. generate the LLVMSparcV8.so in the /usr/local/lib
3. run llc -load=/usr/local/lib/LLVMSparcV8.so -march=sparcv8 test.bc -o test.s

Guess what? I got the assembly code of the test.bc....
why....why....why???
What's wrong with my steps???

Please help me!!!Thanx!

Dave.

I'm trying hard to load my backend. But I got problems.
I took the target SparcV8 for lab.

1. mark all of the code in the bool
SparcV8TargetMachine::addPassesToEmitAssembly(PassManager &PM,
                                              std::ostream &Out)
and make it return false.

It already returns false, what exactly did you do?

2. generate the LLVMSparcV8.so in the /usr/local/lib
3. run llc -load=/usr/local/lib/LLVMSparcV8.so -march=sparcv8 test.bc
-o test.s

Guess what? I got the assembly code of the test.bc....
why....why....why???
What's wrong with my steps???

That's the correct behavior (you didn't change anything), and I don't
understand what you mean -- there's nothing wrong.

Does _YOUR_ addPassesToEmitAssembly() return false? Because that's
what it shold be doing.

I'm sorry, I think I understand now. You commented out all the code in
addPassesToEmitAssembly() and it still outputs assembly code?

Did you change the tools/llc/Makefile to NOT link in SparcV8? Because
if it already linked it in, LLC already had a fully-functioning V8
backend linked into it, so you're probably running the staticly-linked
one (although LLC should probably complain that someone else already
signed up on the "sparcv8" switch...)