roadrunner
2.6.0
Fast simulator for SBML models
|
provide common sbml model functionality to three kinds of resolvers. More...
#include <LoadSymbolResolverBase.h>
Public Member Functions | |
llvm::Value * | loadReactionRate (const libsbml::Reaction *) |
shortcut to get a reaction rate, performance wise, quicker than going through all the loadSymbolValue types. | |
void | recursiveSymbolPush (const std::string &symbol) override |
void | recursiveSymbolPop () override |
virtual bool | isLocalParameter (const std::string &symbol) override |
void | flushCache () |
Flush the symbol cache. More... | |
size_t | pushCacheBlock () override |
nested conditionals (or functions?) can push a local cache block, where symbols would be chached. More... | |
size_t | popCacheBlock () override |
Pop a scoped cache block, this clears these values, and any subsequent reads re-evaluate the requested symbol. More... | |
![]() | |
virtual llvm::Value * | loadSymbolValue (const std::string &symbol, const llvm::ArrayRef< llvm::Value * > &args=llvm::ArrayRef< llvm::Value * >())=0 |
generate an LLVM load instruction. More... | |
Protected Types | |
typedef std::list< std::string > | StringStack |
typedef std::unordered_map< std::string, llvm::Value * > | ValueMap |
typedef std::deque< ValueMap > | ValueMapStack |
Protected Member Functions | |
LoadSymbolResolverBase (const ModelGeneratorContext &ctx, llvm::Value *modelData) | |
llvm::Value * | cacheValue (const std::string &symbol, const llvm::ArrayRef< llvm::Value * > &args, llvm::Value *value=nullptr) |
check in the symbol cache if the symbol exists, if so return it. More... | |
Protected Attributes | |
const ModelGeneratorContext & | modelGenContext |
const libsbml::Model * | model |
const LLVMModelDataSymbols & | modelDataSymbols |
const LLVMModelSymbols & | modelSymbols |
llvm::IRBuilder & | builder |
llvm::Value * | modelData |
StringStack | symbolStack |
ValueMapStack | symbolCache |
provide common sbml model functionality to three kinds of resolvers.
This has common functionality such as dealing with sbml elements such as reactions, species and so forth.
|
protected |
check in the symbol cache if the symbol exists, if so return it.
If the value is not NULL, it is cached and returned.
Cached function args not currently supported (just return NULL).
void rrllvm::LoadSymbolResolverBase::flushCache | ( | ) |
Flush the symbol cache.
This is required in branches and switch blocks as a symbol used in a previous block can not be re-used in the current block.
|
overridevirtual |
Pop a scoped cache block, this clears these values, and any subsequent reads re-evaluate the requested symbol.
Will throw an exception if an empty stack pop is attempted.
Reimplemented from rrllvm::LoadSymbolResolver.
|
overridevirtual |
nested conditionals (or functions?) can push a local cache block, where symbols would be chached.
These need to be popped as these symbols are not valid outside of the local conditional or scope block.
Reimplemented from rrllvm::LoadSymbolResolver.