[LLVMdev] Need Some Help!

Chris Lattner sabre at nondot.org
Wed Nov 19 17:58:02 PST 2003


On Wed, 19 Nov 2003, Reid Spencer wrote:

> I have a "first version" of Stacker up and running. Structurally its a
> lot like llvm-as. When I run it, I get:
> Leaked objects found: after running pass 'Function Pass Manager'
>   LLVM Value subclasses leaked:

This is coming from the LLVM "LeakDetector" stuff.  The idea is that you
are not supposed to create random instructions or basic blocks, then leave
them hanging around: you should put them into a module somewhere.  :)

> Note that the supposed list of "LLVM Value subclasses leaked" is empty.
> Its followed up by a SIGSEGV at AsmWriter.cpp:754 presumably because I
> have a BasicBlock object not assigned to a Function.
> Is the message above attempting to tell me this?

Yeah well, it's trying but failing.  It's attempting to print out the
thing that has been leaked, but the asmwriter isn't handling the "broken"
LLVM IR very well.  :(

> What I can't figure out is where the message comes from and why.

Basically it's because a BasicBlock has not be inserted into a function.
If you want to FORCE this to be acceptable, use the
LeakDetector::removeGarbageObject method in Support/LeakDetector.h

This is yet another "helpful" LLVM debugging tool, pointing out a silly
bug.  :)

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list