[LLVMdev] Pass Added as Required fails assert

Thomas Mason thomasr.mason at gmail.com
Thu Jul 17 12:55:56 PDT 2008


Hey all,

We have been working on a pass that uses another pass to count loads and
stores prior to performing its own instrumentation.  The second pass adds
the first as required via the usual getAnalysisUsage function.  On one
machine, it has been tested and proven to function correctly.  On another
machine, whenever the second pass is run, it consistently fails the
assertion:

opt: /home/tmason/llvm/llvm/include/llvm/PassAnalysisSupport.h:193:
AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const [with
AnalysisType = <unnamed>::LdStCallCounter]: Assertion `ResultPass &&
"getAnalysis*() called on an analysis that was not " "'required' by pass!"'
failed.

We have modified opt.cpp with the following lines:
  addPass(PM, createLdStCallCounter());         // tmason
  addPass(PM, createLAMPProfilerPass());         // tmason

We have modified Instrumentation.h with the following lines:
ModulePass* createLdStCallCounter();
BasicBlockPass *createLAMPProfilerPass();

The .cpp file generating the error is attached.

Both machines run Ubuntu 8.0.4 with gcc 4.2.3.  Does anyone know what could
be causing this error to occur on one machine but not another?


Thanks,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080717/3cff2b0e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LAMPProfiling.cpp
Type: text/x-c++src
Size: 6697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080717/3cff2b0e/attachment.cpp>


More information about the llvm-dev mailing list