[LLVMdev] Lookup table for basicblocks

Tim Northover t.p.northover at gmail.com
Tue Aug 13 23:52:44 PDT 2013


Hi Rasha,

> I need to implement something like a variable for each basic block
> How to implement lookup table in LLVM , I think ValueSymbolTable is closest
> one but how could I do that by it

The most direct solution is using normal C++ containers.
std::map<BasicBlock*, AllocaInst*> or std::map<BasicBlock*,
GlobalValue*> for example (depending on what kind of variable you
want).

LLVM has some of its own implementations with slightly different
performance characteristics, but there's no reason to learn about
those until you decide you actually need them.

Cheers.

Tim.



More information about the llvm-dev mailing list