Guoliang Jin
2010-Sep-22 07:28 UTC
[LLVMdev] Hit assert(I != ValueMap.end() && "Value not in slotcalculator!") in ValueEnumerator.cpp
Hi there, I added a function to a module, but failed to write the bitcode to file because it hit the: assert(I != ValueMap.end() && "Value not in slotcalculator!") So I added some diagnosis information there, unsigned ValueEnumerator::getValueID(const Value *V) const { if (isa<MDNode>(V) || isa<MDString>(V)) { ValueMapType::const_iterator I = MDValueMap.find(V); assert(I != MDValueMap.end() && "Value not in slotcalculator!"); return I->second-1; } ValueMapType::const_iterator I = ValueMap.find(V); if (!(I != ValueMap.end() && "Value not in slotcalculator!")) { V->dump(); for (ValueMapType::const_iterator IB = ValueMap.begin(), IE = ValueMap.end(); IB != IE; IB++) { (*IB).first->dump(); errs() << (*IB).second << " " << V << " " << (*IB).first << "\n"; } assert(I != ValueMap.end() && "Value not in slotcalculator!"); // this is where the assertion fails } return I->second-1; } The output show me that the V that it complains is not the ValueMap, but the content of *V is in the ValueMap. This happened when I applied my pass to some modules from .cpp, and my pass worked on some modules from .c files. Any hint on this? Thanks, Guoliang
Duncan Sands
2010-Sep-22 11:10 UTC
[LLVMdev] Hit assert(I != ValueMap.end() && "Value not in slotcalculator!") in ValueEnumerator.cpp
Hi Guoliang,> I added a function to a module, but failed to write the bitcode to file > because it hit the: > assert(I != ValueMap.end()&& "Value not in slotcalculator!")does the module pass the verifier after you add the function to it? Ciao, Duncan.
Jin Guoliang
2010-Sep-22 20:58 UTC
[LLVMdev] Hit assert(I != ValueMap.end() && "Value not in slotcalculator!") in ValueEnumerator.cpp
Thanks Duncan. After adding the verifier, it gives me: Broken module found, verification continues. Referencing function in another module! And I fixed my code based on this. Thanks, Guoliang On Wed, Sep 22, 2010 at 6:10 AM, Duncan Sands <baldrick at free.fr> wrote:> Hi Guoliang, > > > I added a function to a module, but failed to write the bitcode to file > > because it hit the: > > assert(I != ValueMap.end()&& "Value not in slotcalculator!") > > does the module pass the verifier after you add the function to it? > > Ciao, > > Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100922/50785d01/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Hit assert(I != ValueMap.end() && "Value not in slotcalculator!") in ValueEnumerator.cpp
- [LLVMdev] Value not in slotcalculator! error
- [LLVMdev] CloneModule ValueMap
- [LLVMdev] How to place call(s) to functions found in other llvm modules ???
- DenseMap/ValueMap: is M[New]=M[Old] valid ?