[LLVMdev] FunctionPassManager Issue

Chris Lattner sabre at nondot.org
Wed Apr 14 22:46:01 PDT 2004


On Wed, 14 Apr 2004, Alex Li wrote:
> Hi Chris,
>
> Thanks for responding so quickly, here's the stack trace.

Okay, try applying this patch to your llvm/lib/VMCore/Pass.cpp file.  It
seems to have been in CVS since February 9, I assume that your tarball
predates that.

If this doesn't fix it, I'm not sure that there is anything that I can do,
as I don't have the files you have...

===================================================================
RCS file: /home/vadve/shared/PublicCVS/llvm/lib/VMCore/Pass.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- /home/vadve/lattner/llvm/lib/VMCore/Pass.cpp        21 Nov 2003
20:23:48 -0000      1.54
+++ /home/vadve/lattner/llvm/lib/VMCore/Pass.cpp        9 Feb 2004
00:59:07 -0000       1.55
@@ -91,8 +91,6 @@
 void FunctionPassManager::add(FunctionPass *P) { PM->add(P); }
 void FunctionPassManager::add(ImmutablePass *IP) { PM->add(IP); }
 bool FunctionPassManager::run(Function &F) {
-  Function *mF = MP->getModule()->getNamedFunction(F.getName());
-  assert((&F == mF) && "ModuleProvider does not contain this function!");
   MP->materializeFunction(&F);
   return PM->run(F);
 }

-Chris


> Chris Lattner wrote:
>
> >On Wed, 14 Apr 2004, Alex Li wrote:
> >
> >
> >>I'm a cs326 student that uses LLVM for our MP. While some of the COOL
> >>program can be run seamlessly, I get the following assertion error for
> >>many of them.
> >>
> >>lli: Pass.cpp:95: bool llvm::FunctionPassManager::run(llvm::Function&):
> >>
> >>
> >>>>Assertion `(&F == mF) && "ModuleProvider does not contain this
> >>>>function!"' failed.
> >>>>
> >>>>
> >>It seems like I need to link a library to it but I'm not sure how to
> >>resolve this.
> >>
> >>
> >
> >I really have no idea what is going on here.  From my understanding, you
> >were given a "reduced" version of LLVM to use for CS326.  It's quite
> >possible that there is a problem with the reduction that is causing this.
> >In any case, without more information (a stack trace from GDB for
> >example), I can't really diagnose the issue.
> >
> >
> >
> >>Funny thing, when I use lli -force-interpreter, some of the program runs
> >>but have this error message
> >>Tried to execute an unknown external function: sbyte * (sbyte *) * gets
> >>
> >>
> >
> >The interpreter is not something that can be relied on, except for trivial
> >testcases.  It does not have a generic "foreign function interface" so it
> >cannot call external functions that it does not know about.
> >
> >
> >
> >>Again, I'd like to know how I should link in the function so that it
> >>doesn't complain or fail.
> >>
> >>
> >
> >Try sending in a stack trace.  In particular, run the program in the JIT,
> >but under gdb:
> >
> >$ gdb --args lli foo.bc
> >....
> >gdb> run
> >...
> >gdb> bt
> >
> >and send me the output.
> >
> >Thanks!
> >
> >-Chris
> >
> >
> >
>

-Chris

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




More information about the llvm-dev mailing list