Hi all, I have a question regarding populating ValueSymbolTable of a Function. Is it that ValueSymbolTable is populated automatically whenever an alloca instruction is created using IRBuilder or do we need to explicitly populate?? If we need to populate explicitly, the insert method in ValueSymbolTable is private, so how can we do it? Currently, I am trying to access the symbol table as below: llvm::ValueSymbolTable symTab; symTab = mCurrentFunction->getValueSymbolTable(); llvm::Value* variable = symTab.lookup(aName); Thanks -- View this message in context: http://old.nabble.com/Using-ValueSymbolTable...-tp29461430p29461430.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
subramanyam wrote:> > Hi all, > I have a question regarding populating ValueSymbolTable of a Function. > Is it that ValueSymbolTable is populated automatically whenever an alloca > instruction is created using IRBuilder or do we need to explicitly > populate??It's maintained by LLVM for you, by Value::setName and other methods. Nick
Nick Lewycky wrote:> > > > It's maintained by LLVM for you, by Value::setName and other methods. > > Nick > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >I am getting the following error when trying to fetch the symbol table using getValueSymbolTable() /home/llvm/install/include/llvm/ADT/StringMap.h:256: void llvm::StringMap<ValueTy, AllocatorTy>::operator=(const llvm::StringMap<ValueTy, AllocatorTy>&) [with ValueTy = llvm::Value*, AllocatorTy = llvm::MallocAllocator]: Assertion `RHS.empty() && "assignment from non-empty stringmap not implemented yet!"' failed. Regards, subbu -- View this message in context: http://old.nabble.com/Using-ValueSymbolTable...-tp29461430p29468905.html Sent from the LLVM - Dev mailing list archive at Nabble.com.